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 D111DA0093 for ; Wed, 9 Mar 2022 17:31:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C829D4013F; Wed, 9 Mar 2022 17:31:51 +0100 (CET) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mails.dpdk.org (Postfix) with ESMTP id 4E79F410E8 for ; Wed, 9 Mar 2022 17:31:50 +0100 (CET) Received: by mail-wr1-f41.google.com with SMTP id j17so3999527wrc.0 for ; Wed, 09 Mar 2022 08:31:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q7lFTvVpbzENzL6eL3EaDoqIk7LJesNHM5UMbMivFF0=; b=Xb7m6bbZx3xPgOWOwUMkfBn8SH1Ue+2AgLgenTmhwcsQIknHUcZH05yp/lZVJ2opW8 +6f2Yi5gzjG27SE1w8RWu0yMc6uOBv8eS3aPEK189Oz7D0t4LrkXQQoJcdLqpYyahfoM klk5f17g6s2d2v2Ny6Aqjb3eV8J0i3HWFiqsMidaWs1TTgycv9KN96lPcPEM6ym9AskI 0a9kOvtFTdaLWrTwnPf31M9syE8eC/rtP/WYBmVfh1dCIoK40cMf8sEbpA+7f5eKKfoe KZoSprZoj4epZpb2DWS9142kO0Bq5ZRgzB4aHmyKiTJmY8YdgZrWZG8ECBw8nBSM2WI6 I+yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q7lFTvVpbzENzL6eL3EaDoqIk7LJesNHM5UMbMivFF0=; b=tvqEPVqHJ0HwxlRb/kNY/se8ekqmn2qx7Gpt7jJJIekTEcIzd+Qfwi3ba+r6ZSwg5p KabS1CBwXU3UwE9oVZByK0Qs5pb6AreK0fBH1ijIND7zhNE3yqRnLWoDHvO3AAz0lflS /ThH8ysE2Ld8ZEg7F2Nr053BGEQi14B0L73NrsbnFixasoGsrULijr0sFB97bQ4+v2LD VbyqZYJ5jPeWA2Bddm6mBokXMGX0YKQsZd+WiAzZdyM9wTDENolDmvsI6hDLy1RUE1Zd EcLkSbQBhFcaXEN0p+7xrHKzwI5st91BEpojtd3j+bj4VD/JRwLwzPfZm00+IDa36R8S 0K+A== X-Gm-Message-State: AOAM530uFNFx0OjK0Gjf4Jg8lVRNuxM+jFOAoPikW43D0oYGi7nAgRDJ 122vFXuMiyKDQwpoQ26kdjvInXsqIzw= X-Google-Smtp-Source: ABdhPJx8WEG5vlQu3ju0cs1es5S/xZT9Uw9+malTYwUw26oExA64p75lXWb8smFP450nWCA96oYp3w== X-Received: by 2002:a05:6000:1888:b0:203:75c0:c438 with SMTP id a8-20020a056000188800b0020375c0c438mr313302wri.469.1646843509994; Wed, 09 Mar 2022 08:31:49 -0800 (PST) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id z2-20020a056000110200b001e7140ddb44sm2056563wrw.49.2022.03.09.08.31.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Mar 2022 08:31:48 -0800 (PST) From: luca.boccassi@gmail.com 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 20.11.5 Date: Wed, 9 Mar 2022 16:30:34 +0000 Message-Id: <20220309163053.245754-18-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220309163053.245754-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-1-luca.boccassi@gmail.com> <20220309163053.245754-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.5 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/11/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/0b46c9cad7db070e720e3319d0329a6597be4401 Thanks. Luca Boccassi --- >From 0b46c9cad7db070e720e3319d0329a6597be4401 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 +++++++++++--------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 97cbeb2cf5..edd21f0401 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -2354,35 +2354,18 @@ ice_txd_enable_checksum(uint64_t ol_flags, << ICE_TX_DESC_LEN_MACLEN_S; /* Enable L3 checksum offloads */ - /*Tunnel package usage outer len enable L3 checksum offload*/ - if (ol_flags & PKT_TX_TUNNEL_MASK) { - if (ol_flags & PKT_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 & PKT_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 & PKT_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 & PKT_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 & PKT_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 & PKT_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 & PKT_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 & PKT_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 & PKT_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 & PKT_TX_TCP_SEG) { -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-03-09 16:30:09.208483171 +0000 +++ 0018-net-ice-fix-Tx-offload-path-choice.patch 2022-03-09 16:30:08.543025064 +0000 @@ -1 +1 @@ -From d852fec1be63126bb2c16be187340eb89a3d8a32 Mon Sep 17 00:00:00 2001 +From 0b46c9cad7db070e720e3319d0329a6597be4401 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit d852fec1be63126bb2c16be187340eb89a3d8a32 ] + @@ -29 +30,0 @@ -Cc: stable@dpdk.org @@ -35,3 +36,2 @@ - drivers/net/ice/ice_rxtx.c | 41 ++++++------------- - drivers/net/ice/ice_rxtx_vec_common.h | 57 +++++++++------------------ - 2 files changed, 30 insertions(+), 68 deletions(-) + drivers/net/ice/ice_rxtx.c | 41 +++++++++++--------------------------- + 1 file changed, 12 insertions(+), 29 deletions(-) @@ -40 +40 @@ -index 4f218bcd0d..041f4bc91f 100644 +index 97cbeb2cf5..edd21f0401 100644 @@ -43 +43 @@ -@@ -2501,35 +2501,18 @@ ice_txd_enable_checksum(uint64_t ol_flags, +@@ -2354,35 +2354,18 @@ ice_txd_enable_checksum(uint64_t ol_flags, @@ -48,2 +48,2 @@ -- if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) { -- if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { +- if (ol_flags & PKT_TX_TUNNEL_MASK) { +- if (ol_flags & PKT_TX_IP_CKSUM) { @@ -53 +53 @@ -- } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { +- } else if (ol_flags & PKT_TX_IPV4) { @@ -57 +57 @@ -- } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { +- } else if (ol_flags & PKT_TX_IPV6) { @@ -63 +63 @@ -- if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { +- if (ol_flags & PKT_TX_IP_CKSUM) { @@ -67 +67 @@ -- } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { +- } else if (ol_flags & PKT_TX_IPV4) { @@ -71 +71 @@ -- } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { +- } else if (ol_flags & PKT_TX_IPV6) { @@ -76 +76 @@ -+ if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { ++ if (ol_flags & PKT_TX_IP_CKSUM) { @@ -80 +80 @@ -+ } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { ++ } else if (ol_flags & PKT_TX_IPV4) { @@ -84 +84 @@ -+ } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { ++ } else if (ol_flags & PKT_TX_IPV6) { @@ -90,77 +90 @@ - if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) { -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 -@@ -250,7 +250,8 @@ ice_rxq_vec_setup_default(struct ice_rx_queue *rxq) - #define ICE_TX_NO_VECTOR_FLAGS ( \ - 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 ( \ - RTE_ETH_TX_OFFLOAD_VLAN_INSERT | \ -@@ -364,45 +365,23 @@ ice_txd_enable_offload(struct rte_mbuf *tx_pkt, - uint32_t td_offset = 0; - - /* 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; - } - - /* Enable L4 checksum offloads */ + if (ol_flags & PKT_TX_TCP_SEG) {