patch 'net/nfp: fix VLAN push flow action' has been queued to stable release 22.11.3

Xueming Li xuemingl at nvidia.com
Sun Jun 25 08:34:12 CEST 2023


Hi,

FYI, your patch has been queued to stable release 22.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/27/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=acbaa6bb5dfd4e8fe128d4c8d9503d03391b3dba

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From acbaa6bb5dfd4e8fe128d4c8d9503d03391b3dba Mon Sep 17 00:00:00 2001
From: Chaoyong He <chaoyong.he at corigine.com>
Date: Fri, 12 May 2023 10:03:46 +0800
Subject: [PATCH] net/nfp: fix VLAN push flow action
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 2581c3bb634d905d4459ea15c3f6bd02b58069d3 ]

When process VLAN push flow action, the former logic perform the
mask and shift operations directly on the big endian data, which
cause both the pcp and VLAN id are not correct for offloaded packets.

Fix it by convert the data from big endian to CPU endian before
perform the mask and shift operations.

Fixes: eb9277cb2fd1 ("net/nfp: support VLAN push flow action")

Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 50b166786a..432e19c357 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2194,6 +2194,8 @@ static int
 nfp_flow_action_push_vlan(char *act_data,
 		const struct rte_flow_action *action)
 {
+	uint8_t pcp;
+	uint16_t vid;
 	size_t act_size;
 	struct nfp_fl_act_push_vlan *push_vlan;
 	const struct rte_flow_action_of_push_vlan *push_vlan_conf;
@@ -2216,9 +2218,11 @@ nfp_flow_action_push_vlan(char *act_data,
 			(action + 1)->conf;
 	vlan_vid_conf  = (const struct rte_flow_action_of_set_vlan_vid *)
 			(action + 2)->conf;
+
+	vid = rte_be_to_cpu_16(vlan_vid_conf->vlan_vid) & 0x0fff;
+	pcp = vlan_pcp_conf->vlan_pcp & 0x07;
 	push_vlan->vlan_tpid = push_vlan_conf->ethertype;
-	push_vlan->vlan_tci = ((vlan_pcp_conf->vlan_pcp & 0x07) << 13) |
-			(vlan_vid_conf->vlan_vid & 0x0fff);
+	push_vlan->vlan_tci = rte_cpu_to_be_16(vid | (pcp << 13));
 
 	return 0;
 }
-- 
2.25.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-06-25 14:31:59.441941700 +0800
+++ 0034-net-nfp-fix-VLAN-push-flow-action.patch	2023-06-25 14:31:58.325773900 +0800
@@ -1 +1 @@
-From 2581c3bb634d905d4459ea15c3f6bd02b58069d3 Mon Sep 17 00:00:00 2001
+From acbaa6bb5dfd4e8fe128d4c8d9503d03391b3dba Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 2581c3bb634d905d4459ea15c3f6bd02b58069d3 ]
@@ -17 +19,0 @@
-Cc: stable at dpdk.org
@@ -26 +28 @@
-index 41b722f4d8..fdf5c0f40e 100644
+index 50b166786a..432e19c357 100644
@@ -29 +31 @@
-@@ -2205,6 +2205,8 @@ static int
+@@ -2194,6 +2194,8 @@ static int
@@ -38 +40 @@
-@@ -2227,9 +2229,11 @@ nfp_flow_action_push_vlan(char *act_data,
+@@ -2216,9 +2218,11 @@ nfp_flow_action_push_vlan(char *act_data,


More information about the stable mailing list