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

lpfc: Fix interaction between fdmi_on and enable_SmartSAN

Signed-off-by: default avatarDick Kennedy <dick.kennedy@avagotech.com>
Signed-off-by: default avatarJames Smart <james.smart@avagotech.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 56204984
...@@ -758,7 +758,6 @@ struct lpfc_hba { ...@@ -758,7 +758,6 @@ struct lpfc_hba {
uint32_t cfg_fdmi_on; uint32_t cfg_fdmi_on;
#define LPFC_FDMI_NO_SUPPORT 0 /* FDMI not supported */ #define LPFC_FDMI_NO_SUPPORT 0 /* FDMI not supported */
#define LPFC_FDMI_SUPPORT 1 /* FDMI supported? */ #define LPFC_FDMI_SUPPORT 1 /* FDMI supported? */
#define LPFC_FDMI_SMART_SAN 2 /* SmartSAN supported */
uint32_t cfg_enable_SmartSAN; uint32_t cfg_enable_SmartSAN;
lpfc_vpd_t vpd; /* vital product data */ lpfc_vpd_t vpd; /* vital product data */
......
...@@ -4584,15 +4584,14 @@ LPFC_ATTR_R(enable_SmartSAN, 0, 0, 1, "Enable SmartSAN functionality"); ...@@ -4584,15 +4584,14 @@ LPFC_ATTR_R(enable_SmartSAN, 0, 0, 1, "Enable SmartSAN functionality");
# lpfc_fdmi_on: Controls FDMI support. # lpfc_fdmi_on: Controls FDMI support.
# 0 No FDMI support (default) # 0 No FDMI support (default)
# 1 Traditional FDMI support # 1 Traditional FDMI support
# 2 Smart SAN support # Traditional FDMI support means the driver will assume FDMI-2 support;
# If lpfc_enable_SmartSAN is set 1, the driver sets lpfc_fdmi_on to value 2 # however, if that fails, it will fallback to FDMI-1.
# overwriting the current value. If lpfc_enable_SmartSAN is set 0, the # If lpfc_enable_SmartSAN is set to 1, the driver ignores lpfc_fdmi_on.
# driver uses the current value of lpfc_fdmi_on provided it has value 0 or 1. # If lpfc_enable_SmartSAN is set 0, the driver uses the current value of
# A value of 2 with lpfc_enable_SmartSAN set to 0 causes the driver to # lpfc_fdmi_on.
# set lpfc_fdmi_on back to 1. # Value range [0,1]. Default value is 0.
# Value range [0,2]. Default value is 0.
*/ */
LPFC_ATTR_R(fdmi_on, 0, 0, 2, "Enable FDMI support"); LPFC_ATTR_R(fdmi_on, 0, 0, 1, "Enable FDMI support");
/* /*
# Specifies the maximum number of ELS cmds we can have outstanding (for # Specifies the maximum number of ELS cmds we can have outstanding (for
...@@ -5856,14 +5855,6 @@ lpfc_get_cfgparam(struct lpfc_hba *phba) ...@@ -5856,14 +5855,6 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)
else else
phba->cfg_poll = lpfc_poll; phba->cfg_poll = lpfc_poll;
/* Ensure fdmi_on and enable_SmartSAN don't conflict */
if (phba->cfg_enable_SmartSAN) {
phba->cfg_fdmi_on = LPFC_FDMI_SMART_SAN;
} else {
if (phba->cfg_fdmi_on == LPFC_FDMI_SMART_SAN)
phba->cfg_fdmi_on = LPFC_FDMI_SUPPORT;
}
phba->cfg_soft_wwnn = 0L; phba->cfg_soft_wwnn = 0L;
phba->cfg_soft_wwpn = 0L; phba->cfg_soft_wwpn = 0L;
lpfc_sg_seg_cnt_init(phba, lpfc_sg_seg_cnt); lpfc_sg_seg_cnt_init(phba, lpfc_sg_seg_cnt);
......
...@@ -690,16 +690,17 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ...@@ -690,16 +690,17 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp,
fabric_param_changed = lpfc_check_clean_addr_bit(vport, sp); fabric_param_changed = lpfc_check_clean_addr_bit(vport, sp);
if (fabric_param_changed) { if (fabric_param_changed) {
/* Reset FDMI attribute masks based on config parameter */ /* Reset FDMI attribute masks based on config parameter */
if (phba->cfg_fdmi_on == LPFC_FDMI_NO_SUPPORT) { if (phba->cfg_enable_SmartSAN ||
vport->fdmi_hba_mask = 0; (phba->cfg_fdmi_on == LPFC_FDMI_SUPPORT)) {
vport->fdmi_port_mask = 0;
} else {
/* Setup appropriate attribute masks */ /* Setup appropriate attribute masks */
vport->fdmi_hba_mask = LPFC_FDMI2_HBA_ATTR; vport->fdmi_hba_mask = LPFC_FDMI2_HBA_ATTR;
if (phba->cfg_fdmi_on == LPFC_FDMI_SMART_SAN) if (phba->cfg_enable_SmartSAN)
vport->fdmi_port_mask = LPFC_FDMI2_SMART_ATTR; vport->fdmi_port_mask = LPFC_FDMI2_SMART_ATTR;
else else
vport->fdmi_port_mask = LPFC_FDMI2_PORT_ATTR; vport->fdmi_port_mask = LPFC_FDMI2_PORT_ATTR;
} else {
vport->fdmi_hba_mask = 0;
vport->fdmi_port_mask = 0;
} }
} }
...@@ -8005,7 +8006,8 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport) ...@@ -8005,7 +8006,8 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport)
return; return;
} }
if ((phba->cfg_fdmi_on > LPFC_FDMI_NO_SUPPORT) && if ((phba->cfg_enable_SmartSAN ||
(phba->cfg_fdmi_on == LPFC_FDMI_SUPPORT)) &&
(vport->load_flag & FC_ALLOW_FDMI)) (vport->load_flag & FC_ALLOW_FDMI))
lpfc_start_fdmi(vport); lpfc_start_fdmi(vport);
} }
......
...@@ -6158,11 +6158,12 @@ lpfc_create_shost(struct lpfc_hba *phba) ...@@ -6158,11 +6158,12 @@ lpfc_create_shost(struct lpfc_hba *phba)
* any initial discovery should be completed. * any initial discovery should be completed.
*/ */
vport->load_flag |= FC_ALLOW_FDMI; vport->load_flag |= FC_ALLOW_FDMI;
if (phba->cfg_fdmi_on > LPFC_FDMI_NO_SUPPORT) { if (phba->cfg_enable_SmartSAN ||
(phba->cfg_fdmi_on == LPFC_FDMI_SUPPORT)) {
/* Setup appropriate attribute masks */ /* Setup appropriate attribute masks */
vport->fdmi_hba_mask = LPFC_FDMI2_HBA_ATTR; vport->fdmi_hba_mask = LPFC_FDMI2_HBA_ATTR;
if (phba->cfg_fdmi_on == LPFC_FDMI_SMART_SAN) if (phba->cfg_enable_SmartSAN)
vport->fdmi_port_mask = LPFC_FDMI2_SMART_ATTR; vport->fdmi_port_mask = LPFC_FDMI2_SMART_ATTR;
else else
vport->fdmi_port_mask = LPFC_FDMI2_PORT_ATTR; vport->fdmi_port_mask = LPFC_FDMI2_PORT_ATTR;
......
...@@ -395,7 +395,8 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) ...@@ -395,7 +395,8 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable)
/* At this point we are fully registered with SCSI Layer. */ /* At this point we are fully registered with SCSI Layer. */
vport->load_flag |= FC_ALLOW_FDMI; vport->load_flag |= FC_ALLOW_FDMI;
if (phba->cfg_fdmi_on > LPFC_FDMI_NO_SUPPORT) { if (phba->cfg_enable_SmartSAN ||
(phba->cfg_fdmi_on == LPFC_FDMI_SUPPORT)) {
/* Setup appropriate attribute masks */ /* Setup appropriate attribute masks */
vport->fdmi_hba_mask = phba->pport->fdmi_hba_mask; vport->fdmi_hba_mask = phba->pport->fdmi_hba_mask;
vport->fdmi_port_mask = phba->pport->fdmi_port_mask; vport->fdmi_port_mask = phba->pport->fdmi_port_mask;
......
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