Skip to contentSkip to conversation

net/mlx5: fix IPIP tunnel verification

PATCH In review Gregory Etelson 2 participants 2 messages Mar 10, 2025 – Mar 13, 2025 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/mlx5: fix IPIP tunnel verification

Assuming a case with the following pattern:

eth / ipv4 / udp / vxlan / eth / ipv4 proto is (IPv4 | IPv6)

MLX5 PMD incorrectly recognized this as a packet encapsulated as VXLAN and IP in IP at the same packet header level. This caused a flow validation error.

This patch fixes the inner IP in IP detection logic.

Fixes 2db234e769e1 ("net/mlx5: fix IP-in-IP tunnels recognition")
---
 drivers/net/mlx5/mlx5_flow_dv.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/mlx5/mlx5_flow_dv.c +8 -2
index 61d3101ce8..2d03a3f480 100644
@@ -7925,7 +7925,10 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 				mlx5_flow_tunnel_ip_check(items, next_protocol,
 							  item_flags,
 							  &l3_tunnel_flag);
-			if (l3_tunnel_detection == l3_tunnel_inner) {
+			/*
+			 * explicitly allow inner IPIP match
+			 */
+			if (l3_tunnel_detection == l3_tunnel_outer) {
 				item_flags |= l3_tunnel_flag;
 				tunnel = 1;
 			}
@@ -7949,7 +7952,10 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
 				mlx5_flow_tunnel_ip_check(items, next_protocol,
 							  item_flags,
 							  &l3_tunnel_flag);
-			if (l3_tunnel_detection == l3_tunnel_inner) {
+			/*
+			 * explicitly allow inner IPIP match
+			 */
+			if (l3_tunnel_detection == l3_tunnel_outer) {
 				item_flags |= l3_tunnel_flag;
 				tunnel = 1;
 			}
Signature · 1 line
2.45.2
Acked-by Dariusz Sosnowski on v1 1/1
#1 lore raw

Hi,

From: Gregory Etelson <[email protected]>
Sent: Monday, March 10, 2025 1:19 PM
To: [email protected]
Cc: Gregory Etelson; Maayan Kashani; Raslan Darawsheh; [email protected]; Dariusz Sosnowski; Slava Ovsiienko; Bing Zhao; Ori Kam; Suanming Mou; Matan Azrad
Subject: [PATCH] net/mlx5: fix IPIP tunnel verification

Assuming a case with the following pattern:

eth / ipv4 / udp / vxlan / eth / ipv4 proto is (IPv4 | IPv6)

MLX5 PMD incorrectly recognized this as a packet encapsulated as VXLAN and IP in IP at the same packet header level. This caused a flow validation error.

This patch fixes the inner IP in IP detection logic.

Fixes 2db234e769e1 ("net/mlx5: fix IP-in-IP tunnels recognition")

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh