patch 'net/mlx5: reject unsupported GRE and NVGRE flow patterns' has been queued to stable release 24.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Nov 16 23:52:11 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.11.9

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

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7344d331658b9435bcb76852b5762140c14256ad

Thanks.

Luca Boccassi

---
>From 7344d331658b9435bcb76852b5762140c14256ad Mon Sep 17 00:00:00 2001
From: Itai Sharoni <isharoni at nvidia.com>
Date: Sun, 8 Nov 2026 10:37:21 +0200
Subject: [PATCH] net/mlx5: reject unsupported GRE and NVGRE flow patterns

[ upstream commit 581084541d78e21441d609fff2336f5aa96ddc73 ]

Flow patterns such as eth / ipv4 / udp / nvgre were accepted
silently because mlx5_flow_validate_item_gre and
mlx5_flow_validate_item_nvgre did not check which layers precede
the GRE item.

During translation the GRE handler overwrites the ip_protocol
field from UDP (17) to GRE (47), so the resulting firmware rule
matches plain NVGRE packets instead. This misleads users into
believing they created a UDP+NVGRE rule when the UDP item is
silently discarded. The same applies to TCP, ICMP, ICMPv6 and ESP.

GRE-in-UDP (RFC 8086) is a valid encapsulation that mlx5 does not
support, so reject an outer UDP item with ENOTSUP. GRE cannot be
carried over TCP, ICMP or ICMPv6, and cannot be matched inside an
encrypted ESP payload, so reject those with EINVAL.

The checks are unconditional so they cover both the DV and HWS
steering paths.

Fixes: f4b901a46aec ("net/mlx5: add flow GRE item")
Fixes: ea81c1b816f7 ("net/mlx5: fix NVGRE matching")

Signed-off-by: Itai Sharoni <isharoni at nvidia.com>
Acked-by: Bing Zhao <bingz at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 66fa89750e..0192e489c9 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -3518,6 +3518,16 @@ mlx5_flow_validate_item_gre(const struct rte_eth_dev *dev,
 					  RTE_FLOW_ERROR_TYPE_ITEM, item,
 					  "multiple tunnel layers not"
 					  " supported");
+	if (item_flags & MLX5_FLOW_LAYER_OUTER_L4_UDP)
+		return rte_flow_error_set(error, ENOTSUP,
+					  RTE_FLOW_ERROR_TYPE_ITEM, item,
+					  "GRE over UDP is not supported");
+	if (item_flags & (MLX5_FLOW_LAYER_OUTER_L4_TCP |
+			  MLX5_FLOW_LAYER_ICMP | MLX5_FLOW_LAYER_ICMP6 |
+			  MLX5_FLOW_ITEM_ESP))
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ITEM, item,
+					  "GRE cannot follow TCP, ICMP or ESP layer");
 	if (!mlx5_hws_active(dev)) {
 		if (!(item_flags & MLX5_FLOW_LAYER_OUTER_L3))
 			return rte_flow_error_set(error, ENOTSUP,
@@ -3900,6 +3910,16 @@ mlx5_flow_validate_item_nvgre(const struct rte_eth_dev *dev,
 					  RTE_FLOW_ERROR_TYPE_ITEM, item,
 					  "multiple tunnel layers not"
 					  " supported");
+	if (item_flags & MLX5_FLOW_LAYER_OUTER_L4_UDP)
+		return rte_flow_error_set(error, ENOTSUP,
+					  RTE_FLOW_ERROR_TYPE_ITEM, item,
+					  "NVGRE over UDP is not supported");
+	if (item_flags & (MLX5_FLOW_LAYER_OUTER_L4_TCP |
+			  MLX5_FLOW_LAYER_ICMP | MLX5_FLOW_LAYER_ICMP6 |
+			  MLX5_FLOW_ITEM_ESP))
+		return rte_flow_error_set(error, EINVAL,
+					  RTE_FLOW_ERROR_TYPE_ITEM, item,
+					  "NVGRE cannot follow TCP, ICMP or ESP layer");
 	if (!mlx5_hws_active(dev)) {
 		if (!(item_flags & MLX5_FLOW_LAYER_OUTER_L3))
 			return rte_flow_error_set(error, ENOTSUP,
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-11-16 22:52:18.751555268 +0000
+++ 0057-net-mlx5-reject-unsupported-GRE-and-NVGRE-flow-patte.patch	2026-11-16 22:52:16.504233908 +0000
@@ -1 +1 @@
-From 581084541d78e21441d609fff2336f5aa96ddc73 Mon Sep 17 00:00:00 2001
+From 7344d331658b9435bcb76852b5762140c14256ad Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 581084541d78e21441d609fff2336f5aa96ddc73 ]
+
@@ -27 +28,0 @@
-Cc: stable at dpdk.org
@@ -36 +37 @@
-index 37654918b5..f20214857f 100644
+index 66fa89750e..0192e489c9 100644
@@ -39 +40 @@
-@@ -3519,6 +3519,16 @@ mlx5_flow_validate_item_gre(const struct rte_eth_dev *dev,
+@@ -3518,6 +3518,16 @@ mlx5_flow_validate_item_gre(const struct rte_eth_dev *dev,
@@ -56 +57 @@
-@@ -3894,6 +3904,16 @@ mlx5_flow_validate_item_nvgre(const struct rte_eth_dev *dev,
+@@ -3900,6 +3910,16 @@ mlx5_flow_validate_item_nvgre(const struct rte_eth_dev *dev,


More information about the stable mailing list