net/mlx5: fix next L3 protocol fetching
Checks
Commit Message
During flow pattern validation in DV, the next protocol type
should be calculated if and only if protocol mask is defined.
Fixes: 1d7b7ec3a236 ("net/mlx5: remove code duplications")
Cc: getelson@nvidia.com
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Ori Kam <orika@nvidia.com>
---
drivers/net/mlx5/mlx5_flow_dv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hi,
> -----Original Message-----
> From: Dariusz Sosnowski <dsosnowski@nvidia.com>
> Sent: Thursday, March 14, 2024 12:59 PM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Ori Kam <orika@nvidia.com>;
> Suanming Mou <suanmingm@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Gregory Etelson <getelson@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> Subject: [PATCH] net/mlx5: fix next L3 protocol fetching
>
> During flow pattern validation in DV, the next protocol type should be
> calculated if and only if protocol mask is defined.
>
> Fixes: 1d7b7ec3a236 ("net/mlx5: remove code duplications")
> Cc: getelson@nvidia.com
>
> Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
> Acked-by: Ori Kam <orika@nvidia.com>[Raslan Darawsheh]
Patch squashed into relevant commit in next-net-mlx,
Kindest regards,
Raslan Darawsheh
@@ -7524,9 +7524,9 @@ mlx5_flow_l3_next_protocol(const struct rte_flow_item *l3_item,
uint8_t next_protocol;
if (l3_item->mask != NULL && l3_item->spec != NULL) {
- next_protocol = MLX5_L3_NEXT_PROTOCOL(l3_item, spec);
+ next_protocol = MLX5_L3_NEXT_PROTOCOL(l3_item, mask);
if (next_protocol)
- next_protocol &= MLX5_L3_NEXT_PROTOCOL(l3_item, mask);
+ next_protocol &= MLX5_L3_NEXT_PROTOCOL(l3_item, spec);
else
next_protocol = 0xff;
} else if (key_type == MLX5_SET_MATCHER_HS_M && l3_item->mask != NULL) {