Skip to content

Commit c80b27c

Browse files
jsmart-ghmartinkpetersen
authored andcommitted
scsi: lpfc: Remove NVMe support if kernel has NVME_FC disabled
The driver is initiating NVMe PRLIs to determine device NVMe support. This should not be occurring if CONFIG_NVME_FC support is disabled. Correct this 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 FCP. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ewan D. Milne <[email protected]> Signed-off-by: James Smart <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent c763ec4 commit c80b27c

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

drivers/scsi/lpfc/lpfc.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,16 @@ struct lpfc_hba {
11611161
uint32_t cfg_hostmem_hgp;
11621162
uint32_t cfg_log_verbose;
11631163
uint32_t cfg_enable_fc4_type;
1164+
#define LPFC_ENABLE_FCP 1
1165+
#define LPFC_ENABLE_NVME 2
1166+
#define LPFC_ENABLE_BOTH 3
1167+
#if (IS_ENABLED(CONFIG_NVME_FC))
1168+
#define LPFC_MAX_ENBL_FC4_TYPE LPFC_ENABLE_BOTH
1169+
#define LPFC_DEF_ENBL_FC4_TYPE LPFC_ENABLE_BOTH
1170+
#else
1171+
#define LPFC_MAX_ENBL_FC4_TYPE LPFC_ENABLE_FCP
1172+
#define LPFC_DEF_ENBL_FC4_TYPE LPFC_ENABLE_FCP
1173+
#endif
11641174
uint32_t cfg_aer_support;
11651175
uint32_t cfg_sriov_nr_virtfn;
11661176
uint32_t cfg_request_firmware_upgrade;
@@ -1182,9 +1192,6 @@ struct lpfc_hba {
11821192
uint32_t cfg_ras_fwlog_func;
11831193
uint32_t cfg_enable_bbcr; /* Enable BB Credit Recovery */
11841194
uint32_t cfg_enable_dpp; /* Enable Direct Packet Push */
1185-
#define LPFC_ENABLE_FCP 1
1186-
#define LPFC_ENABLE_NVME 2
1187-
#define LPFC_ENABLE_BOTH 3
11881195
uint32_t cfg_enable_pbde;
11891196
uint32_t cfg_enable_mi;
11901197
struct nvmet_fc_target_port *targetport;

drivers/scsi/lpfc/lpfc_attr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3978,8 +3978,8 @@ LPFC_ATTR_R(nvmet_mrq_post,
39783978
* 3 - register both FCP and NVME
39793979
* Supported values are [1,3]. Default value is 3
39803980
*/
3981-
LPFC_ATTR_R(enable_fc4_type, LPFC_ENABLE_BOTH,
3982-
LPFC_ENABLE_FCP, LPFC_ENABLE_BOTH,
3981+
LPFC_ATTR_R(enable_fc4_type, LPFC_DEF_ENBL_FC4_TYPE,
3982+
LPFC_ENABLE_FCP, LPFC_MAX_ENBL_FC4_TYPE,
39833983
"Enable FC4 Protocol support - FCP / NVME");
39843984

39853985
/*

0 commit comments

Comments
 (0)