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 5F15942CAC; Wed, 14 Jun 2023 04:31:26 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D652140DDB; Wed, 14 Jun 2023 04:31:25 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 6D6F240A7D; Wed, 14 Jun 2023 04:31:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686709884; x=1718245884; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=33o0+cUbG+RlCSJEjRAUmig6KRpf4ngDKHVorM4f3ww=; b=a9bCl/AwlKUqCIF9l6gYZmjuJ+deSo0hDCx/Zc2S2XKxEB9IhHDeeBYV s7p2hb1xqdQ7KbD7cBqT6M32NuG1tFvfEo3AT5g6PPe/71Atv2ExPqyOy now2UPqmXVxCFFafgBdsiM/SwYjPi7h7HdrJzEX2NCH5GElAP9NaJAyyk AhBOdllVad1Ni8kkMcrpBnassIkn9l78ShWOJPHIAv1d77WIXDul5cGcj bKRKYzlyuINJT9/U/Q1sEvmPpY5oON0cgCiHDekqW94TTbNycFkDFUMfX i24ldTMCY0u3dtWAP35P7mmOFxFIxHHkR1u4ZC14O5RBcK59aVwbudeiB Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="343196106" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="343196106" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2023 19:31:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10740"; a="711879566" X-IronPort-AV: E=Sophos;i="6.00,241,1681196400"; d="scan'208";a="711879566" Received: from unknown (HELO root..) ([10.239.252.115]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2023 19:31:05 -0700 From: Shiyang He To: dev@dpdk.org Cc: yidingx.zhou@intel.com, Shiyang He , stable@dpdk.org, Yuying Zhang , Beilei Xing , Zhe Tao , Jianfeng Tan Subject: [PATCH] net/i40e: fix tunnel packet TX descriptor error Date: Wed, 14 Jun 2023 09:59:03 +0000 Message-Id: <20230614095947.57801-1-shiyangx.he@intel.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 The TX descriptor of tunnel packet filled incorrectly due to the MACLEN is not set. This patch fixes this issue by setting MACLEN to correctly fill the TX descriptor. Fixes: c59faf3fe8fe ("net/i40e: support TSO on tunneling packet") Cc: stable@dpdk.org Signed-off-by: Shiyang He --- drivers/net/i40e/i40e_rxtx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index fbbefb5015..b4f65b58fa 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -304,10 +304,7 @@ i40e_txd_enable_checksum(uint64_t ol_flags, union i40e_tx_offload tx_offload) { /* Set MACLEN */ - if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) - *td_offset |= (tx_offload.outer_l2_len >> 1) - << I40E_TX_DESC_LENGTH_MACLEN_SHIFT; - else + if (!(ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK)) *td_offset |= (tx_offload.l2_len >> 1) << I40E_TX_DESC_LENGTH_MACLEN_SHIFT; @@ -1171,9 +1168,12 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) /* Fill in tunneling parameters if necessary */ cd_tunneling_params = 0; - if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) + if (ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) { + td_offset |= (tx_offload.outer_l2_len >> 1) + << I40E_TX_DESC_LENGTH_MACLEN_SHIFT; i40e_parse_tunneling_params(ol_flags, tx_offload, &cd_tunneling_params); + } /* Enable checksum offloading */ if (ol_flags & I40E_TX_CKSUM_OFFLOAD_MASK) i40e_txd_enable_checksum(ol_flags, &td_cmd, -- 2.37.2