Commit 473ca574 authored by Dave Ertman's avatar Dave Ertman Committed by Jeff Kirsher

ice: Correctly handle return values for init DCB

In the init path for DCB, the call to ice_init_dcb()
can return a non-zero value for either an actual
error, or due to the FW lldp engine being stopped.

We are currently treating all non-zero values only as
an indication that the FW LLDP engine is stopped.

Check for an actual error in the DCB init flow.
Signed-off-by: default avatarDave Ertman <david.m.ertman@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent a257f188
...@@ -452,14 +452,18 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked) ...@@ -452,14 +452,18 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
port_info = hw->port_info; port_info = hw->port_info;
err = ice_init_dcb(hw); err = ice_init_dcb(hw);
if (err) { if (err && !port_info->is_sw_lldp) {
/* FW LLDP is disabled, activate SW DCBX/LLDP mode */ dev_err(&pf->pdev->dev, "Error initializing DCB %d\n", err);
goto dcb_init_err;
}
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"DCB is enabled in the hardware, max number of TCs supported on this port are %d\n", "DCB is enabled in the hardware, max number of TCs supported on this port are %d\n",
pf->hw.func_caps.common_cap.maxtc); pf->hw.func_caps.common_cap.maxtc);
if (err) {
/* FW LLDP is disabled, activate SW DCBX/LLDP mode */
dev_info(&pf->pdev->dev, dev_info(&pf->pdev->dev,
"FW LLDP is disabled, DCBx/LLDP in SW mode.\n"); "FW LLDP is disabled, DCBx/LLDP in SW mode.\n");
port_info->is_sw_lldp = true;
clear_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags); clear_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags);
err = ice_dcb_sw_dflt_cfg(pf, locked); err = ice_dcb_sw_dflt_cfg(pf, locked);
if (err) { if (err) {
...@@ -475,7 +479,6 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked) ...@@ -475,7 +479,6 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
return 0; return 0;
} }
port_info->is_sw_lldp = false;
set_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags); set_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags);
/* DCBX in FW and LLDP enabled in FW */ /* DCBX in FW and LLDP enabled in FW */
...@@ -487,10 +490,6 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked) ...@@ -487,10 +490,6 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
if (err) if (err)
goto dcb_init_err; goto dcb_init_err;
dev_info(&pf->pdev->dev,
"DCB is enabled in the hardware, max number of TCs supported on this port are %d\n",
pf->hw.func_caps.common_cap.maxtc);
dev_info(&pf->pdev->dev, "DCBX offload supported\n");
return err; return err;
dcb_init_err: dcb_init_err:
......
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