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 2673F41C61; Fri, 10 Feb 2023 14:20:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1224440EE6; Fri, 10 Feb 2023 14:20:07 +0100 (CET) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mails.dpdk.org (Postfix) with ESMTP id E6DC440687 for ; Fri, 10 Feb 2023 14:20:04 +0100 (CET) Received: by mail-wm1-f46.google.com with SMTP id f47-20020a05600c492f00b003dc584a7b7eso6260298wmp.3 for ; Fri, 10 Feb 2023 05:20:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=yE49wb8x1ZvBSSnDC/PI8U8leZMw33uVDITRfCP2pF4=; b=E2VFqCG0qU2Oe7IV/QXCyijsGaxGvyvJeRVeWgWzsYSMb0WjB0FxE72jkIAtrZEzJQ pWiA4ahcVEWPnkk2PuCWIBvpG592D3AibMlnZftoJbQvtkR7OHniKQAkJFpCNSm/A+eQ Pb3H+iZpmdK9HGZlrMSwSVTxZtPzN1TYa1sK7s+WYzwR+/OYpkM4jANkMJ7IEXBx4SMc fuqw12lQ1CXEF8v5bOmpkUvDlf8zOG9TfRY8OLZjwBHZN7Fh7HgBy+nYN495cN7ih+F5 cDAK2NOrKLG1UWh7eDvVkL/NuABWr51YyNv/DHFK6yoeEQWjhOC9StEIGudL4XfbTSDo bmtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=yE49wb8x1ZvBSSnDC/PI8U8leZMw33uVDITRfCP2pF4=; b=rSsk+LL1sZllGc7UaW6DVp0G1c5QCuqqcz40tHLekopyJxOslczLfWstwkQLJPyBYm 6LnJYQzEsApLHnisaPkReCtddJfrsX1FJyl1jq5GhIRtceeSXdD2tUNQe7hzNhC/9Osa o+YeimnRMy6dk6A0+p9r6KaLLa5GIh6KqZ7NUX84prWs6pUyFaU8l1Ll/5QXVyXfLuqF jb35N28ZQtG7nHTjleSBP1AjZDjiXnMyoKullRmvNM+gT3WgPUSok1GIw20XEDtBiaFj WMOpAAgmCzC34RGBqZMBnNEtv2C37QEpB7vZfbX0CYmUtBhfdtghWB7fRh2JFLvCjRRb r3Qw== X-Gm-Message-State: AO0yUKWeAkq+VxzFx5zDAYsL0h5VmC62Ya4GL4IliK9/59QhHxCzvurn URjJ/k9HH3iD8pT4LS4nnESn1w== X-Google-Smtp-Source: AK7set90PP3yThNvVyYx6dkJaVCrHHeWbY00EjTp5AtNjCr5Y+N6DGs5I6LixGhnK30TAYjtY4k51w== X-Received: by 2002:a05:600c:998:b0:3dc:59ee:7978 with SMTP id w24-20020a05600c099800b003dc59ee7978mr12745679wmp.38.1676035204642; Fri, 10 Feb 2023 05:20:04 -0800 (PST) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id t15-20020a05600c198f00b003ddc781b1d4sm5469365wmq.33.2023.02.10.05.20.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 05:20:04 -0800 (PST) Date: Fri, 10 Feb 2023 14:20:03 +0100 From: Olivier Matz To: Zhichao Zeng Cc: dev@dpdk.org, yidingx.zhou@intel.com Subject: Re: [PATCH] lib/net: support UDP pseudo-header for UFO Message-ID: References: <20230112092608.868006-1-zhichaox.zeng@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230112092608.868006-1-zhichaox.zeng@intel.com> 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 Hello Zhichao, Sorry for the delayed response. On Thu, Jan 12, 2023 at 05:26:08PM +0800, Zhichao Zeng wrote: > Add UDP pseudo-header processing for UDP segmentation offload > by adding the UDP_SEG flag. > > Signed-off-by: Zhichao Zeng > --- > lib/net/rte_ip.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h > index 9c8e8206f0..4761ede747 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); > -- > 2.25.1 > Can you give some more detail about how rte_ipv4_phdr_cksum() is called in your use-case? (what driver, what libs, what use-case) Currently, I see that only the iavf driver supports udp-segmented packets. The lib/vhost is also able to pass the offload information to the virtio ring. For me, the mbufs that have offload flags and that are being transmitted to a driver should use the rte_eth_tx_prepare() API. This function will (among other things) update the required checksums in the packet when Tx offload is set. Most drivers call rte_net_intel_cksum_flags_prepare() in their tx_pkt_prepare callback, so I suspect this function has to be updated. Note that updating it may have an impact on its user that supports UDP_SEG (lib/vhost and driver/net/iavf). I'm not saying that the patch is wrong, but I would like to better understand why you need it. Regards, Olivier