From: Jingjing Wu <jingjing.wu@intel.com>
To: dev@dpdk.org
Cc: jingjing.wu@intel.com, helin.zhang@intel.com
Subject: [dpdk-dev] [PATCH v3 10/17] net/i40e/base: add support for switch parameters
Date: Tue, 27 Jun 2017 21:29:11 +0800 [thread overview]
Message-ID: <1498570158-57201-11-git-send-email-jingjing.wu@intel.com> (raw)
In-Reply-To: <1498570158-57201-1-git-send-email-jingjing.wu@intel.com>
Adds double VLAN tagging ethertype fields to Set Switch Parameters AQ
command. These were added in firmware API 1.7.
Callers of i40e_aq_set_switch_config() can specify the ethertypes to
use by filling out the corresponding fields in struct i40e_hw.
Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
drivers/net/i40e/base/i40e_adminq.c | 6 ++++++
drivers/net/i40e/base/i40e_adminq_cmd.h | 17 ++++++++++++++++-
drivers/net/i40e/base/i40e_common.c | 6 +++++-
drivers/net/i40e/base/i40e_type.h | 6 ++++++
4 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/drivers/net/i40e/base/i40e_adminq.c b/drivers/net/i40e/base/i40e_adminq.c
index a60292a..19871c7 100644
--- a/drivers/net/i40e/base/i40e_adminq.c
+++ b/drivers/net/i40e/base/i40e_adminq.c
@@ -682,6 +682,12 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
&oem_lo);
hw->nvm.oem_ver = ((u32)oem_hi << 16) | oem_lo;
+ /* The ability to RX (not drop) 802.1ad frames was added in API 1.7 */
+ if ((hw->aq.api_maj_ver > 1) ||
+ ((hw->aq.api_maj_ver == 1) &&
+ (hw->aq.api_min_ver >= 7)))
+ hw->flags |= I40E_HW_FLAG_802_1AD_CAPABLE;
+
if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) {
ret_code = I40E_ERR_FIRMWARE_API_VERSION;
goto init_adminq_free_arq;
diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h
index dd9fb55..c36da2a 100644
--- a/drivers/net/i40e/base/i40e_adminq_cmd.h
+++ b/drivers/net/i40e/base/i40e_adminq_cmd.h
@@ -787,7 +787,22 @@ struct i40e_aqc_set_switch_config {
#define I40E_AQ_SET_SWITCH_CFG_L2_FILTER 0x0002
#define I40E_AQ_SET_SWITCH_CFG_HW_ATR_EVICT 0x0004
__le16 valid_flags;
- u8 reserved[12];
+ /* The ethertype in switch_tag is dropped on ingress and used
+ * internally by the switch. Set this to zero for the default
+ * of 0x88a8 (802.1ad). Should be zero for firmware API
+ * versions lower than 1.7.
+ */
+ __le16 switch_tag;
+ /* The ethertypes in first_tag and second_tag are used to
+ * match the outer and inner VLAN tags (respectively) when HW
+ * double VLAN tagging is enabled via the set port parameters
+ * AQ command. Otherwise these are both ignored. Set them to
+ * zero for their defaults of 0x8100 (802.1Q). Should be zero
+ * for firmware API versions lower than 1.7.
+ */
+ __le16 first_tag;
+ __le16 second_tag;
+ u8 reserved[6];
};
I40E_CHECK_CMD_LENGTH(i40e_aqc_set_switch_config);
diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
index 9895a77..b4901ef 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -2695,7 +2695,11 @@ enum i40e_status_code i40e_aq_set_switch_config(struct i40e_hw *hw,
i40e_aqc_opc_set_switch_config);
scfg->flags = CPU_TO_LE16(flags);
scfg->valid_flags = CPU_TO_LE16(valid_flags);
-
+ if (hw->flags & I40E_HW_FLAG_802_1AD_CAPABLE) {
+ scfg->switch_tag = CPU_TO_LE16(hw->switch_tag);
+ scfg->first_tag = CPU_TO_LE16(hw->first_tag);
+ scfg->second_tag = CPU_TO_LE16(hw->second_tag);
+ }
status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
return status;
diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h
index 6ca1a0f..152b4a7 100644
--- a/drivers/net/i40e/base/i40e_type.h
+++ b/drivers/net/i40e/base/i40e_type.h
@@ -700,8 +700,14 @@ struct i40e_hw {
u16 wol_proxy_vsi_seid;
#define I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE BIT_ULL(0)
+#define I40E_HW_FLAG_802_1AD_CAPABLE BIT_ULL(1)
u64 flags;
+ /* Used in set switch config AQ command */
+ u16 switch_tag;
+ u16 first_tag;
+ u16 second_tag;
+
/* debug mask */
u32 debug_mask;
char err_str[16];
--
2.4.11
next prev parent reply other threads:[~2017-06-27 13:34 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-27 3:47 [dpdk-dev] [PATCH 00/10] net/i40e: base code update Jingjing Wu
2017-05-27 3:47 ` [dpdk-dev] [PATCH 01/10] net/i40e/base: use new virtchnl header file Jingjing Wu
2017-05-27 3:47 ` [dpdk-dev] [PATCH 02/10] net/i40e/base: sync nvmupdate command and adminq subtask Jingjing Wu
2017-05-27 3:47 ` [dpdk-dev] [PATCH 03/10] net/i40e/base: add AQ command for read/write PHY registers Jingjing Wu
2017-05-27 3:47 ` [dpdk-dev] [PATCH 04/10] net/i40e/base: add support for Adaptive Virtual Function Jingjing Wu
2017-05-27 3:47 ` [dpdk-dev] [PATCH 05/10] net/i40e/base: store the requested FEC information Jingjing Wu
2017-05-27 3:47 ` [dpdk-dev] [PATCH 06/10] net/i40e/base: add new phy types for 25G AOC and ACC Jingjing Wu
2017-05-27 3:47 ` [dpdk-dev] [PATCH 07/10] net/i40e/base: report supported link modes Jingjing Wu
2017-05-27 3:47 ` [dpdk-dev] [PATCH 08/10] net/i40e/base: track id can be 0 Jingjing Wu
2017-05-27 3:47 ` [dpdk-dev] [PATCH 09/10] net/i40e/base: update FW AQ API version to 1.7 Jingjing Wu
2017-05-27 3:47 ` [dpdk-dev] [PATCH 10/10] net/i40e/base: update base code info Jingjing Wu
2017-05-30 11:10 ` [dpdk-dev] [PATCH 00/10] net/i40e: base code update Ferruh Yigit
2017-06-02 2:24 ` Wu, Jingjing
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 00/16] " Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 01/16] net/i40e/base: use new virtchnl header file Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 02/16] net/i40e/base: sync nvmupdate command and adminq subtask Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 03/16] net/i40e/base: add AQ command for read/write PHY registers Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 04/16] net/i40e/base: add support for Adaptive Virtual Function Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 05/16] net/i40e/base: store the requested FEC information Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 06/16] net/i40e/base: add new phy types for 25G AOC and ACC Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 07/16] net/i40e/base: report supported link modes Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 08/16] net/i40e/base: track id can be 0 Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 09/16] net/i40e/base: update FW AQ API version to 1.7 Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 10/16] net/i40e/base: add support for switch parameters Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 11/16] net/i40e/base: use admin queue for setting LEDs behavior Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 12/16] net/i40e/base: avoid potential null pointer dereference Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 13/16] net/i40e/base: avoid reset timeout issue Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 14/16] net/i40e/base: add EEPROM checksum verification Jingjing Wu
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 15/16] net/i40e/base: extend processing of DDP Jingjing Wu
2017-06-26 13:18 ` Ferruh Yigit
2017-06-26 9:48 ` [dpdk-dev] [PATCH v2 16/16] net/i40e: use set switch aq instead of register setting Jingjing Wu
2017-06-26 13:20 ` Ferruh Yigit
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 00/17] net/i40e: base code update Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 01/17] net/i40e/base: use new virtchnl header file Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 02/17] net/i40e/base: sync nvmupdate command and adminq subtask Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 03/17] net/i40e/base: add AQ command for read/write PHY registers Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 04/17] net/i40e/base: add support for Adaptive Virtual Function Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 05/17] net/i40e/base: store the requested FEC information Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 06/17] net/i40e/base: add new phy types for 25G AOC and ACC Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 07/17] net/i40e/base: report supported link modes Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 08/17] net/i40e/base: track id can be 0 Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 09/17] net/i40e/base: update FW AQ API version to 1.7 Jingjing Wu
2017-06-27 13:29 ` Jingjing Wu [this message]
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 11/17] net/i40e/base: use admin queue for setting LEDs behavior Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 12/17] net/i40e/base: avoid potential null pointer dereference Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 13/17] net/i40e/base: avoid reset timeout issue Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 14/17] net/i40e/base: add EEPROM checksum verification Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 15/17] net/i40e/base: extend processing of DDP Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 16/17] net/i40e: use set switch aq instead of register setting Jingjing Wu
2017-06-27 13:29 ` [dpdk-dev] [PATCH v3 17/17] net/i40e/base: update base code info Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 00/17] net/i40e: base code update Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 01/17] net/i40e/base: use new virtchnl header file Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 02/17] net/i40e/base: sync nvmupdate command and adminq subtask Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 03/17] net/i40e/base: add AQ command for read/write PHY registers Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 04/17] net/i40e/base: add support for Adaptive Virtual Function Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 05/17] net/i40e/base: store the requested FEC information Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 06/17] net/i40e/base: add new phy types for 25G AOC and ACC Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 07/17] net/i40e/base: report supported link modes Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 08/17] net/i40e/base: track id can be 0 Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 09/17] net/i40e/base: update FW AQ API version to 1.7 Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 10/17] net/i40e/base: add support for switch parameters Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 11/17] net/i40e/base: use admin queue for setting LEDs behavior Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 12/17] net/i40e/base: avoid potential null pointer dereference Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 13/17] net/i40e/base: avoid reset timeout issue Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 14/17] net/i40e/base: add EEPROM checksum verification Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 15/17] net/i40e/base: extend processing of DDP Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 16/17] net/i40e: use set switch aq instead of register setting Jingjing Wu
2017-06-27 14:00 ` [dpdk-dev] [PATCH v4 17/17] net/i40e/base: update base code info Jingjing Wu
2017-06-27 14:25 ` [dpdk-dev] [PATCH v4 00/17] net/i40e: base code update Ferruh Yigit
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=1498570158-57201-11-git-send-email-jingjing.wu@intel.com \
--to=jingjing.wu@intel.com \
--cc=dev@dpdk.org \
--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).