From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3420CA052B; Thu, 30 Jul 2020 04:02:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 31FF22BB9; Thu, 30 Jul 2020 04:02:08 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 32BBC2BB8 for ; Thu, 30 Jul 2020 04:02:06 +0200 (CEST) IronPort-SDR: lQZMle0yFm6qeExUzMvDZ8VZvlOZqrOmTm7jjYR2mFbSR3+kLm6Y7Gham+vbaW2FMwqnsL6/ar 7fSfJZIvKukA== X-IronPort-AV: E=McAfee;i="6000,8403,9697"; a="149360779" X-IronPort-AV: E=Sophos;i="5.75,412,1589266800"; d="scan'208";a="149360779" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jul 2020 19:02:04 -0700 IronPort-SDR: eR2u8jsW7lJKWTNwiRWrpJRtC/dwFAZEwANQnQAGg+1MGgnbgccfDENE/TiUIBMOnMSpcpUXcV DwDYnxfLVYwg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,412,1589266800"; d="scan'208";a="330590299" Received: from dpdk-yyzhang2.sh.intel.com ([10.67.117.61]) by orsmga007.jf.intel.com with ESMTP; 29 Jul 2020 19:02:02 -0700 From: Yuying Zhang To: dev@dpdk.org, olivier.matz@6wind.com, qi.z.zhang@intel.com, qiming.yang@intel.com Cc: Yuying Zhang , David Marchand Date: Thu, 30 Jul 2020 02:00:43 +0000 Message-Id: <20200730020043.17546-1-yuying.zhang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200728085531.204296-1-yuying.zhang@intel.com> References: <20200728085531.204296-1-yuying.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 1/1] net: fix bad checksum in offloaded TSOv6 packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The rte_net_intel_cksum_flags_prepare() function prepares the pseudoheader checksum in packet data when doing checksum or TSO offload. It does nothing when no checksum offload flag is set in mbuf. But in case of a IPv6/TCP TSO packet, it is not mandatory to have a checksum flag. We also need to check the PKT_TX_TCP_SEG flag in addition to checksum flags to fix offload preparation for such packets. Fixes: 520059a41aa9 ("net: check fragmented headers in non-debug as well") Signed-off-by: Yuying Zhang Acked-by: Olivier Matz Reviewed-by: David Marchand --- lib/librte_net/rte_net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h index 1edc283a4..94b06d9ee 100644 --- a/lib/librte_net/rte_net.h +++ b/lib/librte_net/rte_net.h @@ -125,7 +125,7 @@ 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))) + if (!(ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_L4_MASK | PKT_TX_TCP_SEG))) return 0; if (ol_flags & (PKT_TX_OUTER_IPV4 | PKT_TX_OUTER_IPV6)) -- 2.25.1