]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
fnic: Using rport-_dd_data to check rport online instead of rport_lookup
authorJason Luo <zhangqing.luo@oracle.com>
Thu, 17 Mar 2016 03:29:50 +0000 (11:29 +0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 21 Mar 2016 16:00:49 +0000 (09:00 -0700)
From: Satish Kharat <satishkh@cisco.com>

When issuing I/O we check if rport is online through libfc
rport_lookup() function which needs to be protected by mutex lock
that cannot acquired in I/O context. The change is to use midlayer
remote port’s dd_data which is preserved until its devloss timeout
and no protection is required.

Fnic driver version changed from 1.6.0.20 to 1.6.0.21

Signed-off-by: Satish Kharat <satishkh@cisco.com>
Orabug: 22918200
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
drivers/scsi/fnic/fnic.h
drivers/scsi/fnic/fnic_scsi.c

index 1023eaea17f3d8e29587417f057ca7ae11c35f1e..9ddc9200e0a48b00632bbc441c492679786ec570 100644 (file)
@@ -39,7 +39,7 @@
 
 #define DRV_NAME               "fnic"
 #define DRV_DESCRIPTION                "Cisco FCoE HBA Driver"
-#define DRV_VERSION            "1.6.0.20"
+#define DRV_VERSION            "1.6.0.21"
 #define PFX                    DRV_NAME ": "
 #define DFX                     DRV_NAME "%d: "
 
index 8b0c5080132c44ab34f515263e17a890142c687e..87cf9ddc4bccd133e02bcfb0ebd1c7649a3c7089 100644 (file)
@@ -423,7 +423,6 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_
        int sg_count = 0;
        unsigned long flags = 0;
        unsigned long ptr;
-       struct fc_rport_priv *rdata;
        spinlock_t *io_lock = NULL;
        int io_lock_acquired = 0;
 
@@ -438,17 +437,18 @@ static int fnic_queuecommand_lck(struct scsi_cmnd *sc, void (*done)(struct scsi_
                done(sc);
                return 0;
        }
+       if (rport) {
+               struct fc_rport_libfc_priv *rp = rport->dd_data;
 
-       rdata = lp->tt.rport_lookup(lp, rport->port_id);
-       if (!rdata || (rdata->rp_state == RPORT_ST_DELETE)) {
-               FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
-                       "returning IO as rport is removed\n");
-               atomic64_inc(&fnic_stats->misc_stats.rport_not_ready);
-               sc->result = DID_NO_CONNECT;
-               done(sc);
-               return 0;
+               if (!rp || rp->rp_state != RPORT_ST_READY) {
+                       FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
+                               "returning DID_NO_CONNECT for IO as rport is removed\n");
+                       atomic64_inc(&fnic_stats->misc_stats.rport_not_ready);
+                       sc->result = DID_NO_CONNECT;
+                       done(sc);
+                       return 0;
+               }
        }
-
        if (lp->state != LPORT_ST_READY || !(lp->link_up))
                return SCSI_MLQUEUE_HOST_BUSY;