]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: qla2xxx: Enable ATIO interrupt handshake for ISP27XX
authorQuinn Tran <quinn.tran@cavium.com>
Thu, 28 Dec 2017 20:33:17 +0000 (12:33 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 4 Jan 2018 04:41:05 +0000 (23:41 -0500)
Enable ATIO Q interrupt handshake for ISP27XX. This patch
coalesce ATIO's interrupts for Quad port ISP27XX adapter.
Interrupt coalesce allows performance to scale for this
specific case.

Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_target.c

index 067bcc57a9ad053ecbbbead50887f4453dbd1433..db6fd3b747edcae886dd234b9376c7280ea2a444 100644 (file)
@@ -6574,7 +6574,9 @@ void
 qlt_24xx_config_rings(struct scsi_qla_host *vha)
 {
        struct qla_hw_data *ha = vha->hw;
-       struct init_cb_24xx *icb;
+       struct qla_msix_entry *msix = &ha->msix_entries[2];
+       struct init_cb_24xx *icb = (struct init_cb_24xx *)ha->init_cb;
+
        if (!QLA_TGT_MODE_ENABLED())
                return;
 
@@ -6582,19 +6584,28 @@ qlt_24xx_config_rings(struct scsi_qla_host *vha)
        WRT_REG_DWORD(ISP_ATIO_Q_OUT(vha), 0);
        RD_REG_DWORD(ISP_ATIO_Q_OUT(vha));
 
-       icb = (struct init_cb_24xx *)ha->init_cb;
-
-       if ((ql2xenablemsix != 0) && IS_ATIO_MSIX_CAPABLE(ha)) {
-               struct qla_msix_entry *msix = &ha->msix_entries[2];
-
-               icb->msix_atio = cpu_to_le16(msix->entry);
-               ql_dbg(ql_dbg_init, vha, 0xf072,
-                   "Registering ICB vector 0x%x for atio que.\n",
-                   msix->entry);
-       } else if (ql2xenablemsix == 0) {
-               icb->firmware_options_2 |= cpu_to_le32(BIT_26);
-               ql_dbg(ql_dbg_init, vha, 0xf07f,
-                   "Registering INTx vector for ATIO.\n");
+       if (ha->flags.msix_enabled) {
+               if (IS_QLA83XX(ha) || IS_QLA27XX(ha)) {
+                       if (IS_QLA2071(ha)) {
+                               /* 4 ports Baker: Enable Interrupt Handshake */
+                               icb->msix_atio = 0;
+                               icb->firmware_options_2 |= BIT_26;
+                       } else {
+                               icb->msix_atio = cpu_to_le16(msix->entry);
+                               icb->firmware_options_2 &= ~BIT_26;
+                       }
+                       ql_dbg(ql_dbg_init, vha, 0xf072,
+                           "Registering ICB vector 0x%x for atio que.\n",
+                           msix->entry);
+               }
+       } else {
+               /* INTx|MSI */
+               if (IS_QLA83XX(ha) || IS_QLA27XX(ha)) {
+                       icb->msix_atio = 0;
+                       icb->firmware_options_2 |= BIT_26;
+                       ql_dbg(ql_dbg_init, vha, 0xf072,
+                           "%s: Use INTx for ATIOQ.\n", __func__);
+               }
        }
 }