From: Olivier Matz <olivier.matz@6wind.com>
To: Zhichao Zeng <zhichaox.zeng@intel.com>
Cc: dev@dpdk.org, yidingx.zhou@intel.com
Subject: Re: [PATCH] lib/net: support UDP pseudo-header for UFO
Date: Fri, 10 Feb 2023 14:20:03 +0100 [thread overview]
Message-ID: <Y+ZEg7QzhOMJzIm8@platinum> (raw)
In-Reply-To: <20230112092608.868006-1-zhichaox.zeng@intel.com>
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 <zhichaox.zeng@intel.com>
> ---
> 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
next prev parent reply other threads:[~2023-02-10 13:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 9:26 Zhichao Zeng
2023-02-08 10:35 ` Zeng, ZhichaoX
2023-02-10 13:20 ` Olivier Matz [this message]
2023-02-13 10:22 ` Zeng, ZhichaoX
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y+ZEg7QzhOMJzIm8@platinum \
--to=olivier.matz@6wind.com \
--cc=dev@dpdk.org \
--cc=yidingx.zhou@intel.com \
--cc=zhichaox.zeng@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).