patch 'net/mlx5: fix VLAN ID in flow modify' has been queued to stable release 22.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Mar 18 16:39:07 CET 2024


Hi,

FYI, your patch has been queued to stable release 22.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/20/24. 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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/f5ff0aaf2e79c551419f48ad0b7dfa4bf20bd00c

Thanks.

Luca Boccassi

---
>From f5ff0aaf2e79c551419f48ad0b7dfa4bf20bd00c Mon Sep 17 00:00:00 2001
From: Gregory Etelson <getelson at nvidia.com>
Date: Fri, 1 Mar 2024 08:04:48 +0200
Subject: [PATCH] net/mlx5: fix VLAN ID in flow modify

[ upstream commit b89bfdd9be845b7ecfd50d2e9ec77f5cc2ccf94d ]

PMD uses MODIFY_FIELD to implement standalone OF_SET_VLAN_VID flow
action.
PMD assigned immediate VLAN Id value to the `.level` member of the
`rte_flow_action_modify_data` structure instead of `.value`.
That assignment has worked because both members had the same offset in
the hosting structure.

The patch assigns VLAN Id directly to `.value`

Fixes: 773ca0e91ba1 ("net/mlx5: support VLAN push/pop/modify with HWS")

Signed-off-by: Gregory Etelson <getelson at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index bb4693c2b4..927be86c36 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -4316,7 +4316,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
 			rm[set_vlan_vid_ix].conf)->vlan_vid != 0);
 	const struct rte_flow_action_of_set_vlan_vid *conf =
 		ra[set_vlan_vid_ix].conf;
-	rte_be16_t vid = masked ? conf->vlan_vid : 0;
 	int width = mlx5_flow_item_field_width(dev, RTE_FLOW_FIELD_VLAN_ID, 0,
 					       NULL, &error);
 	*spec = (typeof(*spec)) {
@@ -4327,8 +4326,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
 		},
 		.src = {
 			.field = RTE_FLOW_FIELD_VALUE,
-			.level = vid,
-			.offset = 0,
 		},
 		.width = width,
 	};
@@ -4340,11 +4337,15 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
 		},
 		.src = {
 			.field = RTE_FLOW_FIELD_VALUE,
-			.level = masked ? (1U << width) - 1 : 0,
-			.offset = 0,
 		},
 		.width = 0xffffffff,
 	};
+	if (masked) {
+		uint32_t mask_val = 0xffffffff;
+
+		rte_memcpy(spec->src.value, &conf->vlan_vid, sizeof(conf->vlan_vid));
+		rte_memcpy(mask->src.value, &mask_val, sizeof(mask_val));
+	}
 	ra[set_vlan_vid_ix].type = RTE_FLOW_ACTION_TYPE_MODIFY_FIELD;
 	ra[set_vlan_vid_ix].conf = spec;
 	rm[set_vlan_vid_ix].type = RTE_FLOW_ACTION_TYPE_MODIFY_FIELD;
@@ -4371,8 +4372,6 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
 		},
 		.src = {
 			.field = RTE_FLOW_FIELD_VALUE,
-			.level = vid,
-			.offset = 0,
 		},
 		.width = width,
 	};
@@ -4381,6 +4380,7 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
 		.conf = &conf
 	};
 
+	rte_memcpy(conf.src.value, &vid, sizeof(vid));
 	return flow_hw_modify_field_construct(job, act_data, hw_acts,
 					      &modify_action);
 }
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-03-18 12:58:39.964237119 +0000
+++ 0017-net-mlx5-fix-VLAN-ID-in-flow-modify.patch	2024-03-18 12:58:39.143345546 +0000
@@ -1 +1 @@
-From b89bfdd9be845b7ecfd50d2e9ec77f5cc2ccf94d Mon Sep 17 00:00:00 2001
+From f5ff0aaf2e79c551419f48ad0b7dfa4bf20bd00c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b89bfdd9be845b7ecfd50d2e9ec77f5cc2ccf94d ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index a4e204695e..658f5daf82 100644
+index bb4693c2b4..927be86c36 100644
@@ -28 +29 @@
-@@ -6858,7 +6858,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
+@@ -4316,7 +4316,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
@@ -36 +37 @@
-@@ -6869,8 +6868,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
+@@ -4327,8 +4326,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
@@ -45 +46 @@
-@@ -6882,11 +6879,15 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
+@@ -4340,11 +4337,15 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
@@ -63 +64 @@
-@@ -6913,8 +6914,6 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
+@@ -4371,8 +4372,6 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
@@ -72 +73 @@
-@@ -6923,6 +6922,7 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
+@@ -4381,6 +4380,7 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
@@ -77 +78,2 @@
- 	return flow_hw_modify_field_construct(mhdr_cmd, act_data, hw_acts, &modify_action);
+ 	return flow_hw_modify_field_construct(job, act_data, hw_acts,
+ 					      &modify_action);
@@ -79 +80,0 @@
- 


More information about the stable mailing list