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 10F15A0093; Thu, 9 Dec 2021 12:03:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D65540F35; Thu, 9 Dec 2021 12:03:31 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id B9385406FF for ; Wed, 8 Dec 2021 10:20:11 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10191"; a="237600827" X-IronPort-AV: E=Sophos;i="5.87,297,1631602800"; d="scan'208";a="237600827" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2021 01:20:10 -0800 X-IronPort-AV: E=Sophos;i="5.87,297,1631602800"; d="scan'208";a="502980786" Received: from dpdk.cd.intel.com (HELO intel-cd-odc-kevin.cd.intel.com) ([10.240.178.210]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2021 01:20:08 -0800 From: Kevin Liu To: dev@dpdk.org Cc: qiming.yang@intel.com, qi.z.zhang@intel.com, stevex.yang@intel.com, Kevin Liu Subject: [PATCH] net/ice: fix error forwarding IPv6 VXLAN packet Date: Wed, 8 Dec 2021 09:13:32 +0000 Message-Id: <20211208091332.84838-1-kevinx.liu@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Thu, 09 Dec 2021 12:03:29 +0100 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org In ice_txd_enable_offload(), when set tunnel packet Tx checksum offload enable, td_offset should be set with outer l2/l3 len instead of inner l2/l3 len. This patch fix the bug that the checksum engine can forward tunnle packets. Fixes: 28f9002ab67f ("net/ice: add Tx AVX512 offload path") Signed-off-by: Kevin Liu --- drivers/net/ice/ice_rxtx_vec_common.h | 52 +++++++++++++++++++-------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/drivers/net/ice/ice_rxtx_vec_common.h b/drivers/net/ice/ice_rxtx_vec_common.h index dfe60c81d9..8ff01046e1 100644 --- a/drivers/net/ice/ice_rxtx_vec_common.h +++ b/drivers/net/ice/ice_rxtx_vec_common.h @@ -364,23 +364,45 @@ ice_txd_enable_offload(struct rte_mbuf *tx_pkt, uint32_t td_offset = 0; /* Tx Checksum Offload */ - /* SET MACLEN */ - td_offset |= (tx_pkt->l2_len >> 1) << + /*Tunnel package usage outer len enable L2/L3 checksum offload*/ + if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) { + /* SET MACLEN */ + td_offset |= (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 |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; - td_offset |= (tx_pkt->l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { - td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4; - td_offset |= (tx_pkt->l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; - } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { - td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6; - td_offset |= (tx_pkt->l3_len >> 2) << - ICE_TX_DESC_LEN_IPLEN_S; + /* Enable L3 checksum offload */ + if (ol_flags & RTE_MBUF_F_TX_IP_CKSUM) { + td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; + td_offset |= (tx_pkt->outer_l3_len >> 2) << + ICE_TX_DESC_LEN_IPLEN_S; + } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { + td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4; + td_offset |= (tx_pkt->outer_l3_len >> 2) << + ICE_TX_DESC_LEN_IPLEN_S; + } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { + td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6; + td_offset |= (tx_pkt->outer_l3_len >> 2) << + ICE_TX_DESC_LEN_IPLEN_S; + } + } else { + /* SET MACLEN */ + td_offset |= (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 |= ICE_TX_DESC_CMD_IIPT_IPV4_CSUM; + td_offset |= (tx_pkt->l3_len >> 2) << + ICE_TX_DESC_LEN_IPLEN_S; + } else if (ol_flags & RTE_MBUF_F_TX_IPV4) { + td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV4; + td_offset |= (tx_pkt->l3_len >> 2) << + ICE_TX_DESC_LEN_IPLEN_S; + } else if (ol_flags & RTE_MBUF_F_TX_IPV6) { + td_cmd |= ICE_TX_DESC_CMD_IIPT_IPV6; + td_offset |= (tx_pkt->l3_len >> 2) << + ICE_TX_DESC_LEN_IPLEN_S; + } } /* Enable L4 checksum offloads */ -- 2.25.1