On Tue, Dec 01, 2026 at 09:36:02AM -0800, Joe Damato wrote:
> 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 <hamz…@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.
>
I reran uso.py on the current HEAD of net-next FWIW and it's passing all
8/8 test cases.
Hamza
> 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 <j…@dama.to>