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 1DC6843337 for ; Wed, 15 Nov 2023 12:46:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 179A240A79; Wed, 15 Nov 2023 12:46:04 +0100 (CET) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) by mails.dpdk.org (Postfix) with ESMTP id 07CA440A79 for ; Wed, 15 Nov 2023 12:46:03 +0100 (CET) Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2c50cf61f6dso93178801fa.2 for ; Wed, 15 Nov 2023 03:46:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700048762; x=1700653562; darn=dpdk.org; 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=D48LvBXxNAFO9hH5wqoWnDvqA46HZjDZ2wmwzWzX7UA=; b=Keo7z2/u1YGugatYD+3hAMAgEZiErmwgm/UWxPWWLPxWg3iI+4NIiqMhL9oTz7rwh1 V6zuJljAagP9h9pOqsOXB/LwX1O7gi6CjZfB89aF1jqUZ3osf8Ntx0URvrlYJJvXzuJZ j9uSpRO9hTfqhol98CwZQdj/mP6UsIDVu3MzAIsoK+0KH03C3x2TgvyK78DVTzUM1Jpa tKXwgqyuwbYl2v6Rc0jNa4vk58xaoXkR8kKDF0Wza64vtXcOFzlDop4gK2nyQzzJ640k 80wY3ATzaLaDHXlEp8UEceK+y5tP2N0GcD3JT0FyPpNZfZxk5e8HR2GuWnjfkZm/GVqm xHwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700048762; x=1700653562; 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=D48LvBXxNAFO9hH5wqoWnDvqA46HZjDZ2wmwzWzX7UA=; b=deuEWNQrcPlfwvB2MieShZSJ4VN2juEzO78KBuAL1UZHXovbmDZ/orMPtyb8s0o7gN 1OVu8zHoMKEgE0F56EEt+qVJEqaVULcIwQEbMJtoWQQjJVJdFzWYiNt+eN49YGOhykFD m19n0S2iECLJ7NeO8PgX6/H8WBwGg7GGxlf07zUYOkA/7GPFDQB7EN3keJRgSNUxw1uC qDZQaz/QNeIS1per865wDPbJrs1Fbj2Ut8ND9H/7qpo31syiBF8ZWmbBTKpeZiuln8+9 ZKwItrPEfFbiD0bBGMWr7DzthQ5pkM6l8MmgXUzhyPR8RRt9FRcQFJ60+CCfLUgpBbn8 R7ng== X-Gm-Message-State: AOJu0YyxBmgm0GjV76ItgYA8dwrFWm1R7Mc6P1t78/+cR79c7rrKxaCI y0tUfYjAWCcLWlmlVvHj6K9wmEiAG11VEw== X-Google-Smtp-Source: AGHT+IHj9cmaHFwuyX1+2laKCf1xTpijVQ8C42gmW1WKWODY1vTS9nlsk+vb3rHF7z5vPLCz4njaTg== X-Received: by 2002:a05:651c:11c6:b0:2c6:f4e0:6d90 with SMTP id z6-20020a05651c11c600b002c6f4e06d90mr3582406ljo.37.1700048762327; Wed, 15 Nov 2023 03:46:02 -0800 (PST) Received: from localhost ([2a01:4b00:d307:1000:f1d3:eb5e:11f4:a7d9]) by smtp.gmail.com with ESMTPSA id i10-20020a05600c354a00b004053e9276easm20815375wmq.32.2023.11.15.03.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 03:46:01 -0800 (PST) From: luca.boccassi@gmail.com To: Eli Britstein Cc: Suanming Mou , dpdk stable Subject: patch 'net/mlx5: zero UDP checksum over IPv4 in encapsulation' has been queued to stable release 20.11.10 Date: Wed, 15 Nov 2023 11:45:14 +0000 Message-Id: <20231115114515.2355140-15-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231115114515.2355140-1-luca.boccassi@gmail.com> References: <20231108192535.922238-37-luca.boccassi@gmail.com> <20231115114515.2355140-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.10 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/17/23. 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/205f03481993e1c59929f52eac68e0c311427c20 Thanks. Luca Boccassi --- >From 205f03481993e1c59929f52eac68e0c311427c20 Mon Sep 17 00:00:00 2001 From: Eli Britstein Date: Mon, 13 Nov 2023 09:29:41 +0200 Subject: [PATCH] net/mlx5: zero UDP checksum over IPv4 in encapsulation [ upstream commit e407221d58ffdfd9b7c80f8e4fff99f67cdbd6e9 ] A zero UDP csum indicates it should not be validated by the receiver. The HW may not calculate UDP csum after encap. The cited commit made sure the UDP csum is zero for UDP over IPv6, mistakenly not handling UDP over IPv4. Fix it. Fixes: bf1d7d9a033a ("net/mlx5: zero out UDP checksum in encapsulation") Signed-off-by: Eli Britstein Acked-by: Suanming Mou --- drivers/net/mlx5/mlx5_flow_dv.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index c413da53d7..44ea28d229 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -3432,6 +3432,7 @@ flow_dv_zero_encap_udp_csum(void *data, struct rte_flow_error *error) { struct rte_ether_hdr *eth = NULL; struct rte_vlan_hdr *vlan = NULL; + struct rte_ipv4_hdr *ipv4 = NULL; struct rte_ipv6_hdr *ipv6 = NULL; struct rte_udp_hdr *udp = NULL; char *next_hdr; @@ -3448,24 +3449,27 @@ flow_dv_zero_encap_udp_csum(void *data, struct rte_flow_error *error) next_hdr += sizeof(struct rte_vlan_hdr); } - /* HW calculates IPv4 csum. no need to proceed */ - if (proto == RTE_ETHER_TYPE_IPV4) - return 0; - /* non IPv4/IPv6 header. not supported */ - if (proto != RTE_ETHER_TYPE_IPV6) { + if (proto != RTE_ETHER_TYPE_IPV4 && proto != RTE_ETHER_TYPE_IPV6) { return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "Cannot offload non IPv4/IPv6"); } - ipv6 = (struct rte_ipv6_hdr *)next_hdr; + if (proto == RTE_ETHER_TYPE_IPV4) { + ipv4 = (struct rte_ipv4_hdr *)next_hdr; + /* ignore non UDP */ + if (ipv4->next_proto_id != IPPROTO_UDP) + return 0; + udp = (struct rte_udp_hdr *)(ipv4 + 1); + } else { + ipv6 = (struct rte_ipv6_hdr *)next_hdr; + /* ignore non UDP */ + if (ipv6->proto != IPPROTO_UDP) + return 0; + udp = (struct rte_udp_hdr *)(ipv6 + 1); + } - /* ignore non UDP */ - if (ipv6->proto != IPPROTO_UDP) - return 0; - - udp = (struct rte_udp_hdr *)(ipv6 + 1); udp->dgram_cksum = 0; return 0; -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-11-15 11:44:14.241249877 +0000 +++ 0015-net-mlx5-zero-UDP-checksum-over-IPv4-in-encapsulatio.patch 2023-11-15 11:44:13.618388510 +0000 @@ -1 +1 @@ -From e407221d58ffdfd9b7c80f8e4fff99f67cdbd6e9 Mon Sep 17 00:00:00 2001 +From 205f03481993e1c59929f52eac68e0c311427c20 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e407221d58ffdfd9b7c80f8e4fff99f67cdbd6e9 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 9753af2cb1..115d730317 100644 +index c413da53d7..44ea28d229 100644 @@ -25 +26 @@ -@@ -4713,6 +4713,7 @@ flow_dv_zero_encap_udp_csum(void *data, struct rte_flow_error *error) +@@ -3432,6 +3432,7 @@ flow_dv_zero_encap_udp_csum(void *data, struct rte_flow_error *error) @@ -33 +34 @@ -@@ -4729,24 +4730,27 @@ flow_dv_zero_encap_udp_csum(void *data, struct rte_flow_error *error) +@@ -3448,24 +3449,27 @@ flow_dv_zero_encap_udp_csum(void *data, struct rte_flow_error *error)