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 377FFA00C2 for ; Tue, 8 Mar 2022 15:16:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 332BB406B4; Tue, 8 Mar 2022 15:16:19 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 356394068B for ; Tue, 8 Mar 2022 15:16:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646748977; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lnk4RH8IWhCvnKAsHm0e2VxEvonmb9EdG5Dz60cJlS8=; b=PIgpwEQ6+i8PIq1UqJfgjU22/mc7UN3jVQwC10LglsaTUd9qyDegPHQS9bYSIKecYa7kZj O8nvy7fXrhRoqwm74T22lJ8jZ1wWNVPkmO6+xfgJ5pJsZMeJV4SsA6jG+3IORoeAgoii6D bpW1qBc0PKdapYq6PNvdZ4xNdkVQcms= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-482-T0Ydqmm-OAWsfcEUbGVAjA-1; Tue, 08 Mar 2022 09:16:12 -0500 X-MC-Unique: T0Ydqmm-OAWsfcEUbGVAjA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C8F01854E21; Tue, 8 Mar 2022 14:16:11 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.190]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1762884034; Tue, 8 Mar 2022 14:16:09 +0000 (UTC) From: Kevin Traynor To: Kevin Liu Cc: Ting Xu , Qi Zhang , dpdk stable Subject: patch 'net/ice: fix Tx offload path choice' has been queued to stable release 21.11.1 Date: Tue, 8 Mar 2022 14:14:46 +0000 Message-Id: <20220308141500.286915-31-ktraynor@redhat.com> In-Reply-To: <20220308141500.286915-1-ktraynor@redhat.com> References: <20220308141500.286915-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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 21.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/14/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/50e654bee488260ee53bfab105563b1fed20226e Thanks. Kevin --- >From 50e654bee488260ee53bfab105563b1fed20226e Mon Sep 17 00:00:00 2001 From: Kevin Liu Date: Wed, 29 Dec 2021 09:37:01 +0000 Subject: [PATCH] net/ice: fix Tx offload path choice [ upstream commit d852fec1be63126bb2c16be187340eb89a3d8a32 ] Testpmd forwards packets in checksum mode that it needs to calculate the checksum of each layer's protocol. When setting the hardware calculates the outer UDP checksum and the software calculates the outer IP checksum, the dev->tx_pkt_burst in ice_set_tx_function is set to ice_xmit_pkts_vec_avx2. The inner and outer UDP checksum of the tunnel packet after forwarding is wrong.The dev->tx_pkt_burst should be set to ice_xmit_pkts. The patch adds RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM to ICE_TX_NO_VECTOR_FLAGS, set dev->tx_pkt_burst to ice_xmit_pkts. After the tunnel packet is forwarded, the inner and outer UDP checksum is correct. At the same time, the patch of "net/ice: fix Tx Checksum offload" will cause interrupt errors in a special case that only inner IP and inner UDP checksum are set for hardware calculation. The patch is updating ICE_TX_NO_VECTOR_FLAGS, the problem can be solved, so I will restore the code modification of that patch. Fixes: 28f9002ab67f ("net/ice: add Tx AVX512 offload path") Fixes: 295968d17407 ("ethdev: add namespace") Fixes: 17c7d0f9d6a4 ("net/ice: support basic Rx/Tx") Signed-off-by: Kevin Liu Acked-by: Ting Xu Reviewed-by: Qi Zhang --- drivers/net/ice/ice_rxtx.c | 41 ++++++------------- drivers/net/ice/ice_rxtx_vec_common.h | 57 +++++++++------------------ 2 files changed, 30 insertions(+), 68 deletions(-) diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 4f218bcd0d..041f4bc91f 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -2502,33 +2502,16 @@ ice_txd_enable_checksum(uint64_t ol_flags, /* Enable L3 checksum offloads */ - /*Tunnel package usage outer len enable L3 checksum offload*/ - if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) { - if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { - *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; - *td_offset |= (tx_offload.outer_l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { - *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4; - *td_offset |= (tx_offload.outer_l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { - *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6; - *td_offset |= (tx_offload.outer_l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } - } else { - if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { - *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; - *td_offset |= (tx_offload.l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { - *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4; - *td_offset |= (tx_offload.l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { - *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6; - *td_offset |= (tx_offload.l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } + if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { + *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; + *td_offset |= (tx_offload.l3_len >> 2) << + ICE_TX_DESC_LEN_IPLEN_S; + } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { + *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4; + *td_offset |= (tx_offload.l3_len >> 2) << + ICE_TX_DESC_LEN_IPLEN_S; + } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { + *td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6; + *td_offset |= (tx_offload.l3_len >> 2) << + ICE_TX_DESC_LEN_IPLEN_S; } diff --git a/drivers/net/ice/ice_rxtx_vec_common.h b/drivers/net/ice/ice_rxtx_vec_common.h index 8ff01046e1..2dd2d83650 100644 --- a/drivers/net/ice/ice_rxtx_vec_common.h +++ b/drivers/net/ice/ice_rxtx_vec_common.h @@ -251,5 +251,6 @@ ice_rxq_vec_setup_default(struct ice_rx_queue *rxq) RTE_ETH_TX_OFFLOAD_MULTI_SEGS | \ RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM | \ - RTE_ETH_TX_OFFLOAD_TCP_TSO) + RTE_ETH_TX_OFFLOAD_TCP_TSO | \ + RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM) #define ICE_TX_VECTOR_OFFLOAD ( \ @@ -365,43 +366,21 @@ ice_txd_enable_offload(struct rte_mbuf *tx_pkt, /* Tx Checksum Offload */ - /*Tunnel package usage outer len enable L2/L3 checksum offload*/ - if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) { - /* SET MACLEN */ - td_offset |= (tx_pkt->outer_l2_len >> 1) << - ICE_TX_DESC_LEN_MACLEN_S; + /* SET MACLEN */ + td_offset |= (tx_pkt->l2_len >> 1) << + ICE_TX_DESC_LEN_MACLEN_S; - /* Enable L3 checksum offload */ - if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { - td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; - td_offset |= (tx_pkt->outer_l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { - td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4; - td_offset |= (tx_pkt->outer_l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { - td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6; - td_offset |= (tx_pkt->outer_l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } - } else { - /* SET MACLEN */ - td_offset |= (tx_pkt->l2_len >> 1) << - ICE_TX_DESC_LEN_MACLEN_S; - - /* Enable L3 checksum offload */ - if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { - td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; - td_offset |= (tx_pkt->l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { - td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4; - td_offset |= (tx_pkt->l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { - td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6; - td_offset |= (tx_pkt->l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } + /* Enable L3 checksum offload */ + if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { + td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; + td_offset |= (tx_pkt->l3_len >> 2) << + ICE_TX_DESC_LEN_IPLEN_S; + } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { + td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4; + td_offset |= (tx_pkt->l3_len >> 2) << + ICE_TX_DESC_LEN_IPLEN_S; + } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { + td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6; + td_offset |= (tx_pkt->l3_len >> 2) << + ICE_TX_DESC_LEN_IPLEN_S; } -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-03-08 13:55:29.190254911 +0000 +++ 0031-net-ice-fix-Tx-offload-path-choice.patch 2022-03-08 13:55:28.504315185 +0000 @@ -1 +1 @@ -From d852fec1be63126bb2c16be187340eb89a3d8a32 Mon Sep 17 00:00:00 2001 +From 50e654bee488260ee53bfab105563b1fed20226e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit d852fec1be63126bb2c16be187340eb89a3d8a32 ] + @@ -29 +30,0 @@ -Cc: stable@dpdk.org