]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: lpfc: Allow reduced polling rate for nvme_admin_async_event cmd completion
authorJames Smart <jsmart2021@gmail.com>
Fri, 3 Jun 2022 17:43:28 +0000 (10:43 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 8 Jun 2022 01:38:18 +0000 (21:38 -0400)
NVMe Asynchronous Event Request commands have no command timeout value per
specifications.

Set WQE option to allow a reduced FLUSH polling rate for I/O error
detection specifically for nvme_admin_async_event commands.

Link: https://lore.kernel.org/r/20220603174329.63777-9-jsmart2021@gmail.com
Co-developed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_hw4.h
drivers/scsi/lpfc/lpfc_nvme.c

index 8511369d2cf8ef083b8791b164780769c4e4abd0..f024415731ac71187e3ba101398c643508facfd7 100644 (file)
@@ -4487,6 +4487,9 @@ struct wqe_common {
 #define wqe_sup_SHIFT         6
 #define wqe_sup_MASK          0x00000001
 #define wqe_sup_WORD          word11
+#define wqe_ffrq_SHIFT         6
+#define wqe_ffrq_MASK          0x00000001
+#define wqe_ffrq_WORD          word11
 #define wqe_wqec_SHIFT        7
 #define wqe_wqec_MASK         0x00000001
 #define wqe_wqec_WORD         word11
index 9cc22cefcb372f64b6f376b51f1c03b4957054d6..cd10ee6482fc0b8d188174738b9512629c8f7583 100644 (file)
@@ -1207,7 +1207,8 @@ lpfc_nvme_prep_io_cmd(struct lpfc_vport *vport,
 {
        struct lpfc_hba *phba = vport->phba;
        struct nvmefc_fcp_req *nCmd = lpfc_ncmd->nvmeCmd;
-       struct lpfc_iocbq *pwqeq = &(lpfc_ncmd->cur_iocbq);
+       struct nvme_common_command *sqe;
+       struct lpfc_iocbq *pwqeq = &lpfc_ncmd->cur_iocbq;
        union lpfc_wqe128 *wqe = &pwqeq->wqe;
        uint32_t req_len;
 
@@ -1264,8 +1265,14 @@ lpfc_nvme_prep_io_cmd(struct lpfc_vport *vport,
                cstat->control_requests++;
        }
 
-       if (pnode->nlp_nvme_info & NLP_NVME_NSLER)
+       if (pnode->nlp_nvme_info & NLP_NVME_NSLER) {
                bf_set(wqe_erp, &wqe->generic.wqe_com, 1);
+               sqe = &((struct nvme_fc_cmd_iu *)
+                       nCmd->cmdaddr)->sqe.common;
+               if (sqe->opcode == nvme_admin_async_event)
+                       bf_set(wqe_ffrq, &wqe->generic.wqe_com, 1);
+       }
+
        /*
         * Finish initializing those WQE fields that are independent
         * of the nvme_cmnd request_buffer