net/mlx5: fix using wrong group ID for action translation

Message ID 20250303134920.72182-1-mkashani@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix using wrong group ID for action translation |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS

Commit Message

Maayan Kashani March 3, 2025, 1:49 p.m. UTC
From: Bing Zhao <bingz@nvidia.com>

In HWS non-template API, the actual group ID is calculated in the
flow_hw_translate_flow_actions(). This would be set into the dummy
template table for the following usage.

Since __flow_hw_translate_actions_template() is also called for the
dummy action template and some fixed actions' translation. The actual
group ID is also needed to avoid the misuse of actions for 'root'
table. Only the 'group' in the attributes can be used in this
function. The actual group should be set explicitly before calling
it in the non-template API.

Fixes: 27d171b88031 ("net/mlx5: abstract flow action and enable reconfigure")
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Raslan Darawsheh March 11, 2025, 7:35 a.m. UTC | #1
Hi,

From: Maayan Kashani <mkashani@nvidia.com>
Sent: Monday, March 3, 2025 3:49 PM
To: dev@dpdk.org
Cc: Maayan Kashani; Dariusz Sosnowski; Raslan Darawsheh; Bing Zhao; stable@dpdk.org; Slava Ovsiienko; Ori Kam; Suanming Mou; Matan Azrad
Subject: [PATCH] net/mlx5: fix using wrong group ID for action translation

From: Bing Zhao <bingz@nvidia.com>

In HWS non-template API, the actual group ID is calculated in the
flow_hw_translate_flow_actions(). This would be set into the dummy
template table for the following usage.

Since __flow_hw_translate_actions_template() is also called for the
dummy action template and some fixed actions' translation. The actual
group ID is also needed to avoid the misuse of actions for 'root'
table. Only the 'group' in the attributes can be used in this
function. The actual group should be set explicitly before calling
it in the non-template API.

Fixes: 27d171b88031 ("net/mlx5: abstract flow action and enable reconfigure")
Cc: stable@dpdk.org

Signed-off-by: Bing Zhao <bingz@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 03cbf53f492..93e71192552 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -13825,6 +13825,7 @@  flow_hw_translate_flow_actions(struct rte_eth_dev *dev,
 	table->cfg.external = external;
 	table->nb_action_templates = 1;
 	memcpy(&table->cfg.attr.flow_attr, attr, sizeof(*attr));
+	table->cfg.attr.flow_attr.group = src_group;
 	table->ats[0].action_template = at;
 	ret = __flow_hw_translate_actions_template(dev, &table->cfg, hw_acts, at,
 						   &table->mpctx, true, error);