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 28638A0C43 for ; Thu, 22 Jul 2021 21:56:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16EFF40DF5; Thu, 22 Jul 2021 21:56:13 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id D7D9C40040; Thu, 22 Jul 2021 21:56:10 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 6349A3200970; Thu, 22 Jul 2021 15:56:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 22 Jul 2021 15:56:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= JeqcNzLBqTmQPqv6hF0ylFKkL5/GfbfHeeZJep/SX4s=; b=SLF8vyZWYeTiOkp2 2iGIKyktMp3yyAbm53nnVjT7Bvy0FZXgBkCbtXqnp5hMiNqdwMktzPO+dLoiOWPe 5Jit3RXgosdwwrpEavIJpEvpaT4hU3epGjL/MWdUIqAy1NcpqzcUjRU501r3tpBX oWGyPaANVR7CAkb5WGBg53CErnO0W9LYXFcSed6puw54IkPHoSPjv/OrtJ13K8FX kIJ+gFbQ8cCj/lo1oJ3DyfyRBcwBc/mvwbQQkqgTYmY3SRBIY7pODsV38XXzmf++ mLCeQxNTiLaJXizdwznuLRFTURrqGk5PLaxwtpvhxfkJjI7EA3Jkp4ZzWxmzv7iE HduKpw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=JeqcNzLBqTmQPqv6hF0ylFKkL5/GfbfHeeZJep/SX 4s=; b=H8/Dx3BDoRMOGBu4Is2Q14EE8ifzjVrBoExAIxVaf2RBQ9GocIqxWtdJt eiAE6NtxsGj4uNe0bXI90uP/YCPd6DEdCufNMw1QO39sZMeKqAziE5Bnb0TPsFoh SlU+46I/SuQqBx6sMQsR23AVf8xkd0w5el6EWynTfiVbdII3qiYGlnNL37Dd/z4H FGB3T3tE5UwgkiTqIWADWgAnuHcvdEb1m0B/nTA+ntj+oP3/BEyK0tnV3DO6qJ5d TXOvV0ulfxYSd04RSNA+o2vorfSwVmm9bPy8EpwrpBWmWJDewIo0Xa+ragUrhSKN cFfBDLO0CM45X2o1+s8iAzyxmXorA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrfeeigddufeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 22 Jul 2021 15:56:07 -0400 (EDT) From: Thomas Monjalon To: Mohsin Kazmi Cc: dev@dpdk.org, stable@dpdk.org, olivier.matz@6wind.com, david.marchand@redhat.com, maxime.coquelin@redhat.com, andrew.rybchenko@oktetlabs.ru, ferruh.yigit@intel.com Date: Thu, 22 Jul 2021 21:56:25 +0200 Message-ID: <7265315.64hUE0sMR9@thomas> In-Reply-To: <20210707094019.40945-1-mohsin.kazmi14@gmail.com> References: <20210630110404.21209-1-mohsin.kazmi14@gmail.com> <20210707094019.40945-1-mohsin.kazmi14@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-stable] [PATCH v3] net: fix Intel-specific Prepare the outer ipv4 hdr for checksum 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 Sender: "stable" +Cc more people for reviews. 07/07/2021 11:40, Mohsin Kazmi: > Preparation the headers for the hardware offload > misses the outer ipv4 checksum offload. > It results in bad checksum computed by hardware NIC. > > This patch fixes the issue by setting the outer ipv4 > checksum field to 0. nit: please write "IPv4" here and below. > Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation") > Cc: stable@dpdk.org > > Signed-off-by: Mohsin Kazmi > Acked-by: Qi Zhang [...] > @@ -125,11 +125,22 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) > * Mainly it is required to avoid fragmented headers check if > * no offloads are requested. > */ > - if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG))) > + if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG | > + PKT_TX_OUTER_IP_CKSUM))) > return 0; > > - if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6)) > + if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6)) { > inner_l3_offset += m->outer_l2_len + m->outer_l3_len; > + /* > + * prepare outer ipv4 header checksum by setting it to 0, > + * in order to be computed by hardware NICs. > + */ > + if (ol_flags & PKT_TX_OUTER_IP_CKSUM) { > + ipv4_hdr = rte_pktmbuf_mtod_offset(m, > + struct rte_ipv4_hdr *, m->outer_l2_len); > + ipv4_hdr->hdr_checksum = 0; > + } > + }