From: Haiyue Wang <haiyue.wang@intel.com>
To: dev@dpdk.org
Cc: qi.z.zhang@intel.com, Yuying.Zhang@intel.com,
Haiyue Wang <haiyue.wang@intel.com>,
Qiming Yang <qiming.yang@intel.com>
Subject: [dpdk-dev] [PATCH v1] net/ice: update QinQ switch filter handling
Date: Tue, 13 Apr 2021 13:14:59 +0800 [thread overview]
Message-ID: <20210413051459.4195-1-haiyue.wang@intel.com> (raw)
The hardware oueter/inner VLAN protocol types are now updated to map to
new interface VLAN protocol types, so update the application to use new
VLAN protocol types when the rte_flow is QinQ filter type.
Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
Depends-on: series-16315 ("base code update batch 2")
---
drivers/net/ice/ice_switch_filter.c | 36 ++++++++++++++++++-----------
1 file changed, 22 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index 6f9e861d08..0bf3660677 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -389,12 +389,17 @@ ice_switch_inset_get(const struct rte_flow_item pattern[],
bool profile_rule = 0;
bool nvgre_valid = 0;
bool vxlan_valid = 0;
+ bool qinq_valid = 0;
bool ipv6_valid = 0;
bool ipv4_valid = 0;
bool udp_valid = 0;
bool tcp_valid = 0;
uint16_t j, t = 0;
+ if (*tun_type == ICE_SW_TUN_AND_NON_TUN_QINQ ||
+ *tun_type == ICE_NON_TUN_QINQ)
+ qinq_valid = 1;
+
for (item = pattern; item->type !=
RTE_FLOW_ITEM_TYPE_END; item++) {
if (item->last) {
@@ -932,22 +937,25 @@ ice_switch_inset_get(const struct rte_flow_item pattern[],
return 0;
}
- if (!outer_vlan_valid &&
- (*tun_type == ICE_SW_TUN_AND_NON_TUN_QINQ ||
- *tun_type == ICE_NON_TUN_QINQ))
- outer_vlan_valid = 1;
- else if (!inner_vlan_valid &&
- (*tun_type == ICE_SW_TUN_AND_NON_TUN_QINQ ||
- *tun_type == ICE_NON_TUN_QINQ))
- inner_vlan_valid = 1;
- else if (!inner_vlan_valid)
- inner_vlan_valid = 1;
+ if (qinq_valid) {
+ if (!outer_vlan_valid)
+ outer_vlan_valid = 1;
+ else
+ inner_vlan_valid = 1;
+ }
if (vlan_spec && vlan_mask) {
- if (outer_vlan_valid && !inner_vlan_valid) {
- list[t].type = ICE_VLAN_EX;
- input_set |= ICE_INSET_VLAN_OUTER;
- } else if (inner_vlan_valid) {
+ if (qinq_valid) {
+ if (!inner_vlan_valid) {
+ list[t].type = ICE_VLAN_EX;
+ input_set |=
+ ICE_INSET_VLAN_OUTER;
+ } else {
+ list[t].type = ICE_VLAN_IN;
+ input_set |=
+ ICE_INSET_VLAN_INNER;
+ }
+ } else {
list[t].type = ICE_VLAN_OFOS;
input_set |= ICE_INSET_VLAN_INNER;
}
--
2.31.1
next reply other threads:[~2021-04-13 5:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-13 5:14 Haiyue Wang [this message]
2021-04-13 7:24 ` 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=20210413051459.4195-1-haiyue.wang@intel.com \
--to=haiyue.wang@intel.com \
--cc=Yuying.Zhang@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@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).