🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25416

Re: [PATCH net-next] net: mana: add UDP segmentation offload support

#25416
From: Hamza Mahfooz
Date: Tue, 01 Dec 2026 18:42
81 lines
11259 bytes
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 <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.
> 

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 <joe@dama.to>
Technical Details
Message-ID: <aw8VDAr3BotJogKN@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375297-linux-kernel-netdev=dewy.ru
References: <20261130231409.2567518-1-hamzamahfooz@linux.microsoft.com> <aw8FgmiM7MUFcwSt@devvm20253.cco0.facebook.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375297-linux-kernel-netdev=dewy.ru
From: hamza@kernel.org (Hamza Mahfooz)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next] net: mana: add UDP segmentation offload support
Date: Tue, 1 Dec 2026 13:42:20 -0500
Organization: Usenet Network
Message-ID: <aw8VDAr3BotJogKN@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
References: <20261130231409.2567518-1-hamzamahfooz@linux.microsoft.com>
 <aw8FgmiM7MUFcwSt@devvm20253.cco0.facebook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="1791358"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:nC7PZ/teztAXj4nwscZUbTvGdPI= sha256:Xxp1PEi9xJmOBXrmlw2XaYt1sIa2DIrtpmD6P/pJBu8=
	sha1:M/V5H/K9UJ4qqaJeGP27b1sW2mE= sha256:CROXR3wehU7VLAbSEcJppsT7jMyLrZMGsGyCJbjr5jc=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 87A0D117460; Tue,  1 Dec 2026 21:42:38 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Frq3nAMYP0Ev;
	Tue,  1 Dec 2026 21:42:34 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-375297-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id D30E6117400; Tue,  1 Dec 2026 21:42:25 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 1BF5F602ADD; Tue,  1 Dec 2026 18:42:25 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796150543;
	b=NMpkMFai4oqvcb3OasIbvSs2EEZ8sMUO87gvnRU1xiKqZR++usmXwtIquLf8G25LB1xZ
	 s1yzTuLqvXUT6ySBduvkLrwnXwLY6AT/SXj77ChbW+HOcJSG6EEx9MUt1LLS6uQEUfA8t
	 ZwQffCFTLorgboBpG6AkML12drpWTncbxdtBu9y/NtfH4a8cMzc/JBdKHRyxkmUA3VlxW
	 Z6jPkck8W/znv3Fic+HWZLPwiDV9K3S32ivluk9AqFJrTQNwN4BGtIRAv/pu42IfdxjRm
	 uSj9DPJcFJY2Y4zXDiEnx44hHai06FHmHBFwybNM31EavCMPM/9S0d2ApuGeeWamgSw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796150543;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Subject:
	 Message-ID:References:X-Mailing-List:List-Id:List-Post:List-Help:
	 List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To;
	bh=lMSBaA6FkSdZnQweL/0aYlH0luyWMTmzxRdHIGjJEUQ=;
	b=LMnH7nPoCIvg6L+4pAsQZF+gCBbXWL4Wn2v8j34bVYOw+sGEF+BI8NkLJqNBYpZTGBTd
	 ZjIoPFIEI4InqYlrS9rJMIsajtvkmkZv0DXGE9nrlpIQ6fVevY4lzRs8rdAtu8nZzCpCr
	 biAkjESPs7RyG7ucyaVMDbiXRfUF/DS5ZWJ/fSyZj5fB2ZIQvUn9HXt5fsoJ0LTDd63X4
	 7i1pCMjZCg1eR3J2cqX3cQtjrTaziJ1+W27o9EjBcwiRsS8b4cAmCiAf162Hfu//Fm74k
	 QQzqWY9CV7vdEnJfjtpMa8KRdKkOoAEtwsGFLJPBeA2NRsG7dgRQlpQflbjXeTpNMCg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IyBAzp+q;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id D5494606A32F;
	Tue,  1 Dec 2026 18:42:23 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IyBAzp+q
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796150543;
	b=ddSyDMi1s+/gN/yGm23GUksCQrtaGYR3NKxFuKyYlzT2OUXaC8D1/F6Y5uYxGY08V3yz
	 PYZyq59M7sPwH3AkmVb5EWHEkAC5fH9a137lskF5pb0mM6kBOUXoYREsFFTfY08/Pq6ye
	 te3o2hDSMHIq+Rf3mqUjqr51NOtGNfNK736r0Klelbyo3i6JmhCXmoWvZzdArRXPAC4su
	 LLkcFitwY20q3jgsLN8iitFnC6aeiQ4ybtcM4xwXJhPzjEW/ktqRPZc7SL0VN//qLsZyN
	 Iv1rFV/ScTzaNkpL1gDBZPoJyEvIrNZVQCaT8RUWoAOcd0ezFS+E8dWhN7/cGwus0Tg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796150543;
	h=Received:DKIM-Signature:Date:From:To:Subject:Message-ID:References:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=lMSBaA6FkSdZnQweL/0aYlH0luyWMTmzxRdHIGjJEUQ=;
	b=wYYpYDzGvqAnBxsv1tL8bx5szlBiVaG7P+RUhqwkSO2xPOdJEdZmBmU5djGc5536cdd1
	 nwKPzora7EB05Yl8sHtzCifCvpv/vs1t9wrHzvA10elFZ7h4/rkOCdLW4H5jMa/UhdOc1
	 uhT47aNOLTYX6poQrs0nAD7UF6WZZyrqfcRmlQhh/D/k+xxsb7BKGxHkracLfHfu+O6Sg
	 7lqYsmYp+s1kx8RcH7pg2Nt+jBem8Dg20qKc2WWgEhL7ytEPnQZzMx60cxfT1KmH3shwK
	 xxmt4/z4sJfOtlmjjKdEfyfqMn2pO7M0GIvrP8SqWxwhPrtOVmVOEKz4qvymNdfZdyA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IyBAzp+q;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2546606A31A;
	Tue,  1 Dec 2026 18:42:22 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3ABC31F00893;
	Tue,  1 Dec 2026 18:42:22 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796150542;
	bh=lMSBaA6FkSdZnQweL/0aYlH0luyWMTmzxRdHIGjJEUQ=;
	h=Date:From:To:Subject:References:In-Reply-To;
	b=IyBAzp+q7/i68y0bJ1ZaPecwr7skyH3bYq2nbUpfAwyH0uxwtf9NCVyf91H+fLXj2
	 yMWLuLZ9zdLYbhX222aFkLxCEFzKXSq5RH//0p+mklTi4jZdJS3t78Q+rd52d4vXyg
	 W9QC+JSLkvthjzdHkva1jOqqKlzYw91gYWBw8EnBhX9MY8g1n/qvCDY5jfwTGSZlDW
	 JDHgKpcx2jG80IGFW7SCCG5k4+0DRS+gyNB0b/d8HSVUqObTFDexMkpyTdi6E9E/et
	 jIQfzYHfPFgVz82YcGfh7bzZFNm33OZUozbpdcIobzvPdbIoEn5JsIZhsIVsvk5Q6U
	 4lCWIOjFDtloA==
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <aw8FgmiM7MUFcwSt@devvm20253.cco0.facebook.com>