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

Xueming Li xuemingl at nvidia.com
Sat Apr 13 14:49:37 CEST 2024


Hi,

FYI, your patch has been queued to stable release 23.11.1

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

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

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 78d38b5d67cfa6270eccc58c38611336bb0d6cff 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
Cc: Xueming Li <xuemingl at nvidia.com>

[ 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 7ed0c0ac9b..aff1ab74e3 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -6224,7 +6224,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)) {
@@ -6235,8 +6234,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
 		},
 		.src = {
 			.field = RTE_FLOW_FIELD_VALUE,
-			.level = vid,
-			.offset = 0,
 		},
 		.width = width,
 	};
@@ -6248,11 +6245,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;
@@ -6279,8 +6280,6 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
 		},
 		.src = {
 			.field = RTE_FLOW_FIELD_VALUE,
-			.level = vid,
-			.offset = 0,
 		},
 		.width = width,
 	};
@@ -6289,6 +6288,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.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-04-13 20:43:07.975640342 +0800
+++ 0097-net-mlx5-fix-VLAN-ID-in-flow-modify.patch	2024-04-13 20:43:05.067753840 +0800
@@ -1 +1 @@
-From b89bfdd9be845b7ecfd50d2e9ec77f5cc2ccf94d Mon Sep 17 00:00:00 2001
+From 78d38b5d67cfa6270eccc58c38611336bb0d6cff Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit b89bfdd9be845b7ecfd50d2e9ec77f5cc2ccf94d ]
@@ -16 +18,0 @@
-Cc: stable at dpdk.org
@@ -25 +27 @@
-index a4e204695e..658f5daf82 100644
+index 7ed0c0ac9b..aff1ab74e3 100644
@@ -28 +30 @@
-@@ -6858,7 +6858,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
+@@ -6224,7 +6224,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
@@ -36 +38 @@
-@@ -6869,8 +6868,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
+@@ -6235,8 +6234,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
@@ -45 +47 @@
-@@ -6882,11 +6879,15 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
+@@ -6248,11 +6245,15 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
@@ -63 +65 @@
-@@ -6913,8 +6914,6 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
+@@ -6279,8 +6280,6 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
@@ -72 +74 @@
-@@ -6923,6 +6922,7 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
+@@ -6289,6 +6288,7 @@ flow_hw_set_vlan_vid_construct(struct rte_eth_dev *dev,
@@ -77 +79,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 +81,0 @@
- 


More information about the stable mailing list