-----Original Message-----
From: Mike Christie [mailto:micha...@cs.wisc.edu]
Sent: Wednesday, February 25, 2009 9:30 AM
To: Karen Xie
Cc: open-iscsi@googlegroups.com; linux-s...@vger.kernel.org;
james.bottom...@hansenpartnership.com
Subject: Re: [PATCH 2/2 2.6.29-rc] cxgb3i - add handling of chip reset
Some other comments about the host and snic allocation.
Karen Xie wrote:
> +/**
> + * cxgb3i_adapter_open - initiate or update a s3 adapter structure
and
> + * any h/w settings
> + * @t3dev: t3cdev adapter
> + */
> +static inline int adapter_update(struct cxgb3i_adapter *snic)
The function name and comment got out of sync.
[Karen] Thanks, will fix it.
> -void cxgb3i_adapter_remove(struct t3cdev *t3dev)
> +void cxgb3i_adapter_open(struct t3cdev *t3dev)
> {
> - int i;
> - struct cxgb3i_adapter *snic;
> + struct cxgb3i_adapter *snic =
cxgb3i_adapter_find_by_tdev(t3dev);
> + int err;
>
> - /* remove from the list */
> - write_lock(&cxgb3i_snic_rwlock);
> - list_for_each_entry(snic, &cxgb3i_snic_list, list_head) {
> - if (snic->tdev == t3dev) {
> - list_del(&snic->list_head);
> - break;
> - }
> + if (snic)
> + err = adapter_update(snic);
> + else {
> + snic = kzalloc(sizeof(*snic), GFP_KERNEL);
> + if (snic) {
> + spin_lock_init(&snic->lock);
> + snic->tdev = t3dev;
> + err = adapter_add(snic);
> + } else
> + err = -ENOMEM;
>
Does the snic represent the actual card. So if I had a dual ported card,
I would have one snic and then have multple shosts/cxgb3i_hba for each
port right?
[Karen] Yes.
It seemed strange because cxgb3i_hba_host_add sets the shost's parent to
the pci device, and we get the pci device from the snic->pdev. And so I
thought we see a pci device per port, so we would also should have a
snic per port?
[Karen] Each port/cxgb3i_hba has a pointer point back to the
snic/adapter. So one snic per adapter, each snic contains one or more
ports, each port corresponds to one shost.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to
open-iscsi+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---