Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH S28 v2 3/9] ice: Check for DCB capability before initializing DCB
Date: Tue,  3 Sep 2019 01:31:02 -0700	[thread overview]
Message-ID: <20190903083108.19593-3-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20190903083108.19593-1-anthony.l.nguyen@intel.com>

From: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>

Check the ICE_FLAG_DCB_CAPABLE before calling ice_init_pf_dcb.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_dcb_lib.c |  3 ---
 drivers/net/ethernet/intel/ice/ice_main.c    | 15 ++++++++-------
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
index e922adf1fa15..20f440a64650 100644
--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
@@ -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;
-		set_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);
 		return 0;
 	}
 
@@ -483,8 +482,6 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
 	/* DCBX in FW and LLDP enabled in FW */
 	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);
 	if (err)
 		goto dcb_init_err;
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 703fc7bf2b31..8bb3b81876a9 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -2252,6 +2252,8 @@ static void ice_deinit_pf(struct ice_pf *pf)
 static int ice_init_pf(struct ice_pf *pf)
 {
 	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
 	if (pf->hw.func_caps.common_cap.sr_iov_1_1) {
 		struct ice_hw *hw = &pf->hw;
@@ -2529,13 +2531,12 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
 		goto err_init_pf_unroll;
 	}
 
-	err = ice_init_pf_dcb(pf, false);
-	if (err) {
-		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;
+	if (test_bit(ICE_FLAG_DCB_CAPABLE, pf->flags)) {
+		/* Note: DCB init failure is non-fatal to load */
+		if (ice_init_pf_dcb(pf, false)) {
+			clear_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);
+			clear_bit(ICE_FLAG_DCB_ENA, pf->flags);
+		}
 	}
 
 	ice_determine_q_usage(pf);
-- 
2.20.1


  parent reply	other threads:[~2019-09-03  8:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03  8:31 [Intel-wired-lan] [PATCH S28 v2 1/9] ice: Reliably reset VFs Tony Nguyen
2019-09-03  8:31 ` [Intel-wired-lan] [PATCH S28 v2 2/9] ice: report link down for VF when PF's queues are not enabled Tony Nguyen
2019-09-04 22:25   ` Bowers, AndrewX
2019-09-03  8:31 ` Tony Nguyen [this message]
2019-09-04 22:26   ` [Intel-wired-lan] [PATCH S28 v2 3/9] ice: Check for DCB capability before initializing DCB Bowers, AndrewX
2019-09-03  8:31 ` [Intel-wired-lan] [PATCH S28 v2 4/9] ice: Report VF link status with opcode to get resources Tony Nguyen
2019-09-04 22:26   ` Bowers, AndrewX
2019-09-03  8:31 ` [Intel-wired-lan] [PATCH S28 v2 5/9] ice: update Tx context struct Tony Nguyen
2019-09-04 22:26   ` Bowers, AndrewX
2019-09-03  8:31 ` [Intel-wired-lan] [PATCH S28 v2 6/9] ice: Allow for delayed LLDP MIB change registration Tony Nguyen
2019-09-04 22:27   ` Bowers, AndrewX
2019-09-03  8:31 ` [Intel-wired-lan] [PATCH S28 v2 7/9] ice: Minor refactor in queue management Tony Nguyen
2019-09-04 22:27   ` Bowers, AndrewX
2019-09-03  8:31 ` [Intel-wired-lan] [PATCH S28 v2 8/9] ice: change default number of receive descriptors Tony Nguyen
2019-09-04 22:27   ` Bowers, AndrewX
2019-09-03  8:31 ` [Intel-wired-lan] [PATCH S28 v2 9/9] ice: Rework around device/function capabilities Tony Nguyen
2019-09-04 22:28   ` Bowers, AndrewX
2019-09-04 22:25 ` [Intel-wired-lan] [PATCH S28 v2 1/9] ice: Reliably reset VFs Bowers, AndrewX

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190903083108.19593-3-anthony.l.nguyen@intel.com \
    --to=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox