From patchwork Thu Jan 12 09:31:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Zeng X-Patchwork-Id: 121885 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 5CD95423B5; Thu, 12 Jan 2023 10:28:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C4CD40156; Thu, 12 Jan 2023 10:28:36 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 42D6C400EF; Thu, 12 Jan 2023 10:28:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673515715; x=1705051715; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=0CF+3Ok8tqoMjzenwoS0hO7hL+lvqiGY2dDxf1faD1Y=; b=Dacyy42gaHfY/r5g+rCx07t8wz8b0PZaOCkTCXxbow43mxeF2Lu+PxqG J0y9Aivis2PClWVsThHdcxwwSI5ZwTjcdTVAuQPgazvav810abszEE6Y0 1fB7Zx2nj073+i2hCrcFAiBBuc0eMhdvTPqZcJ1TRXW2vSCWNn6WVdzro cCLUVdaa7nUKI21SCQvHHrhIDqRHcPyiIvSDiVQDh3WXXbtcG5QVnU6p5 9ByJDpqNzXWgze1mIVu4rj2ozhOuZ1DxknvxD/A3mXLTo8xPcsxbWV2O6 hoR2sF2pJ0XGmCVyufaIeLa1yuELI5yxTb+IWHDECi9llQwqtdt4N7xvu A==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="307178162" X-IronPort-AV: E=Sophos;i="5.96,319,1665471600"; d="scan'208";a="307178162" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 01:28:26 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="651068541" X-IronPort-AV: E=Sophos;i="5.96,319,1665471600"; d="scan'208";a="651068541" Received: from unknown (HELO localhost.localdomain) ([10.239.252.103]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 01:28:20 -0800 From: Zhichao Zeng To: dev@dpdk.org Cc: stable@dpdk.org, yidingx.zhou@intel.com, Zhichao Zeng , Jingjing Wu , Beilei Xing , Declan Doherty , Abhijit Sinha , Radu Nicolau Subject: [PATCH] net/iavf: fix building data desc Date: Thu, 12 Jan 2023 17:31:51 +0800 Message-Id: <20230112093151.868142-1-zhichaox.zeng@intel.com> X-Mailer: git-send-email 2.25.1 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 Build correct data desc for UFO pkt by adding UDP_SEG flag, and disable L4 checksum offload when TSO/UFO is enabled to prevent the MDD. Fixes: 1e728b01120c ("net/iavf: rework Tx path") Cc: stable@dpdk.org Signed-off-by: Zhichao Zeng Acked-by: Qi Zhang --- drivers/net/iavf/iavf_rxtx.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index 8d49967538..3d9224b38d 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -2619,10 +2619,21 @@ iavf_build_data_desc_cmd_offset_fields(volatile uint64_t *qw1, offset |= (m->l3_len >> 2) << IAVF_TX_DESC_LENGTH_IPLEN_SHIFT; } - if (m->ol_flags & RTE_MBUF_F_TX_TCP_SEG) { - command |= IAVF_TX_DESC_CMD_L4T_EOFT_TCP; + if (m->ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) { + if (m->ol_flags & RTE_MBUF_F_TX_TCP_SEG) + command |= IAVF_TX_DESC_CMD_L4T_EOFT_TCP; + else + command |= IAVF_TX_DESC_CMD_L4T_EOFT_UDP; offset |= (m->l4_len >> 2) << IAVF_TX_DESC_LENGTH_L4_FC_LEN_SHIFT; + + *qw1 = rte_cpu_to_le_64((((uint64_t)command << + IAVF_TXD_DATA_QW1_CMD_SHIFT) & IAVF_TXD_DATA_QW1_CMD_MASK) | + (((uint64_t)offset << IAVF_TXD_DATA_QW1_OFFSET_SHIFT) & + IAVF_TXD_DATA_QW1_OFFSET_MASK) | + ((uint64_t)l2tag1 << IAVF_TXD_DATA_QW1_L2TAG1_SHIFT)); + + return; } /* Enable L4 checksum offloads */