Commit 80739b57 authored by Anirudh Venkataramanan's avatar Anirudh Venkataramanan Committed by Jeff Kirsher

ice: Check for DCB capability before initializing DCB

Check the ICE_FLAG_DCB_CAPABLE before calling ice_init_pf_dcb.
Signed-off-by: default avatarAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent c61d2342
...@@ -474,7 +474,6 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked) ...@@ -474,7 +474,6 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
} }
pf->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE; pf->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE;
set_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);
return 0; return 0;
} }
...@@ -483,8 +482,6 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked) ...@@ -483,8 +482,6 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
/* DCBX in FW and LLDP enabled in FW */ /* DCBX in FW and LLDP enabled in FW */
pf->dcbx_cap = DCB_CAP_DCBX_LLD_MANAGED | DCB_CAP_DCBX_VER_IEEE; pf->dcbx_cap = DCB_CAP_DCBX_LLD_MANAGED | DCB_CAP_DCBX_VER_IEEE;
set_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);
err = ice_dcb_init_cfg(pf, locked); err = ice_dcb_init_cfg(pf, locked);
if (err) if (err)
goto dcb_init_err; goto dcb_init_err;
......
...@@ -2252,6 +2252,8 @@ static void ice_deinit_pf(struct ice_pf *pf) ...@@ -2252,6 +2252,8 @@ static void ice_deinit_pf(struct ice_pf *pf)
static int ice_init_pf(struct ice_pf *pf) static int ice_init_pf(struct ice_pf *pf)
{ {
bitmap_zero(pf->flags, ICE_PF_FLAGS_NBITS); bitmap_zero(pf->flags, ICE_PF_FLAGS_NBITS);
if (pf->hw.func_caps.common_cap.dcb)
set_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);
#ifdef CONFIG_PCI_IOV #ifdef CONFIG_PCI_IOV
if (pf->hw.func_caps.common_cap.sr_iov_1_1) { if (pf->hw.func_caps.common_cap.sr_iov_1_1) {
struct ice_hw *hw = &pf->hw; struct ice_hw *hw = &pf->hw;
...@@ -2529,13 +2531,12 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent) ...@@ -2529,13 +2531,12 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
goto err_init_pf_unroll; goto err_init_pf_unroll;
} }
err = ice_init_pf_dcb(pf, false); if (test_bit(ICE_FLAG_DCB_CAPABLE, pf->flags)) {
if (err) { /* Note: DCB init failure is non-fatal to load */
clear_bit(ICE_FLAG_DCB_CAPABLE, pf->flags); if (ice_init_pf_dcb(pf, false)) {
clear_bit(ICE_FLAG_DCB_ENA, pf->flags); clear_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);
clear_bit(ICE_FLAG_DCB_ENA, pf->flags);
/* do not fail overall init if DCB init fails */ }
err = 0;
} }
ice_determine_q_usage(pf); ice_determine_q_usage(pf);
......
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