patch 'net/mlx5: fix MPLS tunnel outer layer overwrite' has been queued to stable release 19.11.11

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Nov 30 17:35:55 CET 2021


Hi,

FYI, your patch has been queued to stable release 19.11.11

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before December 10th 2021. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/49fdbb9a22c144313af5f446c1e4ef250e677fcd

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From 49fdbb9a22c144313af5f446c1e4ef250e677fcd Mon Sep 17 00:00:00 2001
From: Dariusz Sosnowski <dsosnowski at nvidia.com>
Date: Wed, 17 Nov 2021 11:59:33 +0200
Subject: [PATCH] net/mlx5: fix MPLS tunnel outer layer overwrite

[ upstream commit 421177ccd7f59ec8d898fd6aa6bc6fb9eb298a52 ]

mlx5 PMD incorrectly overwrote outer layer fields in MPLS tunnel
rte_flow patterns using defaults for MPLS tunnels. This included
overwriting UDP destination port in MPLSoUDP and GRE protocol field in
MPLSoGRE.

This patch fixes this behavior. If application provides the values in
flow pattern items preceding the MPLS flow item the provided values will
be used, otherwise the defaults will be applied.

Fixes: d1abe664ddde ("net/mlx5: add MPLS to Direct Verbs flow engine")

Signed-off-by: Dariusz Sosnowski <dsosnowski at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index f8ca36b1c6..d1a20dafbe 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -6216,16 +6216,22 @@ flow_dv_translate_item_mpls(void *matcher, void *key,
 
 	switch (prev_layer) {
 	case MLX5_FLOW_LAYER_OUTER_L4_UDP:
-		MLX5_SET(fte_match_set_lyr_2_4, headers_m, udp_dport, 0xffff);
-		MLX5_SET(fte_match_set_lyr_2_4, headers_v, udp_dport,
-			 MLX5_UDP_PORT_MPLS);
+		if (!MLX5_GET16(fte_match_set_lyr_2_4, headers_v, udp_dport)) {
+			MLX5_SET(fte_match_set_lyr_2_4, headers_m, udp_dport,
+				 0xffff);
+			MLX5_SET(fte_match_set_lyr_2_4, headers_v, udp_dport,
+				 MLX5_UDP_PORT_MPLS);
+		}
 		break;
 	case MLX5_FLOW_LAYER_GRE:
 		/* Fall-through. */
 	case MLX5_FLOW_LAYER_GRE_KEY:
-		MLX5_SET(fte_match_set_misc, misc_m, gre_protocol, 0xffff);
-		MLX5_SET(fte_match_set_misc, misc_v, gre_protocol,
-			 RTE_ETHER_TYPE_MPLS);
+		if (!MLX5_GET16(fte_match_set_misc, misc_v, gre_protocol)) {
+			MLX5_SET(fte_match_set_misc, misc_m, gre_protocol,
+				 0xffff);
+			MLX5_SET(fte_match_set_misc, misc_v, gre_protocol,
+				 RTE_ETHER_TYPE_MPLS);
+		}
 		break;
 	default:
 		break;
-- 
2.34.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-11-30 16:50:14.628172549 +0100
+++ 0151-net-mlx5-fix-MPLS-tunnel-outer-layer-overwrite.patch	2021-11-30 16:50:06.118875937 +0100
@@ -1 +1 @@
-From 421177ccd7f59ec8d898fd6aa6bc6fb9eb298a52 Mon Sep 17 00:00:00 2001
+From 49fdbb9a22c144313af5f446c1e4ef250e677fcd Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 421177ccd7f59ec8d898fd6aa6bc6fb9eb298a52 ]
+
@@ -16 +17,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index 7b32c06fc6..d079a52d30 100644
+index f8ca36b1c6..d1a20dafbe 100644
@@ -28 +29 @@
-@@ -9328,16 +9328,22 @@ flow_dv_translate_item_mpls(void *matcher, void *key,
+@@ -6216,16 +6216,22 @@ flow_dv_translate_item_mpls(void *matcher, void *key,


More information about the stable mailing list