net/mlx5: fix non-masked indirect list meter translation in flow rule

Message ID 20240229113119.598405-1-getelson@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix non-masked indirect list meter translation in flow rule |

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-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Gregory Etelson Feb. 29, 2024, 11:31 a.m. UTC
  Template table reuses DR5 action handle for non-masked indirect
actions. Flow rule must explicitly translate non-masked indirect
action and update DR5 handle with the rule indirect object.

Current PMD assumed DR5 handle of non-masked indirect action was
always NULL before the action translation.

The patch always translates non-masked indirect list meter object.

Fixes: e26f50adbf38 ("net/mlx5: support indirect list meter mark action")

Cc: stable@dpdk.org

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
  

Comments

Raslan Darawsheh March 12, 2024, 8 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Gregory Etelson <getelson@nvidia.com>
> Sent: Thursday, February 29, 2024 1:31 PM
> To: dev@dpdk.org
> Cc: Gregory Etelson <getelson@nvidia.com>; Maayan Kashani
> <mkashani@nvidia.com>; Raslan Darawsheh <rasland@nvidia.com>;
> stable@dpdk.org; Dariusz Sosnowski <dsosnowski@nvidia.com>; Slava
> Ovsiienko <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>;
> Suanming Mou <suanmingm@nvidia.com>; Matan Azrad
> <matan@nvidia.com>
> Subject: [PATCH] net/mlx5: fix non-masked indirect list meter translation in
> flow rule
> 
> Template table reuses DR5 action handle for non-masked indirect actions. Flow
> rule must explicitly translate non-masked indirect action and update DR5
> handle with the rule indirect object.
> 
> Current PMD assumed DR5 handle of non-masked indirect action was always
> NULL before the action translation.
> 
> The patch always translates non-masked indirect list meter object.
> 
> Fixes: e26f50adbf38 ("net/mlx5: support indirect list meter mark action")
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@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 9620b7f576..9833654aac 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -1702,15 +1702,9 @@  flow_hw_translate_indirect_meter(struct rte_eth_dev *dev,
 	const struct rte_flow_indirect_update_flow_meter_mark **flow_conf =
 		(typeof(flow_conf))action_conf->conf;
 
-	/*
-	 * Masked indirect handle set dr5 action during template table
-	 * translation.
-	 */
-	if (!dr_rule->action) {
-		ret = flow_dr_set_meter(priv, dr_rule, action_conf);
-		if (ret)
-			return ret;
-	}
+	ret = flow_dr_set_meter(priv, dr_rule, action_conf);
+	if (ret)
+		return ret;
 	if (!act_data->shared_meter.conf_masked) {
 		if (flow_conf && flow_conf[0] && flow_conf[0]->init_color < RTE_COLORS)
 			flow_dr_mtr_flow_color(dr_rule, flow_conf[0]->init_color);