]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Fixed failure in handling large CQ/EQ identifiers in an IOV environment (CR 126856)
authorVaios Papadimitriou <vaios.papadimitriou@emulex.com>
Tue, 8 May 2012 22:01:24 +0000 (17:01 -0500)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Wed, 9 May 2012 00:01:25 +0000 (17:01 -0700)
In an SR-IOV environment, when creating virtual functions, the driver failed to
issue INIT_LINK mailbox commands properly when attaching to the virtual
functions. The driver will now write into CQ/EQ doorbell registers by taking
both the lower and the possible higher bit CQ/EQ identifier fields into
consideration to comply for with the spec for handling INIT_LINK mailbox
commands.

commit id: 6b5151fd7baec6812fece993ddd7a2cf9fd0125f

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

index ad3ab5005e1a071356c89471c55c083b856f89fe..31a8857438ca957cac74eb84f2b737911e9018ff 100644 (file)
@@ -715,12 +715,20 @@ struct lpfc_register {
 #define lpfc_eqcq_doorbell_eqci_SHIFT          9
 #define lpfc_eqcq_doorbell_eqci_MASK           0x0001
 #define lpfc_eqcq_doorbell_eqci_WORD           word0
-#define lpfc_eqcq_doorbell_cqid_SHIFT          0
-#define lpfc_eqcq_doorbell_cqid_MASK           0x03FF
-#define lpfc_eqcq_doorbell_cqid_WORD           word0
-#define lpfc_eqcq_doorbell_eqid_SHIFT          0
-#define lpfc_eqcq_doorbell_eqid_MASK           0x01FF
-#define lpfc_eqcq_doorbell_eqid_WORD           word0
+#define lpfc_eqcq_doorbell_cqid_lo_SHIFT       0
+#define lpfc_eqcq_doorbell_cqid_lo_MASK                0x03FF
+#define lpfc_eqcq_doorbell_cqid_lo_WORD                word0
+#define lpfc_eqcq_doorbell_cqid_hi_SHIFT       11
+#define lpfc_eqcq_doorbell_cqid_hi_MASK                0x001F
+#define lpfc_eqcq_doorbell_cqid_hi_WORD                word0
+#define lpfc_eqcq_doorbell_eqid_lo_SHIFT       0
+#define lpfc_eqcq_doorbell_eqid_lo_MASK                0x01FF
+#define lpfc_eqcq_doorbell_eqid_lo_WORD                word0
+#define lpfc_eqcq_doorbell_eqid_hi_SHIFT       11
+#define lpfc_eqcq_doorbell_eqid_hi_MASK                0x001F
+#define lpfc_eqcq_doorbell_eqid_hi_WORD                word0
+#define LPFC_CQID_HI_FIELD_SHIFT               10
+#define LPFC_EQID_HI_FIELD_SHIFT               9
 
 #define LPFC_BMBX                      0x0160
 #define lpfc_bmbx_addr_SHIFT           2
index 979979b49699abec6fc5adca86fb63d6dff3d5f0..c80bce633ae15b9169ff000b864c2cdfa057efe0 100644 (file)
@@ -293,7 +293,9 @@ lpfc_sli4_eq_release(struct lpfc_queue *q, bool arm)
        }
        bf_set(lpfc_eqcq_doorbell_num_released, &doorbell, released);
        bf_set(lpfc_eqcq_doorbell_qt, &doorbell, LPFC_QUEUE_TYPE_EVENT);
-       bf_set(lpfc_eqcq_doorbell_eqid, &doorbell, q->queue_id);
+       bf_set(lpfc_eqcq_doorbell_eqid_hi, &doorbell,
+                       (q->queue_id >> LPFC_EQID_HI_FIELD_SHIFT));
+       bf_set(lpfc_eqcq_doorbell_eqid_lo, &doorbell, q->queue_id);
        writel(doorbell.word0, q->phba->sli4_hba.EQCQDBregaddr);
        /* PCI read to flush PCI pipeline on re-arming for INTx mode */
        if ((q->phba->intr_type == INTx) && (arm == LPFC_QUEUE_REARM))
@@ -372,7 +374,9 @@ lpfc_sli4_cq_release(struct lpfc_queue *q, bool arm)
                bf_set(lpfc_eqcq_doorbell_arm, &doorbell, 1);
        bf_set(lpfc_eqcq_doorbell_num_released, &doorbell, released);
        bf_set(lpfc_eqcq_doorbell_qt, &doorbell, LPFC_QUEUE_TYPE_COMPLETION);
-       bf_set(lpfc_eqcq_doorbell_cqid, &doorbell, q->queue_id);
+       bf_set(lpfc_eqcq_doorbell_cqid_hi, &doorbell,
+                       (q->queue_id >> LPFC_CQID_HI_FIELD_SHIFT));
+       bf_set(lpfc_eqcq_doorbell_cqid_lo, &doorbell, q->queue_id);
        writel(doorbell.word0, q->phba->sli4_hba.EQCQDBregaddr);
        return released;
 }