]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Fix driver handling of XRI Aborted CQE response (CR 127345)
authorVaios Papadimitriou <vaios.papadimitriou@emulex.com>
Tue, 8 May 2012 22:01:26 +0000 (17:01 -0500)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Wed, 9 May 2012 00:01:26 +0000 (17:01 -0700)
When driver issued an ABTS, the aborted IO and ABTS WQE request would complete
as expected, but the XRI_ABORTED_CQE notification that the ABTS protocol
completed caused the driver to tear down the rport mapping for each completed
ABTS. Now process the status and extended status before making a decision to
tear down the target status.

commit id: 5c1db2accd4b3e21aa7440526af9d2d0ccf5241c

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
drivers/scsi/lpfc/lpfc_hw4.h
drivers/scsi/lpfc/lpfc_sli.c

index f6f3d30f1fb82a30e8721c7792baf18f6b7cb181..1b4254a146d98e9efabc3a37e8283891c4dd8fd9 100644 (file)
@@ -334,6 +334,12 @@ struct lpfc_cqe {
 #define CQE_CODE_XRI_ABORTED           0x5
 #define CQE_CODE_RECEIVE_V1            0x9
 
+/*
+ * Define mask value for xri_aborted and wcqe completed CQE extended status.
+ * Currently, extended status is limited to 9 bits (0x0 -> 0x103) .
+ */
+#define WCQE_PARAM_MASK                0x1FF;
+
 /* completion queue entry for wqe completions */
 struct lpfc_wcqe_complete {
        uint32_t word0;
index 442ccd3ccc079d8bd677984fed2066df798696d0..73310e838ee1f859ce932888d996c85f9a371c61 100644 (file)
@@ -8402,6 +8402,7 @@ lpfc_sli4_abts_err_handler(struct lpfc_hba *phba,
                           struct sli4_wcqe_xri_aborted *axri)
 {
        struct lpfc_vport *vport;
+       uint32_t ext_status = 0;
 
        if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) {
                lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
@@ -8413,12 +8414,20 @@ lpfc_sli4_abts_err_handler(struct lpfc_hba *phba,
        vport = ndlp->vport;
        lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
                        "3116 Port generated FCP XRI ABORT event on "
-                       "vpi %d rpi %d xri x%x status 0x%x\n",
+                       "vpi %d rpi %d xri x%x status 0x%x parameter x%x\n",
                        ndlp->vport->vpi, ndlp->nlp_rpi,
                        bf_get(lpfc_wcqe_xa_xri, axri),
-                       bf_get(lpfc_wcqe_xa_status, axri));
+                       bf_get(lpfc_wcqe_xa_status, axri),
+                       axri->parameter);
 
-       if (bf_get(lpfc_wcqe_xa_status, axri) == IOSTAT_LOCAL_REJECT)
+       /*
+        * Catch the ABTS protocol failure case.  Older OCe FW releases returned
+        * LOCAL_REJECT and 0 for a failed ABTS exchange and later OCe and
+        * LPe FW releases returned LOCAL_REJECT and SEQUENCE_TIMEOUT.
+        */
+       ext_status = axri->parameter & WCQE_PARAM_MASK;
+       if ((bf_get(lpfc_wcqe_xa_status, axri) == IOSTAT_LOCAL_REJECT) &&
+           ((ext_status == IOERR_SEQUENCE_TIMEOUT) || (ext_status == 0)))
                lpfc_sli_abts_recover_port(vport, ndlp);
 }