Skip to contentSkip to conversation

lpfc: Remove NVME protocol support of kernel has NVME_FC support disabled

PATCH Applied James Smart 3 participants 3 messages Feb 7, 2022 – Feb 8, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lpfc: Remove NVME protocol support of kernel has NVME_FC support disabled

The driver is intiating NVME PRLI's to determine NVME support to devices. This should not be occurring if CONFIG_NVME_FC support is disabled.

Corrected by changing the default value for FC4 support. Currently it defaults to FCP and NVME. With change, when NVME_FC support is not enabled in the kernel, the default value is just SCSI.

Cut against 5.18/scsi-queue

---
 drivers/scsi/lpfc/lpfc.h      | 13 ++++++++++---
 drivers/scsi/lpfc/lpfc_attr.c |  4 ++--
 2 files changed, 12 insertions(+), 5 deletions(-)
drivers/scsi/lpfc/lpfc.h +10 -3
index 4878c94761f9..a1e0a106c132 100644
@@ -1161,6 +1161,16 @@ struct lpfc_hba {
 	uint32_t cfg_hostmem_hgp;
 	uint32_t cfg_log_verbose;
 	uint32_t cfg_enable_fc4_type;
+#define LPFC_ENABLE_FCP  1
+#define LPFC_ENABLE_NVME 2
+#define LPFC_ENABLE_BOTH 3
+#if (IS_ENABLED(CONFIG_NVME_FC))
+#define LPFC_MAX_ENBL_FC4_TYPE LPFC_ENABLE_BOTH
+#define LPFC_DEF_ENBL_FC4_TYPE LPFC_ENABLE_BOTH
+#else
+#define LPFC_MAX_ENBL_FC4_TYPE LPFC_ENABLE_FCP
+#define LPFC_DEF_ENBL_FC4_TYPE LPFC_ENABLE_FCP
+#endif
 	uint32_t cfg_aer_support;
 	uint32_t cfg_sriov_nr_virtfn;
 	uint32_t cfg_request_firmware_upgrade;
@@ -1182,9 +1192,6 @@ struct lpfc_hba {
 	uint32_t cfg_ras_fwlog_func;
 	uint32_t cfg_enable_bbcr;	/* Enable BB Credit Recovery */
 	uint32_t cfg_enable_dpp;	/* Enable Direct Packet Push */
-#define LPFC_ENABLE_FCP  1
-#define LPFC_ENABLE_NVME 2
-#define LPFC_ENABLE_BOTH 3
 	uint32_t cfg_enable_pbde;
 	uint32_t cfg_enable_mi;
 	struct nvmet_fc_target_port *targetport;
drivers/scsi/lpfc/lpfc_attr.c +2 -2
index 7a7f17d71811..bac78fbce8d6 100644
@@ -3978,8 +3978,8 @@ LPFC_ATTR_R(nvmet_mrq_post,
  *                    3 - register both FCP and NVME
  * Supported values are [1,3]. Default value is 3
  */
-LPFC_ATTR_R(enable_fc4_type, LPFC_ENABLE_BOTH,
-	    LPFC_ENABLE_FCP, LPFC_ENABLE_BOTH,
+LPFC_ATTR_R(enable_fc4_type, LPFC_DEF_ENBL_FC4_TYPE,
+	    LPFC_ENABLE_FCP, LPFC_MAX_ENBL_FC4_TYPE,
 	    "Enable FC4 Protocol support - FCP / NVME");
 
 /*
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 65 lines · James Smart

The driver is intiating NVME PRLI's to determine NVME support to devices. This should not be occurring if CONFIG_NVME_FC support is disabled.

Corrected by changing the default value for FC4 support. Currently it defaults to FCP and NVME. With change, when NVME_FC support is not enabled in the kernel, the default value is just SCSI.

Cut against 5.18/scsi-queue

---
 drivers/scsi/lpfc/lpfc.h      | 13 ++++++++++---
 drivers/scsi/lpfc/lpfc_attr.c |  4 ++--
 2 files changed, 12 insertions(+), 5 deletions(-)
drivers/scsi/lpfc/lpfc.h +10 -3
index 4878c94761f9..a1e0a106c132 100644
@@ -1161,6 +1161,16 @@ struct lpfc_hba {
        uint32_t cfg_hostmem_hgp;
        uint32_t cfg_log_verbose;
        uint32_t cfg_enable_fc4_type;
+#define LPFC_ENABLE_FCP  1
+#define LPFC_ENABLE_NVME 2
+#define LPFC_ENABLE_BOTH 3
+#if (IS_ENABLED(CONFIG_NVME_FC))
+#define LPFC_MAX_ENBL_FC4_TYPE LPFC_ENABLE_BOTH
+#define LPFC_DEF_ENBL_FC4_TYPE LPFC_ENABLE_BOTH
+#else
+#define LPFC_MAX_ENBL_FC4_TYPE LPFC_ENABLE_FCP
+#define LPFC_DEF_ENBL_FC4_TYPE LPFC_ENABLE_FCP
+#endif
        uint32_t cfg_aer_support;
        uint32_t cfg_sriov_nr_virtfn;
        uint32_t cfg_request_firmware_upgrade;
@@ -1182,9 +1192,6 @@ struct lpfc_hba {
        uint32_t cfg_ras_fwlog_func;
        uint32_t cfg_enable_bbcr;       /* Enable BB Credit Recovery */
        uint32_t cfg_enable_dpp;        /* Enable Direct Packet Push */
-#define LPFC_ENABLE_FCP  1
-#define LPFC_ENABLE_NVME 2
-#define LPFC_ENABLE_BOTH 3
        uint32_t cfg_enable_pbde;
        uint32_t cfg_enable_mi;
        struct nvmet_fc_target_port *targetport;
drivers/scsi/lpfc/lpfc_attr.c +2 -3
index 7a7f17d71811..bac78fbce8d6 100644
@@ -3978,8 +3978,8 @@ LPFC_ATTR_R(nvmet_mrq_post,
  *                    3 - register both FCP and NVME
  * Supported values are [1,3]. Default value is 3
  */
-LPFC_ATTR_R(enable_fc4_type, LPFC_ENABLE_BOTH,
-           LPFC_ENABLE_FCP, LPFC_ENABLE_BOTH,
+LPFC_ATTR_R(enable_fc4_type, LPFC_DEF_ENBL_FC4_TYPE,
+           LPFC_ENABLE_FCP, LPFC_MAX_ENBL_FC4_TYPE,
            "Enable FC4 Protocol support - FCP / NVME");
 
 /*
--

2.26.2

#2 lore raw
In reply to James Smart
Quoted 8 lines · James Smart

The driver is intiating NVME PRLI's to determine NVME support to devices. This should not be occurring if CONFIG_NVME_FC support is disabled.

Corrected by changing the default value for FC4 support. Currently it defaults to FCP and NVME. With change, when NVME_FC support is not enabled in the kernel, the default value is just SCSI.

[...]

Applied to 5.17/scsi-fixes, thanks!

[1/1] lpfc: Remove NVME protocol support of kernel has NVME_FC support disabled

      https://git.kernel.org/mkp/scsi/c/c80b27cfd93b
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering