Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: "Anil Veerabhadrappa" <anilgv@broadcom.com>
To: Mike Christie <michaelc@cs.wisc.edu>
Cc: Michael Chan <mchan@broadcom.com>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"open-iscsi@googlegroups.com" <open-iscsi@googlegroups.com>
Subject: Re: [PATCH] BNX2I: register given device with cnic if shost != NULL in ep_connect()
Date: Thu, 9 Jul 2009 13:32:36 -0700	[thread overview]
Message-ID: <1247171556.9829.622.camel@anilgv-desktop> (raw)
In-Reply-To: <4A562C41.7040600@cs.wisc.edu>

On Thu, 2009-07-09 at 10:43 -0700, Mike Christie wrote:
> On 07/09/2009 09:39 AM, Anil Veerabhadrappa wrote:
> > On Thu, 2009-07-09 at 00:15 -0700, Michael Chan wrote:
> >> Mike Christie wrote:
> >>> Anil Veerabhadrappa wrote:
> >>>> diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c
> >>> b/drivers/scsi/bnx2i/bnx2i_iscsi.c
> >>>> index f741219..98148f3 100644
> >>>> --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
> >>>> +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
> >>>> @@ -1653,15 +1653,18 @@ static struct iscsi_endpoint
> >>> *bnx2i_ep_connect(struct Scsi_Host *shost,
> >>>>      struct iscsi_endpoint *ep;
> >>>>      int rc = 0;
> >>>>
> >>>> -   if (shost)
> >>>> +   if (shost) {
> >>>>              /* driver is given scsi host to work with */
> >>>>              hba = iscsi_host_priv(shost);
> >>>> -   else
> >>>> +           /* Register the device with cnic if not already
> >>> done so */
> >>>> +           bnx2i_register_device(hba);
> >>>> +   } else
> >>>>              /*
> >>>>               * check if the given destination can be reached through
> >>>>               * a iscsi capable NetXtreme2 device
> >>>>               */
> >>>>              hba = bnx2i_check_route(dst_addr);
> >>>> +
> >>>>      if (!hba) {
> >>>>              rc = -ENOMEM;
> >>>>              goto check_busy;
> >>> Do you want to do the test_bit(BNX2I_CNIC_REGISTERED,
> >>> &hba->reg_with_cnic) test here instead of down below. If it
> >>> failed then
> >>> you might try to do a cm_create on a cnic that is not
> >>> properly registered.
> >>>
> >> Good idea.  cm_create() will properly be ok because there is no
> >> hardware interaction.  bnx2i_send_conn_ofld_req() will fail if
> >> the cnic is not properly registered because there will be no call
> >> backs from the hardware events.
> >
> > following 2 conditions needs to be satisfied to offload an iscsi
> > connection,
> >    1) device has to be registered with cnic
> >    2) device has to support iscsi offload
> >
> >    bnx2i_adapter_ready() will return success only if both conditions
> > (which is flagged by ADAPTER_STATE_UP bit in hba->adapter_state) are
> > met. bnx2i_ep_connect() will bailout if bnx2i_adapter_ready() does not
> > return correct status and this guarantees bnx2i will not make any cnic
> > calls on an unregistered device.
> >
> 
> Ok then. It seems fine to me.
> 
> Reviewed-by Mike Christie <michaelc@cs.wisc.edu>
> 
> One other question though. Do you need the BNX2I_CNIC_REGISTERED tst in 
> ep_connect then? If not then maybe in separate patch for the next 
> feature window we can clean that up.
> 
> 
It is not required to test for BNX2I_CNIC_REGISTERED because a
successful return from bnx2i_adapter_ready() implicitly means the device
is registered with cnic



  reply	other threads:[~2009-07-09 20:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-24  1:11 [PATCH 1/3] bnx2i remove not so useful global variable bnx2i_reg_devices Anil Veerabhadrappa
2009-06-24 20:00 ` Mike Christie
2009-06-28 14:33 ` James Bottomley
2009-06-28 15:46   ` Michael Chan
2009-06-28 17:25     ` James Bottomley
2009-06-28 19:59       ` Michael Chan
2009-06-28 20:11         ` James Bottomley
2009-07-09  1:21 ` [PATCH] BNX2I: register given device with cnic if shost != NULL in ep_connect() Anil Veerabhadrappa
2009-07-09  6:21   ` Mike Christie
2009-07-09  7:15     ` Michael Chan
2009-07-09 14:39       ` Anil Veerabhadrappa
2009-07-09 17:43         ` Mike Christie
2009-07-09 20:32           ` Anil Veerabhadrappa [this message]
2009-07-09 20:49           ` Anil Veerabhadrappa
2009-07-30  4:49 ` [PATCH 1/2] bnx2i : Fix CMDSN jump issue seen during cable pull test Anil Veerabhadrappa
2009-07-30 15:31   ` Mike Christie
2009-09-11 17:38 ` [PATCH 1/1] BNX2I - Fix context mapping issue for architectures with PAGE_SIZE != 4096 Anil Veerabhadrappa

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=1247171556.9829.622.camel@anilgv-desktop \
    --to=anilgv@broadcom.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=michaelc@cs.wisc.edu \
    --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