From patchwork Thu Apr 13 05:34:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Zeng X-Patchwork-Id: 125976 X-Patchwork-Delegate: ferruh.yigit@amd.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 6BF4E4292D; Thu, 13 Apr 2023 07:28:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 58F04410F9; Thu, 13 Apr 2023 07:28:50 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id E939541138 for ; Thu, 13 Apr 2023 07:28:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681363729; x=1712899729; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=aAZ0hSZcRdhXB5GYGEwWYmWnEFzg/16oR/iwOv1yHik=; b=GXKQKbehSupZKDiEUD2R+1/YFeWVYysrkBsmUa4MtJIlPx9yvDEPOnj9 QwEiWCRVdjeME+wcTwGSTTrr00FcMIzuTWYn3ujCqw4eDoZkYXDozTSqL /bVEUcFpjlKou4oPJ/kCQSzA3HvRuw3nFXKi29hNG+ESS/qzFsHKNp/XQ 5ADYEJ/mP1j2oxsp1hdlafyN15tSC09iVbYodyHMoqZB/EkT9Ix3N8lGo 8Er2qCLJjAEd2Y4BiY6yq5TYWL9R5zcmlhZ2gTWfONHEZT78FyeijIcXg c5pGPOYA0Ew0mknEQAOoXCYUpDS+SnYM4Y5oxblnVqybaC38kbm39EKgK g==; X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="406929372" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="406929372" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 22:28:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="691793578" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="691793578" Received: from unknown (HELO localhost.localdomain) ([10.239.252.103]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 22:28:43 -0700 From: Zhichao Zeng To: dev@dpdk.org Cc: qi.z.zhang@intel.com, ke1.xu@intel.com, Zhichao Zeng , Olivier Matz Subject: [PATCH 1/4] net: calculate correct UDP pseudo header for UFO Date: Thu, 13 Apr 2023 13:34:00 +0800 Message-Id: <20230413053401.4190743-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 This commit calculates the correct pseudo header for the UDP fragmentation offload by adding UDP_SEG flag. Signed-off-by: Zhichao Zeng Acked-by: Olivier Matz --- lib/net/rte_ip.h | 4 ++-- lib/net/rte_net.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h index a310e9d498..8073c8e889 100644 --- a/lib/net/rte_ip.h +++ b/lib/net/rte_ip.h @@ -345,7 +345,7 @@ rte_ipv4_phdr_cksum(const struct rte_ipv4_hdr *ipv4_hdr, uint64_t ol_flags) psd_hdr.dst_addr = ipv4_hdr->dst_addr; psd_hdr.zero = 0; psd_hdr.proto = ipv4_hdr->next_proto_id; - if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) { + if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) { psd_hdr.len = 0; } else { l3_len = rte_be_to_cpu_16(ipv4_hdr->total_length); @@ -596,7 +596,7 @@ rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags) } psd_hdr; psd_hdr.proto = (uint32_t)(ipv6_hdr->proto << 24); - if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) { + if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) { psd_hdr.len = 0; } else { psd_hdr.len = ipv6_hdr->payload_len; diff --git a/lib/net/rte_net.h b/lib/net/rte_net.h index 56611fc8f9..ef3ff4c6fd 100644 --- a/lib/net/rte_net.h +++ b/lib/net/rte_net.h @@ -121,7 +121,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) * no offloads are requested. */ if (!(ol_flags & (RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_L4_MASK | RTE_MBUF_F_TX_TCP_SEG | - RTE_MBUF_F_TX_OUTER_IP_CKSUM))) + RTE_MBUF_F_TX_UDP_SEG | RTE_MBUF_F_TX_OUTER_IP_CKSUM))) return 0; if (ol_flags & (RTE_MBUF_F_TX_OUTER_IPV4 | RTE_MBUF_F_TX_OUTER_IPV6)) { @@ -154,7 +154,8 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) ipv4_hdr->hdr_checksum = 0; } - if ((ol_flags & RTE_MBUF_F_TX_L4_MASK) == RTE_MBUF_F_TX_UDP_CKSUM) { + if ((ol_flags & RTE_MBUF_F_TX_L4_MASK) == RTE_MBUF_F_TX_UDP_CKSUM || + (ol_flags & RTE_MBUF_F_TX_UDP_SEG)) { if (ol_flags & RTE_MBUF_F_TX_IPV4) { udp_hdr = (struct rte_udp_hdr *)((char *)ipv4_hdr + m->l3_len); From patchwork Thu Apr 13 05:34:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Zeng X-Patchwork-Id: 125977 X-Patchwork-Delegate: ferruh.yigit@amd.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 2EC984292D; Thu, 13 Apr 2023 07:29:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F3C740A84; Thu, 13 Apr 2023 07:29:14 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 771F04021F for ; Thu, 13 Apr 2023 07:29:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681363752; x=1712899752; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=0v2NOwzsmh3xEp9n1wmsiAA3IbkAYWCXwfEa6D0800Y=; b=Agb9OK7kHIhIcBh1h8O4AnT/DDFw4Xd24RdnXdNjuVfhcLmZGv85e3zI sfgIYZb90EmnUyqNYvL9vKUgAPBFSVBRXOiabNjlCvcTWUUtnCRYkDpiV C2YgQL3L7aJ2z05zbJ7qsQOaV3CNQdbS8T2CbcyMjK2wXXLvylLRRshUL FiwW9LxQ9wFWagKnPws5wa52ufq0WusT6ryyDoH88Z7fcEc8gwiRBiL0t Gi2Uctdi+N9MfZxNJ5Ry3dYswDMhcMsQZFK6nWZutfNFCM3xh+a532F2P ryIUlgteIxqzx004lKDzgDyd0/xdpaujpQshhfJnz+chjRapNkjXRhGu8 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="328205319" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="328205319" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 22:29:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="753832947" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="753832947" Received: from unknown (HELO localhost.localdomain) ([10.239.252.103]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 22:29:08 -0700 From: Zhichao Zeng To: dev@dpdk.org Cc: qi.z.zhang@intel.com, ke1.xu@intel.com, Zhichao Zeng , Aman Singh , Yuying Zhang Subject: [PATCH 2/4] app/testpmd: support UFO in checksum engine Date: Thu, 13 Apr 2023 13:34:26 +0800 Message-Id: <20230413053426.4190965-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 This commit supports UFO for both non-tunnel and tunneled packets. Similar to TSO, the command "tso set " or "tunnel_tso set " is used to enable UFO, and the following conditions need to be met: a. The NIC supports UFO; b. For enabling UFO in tunnel packets, "csum parse_tunnel" must be set to recognize tunnel packets; c. For IPv4 tunnel packets, "csum set outer-ip" must be set to hw, because UFO changes the total_len of the external IP header and the checksum calculated by SW becomes incorrect; This is not necessary for IPv6 tunnel packets since there's no checksum field to fill in. Signed-off-by: Zhichao Zeng Acked-by: Aman Singh --- app/test-pmd/csumonly.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index fc85c22a77..062eb09b36 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -505,7 +505,9 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info, udp_hdr = (struct rte_udp_hdr *)((char *)l3_hdr + info->l3_len); /* do not recalculate udp cksum if it was 0 */ if (udp_hdr->dgram_cksum != 0) { - if (tx_offloads & RTE_ETH_TX_OFFLOAD_UDP_CKSUM) { + if (tso_segsz) + ol_flags |= RTE_MBUF_F_TX_UDP_SEG; + else if (tx_offloads & RTE_ETH_TX_OFFLOAD_UDP_CKSUM) { ol_flags |= RTE_MBUF_F_TX_UDP_CKSUM; } else { if (info->is_tunnel) @@ -590,8 +592,10 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info, udp_hdr = (struct rte_udp_hdr *) ((char *)outer_l3_hdr + info->outer_l3_len); - if (tso_enabled) + if (tso_enabled && info->l4_proto == IPPROTO_TCP) ol_flags |= RTE_MBUF_F_TX_TCP_SEG; + else if (tso_enabled && info->l4_proto == IPPROTO_UDP) + ol_flags |= RTE_MBUF_F_TX_UDP_SEG; /* Skip SW outer UDP checksum generation if HW supports it */ if (tx_offloads & RTE_ETH_TX_OFFLOAD_OUTER_UDP_CKSUM) { @@ -991,7 +995,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) if (info.is_tunnel == 1) { tx_ol_flags |= process_outer_cksums(outer_l3_hdr, &info, tx_offloads, - !!(tx_ol_flags & RTE_MBUF_F_TX_TCP_SEG), + !!(tx_ol_flags & (RTE_MBUF_F_TX_TCP_SEG | + RTE_MBUF_F_TX_UDP_SEG)), m); } @@ -1083,11 +1088,13 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) m->outer_l2_len, m->outer_l3_len); if (info.tunnel_tso_segsz != 0 && - (m->ol_flags & RTE_MBUF_F_TX_TCP_SEG)) + (m->ol_flags & (RTE_MBUF_F_TX_TCP_SEG | + RTE_MBUF_F_TX_UDP_SEG))) printf("tx: m->tso_segsz=%d\n", m->tso_segsz); } else if (info.tso_segsz != 0 && - (m->ol_flags & RTE_MBUF_F_TX_TCP_SEG)) + (m->ol_flags & (RTE_MBUF_F_TX_TCP_SEG | + RTE_MBUF_F_TX_UDP_SEG))) printf("tx: m->tso_segsz=%d\n", m->tso_segsz); rte_get_tx_ol_flag_list(m->ol_flags, buf, sizeof(buf)); printf("tx: flags=%s", buf); From patchwork Thu Apr 13 05:34:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Zeng X-Patchwork-Id: 125978 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 A5EA04292D; Thu, 13 Apr 2023 07:29:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 939B1427EE; Thu, 13 Apr 2023 07:29:36 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 0586A410F9 for ; Thu, 13 Apr 2023 07:29:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681363775; x=1712899775; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Y89bEIcRMBwDhCiS3LfVels3LleT9yda1TJVbzbRQrA=; b=OEA4rS2+NcsIp0rP9QV2MEp/SjxTd2bCnh9ZZDu1xFYCFIolbPgCfj4x Ptp8FF/Sc+24nwT3KXN++wz/jwJ7Lea7UuC/ImK66slAOuT3ZBY5f2p3c FSHzWSsoWQ3tDCBu9MmyBIz7TQtQN9klCTQFInRZYzc42fpD/gr1C+aw6 qWlLc9NmCd/hWUpnhafZKubGgmPnBVWK5W5QjXxggMyxUpblQa9AKB+tD 86QT95MeYyhiIDvdaCfvXFKkuwOi+yYX9LyhaELzrIzT3NfHtSrqwAs/7 plID6d+VZNL41gP/RcPFT9c4jf3PR1HWlDuB4tbt/wmigs96MY2Mqreg4 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="328205338" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="328205338" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 22:29:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="753832991" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="753832991" Received: from unknown (HELO localhost.localdomain) ([10.239.252.103]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 22:29:27 -0700 From: Zhichao Zeng To: dev@dpdk.org Cc: qi.z.zhang@intel.com, ke1.xu@intel.com, Zhichao Zeng , Qiming Yang Subject: [PATCH 3/4] net/ice: enable UDP fragmentation offload Date: Thu, 13 Apr 2023 13:34:45 +0800 Message-Id: <20230413053445.4191148-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 This commit enables transmit segmentation offload for UDP, including both non-tunneled and tunneled packets. The command "tso set " or "tunnel_tso set " is used to enable UFO. Signed-off-by: Zhichao Zeng Acked-by: Qi Zhang --- drivers/net/ice/ice_rxtx.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 0ea0045836..ed4d27389a 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -12,6 +12,7 @@ #define ICE_TX_CKSUM_OFFLOAD_MASK (RTE_MBUF_F_TX_IP_CKSUM | \ RTE_MBUF_F_TX_L4_MASK | \ RTE_MBUF_F_TX_TCP_SEG | \ + RTE_MBUF_F_TX_UDP_SEG | \ RTE_MBUF_F_TX_OUTER_IP_CKSUM) /** @@ -2767,6 +2768,13 @@ ice_txd_enable_checksum(uint64_t ol_flags, return; } + if (ol_flags & RTE_MBUF_F_TX_UDP_SEG) { + *td_cmd |= ICE_TX_DESC_CMD_L4T_EOFT_UDP; + *td_offset |= (tx_offload.l4_len >> 2) << + ICE_TX_DESC_LEN_L4_LEN_S; + return; + } + /* Enable L4 checksum offloads */ switch (ol_flags & RTE_MBUF_F_TX_L4_MASK) { case RTE_MBUF_F_TX_TCP_CKSUM: @@ -2858,6 +2866,7 @@ static inline uint16_t ice_calc_context_desc(uint64_t flags) { static uint64_t mask = RTE_MBUF_F_TX_TCP_SEG | + RTE_MBUF_F_TX_UDP_SEG | RTE_MBUF_F_TX_QINQ | RTE_MBUF_F_TX_OUTER_IP_CKSUM | RTE_MBUF_F_TX_TUNNEL_MASK | @@ -2966,7 +2975,7 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) * the mbuf data size exceeds max data size that hw allows * per tx desc. */ - if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) + if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) nb_used = (uint16_t)(ice_calc_pkt_desc(tx_pkt) + nb_ctx); else @@ -3026,7 +3035,7 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) txe->mbuf = NULL; } - if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) + if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) cd_type_cmd_tso_mss |= ice_set_tso_ctx(tx_pkt, tx_offload); else if (ol_flags & RTE_MBUF_F_TX_IEEE1588_TMST) @@ -3066,7 +3075,7 @@ ice_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) slen = m_seg->data_len; buf_dma_addr = rte_mbuf_data_iova(m_seg); - while ((ol_flags & RTE_MBUF_F_TX_TCP_SEG) && + while ((ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) && unlikely(slen > ICE_MAX_DATA_PER_TXD)) { txd->buf_addr = rte_cpu_to_le_64(buf_dma_addr); txd->cmd_type_offset_bsz = From patchwork Thu Apr 13 05:35:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Zeng X-Patchwork-Id: 125979 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 07B534292D; Thu, 13 Apr 2023 07:29:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EA20B41153; Thu, 13 Apr 2023 07:29:53 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 1113342B8E for ; Thu, 13 Apr 2023 07:29:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681363792; x=1712899792; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=LqEVedGhU6NTzIn4YA6m4vtNCqBUlyUjwGac+ieSAmY=; b=QLkVcykgYb35397SKpAp4fozYV7OjY/5qyVvCDEpemOTMDMWUEMxInlL n2c4XGf+vH95LdJ5Dn0hF4rMkSQRYNy6dhcV1a5sDGiS46MH8YlbJN48t 1lqeDS0fx3akkXgt55KBjhox1VDsrV4ugiAcYrkDCLftHLZhLgO/cPY7t P4uxPWa2kJmYVO0NObiwkRH0Iummb/k+D67pUqdEOt0DCSS67YRZ2+P8H GMAuPeJV2Nu26uy08mk0AzSknNl91ZCsJ5olUk0wzW7Zo0ASQdsKAADVL KJmFoCKEK2IXSig1H3RnZDRu2WuuRdz+vjbAwIgmuxyATKoWALmP60ZxP A==; X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="409240724" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="409240724" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 22:29:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="813244880" X-IronPort-AV: E=Sophos;i="5.98,339,1673942400"; d="scan'208";a="813244880" Received: from unknown (HELO localhost.localdomain) ([10.239.252.103]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2023 22:29:48 -0700 From: Zhichao Zeng To: dev@dpdk.org Cc: qi.z.zhang@intel.com, ke1.xu@intel.com, Zhichao Zeng , Jingjing Wu , Beilei Xing Subject: [PATCH 4/4] net/iavf: enable UDP fragmentation offload Date: Thu, 13 Apr 2023 13:35:06 +0800 Message-Id: <20230413053506.4191340-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 This commit enables transmit segmentation offload for UDP, including both non-tunneled and tunneled packets. The command "tso set " or "tunnel_tso set " is used to enable UFO. Signed-off-by: Zhichao Zeng Tested-by: Ke Xu Acked-by: Qi Zhang --- drivers/net/iavf/iavf_rxtx.c | 2 +- drivers/net/iavf/iavf_rxtx.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index b1d0fbceb6..8eca8aba3e 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -3622,7 +3622,7 @@ iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts, ol_flags = m->ol_flags; /* Check condition for nb_segs > IAVF_TX_MAX_MTU_SEG. */ - if (!(ol_flags & RTE_MBUF_F_TX_TCP_SEG)) { + if (!(ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG))) { if (m->nb_segs > IAVF_TX_MAX_MTU_SEG) { rte_errno = EINVAL; return i; diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h index 09e2127db0..5096868d87 100644 --- a/drivers/net/iavf/iavf_rxtx.h +++ b/drivers/net/iavf/iavf_rxtx.h @@ -73,6 +73,7 @@ RTE_MBUF_F_TX_IP_CKSUM | \ RTE_MBUF_F_TX_L4_MASK | \ RTE_MBUF_F_TX_TCP_SEG | \ + RTE_MBUF_F_TX_UDP_SEG | \ RTE_MBUF_F_TX_OUTER_IP_CKSUM | \ RTE_MBUF_F_TX_OUTER_UDP_CKSUM) @@ -85,6 +86,7 @@ RTE_MBUF_F_TX_IP_CKSUM | \ RTE_MBUF_F_TX_L4_MASK | \ RTE_MBUF_F_TX_TCP_SEG | \ + RTE_MBUF_F_TX_UDP_SEG | \ RTE_MBUF_F_TX_TUNNEL_MASK | \ RTE_MBUF_F_TX_OUTER_IP_CKSUM | \ RTE_MBUF_F_TX_OUTER_UDP_CKSUM | \