Skip to content

Commit

Permalink
scsi: lpfc: Rework misleading nvme not supported in firmware message
Browse files Browse the repository at this point in the history
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: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
James Smart authored and Martin K. Petersen committed Jun 18, 2019
1 parent b9e5a2d commit c15e070
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 18 deletions.
55 changes: 37 additions & 18 deletions drivers/scsi/lpfc/lpfc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -11333,24 +11333,43 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
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->nvme_support = (bf_get(cfg_nvme, mbx_sli4_parameters) &&
bf_get(cfg_xib, mbx_sli4_parameters));

if ((phba->cfg_enable_fc4_type == LPFC_ENABLE_FCP) ||
!phba->nvme_support) {
phba->nvme_support = 0;
phba->nvmet_support = 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 (!(phba->cfg_enable_fc4_type & LPFC_ENABLE_FCP))
return -ENODEV;
phba->cfg_enable_fc4_type = LPFC_ENABLE_FCP;

/* Check for firmware nvme support */
rc = (bf_get(cfg_nvme, mbx_sli4_parameters) &&
bf_get(cfg_xib, mbx_sli4_parameters));

if (rc) {
/* 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->nvmet_support = 0;
phba->cfg_nvmet_mrq = 0;

/* If no FC4 type support, move to just SCSI support */
if (!(phba->cfg_enable_fc4_type & LPFC_ENABLE_FCP))
return -ENODEV;
phba->cfg_enable_fc4_type = LPFC_ENABLE_FCP;
}
}

/* Only embed PBDE for if_type 6, PBDE support requires xib be set */
Expand Down
1 change: 1 addition & 0 deletions drivers/scsi/lpfc/lpfc_sli4.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ struct lpfc_pc_sli4_params {
#define LPFC_WQ_SZ64_SUPPORT 1
#define LPFC_WQ_SZ128_SUPPORT 2
uint8_t wqpcnt;
uint8_t nvme;
};

#define LPFC_CQ_4K_PAGE_SZ 0x1
Expand Down

0 comments on commit c15e070

Please sign in to comment.