Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ice: Check for DCB capability before initializing DCB

Check the ICE_FLAG_DCB_CAPABLE before calling ice_init_pf_dcb.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

authored by

Anirudh Venkataramanan and committed by
Jeff Kirsher
80739b57 c61d2342

+8 -10
-3
drivers/net/ethernet/intel/ice/ice_dcb_lib.c
··· 474 474 } 475 475 476 476 pf->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE; 477 - set_bit(ICE_FLAG_DCB_CAPABLE, pf->flags); 478 477 return 0; 479 478 } 480 479 ··· 481 482 482 483 /* DCBX in FW and LLDP enabled in FW */ 483 484 pf->dcbx_cap = DCB_CAP_DCBX_LLD_MANAGED | DCB_CAP_DCBX_VER_IEEE; 484 - 485 - set_bit(ICE_FLAG_DCB_CAPABLE, pf->flags); 486 485 487 486 err = ice_dcb_init_cfg(pf, locked); 488 487 if (err)
+8 -7
drivers/net/ethernet/intel/ice/ice_main.c
··· 2252 2252 static int ice_init_pf(struct ice_pf *pf) 2253 2253 { 2254 2254 bitmap_zero(pf->flags, ICE_PF_FLAGS_NBITS); 2255 + if (pf->hw.func_caps.common_cap.dcb) 2256 + set_bit(ICE_FLAG_DCB_CAPABLE, pf->flags); 2255 2257 #ifdef CONFIG_PCI_IOV 2256 2258 if (pf->hw.func_caps.common_cap.sr_iov_1_1) { 2257 2259 struct ice_hw *hw = &pf->hw; ··· 2531 2529 goto err_init_pf_unroll; 2532 2530 } 2533 2531 2534 - err = ice_init_pf_dcb(pf, false); 2535 - if (err) { 2536 - clear_bit(ICE_FLAG_DCB_CAPABLE, pf->flags); 2537 - clear_bit(ICE_FLAG_DCB_ENA, pf->flags); 2538 - 2539 - /* do not fail overall init if DCB init fails */ 2540 - err = 0; 2532 + if (test_bit(ICE_FLAG_DCB_CAPABLE, pf->flags)) { 2533 + /* Note: DCB init failure is non-fatal to load */ 2534 + if (ice_init_pf_dcb(pf, false)) { 2535 + clear_bit(ICE_FLAG_DCB_CAPABLE, pf->flags); 2536 + clear_bit(ICE_FLAG_DCB_ENA, pf->flags); 2537 + } 2541 2538 } 2542 2539 2543 2540 ice_determine_q_usage(pf);