* [PATCH] net/mlx5: fix flex tunnel validation
@ 2025-04-30 11:03 Dariusz Sosnowski
2025-05-13 6:27 ` Raslan Darawsheh
0 siblings, 1 reply; 2+ messages in thread
From: Dariusz Sosnowski @ 2025-04-30 11:03 UTC (permalink / raw)
To: Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
Matan Azrad, Gregory Etelson
Cc: dev, stable
Pattern template validation did not take into account
the configured tunnel mode of the flex item.
This caused validation failures for templates with
flex item registered as tunnel headers.
Specifically, any item after such flex item was still considered
as outer header, not an inner.
This patch fixes the flex item validation,
by correctly updating recognized items bitmask depending
on flex item mode.
Fixes: 80c676259a04 ("net/mlx5: validate HWS template items")
Cc: getelson@nvidia.com
Cc: stable@dpdk.org
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
drivers/net/mlx5/mlx5_flow_hw.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 20d38ce414..723652a6ec 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -8867,12 +8867,21 @@ flow_hw_pattern_validate(struct rte_eth_dev *dev,
MLX5_FLOW_ITEM_INNER_IPV6_ROUTING_EXT :
MLX5_FLOW_ITEM_OUTER_IPV6_ROUTING_EXT;
break;
- case RTE_FLOW_ITEM_TYPE_FLEX:
- /* match mlx5dr_definer_conv_items_to_hl() */
- last_item = tunnel ?
- MLX5_FLOW_ITEM_INNER_FLEX :
- MLX5_FLOW_ITEM_OUTER_FLEX;
+ case RTE_FLOW_ITEM_TYPE_FLEX: {
+ enum rte_flow_item_flex_tunnel_mode tunnel_mode = FLEX_TUNNEL_MODE_SINGLE;
+
+ ret = mlx5_flex_get_tunnel_mode(item, &tunnel_mode);
+ if (ret < 0)
+ return rte_flow_error_set(error, -ret, RTE_FLOW_ERROR_TYPE_ITEM,
+ item, "Unable to get flex item mode");
+ if (tunnel_mode == FLEX_TUNNEL_MODE_TUNNEL)
+ last_item = MLX5_FLOW_ITEM_FLEX_TUNNEL;
+ else
+ last_item = tunnel ?
+ MLX5_FLOW_ITEM_INNER_FLEX :
+ MLX5_FLOW_ITEM_OUTER_FLEX;
break;
+ }
case RTE_FLOW_ITEM_TYPE_RANDOM:
last_item = MLX5_FLOW_ITEM_RANDOM;
break;
--
2.39.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net/mlx5: fix flex tunnel validation
2025-04-30 11:03 [PATCH] net/mlx5: fix flex tunnel validation Dariusz Sosnowski
@ 2025-05-13 6:27 ` Raslan Darawsheh
0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2025-05-13 6:27 UTC (permalink / raw)
To: Dariusz Sosnowski, Viacheslav Ovsiienko, Bing Zhao, Ori Kam,
Suanming Mou, Matan Azrad, Gregory Etelson
Cc: dev, stable
Hi,
On 30/04/2025 2:03 PM, Dariusz Sosnowski wrote:
> Pattern template validation did not take into account
> the configured tunnel mode of the flex item.
> This caused validation failures for templates with
> flex item registered as tunnel headers.
> Specifically, any item after such flex item was still considered
> as outer header, not an inner.
>
> This patch fixes the flex item validation,
> by correctly updating recognized items bitmask depending
> on flex item mode.
>
> Fixes: 80c676259a04 ("net/mlx5: validate HWS template items")
> Cc: getelson@nvidia.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
Patch applied to next-net-mlx,
--
Kindest regards
Raslan Darawsheh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-13 6:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-30 11:03 [PATCH] net/mlx5: fix flex tunnel validation Dariusz Sosnowski
2025-05-13 6:27 ` Raslan Darawsheh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).