[dpdk-stable] patch 'net/cxgbe: fix parsing VLAN ID rewrite action' has been queued to LTS release 18.11.6

Kevin Traynor ktraynor at redhat.com
Tue Dec 3 19:26:26 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.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 12/10/19. 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.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/0367aa0d7b11a240c92a0cb4fcd3184a63d57533

Thanks.

Kevin.

---
>From 0367aa0d7b11a240c92a0cb4fcd3184a63d57533 Mon Sep 17 00:00:00 2001
From: Rahul Lakkireddy <rahul.lakkireddy at chelsio.com>
Date: Sat, 28 Sep 2019 02:00:04 +0530
Subject: [PATCH] net/cxgbe: fix parsing VLAN ID rewrite action

[ upstream commit 46a687dbfa4d51e31515e08cae045a691144c8b5 ]

Set VLAN action mode to VLAN_REWRITE only if VLAN_INSERT has not been
set yet. Otherwise, the resulting VLAN packets will have their VLAN
header rewritten, instead of pushing a new outer VLAN header.

Also fix the VLAN ID extraction logic and endianness issues.

Fixes: 1decc62b1cbe ("net/cxgbe: add flow operations to offload VLAN actions")

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy at chelsio.com>
---
 drivers/net/cxgbe/cxgbe_flow.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c
index f8f3d0a22..f130c7eb4 100644
--- a/drivers/net/cxgbe/cxgbe_flow.c
+++ b/drivers/net/cxgbe/cxgbe_flow.c
@@ -447,4 +447,5 @@ ch_rte_parse_atype_switch(const struct rte_flow_action *a,
 	const struct rte_flow_action_phy_port *port;
 	int item_index;
+	u16 tmp_vlan;
 
 	switch (a->type) {
@@ -452,11 +453,19 @@ ch_rte_parse_atype_switch(const struct rte_flow_action *a,
 		vlanid = (const struct rte_flow_action_of_set_vlan_vid *)
 			  a->conf;
-		fs->newvlan = VLAN_REWRITE;
-		fs->vlan = vlanid->vlan_vid;
+		/* If explicitly asked to push a new VLAN header,
+		 * then don't set rewrite mode. Otherwise, the
+		 * incoming VLAN packets will get their VLAN fields
+		 * rewritten, instead of adding an additional outer
+		 * VLAN header.
+		 */
+		if (fs->newvlan != VLAN_INSERT)
+			fs->newvlan = VLAN_REWRITE;
+		tmp_vlan = fs->vlan & 0xe000;
+		fs->vlan = (be16_to_cpu(vlanid->vlan_vid) & 0xfff) | tmp_vlan;
 		break;
 	case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN:
 		pushvlan = (const struct rte_flow_action_of_push_vlan *)
 			    a->conf;
-		if (pushvlan->ethertype != ETHER_TYPE_VLAN)
+		if (be16_to_cpu(pushvlan->ethertype) != ETHER_TYPE_VLAN)
 			return rte_flow_error_set(e, EINVAL,
 						  RTE_FLOW_ERROR_TYPE_ACTION, a,
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-03 17:29:52.813236008 +0000
+++ 0017-net-cxgbe-fix-parsing-VLAN-ID-rewrite-action.patch	2019-12-03 17:29:51.716750661 +0000
@@ -1 +1 @@
-From 46a687dbfa4d51e31515e08cae045a691144c8b5 Mon Sep 17 00:00:00 2001
+From 0367aa0d7b11a240c92a0cb4fcd3184a63d57533 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 46a687dbfa4d51e31515e08cae045a691144c8b5 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 8a5d06ff3..4c8553039 100644
+index f8f3d0a22..f130c7eb4 100644
@@ -49,2 +50,2 @@
--		if (pushvlan->ethertype != RTE_ETHER_TYPE_VLAN)
-+		if (be16_to_cpu(pushvlan->ethertype) != RTE_ETHER_TYPE_VLAN)
+-		if (pushvlan->ethertype != ETHER_TYPE_VLAN)
++		if (be16_to_cpu(pushvlan->ethertype) != ETHER_TYPE_VLAN)



More information about the stable mailing list