From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
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 <dev@dpdk.org>; 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 <yuying.zhang@intel.com>
To: dev@dpdk.org, olivier.matz@6wind.com, qi.z.zhang@intel.com,
 qiming.yang@intel.com
Cc: Yuying Zhang <yuying.zhang@intel.com>,
 David Marchand <david.marchand@redhat.com>
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

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 <yuying.zhang@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 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