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 EECA9A0C54; Fri, 3 Sep 2021 13:05:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B493140E3C; Fri, 3 Sep 2021 13:05:43 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id ED14B40E2D for ; Fri, 3 Sep 2021 13:05:41 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10095"; a="217532400" X-IronPort-AV: E=Sophos;i="5.85,265,1624345200"; d="scan'208";a="217532400" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Sep 2021 04:05:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,265,1624345200"; d="scan'208";a="689602638" Received: from silpixa00400884.ir.intel.com ([10.243.22.82]) by fmsmga006.fm.intel.com with ESMTP; 03 Sep 2021 04:05:40 -0700 From: Radu Nicolau To: Olivier Matz Cc: dev@dpdk.org, Radu Nicolau , Declan Doherty Date: Fri, 3 Sep 2021 11:59:42 +0100 Message-Id: <20210903105942.265501-1-radu.nicolau@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net: add support for UDP segmentation case 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 Sender: "dev" Add support to the ipv4/ipv6 pseudo-header function when TSO is enabled in the UDP case, eg PKT_TX_UDP_SEG is set in the mbuf ol_flags Signed-off-by: Declan Doherty Signed-off-by: Radu Nicolau --- lib/net/rte_ip.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h index 05948b69b7..c916ec1b09 100644 --- a/lib/net/rte_ip.h +++ b/lib/net/rte_ip.h @@ -333,7 +333,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 & PKT_TX_TCP_SEG) { + if (ol_flags & (PKT_TX_TCP_SEG | PKT_TX_UDP_SEG)) { psd_hdr.len = 0; } else { l3_len = rte_be_to_cpu_16(ipv4_hdr->total_length); @@ -474,7 +474,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 & PKT_TX_TCP_SEG) { + if (ol_flags & (PKT_TX_TCP_SEG | PKT_TX_UDP_SEG)) { psd_hdr.len = 0; } else { psd_hdr.len = ipv6_hdr->payload_len; -- 2.25.1