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 001A8A04A4 for ; Fri, 4 Mar 2022 04:32:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2DA0427A3; Fri, 4 Mar 2022 04:32:09 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 1203E4013F; Fri, 4 Mar 2022 04:32:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646364727; x=1677900727; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=B2mQJgmn+99FA+5prfQ77JB8VDYRElJ0J5+eg/bwUWk=; b=WYMuVI7TgFh+gy0JrGy32nn0puBBnarZW4SzLDZmzytc/lPRDoomHbiI alP/HozZb1EMvcKDrJCQm07axd4qtO0xEIwBY4z0oGrob2B9O5wrZXgH1 XhE35EgME5Ou14YVPVdP+0vaWGIOA56GUtgWX96f5WIdixbnLqghY7wN0 eNPDziLl35fV2jdHq8qguCrt1jjeJholt6S5PvpmzKR/ug+P2/+hv4IuL XgptmstTu6Omlmd6y5niQdCUTCJuCxbmk/YG1E9/YE52esMgsJNUlXdnw K7bvwjK9MISOQBZWf1uMa63AKSFtwhcElvAc+vd3GW8mwo9D1XDDzk5T8 A==; X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="340316583" X-IronPort-AV: E=Sophos;i="5.90,154,1643702400"; d="scan'208";a="340316583" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 19:31:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,154,1643702400"; d="scan'208";a="779507905" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga006.fm.intel.com with ESMTP; 03 Mar 2022 19:31:58 -0800 Received: from shsmsx603.ccr.corp.intel.com (10.109.6.143) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 3 Mar 2022 19:31:58 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX603.ccr.corp.intel.com (10.109.6.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Fri, 4 Mar 2022 11:31:56 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.2308.021; Fri, 4 Mar 2022 11:31:56 +0800 From: "Zhang, Qi Z" To: "Xu, Ting" , "Liu, KevinX" , "dev@dpdk.org" CC: "Yang, Qiming" , "Yang, SteveX" , "Yigit, Ferruh" , "Liu, KevinX" , "stable@dpdk.org" Subject: RE: [PATCH v2 1/2] net/ice: fix Tx offload path choice Thread-Topic: [PATCH v2 1/2] net/ice: fix Tx offload path choice Thread-Index: AQHYLFMilfWRVNMRwEW2mzs52nOb66yuDosAgACJhfA= Date: Fri, 4 Mar 2022 03:31:56 +0000 Message-ID: <894899b025bc41a29aeff249740a7f92@intel.com> References: <20211224150925.3296471-1-kevinx.liu@intel.com> <20211229093702.1930214-1-kevinx.liu@intel.com> <20211229093702.1930214-2-kevinx.liu@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.401.20 dlp-product: dlpe-windows x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 > -----Original Message----- > From: Xu, Ting > Sent: Friday, March 4, 2022 11:19 AM > To: Liu, KevinX ; dev@dpdk.org > Cc: Yang, Qiming ; Zhang, Qi Z > ; Yang, SteveX ; Yigit, Ferr= uh > ; Liu, KevinX ; stable@dpdk= .org > Subject: RE: [PATCH v2 1/2] net/ice: fix Tx offload path choice >=20 > > -----Original Message----- > > From: Kevin Liu > > Sent: Wednesday, December 29, 2021 5:37 PM > > To: dev@dpdk.org > > Cc: Yang, Qiming ; Zhang, Qi Z > > ; Yang, SteveX ; Yigit, > > Ferruh ; Liu, KevinX ; > > stable@dpdk.org > > Subject: [PATCH v2 1/2] net/ice: fix Tx offload path choice > > > > 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 cor= rect. > > > > 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") > > Cc: stable@dpdk.org > > > > Signed-off-by: Kevin Liu > > --- > > drivers/net/ice/ice_rxtx.c | 41 ++++++------------- > > drivers/net/ice/ice_rxtx_vec_common.h | 59 > > +++++++++------------------ > > 2 files changed, 31 insertions(+), 69 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 > > @@ -2501,35 +2501,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 & RTE_MBUF_F_TX_TUNNEL_MASK) { > > - if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { > > - *td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; > > - *td_offset |=3D (tx_offload.outer_l3_len >> 2) << > > - ICE_TX_DESC_LEN_IPLEN_S; > > - } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { > > - *td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV4; > > - *td_offset |=3D (tx_offload.outer_l3_len >> 2) << > > - ICE_TX_DESC_LEN_IPLEN_S; > > - } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { > > - *td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV6; > > - *td_offset |=3D (tx_offload.outer_l3_len >> 2) << > > - ICE_TX_DESC_LEN_IPLEN_S; > > - } > > - } else { > > - if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { > > - *td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; > > - *td_offset |=3D (tx_offload.l3_len >> 2) << > > - ICE_TX_DESC_LEN_IPLEN_S; > > - } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { > > - *td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV4; > > - *td_offset |=3D (tx_offload.l3_len >> 2) << > > - ICE_TX_DESC_LEN_IPLEN_S; > > - } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { > > - *td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV6; > > - *td_offset |=3D (tx_offload.l3_len >> 2) << > > - ICE_TX_DESC_LEN_IPLEN_S; > > - } > > + if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { > > + *td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; > > + *td_offset |=3D (tx_offload.l3_len >> 2) << > > + ICE_TX_DESC_LEN_IPLEN_S; > > + } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { > > + *td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV4; > > + *td_offset |=3D (tx_offload.l3_len >> 2) << > > + ICE_TX_DESC_LEN_IPLEN_S; > > + } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { > > + *td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV6; > > + *td_offset |=3D (tx_offload.l3_len >> 2) << > > + ICE_TX_DESC_LEN_IPLEN_S; > > } > > > > 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 =3D 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 |=3D (tx_pkt->outer_l2_len >> 1) << > > - ICE_TX_DESC_LEN_MACLEN_S; > > - > > - /* Enable L3 checksum offload */ > > - if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { > > - td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; > > - td_offset |=3D (tx_pkt->outer_l3_len >> 2) << > > - ICE_TX_DESC_LEN_IPLEN_S; > > - } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { > > - td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV4; > > - td_offset |=3D (tx_pkt->outer_l3_len >> 2) << > > - ICE_TX_DESC_LEN_IPLEN_S; > > - } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { > > - td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV6; > > - td_offset |=3D (tx_pkt->outer_l3_len >> 2) << > > - ICE_TX_DESC_LEN_IPLEN_S; > > - } > > - } else { > > - /* SET MACLEN */ > > - td_offset |=3D (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 |=3D ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; > > - td_offset |=3D (tx_pkt->l3_len >> 2) << > > - ICE_TX_DESC_LEN_IPLEN_S; > > - } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { > > - td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV4; > > - td_offset |=3D (tx_pkt->l3_len >> 2) << > > - ICE_TX_DESC_LEN_IPLEN_S; > > - } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { > > - td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV6; > > - td_offset |=3D (tx_pkt->l3_len >> 2) << > > - ICE_TX_DESC_LEN_IPLEN_S; > > - } > > + /* SET MACLEN */ > > + td_offset |=3D (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 |=3D ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; > > + td_offset |=3D (tx_pkt->l3_len >> 2) << > > + ICE_TX_DESC_LEN_IPLEN_S; > > + } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { > > + td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV4; > > + td_offset |=3D (tx_pkt->l3_len >> 2) << > > + ICE_TX_DESC_LEN_IPLEN_S; > > + } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { > > + td_cmd |=3D ICE_TX_DESC_CMD_IIPT_IPV6; > > + td_offset |=3D (tx_pkt->l3_len >> 2) << > > + ICE_TX_DESC_LEN_IPLEN_S; > > } > > > > /* Enable L4 checksum offloads */ > > -- > > 2.33.1 >=20 > Acked-by: Ting Xu Applied to dpdk-next-net-intel. Thanks Qi