net/mlx5: fix next L3 protocol fetching

Message ID 20240314105902.399968-1-dsosnowski@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix next L3 protocol fetching |

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/intel-Functional success Functional PASS
ci/iol-testing warning apply patch failure

Commit Message

Dariusz Sosnowski March 14, 2024, 10:59 a.m. UTC
  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

Raslan Darawsheh March 14, 2024, 11:14 a.m. UTC | #1
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
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 815f74ec5c..d434c678c8 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -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) {