patch 'net/mlx5: fix non-template set VLAN VID' has been queued to stable release 24.11.2

Kevin Traynor ktraynor at redhat.com
Mon Mar 24 17:16:18 CET 2025


Hi,

FYI, your patch has been queued to stable release 24.11.2

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/28/25. 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

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

Thanks.

Kevin

---
>From a1aa7eba64735891ba7cff539aa9a0cfd586fe7e Mon Sep 17 00:00:00 2001
From: Maayan Kashani <mkashani at nvidia.com>
Date: Thu, 27 Feb 2025 12:45:27 +0200
Subject: [PATCH] net/mlx5: fix non-template set VLAN VID

[ upstream commit 5fd4de3aef4cec5ca3395139135b1c58d43d5a9c ]

Support set vlan vid in non template on top of HWS.
Update relevant return errors in the relevant functions to avoid crash.
Mask the vlan vid action in non template mode
such that the action template create will use the vid value.

Fixes: 00a0a6b80674 ("net/mlx5: support indirect actions in non-template setup")

Signed-off-by: Maayan Kashani <mkashani at nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index e72b87d70f..fc78bf2e1d 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -671,4 +671,7 @@ flow_hw_action_flags_get(const struct rte_flow_action actions[],
 			action_flags |= MLX5_FLOW_ACTION_OF_POP_VLAN;
 			break;
+		case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:
+			action_flags |= MLX5_FLOW_ACTION_OF_SET_VLAN_VID;
+			break;
 		case RTE_FLOW_ACTION_TYPE_JUMP:
 			action_flags |= MLX5_FLOW_ACTION_JUMP;
@@ -7700,5 +7703,5 @@ err_actions_num:
 }
 
-static void
+static int
 flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
 		     struct rte_flow_action *ra,
@@ -7706,7 +7709,7 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
 		     struct rte_flow_action_modify_field *spec,
 		     struct rte_flow_action_modify_field *mask,
-		     int set_vlan_vid_ix)
+		     int set_vlan_vid_ix,
+		     struct rte_flow_error *error)
 {
-	struct rte_flow_error error;
 	const bool masked = rm[set_vlan_vid_ix].conf &&
 		(((const struct rte_flow_action_of_set_vlan_vid *)
@@ -7715,5 +7718,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
 		ra[set_vlan_vid_ix].conf;
 	int width = mlx5_flow_item_field_width(dev, RTE_FLOW_FIELD_VLAN_ID, 0,
-					       NULL, &error);
+					       NULL, error);
+	MLX5_ASSERT(width);
 	*spec = (typeof(*spec)) {
 		.operation = RTE_FLOW_MODIFY_SET,
@@ -7748,4 +7752,5 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
 	rm[set_vlan_vid_ix].type = RTE_FLOW_ACTION_TYPE_MODIFY_FIELD;
 	rm[set_vlan_vid_ix].conf = mask;
+	return 0;
 }
 
@@ -7993,7 +7998,9 @@ __flow_hw_actions_template_create(struct rte_eth_dev *dev,
 								   &ra, &rm,
 								   act_num);
-		flow_hw_set_vlan_vid(dev, ra, rm,
-				     &set_vlan_vid_spec, &set_vlan_vid_mask,
-				     set_vlan_vid_ix);
+		ret = flow_hw_set_vlan_vid(dev, ra, rm,
+					   &set_vlan_vid_spec, &set_vlan_vid_mask,
+					   set_vlan_vid_ix, error);
+		if (ret)
+			goto error;
 		action_flags |= MLX5_FLOW_ACTION_MODIFY_FIELD;
 	}
@@ -13506,4 +13513,8 @@ flow_nta_build_template_mask(const struct rte_flow_action actions[],
 			mask->conf = conf;
 			break;
+		case RTE_FLOW_ACTION_TYPE_OF_SET_VLAN_VID:
+			memset(conf, 0xff, sizeof(struct rte_flow_action_of_set_vlan_vid));
+			mask->conf = conf;
+			break;
 		default:
 			break;
-- 
2.48.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-03-24 16:15:15.196284543 +0000
+++ 0011-net-mlx5-fix-non-template-set-VLAN-VID.patch	2025-03-24 16:15:14.737735447 +0000
@@ -1 +1 @@
-From 5fd4de3aef4cec5ca3395139135b1c58d43d5a9c Mon Sep 17 00:00:00 2001
+From a1aa7eba64735891ba7cff539aa9a0cfd586fe7e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 5fd4de3aef4cec5ca3395139135b1c58d43d5a9c ]
+
@@ -12 +13,0 @@
-Cc: stable at dpdk.org
@@ -21 +22 @@
-index 03cbf53f49..7f34af49de 100644
+index e72b87d70f..fc78bf2e1d 100644
@@ -24 +25 @@
-@@ -715,4 +715,7 @@ flow_hw_action_flags_get(const struct rte_flow_action actions[],
+@@ -671,4 +671,7 @@ flow_hw_action_flags_get(const struct rte_flow_action actions[],
@@ -32 +33 @@
-@@ -7814,5 +7817,5 @@ err_actions_num:
+@@ -7700,5 +7703,5 @@ err_actions_num:
@@ -39 +40 @@
-@@ -7820,7 +7823,7 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
+@@ -7706,7 +7709,7 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
@@ -49 +50 @@
-@@ -7829,5 +7832,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
+@@ -7715,5 +7718,6 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
@@ -57 +58 @@
-@@ -7862,4 +7866,5 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
+@@ -7748,4 +7752,5 @@ flow_hw_set_vlan_vid(struct rte_eth_dev *dev,
@@ -63 +64 @@
-@@ -8107,7 +8112,9 @@ __flow_hw_actions_template_create(struct rte_eth_dev *dev,
+@@ -7993,7 +7998,9 @@ __flow_hw_actions_template_create(struct rte_eth_dev *dev,
@@ -76 +77 @@
-@@ -13750,4 +13757,8 @@ flow_nta_build_template_mask(const struct rte_flow_action actions[],
+@@ -13506,4 +13513,8 @@ flow_nta_build_template_mask(const struct rte_flow_action actions[],



More information about the stable mailing list