From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 480FCA0543 for ; Sat, 5 Nov 2022 18:13:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4372740151; Sat, 5 Nov 2022 18:13:18 +0100 (CET) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mails.dpdk.org (Postfix) with ESMTP id 22375400D5 for ; Sat, 5 Nov 2022 18:13:17 +0100 (CET) Received: by mail-wr1-f54.google.com with SMTP id v1so10844123wrt.11 for ; Sat, 05 Nov 2022 10:13:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1kQcbD5T/5TiMWRdSkDljA3X6EOWVdjkrjBwlVUfRko=; b=YwKyj69GjgxNHLY88Zx0NT7j5QaWxgpDVjSGEFjBJTq/nECZvd4FnaZqpxuEY+dX9F M7sqxEniMS9rLr7NmXHbu3eHzTUPsUfJSgQj78NDXcvaZmiuwRfy4djtY+IbFYhCMbm5 bRUMJmjBWkq9J+JZmcdc7odvAq6OQjdAYwCO4y3b0zXbNJ+KJR+yp+sW86GAW0/1K8dV kjOHPxrDD/0jRcO49l/YTHuKGvJxrLSwq7YhjvsDwBVwsNadVPTIZ+Rbx9EMRLHMquRy 5EmhlTo0HpQkNwtU0c6JQbpL9zHxWsmDq4XZUT3Tyx0A9E4oPjpfsuaLA/+hO9DMf5+p Epvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1kQcbD5T/5TiMWRdSkDljA3X6EOWVdjkrjBwlVUfRko=; b=3PA6+UF1GG0ALfl70soTx5ypD1wSBBloMi4yFQLft2kTCkvbcHORjTCDWQwuPoR/lS PhUg8ln7DXm7E8rkxqiRQH8fhsRHsopdVTVrVNeroZDpxdg0xxlZ7IRFdt4gAgrglza5 mh4dc8RSOYq+i2u9iTssAXToJ9p74AbBJFXAh+u/K6rzVP7ephyfU1d8GubR92ub4te/ Lx/5szIfXst2NjaM0e3a7QEf0p8dRtjx9YUdNUQs4k1jfpwxNdTvAzqlBUsZOBV6MxPp lzg2pvk8beieEmRU9t6yUuvIFgIkLciAKcpwIlTbm3xe8OUZT3W2vQ7iZ7n6gJ51kbAS 0g+w== X-Gm-Message-State: ACrzQf0142xfbT1utzf2aZcQcXMp19z4pUzhWV/0eAhBOPMPcLhT380B om6fwYAf4L8e/G+6/K8NX18= X-Google-Smtp-Source: AMsMyM6NKiSJ1q2hH9m2kcc1p0oeoS2xRv9tPdoxFFxizixhxLuB9aJNHd0pDAOFz/8sZA7py/gaEw== X-Received: by 2002:adf:e911:0:b0:236:73b7:e668 with SMTP id f17-20020adfe911000000b0023673b7e668mr25924899wrm.96.1667668396841; Sat, 05 Nov 2022 10:13:16 -0700 (PDT) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id ay15-20020a05600c1e0f00b003c6deb5c1edsm3083360wmb.45.2022.11.05.10.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Nov 2022 10:13:16 -0700 (PDT) From: luca.boccassi@gmail.com To: Jiawei Wang Cc: Viacheslav Ovsiienko , dpdk stable Subject: patch 'net/mlx5: fix tunnel header with IPIP offload' has been queued to stable release 20.11.7 Date: Sat, 5 Nov 2022 17:11:25 +0000 Message-Id: <20221105171146.1520039-26-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221105171146.1520039-1-luca.boccassi@gmail.com> References: <20221103092758.1099402-100-luca.boccassi@gmail.com> <20221105171146.1520039-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.7 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/07/22. 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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/5a8a4d8a8c445336bb67e8c1662a0f8d116b54c2 Thanks. Luca Boccassi --- >From 5a8a4d8a8c445336bb67e8c1662a0f8d116b54c2 Mon Sep 17 00:00:00 2001 From: Jiawei Wang Date: Thu, 20 Oct 2022 15:55:34 +0300 Subject: [PATCH] net/mlx5: fix tunnel header with IPIP offload [ upstream commit bfa87e21bdeadb48c0ad9ad6b360393c413be861 ] For the flows with multiple tunnel layers and containing tunnel decap and modify actions, for example: ... / vxlan / eth / ipv4 proto is 4 / end actions raw_decap / modify_field / ... (note: proto 4 means we have the IP-over-IP tunnel in VXLAN payload) We have added the multiple tunnel layers validation rejecting the flows like above mentioned one. The hardware supports the above match combination till the inner IP-over-IP header (not including the last one), both for IP-over-IPv4 and IP-over-IPv6, so we should not blindly reject. Also, for the modify actions following the decap we should set the layer attributes correctly. This patch reverts the below code changes to support the match, and adjusts the layers update in case of decap with outer tunnel header. Fixes: fa06906a48ee ("net/mlx5: fix IPIP multi-tunnel validation") Signed-off-by: Jiawei Wang Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 9893bac212..43fa595be1 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2217,7 +2217,7 @@ mlx5_flow_validate_item_ipv4(const struct rte_flow_item *item, RTE_FLOW_ERROR_TYPE_ITEM, item, "IPv4 cannot follow L2/VLAN layer " "which ether type is not IPv4"); - if (item_flags & MLX5_FLOW_LAYER_TUNNEL) { + if (item_flags & MLX5_FLOW_LAYER_IPIP) { if (mask && spec) next_proto = mask->hdr.next_proto_id & spec->hdr.next_proto_id; @@ -2325,7 +2325,7 @@ mlx5_flow_validate_item_ipv6(const struct rte_flow_item *item, "which ether type is not IPv6"); if (mask && mask->hdr.proto == UINT8_MAX && spec) next_proto = spec->hdr.proto; - if (item_flags & MLX5_FLOW_LAYER_TUNNEL) { + if (item_flags & MLX5_FLOW_LAYER_IPIP) { if (next_proto == IPPROTO_IPIP || next_proto == IPPROTO_IPV6) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 500ffaf013..f25ee9f92f 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -104,6 +104,7 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, struct mlx5_flow *dev_flow, bool tunnel_decap) { uint64_t layers = dev_flow->handle->layers; + bool tunnel_match = false; /* * If layers is already initialized, it means this dev_flow is the @@ -140,8 +141,10 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, case RTE_FLOW_ITEM_TYPE_GENEVE: case RTE_FLOW_ITEM_TYPE_MPLS: case RTE_FLOW_ITEM_TYPE_GTP: - if (tunnel_decap) + if (tunnel_decap) { attr->attr = 0; + tunnel_match = true; + } break; case RTE_FLOW_ITEM_TYPE_IPV4: if (!attr->ipv6) @@ -155,7 +158,8 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, ((const struct rte_flow_item_ipv4 *) (item->mask))->hdr.next_proto_id; if ((next_protocol == IPPROTO_IPIP || - next_protocol == IPPROTO_IPV6) && tunnel_decap) + next_protocol == IPPROTO_IPV6) && tunnel_decap && + !tunnel_match) attr->attr = 0; break; case RTE_FLOW_ITEM_TYPE_IPV6: @@ -170,7 +174,8 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, ((const struct rte_flow_item_ipv6 *) (item->mask))->hdr.proto; if ((next_protocol == IPPROTO_IPIP || - next_protocol == IPPROTO_IPV6) && tunnel_decap) + next_protocol == IPPROTO_IPV6) && tunnel_decap && + !tunnel_match) attr->attr = 0; break; case RTE_FLOW_ITEM_TYPE_UDP: -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-11-05 17:11:10.962629843 +0000 +++ 0026-net-mlx5-fix-tunnel-header-with-IPIP-offload.patch 2022-11-05 17:11:08.726943758 +0000 @@ -1 +1 @@ -From bfa87e21bdeadb48c0ad9ad6b360393c413be861 Mon Sep 17 00:00:00 2001 +From 5a8a4d8a8c445336bb67e8c1662a0f8d116b54c2 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit bfa87e21bdeadb48c0ad9ad6b360393c413be861 ] + @@ -25 +26,0 @@ -Cc: stable@dpdk.org @@ -35 +36 @@ -index 3aec121679..8e7d649d15 100644 +index 9893bac212..43fa595be1 100644 @@ -38 +39 @@ -@@ -2664,7 +2664,7 @@ mlx5_flow_validate_item_ipv4(const struct rte_flow_item *item, +@@ -2217,7 +2217,7 @@ mlx5_flow_validate_item_ipv4(const struct rte_flow_item *item, @@ -47 +48 @@ -@@ -2772,7 +2772,7 @@ mlx5_flow_validate_item_ipv6(const struct rte_flow_item *item, +@@ -2325,7 +2325,7 @@ mlx5_flow_validate_item_ipv6(const struct rte_flow_item *item, @@ -57 +58 @@ -index 6d8c155e45..1e52278191 100644 +index 500ffaf013..f25ee9f92f 100644 @@ -60 +61 @@ -@@ -128,6 +128,7 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, +@@ -104,6 +104,7 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, @@ -68 +69 @@ -@@ -164,8 +165,10 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, +@@ -140,8 +141,10 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, @@ -80 +81 @@ -@@ -179,7 +182,8 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, +@@ -155,7 +158,8 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, @@ -90 +91 @@ -@@ -194,7 +198,8 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr, +@@ -170,7 +174,8 @@ flow_dv_attr_init(const struct rte_flow_item *item, union flow_dv_attr *attr,