public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Karen Xie <kxie@chelsio.com>
Cc: open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org,
	James.Bottomley@HansenPartnership.com
Subject: Re: [PATCH 2/2 2.6.29-rc] cxgb3i - add handling of chip reset
Date: Wed, 25 Feb 2009 11:29:43 -0600	[thread overview]
Message-ID: <49A58007.20304@cs.wisc.edu> (raw)
In-Reply-To: <200902250128.n1P1SJOD007746@localhost.localdomain>

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.


> -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?

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?


  parent reply	other threads:[~2009-02-25 17:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25  1:28 [PATCH 2/2 2.6.29-rc] cxgb3i - add handling of chip reset Karen Xie
2009-02-25 17:21 ` Mike Christie
2009-02-25 18:00   ` Karen Xie
2009-02-25 17:29 ` Mike Christie [this message]
2009-02-25 18:06   ` Karen Xie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49A58007.20304@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=kxie@chelsio.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=open-iscsi@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox