DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qi Zhang <qi.z.zhang@intel.com>
To: beilei.xing@intel.com
Cc: dev@dpdk.org, ferruh.yigit@intel.com, helin.zhang@intel.com,
	Qi Zhang <qi.z.zhang@intel.com>
Subject: [dpdk-dev] [PATCH 18/20] net/i40e/base: add capability flag for stopping FW LLDP
Date: Tue, 25 Sep 2018 10:34:40 +0800	[thread overview]
Message-ID: <20180925023442.134705-19-qi.z.zhang@intel.com> (raw)
In-Reply-To: <20180925023442.134705-1-qi.z.zhang@intel.com>

Add HW capability flag to indicate that firmware supports stopping
LLDP agent. This feature has been added in FW API 1.7 for XL710
devices and 1.6 for X722. Also raise expected minor version number
for X722 FW API to 6.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/base/i40e_adminq.c     | 6 ++++++
 drivers/net/i40e/base/i40e_adminq_cmd.h | 4 +++-
 drivers/net/i40e/base/i40e_common.c     | 3 +++
 drivers/net/i40e/base/i40e_type.h       | 1 +
 4 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/base/i40e_adminq.c b/drivers/net/i40e/base/i40e_adminq.c
index 3a11becec..38214a373 100644
--- a/drivers/net/i40e/base/i40e_adminq.c
+++ b/drivers/net/i40e/base/i40e_adminq.c
@@ -668,6 +668,12 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
 	    hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
 	    hw->aq.api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710) {
 		hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE;
+		hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE;
+	}
+	if (hw->mac.type == I40E_MAC_X722 &&
+	    hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
+	    hw->aq.api_min_ver >= I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722) {
+		hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE;
 	}
 
 	/* Newer versions of firmware require lock when reading the NVM */
diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h
index cd8e3a50a..6ff46e3b0 100644
--- a/drivers/net/i40e/base/i40e_adminq_cmd.h
+++ b/drivers/net/i40e/base/i40e_adminq_cmd.h
@@ -12,7 +12,7 @@
  */
 
 #define I40E_FW_API_VERSION_MAJOR	0x0001
-#define I40E_FW_API_VERSION_MINOR_X722	0x0005
+#define I40E_FW_API_VERSION_MINOR_X722	0x0006
 #define I40E_FW_API_VERSION_MINOR_X710	0x0007
 
 #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \
@@ -21,6 +21,8 @@
 
 /* API version 1.7 implements additional link and PHY-specific APIs  */
 #define I40E_MINOR_VER_GET_LINK_INFO_XL710 0x0007
+/* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */
+#define I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006
 
 struct i40e_aq_desc {
 	__le16 flags;
diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
index 717e06737..351608453 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -4552,6 +4552,9 @@ i40e_aq_set_dcb_parameters(struct i40e_hw *hw, bool dcb_enable,
 		(struct i40e_aqc_set_dcb_parameters *)&desc.params.raw;
 	enum i40e_status_code status;
 
+	if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_STOPPABLE))
+		return I40E_ERR_DEVICE_NOT_SUPPORTED;
+
 	i40e_fill_default_direct_cmd_desc(&desc,
 					  i40e_aqc_opc_set_dcb_parameters);
 
diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h
index b3621158b..77562f24e 100644
--- a/drivers/net/i40e/base/i40e_type.h
+++ b/drivers/net/i40e/base/i40e_type.h
@@ -720,6 +720,7 @@ struct i40e_hw {
 #define I40E_HW_FLAG_802_1AD_CAPABLE        BIT_ULL(1)
 #define I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE  BIT_ULL(2)
 #define I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK BIT_ULL(3)
+#define I40E_HW_FLAG_FW_LLDP_STOPPABLE	    BIT_ULL(4)
 	u64 flags;
 
 	/* Used in set switch config AQ command */
-- 
2.13.6

  parent reply	other threads:[~2018-09-25  2:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25  2:34 [dpdk-dev] [PATCH 00/20] base code update Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 01/20] net/i40e/base: replace license text with SPDX tag Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 02/20] net/i40e/base: fix partition id calculation for X722 Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 03/20] net/i40e/base: introduce PHY type bitmask Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 04/20] net/i40e/base: enable cloud filter mode for switch config Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 05/20] net/i40e/base: add admin queue definitions for cloud filters Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 06/20] net/i40e/base: enable cloud filters via tc flower Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 07/20] net/i40e/base: improve the polling mechanism Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 08/20] net/i40e/base: read LLDP config area with correct endianness Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 09/20] net/i40e/base: properly clean resources Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 10/20] net/i40e/base: gracefully clean the resources Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 11/20] net/i40e/base: correct global reset timeout calculation Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 12/20] net/i40e/base: change AQ command for PHY access Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 13/20] net/i40e/base: add additional return code Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 14/20] net/i40e/base: add AQ command for rearrange NVM structure Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 15/20] net/i40e/base: add FC threshold parameter for set MAC Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 16/20] net/i40e/base: add support for carlsville device Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 17/20] net/i40e/base: wrap admin queue set/get PHY register funcs Qi Zhang
2018-09-25  2:34 ` Qi Zhang [this message]
2018-09-25  2:34 ` [dpdk-dev] [PATCH 19/20] net/i40e/base: add new TR bits used for cloud filters Qi Zhang
2018-09-25  2:34 ` [dpdk-dev] [PATCH 20/20] net/i40e/base: update readme Qi Zhang
2018-09-27  7:39 ` [dpdk-dev] [PATCH 00/20] base code update Xing, Beilei
2018-09-29  2:13   ` Zhang, Qi Z

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=20180925023442.134705-19-qi.z.zhang@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=helin.zhang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).