From patchwork Mon Nov 23 07:05:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murphy Yang X-Patchwork-Id: 84456 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 32D56A04B1; Mon, 23 Nov 2020 08:07:58 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B6A9E37AF; Mon, 23 Nov 2020 08:07:55 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id B811E375B for ; Mon, 23 Nov 2020 08:07:52 +0100 (CET) IronPort-SDR: /ReG18NKb4RsN6K4VYJgNvy0aguqISV2Syc2y3YVKra8HMYAogAalvrE8CbAzryTl8pakB1hFx MDMg5hcIJzjQ== X-IronPort-AV: E=McAfee;i="6000,8403,9813"; a="235856666" X-IronPort-AV: E=Sophos;i="5.78,361,1599548400"; d="scan'208";a="235856666" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2020 23:07:50 -0800 IronPort-SDR: bWBPv+euodCMVE6B4QWVFIEoRFl8GKG+pCfnxBl2urntasTmEDHQJHczGyaE7DE9XajUO+b9r1 PV2d+OSiSbmw== X-IronPort-AV: E=Sophos;i="5.78,361,1599548400"; d="scan'208";a="546300797" Received: from unknown (HELO intel-npg-odc-srv02.cd.intel.com) ([10.240.178.186]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2020 23:07:48 -0800 From: Murphy Yang To: dev@dpdk.org Cc: qiming.yang@intel.com, qi.z.zhang@intel.com, stevex.yang@intel.com, Murphy Yang Date: Mon, 23 Nov 2020 07:05:23 +0000 Message-Id: <20201123070523.21661-1-murphyx.yang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] net/ice: fix outer UDP Tx offload checksum error 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" If enable hardware outer UDP TX offload checksum, it doesn't take effect when send 'IPv6/UDP/VXLAN' packet with error outer UDP checksum. In order to take effect, set the 'L4T_CS' flag valid only when 'L4TUNT' equals one and 'EIPT' is not zero. If 'L4T_CS' flag marked, the hardware can calculate the outer tunneling UDP checksum. Fixes: bd70c451532c ("net/ice: support Tx checksum offload for tunnel") Signed-off-by: Murphy Yang Tested-by: Xie,WeiX < weix.xie@intel.com> Acked-by: Qi Zhang --- drivers/net/ice/ice_rxtx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 5fbd68eafc..9769e216bf 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -2319,8 +2319,11 @@ ice_parse_tunneling_params(uint64_t ol_flags, *cd_tunneling |= (tx_offload.l2_len >> 1) << ICE_TXD_CTX_QW0_NATLEN_S; - if ((ol_flags & PKT_TX_OUTER_UDP_CKSUM) && - (ol_flags & PKT_TX_OUTER_IP_CKSUM) && + /** + * Calculate the tunneling UDP checksum. + * Shall be set only if L4TUNT = 01b and EIPT is not zero + */ + if (!(*cd_tunneling & ICE_TX_CTX_EIPT_NONE) && (*cd_tunneling & ICE_TXD_CTX_UDP_TUNNELING)) *cd_tunneling |= ICE_TXD_CTX_QW0_L4T_CS_M; }