From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Avinash Dayanand <avinash.dayanand@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
Scott Register <scottx.register@intel.com>,
Andrew Bowers <andrewx.bowers@intel.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 06/13] ice: Report correct DCB mode
Date: Wed, 19 Feb 2020 14:06:45 -0800 [thread overview]
Message-ID: <20200219220652.2255171-7-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20200219220652.2255171-1-jeffrey.t.kirsher@intel.com>
From: Avinash Dayanand <avinash.dayanand@intel.com>
Add code to detect if DCB is in IEEE or CEE mode. Without this the code
will always report as IEEE mode which is incorrect and confuses the
user.
Signed-off-by: Avinash Dayanand <avinash.dayanand@intel.com>
Signed-off-by: Scott Register <scottx.register@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 27 +++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
index 1c118e7bab88..16656b6c3d09 100644
--- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c
@@ -62,6 +62,26 @@ u8 ice_dcb_get_ena_tc(struct ice_dcbx_cfg *dcbcfg)
return ena_tc;
}
+/**
+ * ice_dcb_get_mode - gets the DCB mode
+ * @port_info: pointer to port info structure
+ * @host: if set it's HOST if not it's MANAGED
+ */
+static u8 ice_dcb_get_mode(struct ice_port_info *port_info, bool host)
+{
+ u8 mode;
+
+ if (host)
+ mode = DCB_CAP_DCBX_HOST;
+ else
+ mode = DCB_CAP_DCBX_LLD_MANAGED;
+
+ if (port_info->local_dcbx_cfg.dcbx_mode & ICE_DCBX_MODE_CEE)
+ return (mode | DCB_CAP_DCBX_VER_CEE);
+ else
+ return (mode | DCB_CAP_DCBX_VER_IEEE);
+}
+
/**
* ice_dcb_get_num_tc - Get the number of TCs from DCBX config
* @dcbcfg: config to retrieve number of TCs from
@@ -645,14 +665,14 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
ice_cfg_sw_lldp(pf_vsi, false, true);
- pf->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE;
+ pf->dcbx_cap = ice_dcb_get_mode(port_info, true);
return 0;
}
set_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags);
- /* DCBX in FW and LLDP enabled in FW */
- pf->dcbx_cap = DCB_CAP_DCBX_LLD_MANAGED | DCB_CAP_DCBX_VER_IEEE;
+ /* DCBX/LLDP enabled in FW, set DCBNL mode advertisement */
+ pf->dcbx_cap = ice_dcb_get_mode(port_info, false);
err = ice_dcb_init_cfg(pf, locked);
if (err)
@@ -812,6 +832,7 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,
/* No change detected in DCBX configs */
if (!memcmp(&tmp_dcbx_cfg, &pi->local_dcbx_cfg, sizeof(tmp_dcbx_cfg))) {
dev_dbg(dev, "No change detected in DCBX configuration.\n");
+ pf->dcbx_cap = ice_dcb_get_mode(pi, false);
goto out;
}
--
2.24.1
next prev parent reply other threads:[~2020-02-19 22:07 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-19 22:06 [net-next 00/13][pull request] 100GbE Intel Wired LAN Driver Updates 2020-02-19 Jeff Kirsher
2020-02-19 22:06 ` [net-next 01/13] ice: Validate config for SW DCB map Jeff Kirsher
2020-02-19 22:06 ` [net-next 02/13] ice: update malicious driver detection event handling Jeff Kirsher
2020-02-19 22:06 ` [net-next 03/13] ice: Fix for TCAM entry management Jeff Kirsher
2020-02-19 22:06 ` [net-next 04/13] ice: Always clear the QRXFLXP_CNTXT register for VF Rx queues Jeff Kirsher
2020-02-19 22:06 ` [net-next 05/13] ice: Add DCBNL ops required to configure ETS in CEE for SW DCB Jeff Kirsher
2020-02-19 22:06 ` Jeff Kirsher [this message]
2020-02-20 9:55 ` [net-next 06/13] ice: Report correct DCB mode Sergei Shtylyov
2020-02-19 22:06 ` [net-next 07/13] ice: SW DCB, report correct max TC value Jeff Kirsher
2020-02-19 22:06 ` [net-next 08/13] ice: Support XDP UMEM wake up mechanism Jeff Kirsher
2020-02-19 22:06 ` [net-next 09/13] ice: increase PF reset wait timeout to 300 milliseconds Jeff Kirsher
2020-02-19 22:06 ` [net-next 10/13] ice: add backslash-n to strings Jeff Kirsher
2020-02-19 22:06 ` [net-next 11/13] ice: add additional E810 device id Jeff Kirsher
2020-02-19 22:06 ` [net-next 12/13] ice: add support for E823 devices Jeff Kirsher
2020-02-19 22:06 ` [net-next 13/13] ice: fix define for E822 backplane device Jeff Kirsher
2020-02-20 23:05 ` [net-next 00/13][pull request] 100GbE Intel Wired LAN Driver Updates 2020-02-19 David Miller
2020-02-21 22:49 ` Jeff Kirsher
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=20200219220652.2255171-7-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=andrewx.bowers@intel.com \
--cc=avinash.dayanand@intel.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
--cc=scottx.register@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.