Commit c15e0704 authored by James Smart's avatar James Smart Committed by Martin K. Petersen

scsi: lpfc: Rework misleading nvme not supported in firmware message

The driver unconditionally says fw doesn't support nvme when in
truth it was a driver parameter settings that disabled nvme support.

Rework the code validating nvme support to accurately report what
condition is disabling nvme support. Save state on whether nvme
fw supports nvme in case sysfs attributes change dynamically.
Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b9e5a2d9
...@@ -11333,25 +11333,44 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) ...@@ -11333,25 +11333,44 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
mbx_sli4_parameters); mbx_sli4_parameters);
phba->sli4_hba.extents_in_use = bf_get(cfg_ext, mbx_sli4_parameters); phba->sli4_hba.extents_in_use = bf_get(cfg_ext, mbx_sli4_parameters);
phba->sli4_hba.rpi_hdrs_in_use = bf_get(cfg_hdrr, mbx_sli4_parameters); phba->sli4_hba.rpi_hdrs_in_use = bf_get(cfg_hdrr, mbx_sli4_parameters);
phba->nvme_support = (bf_get(cfg_nvme, mbx_sli4_parameters) &&
/* Check for firmware nvme support */
rc = (bf_get(cfg_nvme, mbx_sli4_parameters) &&
bf_get(cfg_xib, mbx_sli4_parameters)); bf_get(cfg_xib, mbx_sli4_parameters));
if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_FCP) || if (rc) {
!phba->nvme_support) { /* Save this to indicate the Firmware supports NVME */
sli4_params->nvme = 1;
/* Firmware NVME support, check driver FC4 NVME support */
if (phba->cfg_enable_fc4_type == LPFC_ENABLE_FCP) {
lpfc_printf_log(phba, KERN_INFO, LOG_INIT | LOG_NVME,
"6133 Disabling NVME support: "
"FC4 type not supported: x%x\n",
phba->cfg_enable_fc4_type);
goto fcponly;
}
} else {
/* No firmware NVME support, check driver FC4 NVME support */
sli4_params->nvme = 0;
if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_NVME,
"6101 Disabling NVME support: Not "
"supported by firmware (%d %d) x%x\n",
bf_get(cfg_nvme, mbx_sli4_parameters),
bf_get(cfg_xib, mbx_sli4_parameters),
phba->cfg_enable_fc4_type);
fcponly:
phba->nvme_support = 0; phba->nvme_support = 0;
phba->nvmet_support = 0; phba->nvmet_support = 0;
phba->cfg_nvmet_mrq = 0; phba->cfg_nvmet_mrq = 0;
lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_NVME,
"6101 Disabling NVME support: "
"Not supported by firmware: %d %d\n",
bf_get(cfg_nvme, mbx_sli4_parameters),
bf_get(cfg_xib, mbx_sli4_parameters));
/* If firmware doesn't support NVME, just use SCSI support */ /* If no FC4 type support, move to just SCSI support */
if (!(phba->cfg_enable_fc4_type & LPFC_ENABLE_FCP)) if (!(phba->cfg_enable_fc4_type & LPFC_ENABLE_FCP))
return -ENODEV; return -ENODEV;
phba->cfg_enable_fc4_type = LPFC_ENABLE_FCP; phba->cfg_enable_fc4_type = LPFC_ENABLE_FCP;
} }
}
/* Only embed PBDE for if_type 6, PBDE support requires xib be set */ /* Only embed PBDE for if_type 6, PBDE support requires xib be set */
if ((bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) != if ((bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) !=
......
...@@ -514,6 +514,7 @@ struct lpfc_pc_sli4_params { ...@@ -514,6 +514,7 @@ struct lpfc_pc_sli4_params {
#define LPFC_WQ_SZ64_SUPPORT 1 #define LPFC_WQ_SZ64_SUPPORT 1
#define LPFC_WQ_SZ128_SUPPORT 2 #define LPFC_WQ_SZ128_SUPPORT 2
uint8_t wqpcnt; uint8_t wqpcnt;
uint8_t nvme;
}; };
#define LPFC_CQ_4K_PAGE_SZ 0x1 #define LPFC_CQ_4K_PAGE_SZ 0x1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment