DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qi Zhang <qi.z.zhang@intel.com>
To: qiming.yang@intel.com
Cc: dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>,
	Michal Swiatkowski <michal.swiatkowski@intel.com>,
	Haiyue Wang <haiyue.wang@intel.com>
Subject: [dpdk-dev] [PATCH 6/8] net/ice/base: change protocol ID for VLAN in case of DVM
Date: Mon, 29 Mar 2021 22:14:09 +0800	[thread overview]
Message-ID: <20210329141411.2395069-7-qi.z.zhang@intel.com> (raw)
In-Reply-To: <20210329141411.2395069-1-qi.z.zhang@intel.com>

Protocol id for first vlan in Double VLAN Mode (DVM) should be
ICE_VLAN_OF_HW = 16, but for Single VLAN Mode (SVM) this should be
ICE_VLAN_OL_HW = 17.

Change protocol id in type to id translation array for outer vlan
to 17 when DVM is enabled, which means the driver, package,
and firmware support DVM.

Signed-off-by: Michal Swiatkowski <michal.swiatkowski@intel.com>
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/ice/base/ice_flex_pipe.c |  3 +++
 drivers/net/ice/base/ice_switch.c    | 19 ++++++++++++++++++-
 drivers/net/ice/base/ice_switch.h    |  1 +
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c
index 90264240c4..b489c8ddb2 100644
--- a/drivers/net/ice/base/ice_flex_pipe.c
+++ b/drivers/net/ice/base/ice_flex_pipe.c
@@ -1244,6 +1244,9 @@ ice_download_pkg(struct ice_hw *hw, struct ice_seg *ice_seg)
 
 	ice_cache_vlan_mode(hw);
 
+	if (ice_is_dvm_ena(hw))
+		ice_change_proto_id_to_dvm();
+
 	return status;
 }
 
diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index 393fec3d40..86ce6064d1 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -6538,7 +6538,7 @@ static const struct ice_prot_ext_tbl_entry ice_prot_ext[ICE_PROTOCOL_LAST] = {
  * following policy.
  */
 
-static const struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = {
+static struct ice_protocol_entry ice_prot_id_tbl[ICE_PROTOCOL_LAST] = {
 	{ ICE_MAC_OFOS,		ICE_MAC_OFOS_HW },
 	{ ICE_MAC_IL,		ICE_MAC_IL_HW },
 	{ ICE_ETYPE_OL,		ICE_ETYPE_OL_HW },
@@ -6643,6 +6643,23 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,
 	return ICE_MAX_NUM_RECIPES;
 }
 
+/**
+ * ice_change_proto_id_to_dvm - change proto id in prot_id_tbl
+ *
+ * As protocol id for outer vlan is different in dvm and svm, if dvm is
+ * supported protocol array record for outer vlan has to be modified to
+ * reflect the value proper for DVM.
+ */
+void ice_change_proto_id_to_dvm(void)
+{
+	u8 i;
+
+	for (i = 0; i < ARRAY_SIZE(ice_prot_id_tbl); i++)
+		if (ice_prot_id_tbl[i].type == ICE_VLAN_OFOS &&
+		    ice_prot_id_tbl[i].protocol_id != ICE_VLAN_OF_HW)
+			ice_prot_id_tbl[i].protocol_id = ICE_VLAN_OF_HW;
+}
+
 /**
  * ice_prot_type_to_id - get protocol ID from protocol type
  * @type: protocol type
diff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h
index 04d3c31006..61be54f9c0 100644
--- a/drivers/net/ice/base/ice_switch.h
+++ b/drivers/net/ice/base/ice_switch.h
@@ -535,4 +535,5 @@ bool ice_is_prof_rule(enum ice_sw_tunnel_type type);
 enum ice_status
 ice_update_recipe_lkup_idx(struct ice_hw *hw,
 			   struct ice_update_recipe_lkup_idx_params *params);
+void ice_change_proto_id_to_dvm(void);
 #endif /* _ICE_SWITCH_H_ */
-- 
2.26.2


  parent reply	other threads:[~2021-03-29 14:11 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 14:14 [dpdk-dev] [PATCH 0/8] ice: base code update batch 2 Qi Zhang
2021-03-29 14:14 ` [dpdk-dev] [PATCH 1/8] net/ice/base: code cleanup Qi Zhang
2021-03-29 14:14 ` [dpdk-dev] [PATCH 2/8] net/ice/base: support removing VSI from flow profile Qi Zhang
2021-03-29 14:14 ` [dpdk-dev] [PATCH 3/8] net/ice/base: print link configure error Qi Zhang
2021-03-29 14:14 ` [dpdk-dev] [PATCH 4/8] net/ice/base: remove unused ptype field in PTT definition Qi Zhang
2021-03-29 14:14 ` [dpdk-dev] [PATCH 5/8] net/ice/base: set MAC type for E823C device Qi Zhang
2021-03-29 14:14 ` Qi Zhang [this message]
2021-03-29 14:14 ` [dpdk-dev] [PATCH 7/8] net/ice/base: enable I2C read/write commands Qi Zhang
2021-03-29 14:14 ` [dpdk-dev] [PATCH 8/8] net/ice/base: add RSS support for PPPoL2TPv2oUDP Qi Zhang
2021-04-13  5:06 ` [dpdk-dev] [PATCH v2 00/14] base code update batch 2 Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 01/14] net/ice/base: code cleanup Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 02/14] net/ice/base: support removing VSI from flow profile Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 03/14] net/ice/base: print link configure error Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 04/14] net/ice/base: remove unused ptype field in PTT definition Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 05/14] net/ice/base: set MAC type for E823C device Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 06/14] net/ice/base: change protocol ID for VLAN in case of DVM Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 07/14] net/ice/base: enable I2C read/write commands Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 08/14] net/ice/base: add RSS support for PPPoL2TPv2oUDP Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 09/14] net/ice/base: add set/get GPIO helper functions Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 10/14] net/ice/base: add priority check of matching recipe Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 11/14] net/ice/base: add inner VLAN protocol type for QinQ filter Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 12/14] net/ice/base: fix QinQ PPPoE dummy pkt selection Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 13/14] net/ice/base: add PTYPE values for PPPoL2TPv2oUDP Qi Zhang
2021-04-13  5:06   ` [dpdk-dev] [PATCH v2 14/14] net/ice/base: allow support for GTP-U filter using only inner protocols Qi Zhang
2021-04-13  6:16   ` [dpdk-dev] [PATCH v2 00/14] base code update batch 2 Yang, Qiming
2021-04-13 11:38     ` Ferruh Yigit
2021-04-13 14:30 ` [dpdk-dev] [PATCH v3 00/14] ice: " Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 01/14] net/ice/base: code cleanup Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 02/14] net/ice/base: support removing VSI from flow profile Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 03/14] net/ice/base: print link configure error Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 04/14] net/ice/base: remove unused ptype field in PTT definition Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 05/14] net/ice/base: set MAC type for E823C device Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 06/14] net/ice/base: add RSS support for PPPoL2TPv2oUDP Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 07/14] net/ice/base: change protocol ID for VLAN in case of DVM Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 08/14] net/ice/base: add priority check of matching recipe Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 09/14] net/ice/base: enable I2C read/write commands Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 10/14] net/ice/base: add set/get GPIO helper functions Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 11/14] net/ice/base: add inner VLAN protocol type for QinQ filter Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 12/14] net/ice/base: fix QinQ PPPoE dummy pkt selection Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 13/14] net/ice/base: add PTYPE values for PPPoL2TPv2oUDP Qi Zhang
2021-04-13 14:30   ` [dpdk-dev] [PATCH v3 14/14] net/ice/base: allow support for GTP-U filter using only inner protocols Qi Zhang

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=20210329141411.2395069-7-qi.z.zhang@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=haiyue.wang@intel.com \
    --cc=michal.swiatkowski@intel.com \
    --cc=qiming.yang@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).