Linux-HyperV List
 help / color / mirror / Atom feed
From: Joe Damato <joe@dama.to>
To: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Cc: netdev@vger.kernel.org, Haiyang Zhang <haiyangz@microsoft.com>,
	Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Wei Hu <weh@microsoft.com>,
	Konstantin Taranov <kotaranov@microsoft.com>,
	Willem de Bruijn <willemb@google.com>,
	Simon Horman <horms@kernel.org>,
	linux-hyperv@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH net-next] net: mana: add UDP segmentation offload support
Date: Tue, 1 Dec 2026 09:36:02 -0800	[thread overview]
Message-ID: <aw8FgmiM7MUFcwSt@devvm20253.cco0.facebook.com> (raw)
In-Reply-To: <20261130231409.2567518-1-hamzamahfooz@linux.microsoft.com>

On Mon, Nov 30, 2026 at 06:14:09PM -0500, Hamza Mahfooz wrote:
> The hardware segments both TCP and UDP. In LSO mode it takes the L4
> protocol from the parsed header, rewrites the IP total/payload length,
> the IPv4 ID and the UDP length of each segment, and computes the L4
> checksum from scratch. However, it reports a non-fatal error if neither
> the TCP nor the UDP checksum offload bit is set in the TX OOB.
> 
> Advertise NETIF_F_GSO_UDP_L4 and, for SKB_GSO_UDP_L4 skbs, set
> comp_udp_csum instead of comp_tcp_csum and seed the UDP checksum
> rather than the TCP one. Everything else, including the header size
> calculation in mana_get_gso_hs(), is shared with TSO.
> 
> Advertise this change to the PF with the new driver capability flag
> GDMA_DRV_CAP_FLAG_1_UDP_SEGMENTATION_OFFLOAD.
> 
> Tested between two Azure Standard_E372is_v7 VMs on different hosts,
> where the MANA device is the VM's only network interface. The changes
> below are relative to the same kernel with tx-udp-segmentation turned
> off.
> 
> udpgso_bench_tx, one sender pinned to a CPU, 61600 byte sends split
> into 1400 byte segments, median of three 10 second runs:
> 
>                  throughput  CPU per byte
>   IPv4                +307%          -84%
>   IPv6                +348%          -84%
>   IPv4 zerocopy       +498%          -80%
>   IPv6 zerocopy       +190%          -79%
> 
> CPU is the user plus system time of the sending process. With USO a
> single sender is no longer CPU bound. Its throughput varied widely,
> both within and between runs, but its CPU time per byte did not.
> 
> With 8 IPv4 senders, each on its own core, the total throughput went
> up by 432% while the senders' CPU usage went down by 51%. With the
> default 212992 byte send buffer, a socket can only have about three
> such sends in flight, so the rate also depends on TX completion
> latency. With net.core.wmem_default raised to 4 MiB, 8, 16 and 32
> senders all came close to the VMs' network limit, with 604% to 656%
> more throughput than software GSO.
> 
> Uploads with msquic's secnetperf (which uses UDP_SEGMENT):
> 
>                  throughput  CPU per byte
>   1 connection         +39%          -48%
>   8 connections       +104%          -56%
> 
> IPv6 results were similar. Sending without GSO is unaffected.
> 
> NOTE: netvsc does not advertise NETIF_F_GSO_UDP_L4. On VMs with
> accelerated networking, where traffic goes through the netvsc device
> and is then passed to the VF, UDP GSO packets are therefore still
> segmented in software until netvsc supports USO as well. Where the
> MANA device is the VM's network interface, as in the tests above,
> this patch is enough.
> 
> Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
> ---
>  drivers/net/ethernet/microsoft/mana/mana_en.c | 26 ++++++++++++-------
>  include/net/mana/gdma.h                       |  6 ++++-
>  2 files changed, 22 insertions(+), 10 deletions(-)
>

Did you run uso.py from the selftests? Asking because it wasn't mentioned and
it might be worth running if you already have the test environment setup. You
might want to run it from the latest net-next because I recently added small
MSS size tests.

Other than the nit above about running the selftests, I spent a bit of time
reading the patch and it looks vaguely right to me with the caveat that I am
not super familiar with this driver, but:

Reviewed-by: Joe Damato <joe@dama.to>

      reply	other threads:[~2026-12-01 17:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 23:14 [PATCH net-next] net: mana: add UDP segmentation offload support Hamza Mahfooz
2026-12-01 17:36 ` Joe Damato [this message]

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=aw8FgmiM7MUFcwSt@devvm20253.cco0.facebook.com \
    --to=joe@dama.to \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@kernel.org \
    --cc=haiyangz@microsoft.com \
    --cc=hamzamahfooz@linux.microsoft.com \
    --cc=horms@kernel.org \
    --cc=kotaranov@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=weh@microsoft.com \
    --cc=wei.liu@kernel.org \
    --cc=willemb@google.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