From patchwork Tue Dec 13 01:45:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Zeng X-Patchwork-Id: 120781 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 mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2FD70A0540; Tue, 13 Dec 2022 02:42:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C61840684; Tue, 13 Dec 2022 02:42:23 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id D852840146 for ; Tue, 13 Dec 2022 02:42:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670895742; x=1702431742; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8bnk80RRMeKZPGTlqQ+cguDk32UlC+bZFxK5wAL6Mo4=; b=LuA0fWF5VkdSQHaWKbDdoifN/tJGFHdPbfMSxoCYv0w4vydsDij9Xi6s pNYoW3X5rL0hbEMBXS56NvVbsESHQ0Xp6XummAbVmIIUr1cO9NXuCf/qi SllwF5CG0c45zTP3bAPlAWCmDLTNKmgQnmFMXs2yV0bMfBApO6j8D7E4w Hp0N9prD7ZjYpFOJtR5/+ZbocwT2C/+zgWrwUPnfvCoJIf8AS7dsk8zBv HRY0cY8zSfBjef1TxrCOpRjtuButA80E6O/VLPKZJRBvk2soXeQebGeER aIF6ba7WZqoItg4aPyLZbN5nR+5BiDVWJYSmxxNAfXouWEkxL/W2Fgia8 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="318044410" X-IronPort-AV: E=Sophos;i="5.96,240,1665471600"; d="scan'208";a="318044410" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2022 17:42:20 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10559"; a="626115407" X-IronPort-AV: E=Sophos;i="5.96,240,1665471600"; d="scan'208";a="626115407" Received: from unknown (HELO localhost.localdomain) ([10.239.252.103]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2022 17:42:17 -0800 From: Zhichao Zeng To: dev@dpdk.org Cc: yidingx.zhou@intel.com, ke1.xu@intel.com, qi.z.zhang@intel.com, Zhichao Zeng , Jingjing Wu , Beilei Xing , Radu Nicolau Subject: [PATCH v2] net/iavf: fix outer udp checksum offload Date: Tue, 13 Dec 2022 09:45:11 +0800 Message-Id: <20221213014512.150575-1-zhichaox.zeng@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221118070316.198683-1-zhichaox.zeng@intel.com> References: <20221118070316.198683-1-zhichaox.zeng@intel.com> MIME-Version: 1.0 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 Currently, when dealing with UDP tunnel pkts checksum offloading, the outer-udp checksum will be offloaded by default. So the 'csum set outer-udp hw/sw' command does not work. This patch fixes judgment of the EIPT flag and enables the 'csum set outer-udp hw/sw' command by adding judgment for the outer-udp checksum offload flag. Fixes: 0c550022fb82 ("net/iavf: fix Tx descriptors for IPsec") Signed-off-by: Zhichao Zeng --- drivers/net/iavf/iavf_rxtx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index cf87a6beda..8d49967538 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -2453,8 +2453,11 @@ iavf_fill_ctx_desc_tunnelling_field(volatile uint64_t *qw0, * Calculate the tunneling UDP checksum. * Shall be set only if L4TUNT = 01b and EIPT is not zero */ - if (!(eip_typ & IAVF_TX_CTX_EXT_IP_NONE) && - (eip_typ & IAVF_TXD_CTX_UDP_TUNNELING)) + if ((eip_typ & (IAVF_TX_CTX_EXT_IP_IPV6 | + IAVF_TX_CTX_EXT_IP_IPV4 | + IAVF_TX_CTX_EXT_IP_IPV4_NO_CSUM)) && + (eip_typ & IAVF_TXD_CTX_UDP_TUNNELING) && + (m->ol_flags & RTE_MBUF_F_TX_OUTER_UDP_CKSUM)) eip_typ |= IAVF_TXD_CTX_QW0_L4T_CS_MASK; }