[dpdk-stable] patch 'net/mlx5: fix matching for UDP tunnels with Verbs' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:05:43 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. 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.

Thanks.

Luca Boccassi

---
>From 77ca941f9db712eeac44afd8566cf8899bb697d5 Mon Sep 17 00:00:00 2001
From: Raslan Darawsheh <rasland at mellanox.com>
Date: Wed, 6 May 2020 09:57:56 +0300
Subject: [PATCH] net/mlx5: fix matching for UDP tunnels with Verbs

[ upstream commit 8a2e026add3a6a7161a7273aedcf396f2a05f3f1 ]

When creating flow rule with zero specs it will cause
matching all UDP packets like following:
 eth / ipv4 / udp / vxlan / end
Such rule will match all udp packets.

This change the behavior to match the dv flow engine
which will automatically set the match on relative
outer UDP port if the user didn't specify any.

Fixes: 84c406e74524 ("net/mlx5: add flow translate function")

Signed-off-by: Raslan Darawsheh <rasland at mellanox.com>
Acked-by: Matan Azrad <matan at mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_verbs.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c
index f66489c791..7ac6a25e43 100644
--- a/drivers/net/mlx5/mlx5_flow_verbs.c
+++ b/drivers/net/mlx5/mlx5_flow_verbs.c
@@ -586,6 +586,28 @@ flow_verbs_translate_item_udp(struct mlx5_flow *dev_flow,
 		udp.val.src_port &= udp.mask.src_port;
 		udp.val.dst_port &= udp.mask.dst_port;
 	}
+	item++;
+	while (item->type == RTE_FLOW_ITEM_TYPE_VOID)
+		item++;
+	if (!(udp.val.dst_port & udp.mask.dst_port)) {
+		switch ((item)->type) {
+		case RTE_FLOW_ITEM_TYPE_VXLAN:
+			udp.val.dst_port = htons(MLX5_UDP_PORT_VXLAN);
+			udp.mask.dst_port = 0xffff;
+			break;
+		case RTE_FLOW_ITEM_TYPE_VXLAN_GPE:
+			udp.val.dst_port = htons(MLX5_UDP_PORT_VXLAN_GPE);
+			udp.mask.dst_port = 0xffff;
+			break;
+		case RTE_FLOW_ITEM_TYPE_MPLS:
+			udp.val.dst_port = htons(MLX5_UDP_PORT_MPLS);
+			udp.mask.dst_port = 0xffff;
+			break;
+		default:
+			break;
+		}
+	}
+
 	flow_verbs_spec_add(&dev_flow->verbs, &udp, size);
 }
 
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:53.092511764 +0100
+++ 0208-net-mlx5-fix-matching-for-UDP-tunnels-with-Verbs.patch	2020-05-19 14:04:44.600655334 +0100
@@ -1,8 +1,10 @@
-From 8a2e026add3a6a7161a7273aedcf396f2a05f3f1 Mon Sep 17 00:00:00 2001
+From 77ca941f9db712eeac44afd8566cf8899bb697d5 Mon Sep 17 00:00:00 2001
 From: Raslan Darawsheh <rasland at mellanox.com>
 Date: Wed, 6 May 2020 09:57:56 +0300
 Subject: [PATCH] net/mlx5: fix matching for UDP tunnels with Verbs
 
+[ upstream commit 8a2e026add3a6a7161a7273aedcf396f2a05f3f1 ]
+
 When creating flow rule with zero specs it will cause
 matching all UDP packets like following:
  eth / ipv4 / udp / vxlan / end
@@ -13,7 +15,6 @@
 outer UDP port if the user didn't specify any.
 
 Fixes: 84c406e74524 ("net/mlx5: add flow translate function")
-Cc: stable at dpdk.org
 
 Signed-off-by: Raslan Darawsheh <rasland at mellanox.com>
 Acked-by: Matan Azrad <matan at mellanox.com>
@@ -22,10 +23,10 @@
  1 file changed, 22 insertions(+)
 
 diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c
-index 4659f0a7f7..c403f72be3 100644
+index f66489c791..7ac6a25e43 100644
 --- a/drivers/net/mlx5/mlx5_flow_verbs.c
 +++ b/drivers/net/mlx5/mlx5_flow_verbs.c
-@@ -680,6 +680,28 @@ flow_verbs_translate_item_udp(struct mlx5_flow *dev_flow,
+@@ -586,6 +586,28 @@ flow_verbs_translate_item_udp(struct mlx5_flow *dev_flow,
  		udp.val.src_port &= udp.mask.src_port;
  		udp.val.dst_port &= udp.mask.dst_port;
  	}


More information about the stable mailing list