Skip to content

Commit 473ca57

Browse files
dmertmanJeff Kirsher
authored andcommitted
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: Dave Ertman <david.m.ertman@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent a257f18 commit 473ca57

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

drivers/net/ethernet/intel/ice/ice_dcb_lib.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -452,14 +452,18 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
452452
port_info = hw->port_info;
453453

454454
err = ice_init_dcb(hw);
455+
if (err && !port_info->is_sw_lldp) {
456+
dev_err(&pf->pdev->dev, "Error initializing DCB %d\n", err);
457+
goto dcb_init_err;
458+
}
459+
460+
dev_info(&pf->pdev->dev,
461+
"DCB is enabled in the hardware, max number of TCs supported on this port are %d\n",
462+
pf->hw.func_caps.common_cap.maxtc);
455463
if (err) {
456464
/* FW LLDP is disabled, activate SW DCBX/LLDP mode */
457-
dev_info(&pf->pdev->dev,
458-
"DCB is enabled in the hardware, max number of TCs supported on this port are %d\n",
459-
pf->hw.func_caps.common_cap.maxtc);
460465
dev_info(&pf->pdev->dev,
461466
"FW LLDP is disabled, DCBx/LLDP in SW mode.\n");
462-
port_info->is_sw_lldp = true;
463467
clear_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags);
464468
err = ice_dcb_sw_dflt_cfg(pf, locked);
465469
if (err) {
@@ -475,7 +479,6 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
475479
return 0;
476480
}
477481

478-
port_info->is_sw_lldp = false;
479482
set_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags);
480483

481484
/* DCBX in FW and LLDP enabled in FW */
@@ -487,10 +490,6 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
487490
if (err)
488491
goto dcb_init_err;
489492

490-
dev_info(&pf->pdev->dev,
491-
"DCB is enabled in the hardware, max number of TCs supported on this port are %d\n",
492-
pf->hw.func_caps.common_cap.maxtc);
493-
dev_info(&pf->pdev->dev, "DCBX offload supported\n");
494493
return err;
495494

496495
dcb_init_err:

0 commit comments

Comments
 (0)