Skip to contentSkip to conversation

net/mlx5/hws: fix range definer error recovery

PATCH In review Gregory Etelson 2 participants 2 messages Oct 27, 2024 – Oct 28, 2024 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5/hws: fix range definer error recovery

PMD did not assign rte_errno value after it discovered an error in matcher range parameters.
As a result, the calling function was not notified about the fault.

The patch assigns EINVAL to rte_errno if matcher range definition was invalid.

Fixes 9732ffe13bd6 ("net/mlx5/hws: add range definer creation")
---
 drivers/net/mlx5/hws/mlx5dr_definer.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/mlx5/hws/mlx5dr_definer.c +1 -0
index a9fa5d06ed..fd0a9b15d8 100644
@@ -4056,6 +4056,7 @@ mlx5dr_definer_matcher_range_init(struct mlx5dr_context *ctx,
 
 		if (i && ((is_range && !has_range) || (!is_range && has_range))) {
 			DR_LOG(ERR, "Using range and non range templates is not allowed");
+			rte_errno = EINVAL;
 			goto free_definers;
 		}
 
Signature · 1 line
2.43.0
Acked-by Dariusz Sosnowski on v1 1/1
#1 lore raw

Hi,

From: Gregory Etelson <[email protected]>
Sent: Sunday, October 27, 2024 3:07 PM
To: [email protected]
Cc: Gregory Etelson; Maayan Kashani; Raslan Darawsheh; [email protected]; Dariusz Sosnowski; Slava Ovsiienko; Bing Zhao; Ori Kam; Suanming Mou; Matan Azrad; Alex Vesker
Subject: [PATCH] net/mlx5/hws: fix range definer error recovery

PMD did not assign rte_errno value after it discovered an error in matcher range parameters.
As a result, the calling function was not notified about the fault.

The patch assigns EINVAL to rte_errno if matcher range definition was invalid.

Fixes 9732ffe13bd6 ("net/mlx5/hws: add range definer creation")

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh