]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: lpfc: cleanup: remove nrport from nvme command structure
authorJames Smart <jsmart2021@gmail.com>
Mon, 28 Jan 2019 19:14:17 +0000 (11:14 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 6 Feb 2019 03:22:42 +0000 (22:22 -0500)
An hba-wide lock is taken in the nvme io completion routine. The lock
covers null'ing of the nrport pointer in the cmd structure.

The nrport member isn't necessary. After extracting the pointer from the
command, the pointer was dereferenced to get the fc discovery node
pointer. But the fc discovery node pointer is alrady in the command
structure so the dereferrence was unnecessary.

Eliminated the nrport structure member and its use, which also eliminates
the port-wide lock.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_nvme.c
drivers/scsi/lpfc/lpfc_nvme.h

index 4c66b19e61996a80c6440211e78086a1b4257c10..b59bf37af881afd964e223f6ac69f8f1173f8d28 100644 (file)
@@ -961,18 +961,16 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
        struct nvmefc_fcp_req *nCmd;
        struct nvme_fc_ersp_iu *ep;
        struct nvme_fc_cmd_iu *cp;
-       struct lpfc_nvme_rport *rport;
        struct lpfc_nodelist *ndlp;
        struct lpfc_nvme_fcpreq_priv *freqpriv;
        struct lpfc_nvme_lport *lport;
        struct lpfc_nvme_ctrl_stat *cstat;
-       unsigned long flags;
        uint32_t code, status, idx;
        uint16_t cid, sqhd, data;
        uint32_t *ptr;
 
        /* Sanity check on return of outstanding command */
-       if (!lpfc_ncmd || !lpfc_ncmd->nvmeCmd || !lpfc_ncmd->nrport) {
+       if (!lpfc_ncmd || !lpfc_ncmd->nvmeCmd) {
                if (!lpfc_ncmd) {
                        lpfc_printf_vlog(vport, KERN_ERR,
                                         LOG_NODE | LOG_NVME_IOERR,
@@ -983,16 +981,14 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
 
                lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE | LOG_NVME_IOERR,
                                 "6066 Missing cmpl ptrs: lpfc_ncmd %p, "
-                                "nvmeCmd %p nrport %p\n",
-                                lpfc_ncmd, lpfc_ncmd->nvmeCmd,
-                                lpfc_ncmd->nrport);
+                                "nvmeCmd %p\n",
+                                lpfc_ncmd, lpfc_ncmd->nvmeCmd);
 
                /* Release the lpfc_ncmd regardless of the missing elements. */
                lpfc_release_nvme_buf(phba, lpfc_ncmd);
                return;
        }
        nCmd = lpfc_ncmd->nvmeCmd;
-       rport = lpfc_ncmd->nrport;
        status = bf_get(lpfc_wcqe_c_status, wcqe);
 
        if (vport->localport) {
@@ -1016,18 +1012,11 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
         * Catch race where our node has transitioned, but the
         * transport is still transitioning.
         */
-       ndlp = rport->ndlp;
+       ndlp = lpfc_ncmd->ndlp;
        if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) {
-               lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE | LOG_NVME_IOERR,
-                                "6061 rport %p,  DID x%06x node not ready.\n",
-                                rport, rport->remoteport->port_id);
-
-               ndlp = lpfc_findnode_did(vport, rport->remoteport->port_id);
-               if (!ndlp) {
-                       lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_IOERR,
-                                        "6062 Ignoring NVME cmpl.  No ndlp\n");
-                       goto out_err;
-               }
+               lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_IOERR,
+                                "6062 Ignoring NVME cmpl.  No ndlp\n");
+               goto out_err;
        }
 
        code = bf_get(lpfc_wcqe_c_code, wcqe);
@@ -1168,10 +1157,6 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn,
                lpfc_ncmd->nvmeCmd = NULL;
        }
 
-       spin_lock_irqsave(&phba->hbalock, flags);
-       lpfc_ncmd->nrport = NULL;
-       spin_unlock_irqrestore(&phba->hbalock, flags);
-
        /* Call release with XB=1 to queue the IO into the abort list. */
        lpfc_release_nvme_buf(phba, lpfc_ncmd);
 }
@@ -1585,7 +1570,6 @@ lpfc_nvme_fcp_io_submit(struct nvme_fc_local_port *pnvme_lport,
         */
        freqpriv->nvme_buf = lpfc_ncmd;
        lpfc_ncmd->nvmeCmd = pnvme_fcreq;
-       lpfc_ncmd->nrport = rport;
        lpfc_ncmd->ndlp = ndlp;
        lpfc_ncmd->start_time = jiffies;
 
index cfd4719be25c3d3eb35ae4ae5ea7e56d357d0d21..7a636bde326f58de760962f8fb58d6342054a972 100644 (file)
@@ -79,7 +79,6 @@ struct lpfc_nvme_rport {
 struct lpfc_nvme_buf {
        struct list_head list;
        struct nvmefc_fcp_req *nvmeCmd;
-       struct lpfc_nvme_rport *nrport;
        struct lpfc_nodelist *ndlp;
 
        uint32_t timeout;