[dpdk-stable] patch 'net/enic: ignore VLAN inner type when it is zero' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:43:33 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/30/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 9b4b0577cdfb4a3c3155dd9b0efe6d46ec25ce3f Mon Sep 17 00:00:00 2001
From: Hyong Youb Kim <hyonkim at cisco.com>
Date: Wed, 9 Sep 2020 07:00:04 -0700
Subject: [PATCH] net/enic: ignore VLAN inner type when it is zero

[ upstream commit 473e9407a4d7a365074d9b0618a8f1eccef291b5 ]

When a VLAN pattern is present, the flow handler always copies its
inner_type to the match buffer regardless of its value (i.e. HW
matches inner_type against packet's inner ethertype). When inner_type
spec and mask are both 0, adding it to the match buffer is usually
harmless but breaks the following pattern used in some applications
like OVS-DPDK.

flow create 0 ingress ... pattern eth ... type is 0x0800 /
vlan tci spec 0x2 tci mask 0xefff / ipv4 / end actions count /
of_pop_vlan / ...

The VLAN pattern's inner_type is 0. And the outer eth pattern's type
actually specifies the inner ethertype. The outer ethertype (0x0800)
is first copied to the match buffer. Then, the driver copies
inner_type (0) to the match buffer, which overwrites the existing
0x0800 with 0 and breaks the app usage above.

Simply ignore inner_type when it is 0, which is the correct
behavior. As a byproduct, the driver can support the usage like the
above.

Fixes: ea7768b5bba8 ("net/enic: add flow implementation based on Flow Manager API")

Signed-off-by: Hyong Youb Kim <hyonkim at cisco.com>
Reviewed-by: John Daley <johndale at cisco.com>
---
 drivers/net/enic/enic_fm_flow.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c
index e8d5927674..5b456f20d4 100644
--- a/drivers/net/enic/enic_fm_flow.c
+++ b/drivers/net/enic/enic_fm_flow.c
@@ -349,8 +349,11 @@ enic_fm_copy_item_vlan(struct copy_item_args *arg)
 	eth_mask = (void *)&fm_mask->l2.eth;
 	eth_val = (void *)&fm_data->l2.eth;
 
-	/* Outer TPID cannot be matched */
-	if (eth_mask->ether_type)
+	/*
+	 * Outer TPID cannot be matched. If inner_type is 0, use what is
+	 * in the eth header.
+	 */
+	if (eth_mask->ether_type && mask->inner_type)
 		return -ENOTSUP;
 
 	/*
@@ -358,8 +361,10 @@ enic_fm_copy_item_vlan(struct copy_item_args *arg)
 	 * L2, regardless of vlan stripping settings. So, the inner type
 	 * from vlan becomes the ether type of the eth header.
 	 */
-	eth_mask->ether_type = mask->inner_type;
-	eth_val->ether_type = spec->inner_type;
+	if (mask->inner_type) {
+		eth_mask->ether_type = mask->inner_type;
+		eth_val->ether_type = spec->inner_type;
+	}
 	fm_data->fk_header_select |= FKH_ETHER | FKH_QTAG;
 	fm_mask->fk_header_select |= FKH_ETHER | FKH_QTAG;
 	fm_data->fk_vlan = rte_be_to_cpu_16(spec->tci);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:13.461581270 +0000
+++ 0054-net-enic-ignore-VLAN-inner-type-when-it-is-zero.patch	2020-10-28 10:35:11.520830259 +0000
@@ -1,8 +1,10 @@
-From 473e9407a4d7a365074d9b0618a8f1eccef291b5 Mon Sep 17 00:00:00 2001
+From 9b4b0577cdfb4a3c3155dd9b0efe6d46ec25ce3f Mon Sep 17 00:00:00 2001
 From: Hyong Youb Kim <hyonkim at cisco.com>
 Date: Wed, 9 Sep 2020 07:00:04 -0700
 Subject: [PATCH] net/enic: ignore VLAN inner type when it is zero
 
+[ upstream commit 473e9407a4d7a365074d9b0618a8f1eccef291b5 ]
+
 When a VLAN pattern is present, the flow handler always copies its
 inner_type to the match buffer regardless of its value (i.e. HW
 matches inner_type against packet's inner ethertype). When inner_type
@@ -25,7 +27,6 @@
 above.
 
 Fixes: ea7768b5bba8 ("net/enic: add flow implementation based on Flow Manager API")
-Cc: stable at dpdk.org
 
 Signed-off-by: Hyong Youb Kim <hyonkim at cisco.com>
 Reviewed-by: John Daley <johndale at cisco.com>
@@ -34,10 +35,10 @@
  1 file changed, 9 insertions(+), 4 deletions(-)
 
 diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c
-index ee671e11df..94e39a94bf 100644
+index e8d5927674..5b456f20d4 100644
 --- a/drivers/net/enic/enic_fm_flow.c
 +++ b/drivers/net/enic/enic_fm_flow.c
-@@ -392,8 +392,11 @@ enic_fm_copy_item_vlan(struct copy_item_args *arg)
+@@ -349,8 +349,11 @@ enic_fm_copy_item_vlan(struct copy_item_args *arg)
  	eth_mask = (void *)&fm_mask->l2.eth;
  	eth_val = (void *)&fm_data->l2.eth;
  
@@ -51,7 +52,7 @@
  		return -ENOTSUP;
  
  	/*
-@@ -401,8 +404,10 @@ enic_fm_copy_item_vlan(struct copy_item_args *arg)
+@@ -358,8 +361,10 @@ enic_fm_copy_item_vlan(struct copy_item_args *arg)
  	 * L2, regardless of vlan stripping settings. So, the inner type
  	 * from vlan becomes the ether type of the eth header.
  	 */


More information about the stable mailing list