public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Anil Veerabhadrappa" <anilgv-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
To: James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org
Cc: linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	open-iscsi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org,
	mchan-dY08KVG/lbpWk0Htik3J/w@public.gmane.org
Subject: [PATCH] BNX2I: register given device with cnic if shost != NULL in ep_connect()
Date: Wed, 8 Jul 2009 18:21:01 -0700	[thread overview]
Message-ID: <1247102461.9829.438.camel@anilgv-desktop> (raw)
In-Reply-To: <1245805860.9829.50.camel@anilgv-desktop>



    * When using iface, bnx2i was unable to offload further connections after
      all active sessions are logged out. bnx2i will unregister the device from
      cnic when the last connection is torn down. Next call to ep_connect()
      will fail because the device is not registered. This issue is not seen
      if shost == NULL is passed to ep_connect() call because in that case bnx2i
      will registers all known devices with cnic before doing a route look-up.
      When shost != NULL, bnx2i knows the device on which to offload the
      connection and has to register this device before attempting to offload
      the connection

Signed-off-by: Anil Veerabhadrappa <anilgv-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Reviewed-by: Michael Chan <mchan-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
 drivers/scsi/bnx2i/bnx2i_init.c  |    7 +++++--
 drivers/scsi/bnx2i/bnx2i_iscsi.c |    7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c
index fd78540..0c4210d 100644
--- a/drivers/scsi/bnx2i/bnx2i_init.c
+++ b/drivers/scsi/bnx2i/bnx2i_init.c
@@ -185,14 +185,17 @@ void bnx2i_stop(void *handle)
  */
 void bnx2i_register_device(struct bnx2i_hba *hba)
 {
+	int rc;
+
 	if (test_bit(ADAPTER_STATE_GOING_DOWN, &hba->adapter_state) ||
 	    test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic)) {
 		return;
 	}
 
-	hba->cnic->register_device(hba->cnic, CNIC_ULP_ISCSI, hba);
+	rc = hba->cnic->register_device(hba->cnic, CNIC_ULP_ISCSI, hba);
 
-	set_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic);
+	if (!rc)
+		set_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic);
 }
 
 
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;
-- 
1.5.4.3

  parent reply	other threads:[~2009-07-09  1:21 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 ` Anil Veerabhadrappa [this message]
2009-07-09  6:21   ` [PATCH] BNX2I: register given device with cnic if shost != NULL in ep_connect() 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
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=1247102461.9829.438.camel@anilgv-desktop \
    --to=anilgv-dy08kvg/lbpwk0htik3j/w@public.gmane.org \
    --cc=James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org \
    --cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mchan-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=michaelc-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org \
    --cc=open-iscsi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    /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