aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bnx2i/bnx2i_iscsi.c
diff options
context:
space:
mode:
authorAnil Veerabhadrappa <anilgv@broadcom.com>2009-07-08 21:21:01 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-08-22 18:51:54 -0400
commitfac3cc458fc2f8272bcc1ff1903474ff41715723 (patch)
treefadaa312e909cd0d1ed0e13d77f8d1c1daf08949 /drivers/scsi/bnx2i/bnx2i_iscsi.c
parentfe5d20c818a8c5fe83d9f2223a051fb5bc50d180 (diff)
[SCSI] bnx2i: register given device with cnic if shost != NULL in ep_connect()
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@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bnx2i/bnx2i_iscsi.c')
-rw-r--r--drivers/scsi/bnx2i/bnx2i_iscsi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index f7412196f2f..98148f3f3c6 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,
1653 struct iscsi_endpoint *ep; 1653 struct iscsi_endpoint *ep;
1654 int rc = 0; 1654 int rc = 0;
1655 1655
1656 if (shost) 1656 if (shost) {
1657 /* driver is given scsi host to work with */ 1657 /* driver is given scsi host to work with */
1658 hba = iscsi_host_priv(shost); 1658 hba = iscsi_host_priv(shost);
1659 else 1659 /* Register the device with cnic if not already done so */
1660 bnx2i_register_device(hba);
1661 } else
1660 /* 1662 /*
1661 * check if the given destination can be reached through 1663 * check if the given destination can be reached through
1662 * a iscsi capable NetXtreme2 device 1664 * a iscsi capable NetXtreme2 device
1663 */ 1665 */
1664 hba = bnx2i_check_route(dst_addr); 1666 hba = bnx2i_check_route(dst_addr);
1667
1665 if (!hba) { 1668 if (!hba) {
1666 rc = -ENOMEM; 1669 rc = -ENOMEM;
1667 goto check_busy; 1670 goto check_busy;