🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #25389

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

#25389
From: Joe Damato
Date: Tue, 01 Dec 2026 17:36
74 lines
14927 bytes
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>
Technical Details
Message-ID: <aw8FgmiM7MUFcwSt@devvm20253.cco0.facebook.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder3.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375248-linux-kernel-netdev=dewy.ru
References: <20261130231409.2567518-1-hamzamahfooz@linux.microsoft.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder3.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375248-linux-kernel-netdev=dewy.ru
From: joe@dama.to (Joe Damato)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next] net: mana: add UDP segmentation offload support
Date: Tue, 1 Dec 2026 09:36:02 -0800
Organization: Usenet Network
Message-ID: <aw8FgmiM7MUFcwSt@devvm20253.cco0.facebook.com>
References: <20261130231409.2567518-1-hamzamahfooz@linux.microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network; logging-data="1778944"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:pKE1N4Dy83uQYqiSI/ZoeOEHWRg= sha256:O7pp8d6mByEJWr9F0JwXtJlzmIr/+gjyFD5+KkeTTQI= sha1:BRWN0+WpupOTLx38u9aGOuEs8VM= sha256:uNm7aYYl65vcnjFve+iEh0TRQFlv3wILBN9hPY2UfaE=
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 B5DA1117439; Tue,  1 Dec 2026 20:36:28 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.95
X-Spam-Status: No, score=-2.95 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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=dama-to.20260707.gappssmtp.com
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 M9JrSuakZNZh; Tue,  1 Dec 2026 20:36:25 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-375248-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=dama.to
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id C2024117408; Tue,  1 Dec 2026 20:36:16 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id C9E822BB29; Tue,  1 Dec 2026 17:36:08 +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=1796146566; b=WYockA5N3vJcuRm0FV8wJuFAjOjsIfIVZaRv4UlysW6E0HVl0o1bQqW8TIEaz6oSBKBC W7ettbYEKCgUDZM16oz8ZiS3qvR3sIOPthJzOlfLxjgwPXnPCLwfARvOoMZh/bVjk/Z34 a4ee7uvMTBrjdQHn6Nv9I8lC/ViFX/Nr7FbarWGyhqNsdYW9MXZzbqj9y3zlbmwoJfzpn iF528DiMwT0i8QfRLUB18S6WrfoGreYeVvPENaOuH7u2JMIzlkZYT6aUPnqsRyieWm433 Sh08j90mjdxZSI8vQ8CObP+/AcWuQ2k/5kaqm9MXrG3Rd3uqlCke16RPbs/4kIJvEuw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796146566; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received: Received:Date:From:To:Cc:Subject:Message-ID:Mail-Followup-To: 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=H8KZzNMqcJjupKJsPfPMnc4YVjp3tJhmz2pDEpX6b+0=; b=obkicKHBDY0PLHj2yS1DaKH+wFuVul1wblOU7zfwq75N5UC0DbdVLxvSxGkSKa+zGSLH JXwqe8FMxE7zj5YZ0/M2aeZeUgsPgYtwTDg/+Xr1h8b4ptaT0OBtK+wMNA6Bb0jq/bLpr O7H8770ZIo5Rz+CdqUNjcqrbvZP9PXemiBMXa8uutPrjykIqboDN546BSpBYsb+e9kK8D ob/oLV596z8WDV19NpFV6tfrdjlLGwvd620muBq0nWnHd4hElT44TwEhV6ejrft0HgmoL aLgZd+UtXsldNLRGt76F7HKTIqvA+uhh9XDJWIAzWxMVSvoah/1yzCiMBtYXYWyE1MA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=Fq7QhIkd; dmarc=none header.from=dama.to; spf=none smtp.mailfrom=dama.to; 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 09A74606A68B; Tue,  1 Dec 2026 17:36:06 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=Fq7QhIkd
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.176
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796146565; b=SKiPP/MwaRfQsQgr6mtWUQYhxI1sNlGCwv0ATbtfedBzHGv5oaIiFqiNFSuPOGXqvlRf jO65nTFfrPEf8iHIKvGtbsI46eG5Jm97LjZEZVohCtNz3L+Ipt6KRZSu/KY4kZnEsj1yh r5DAGt2uGGZYoYNuYewKm1QJZqVixWcAxtVzvEIPTpbGg/Zh7+MRZHYDA9AF3AiFhf6X0 HJGH3apCkvfs52+D5X0eVaQYzgm2mV8x7tJdr9OBekca/3RCHTF7iHncyJt/drpEfWpXN TZZ73MoVjqDhZtexZDeXw0GRMqbwiz6h6lMKrTWJJt3Xy0U78hPf2/VnDb9R1u4z3ug==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796146565; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Date:From:To:Cc: Subject:Message-ID:Mail-Followup-To:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=H8KZzNMqcJjupKJsPfPMnc4YVjp3tJhmz2pDEpX6b+0=; b=ddiMH0whlsO2orUnh5e5BnmJfNSRpyEeoWLQZlM81oc/bctOvHv2GEmFc0DjeX/xx4YE zgdm8gG585kMD5dR0lwbfpgtddZmvxUg4OXr3t9PoLtIbMYc/NgrGg4F2woQ/BIyTbfo8 d/UyfXPkJ62xogGQ5d/uiCsVPgMqdOa7VBOpkpP+5ZLEJuLjyRqqHFkSBPwaqBIe2Ht1g uspz50hT/wmBs8yisHU+ZRNrchW3F5Qw3zHoRlxfeh4YyxqTErx2K5Hst6NePo6Ra2aiU PdH0EiWOkFgg/iQOaPxhNDTypOQn5Hku/YqdZLVr7PUXzDM3y1CWhLdP8nDqo7xFDCQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=dama.to; spf=none smtp.mailfrom=dama.to; dkim=pass header.d=dama-to.20260707.gappssmtp.com header.i=@dama-to.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=Fq7QhIkd; arc=none smtp.remote-ip=209.85.210.176
X-Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92980606A68A for <netdev@vger.kernel.org>; Tue,  1 Dec 2026 17:36:04 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 92980606A68A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to
X-Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to
X-Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-8ca6a12efd9so4730283b3a.1 for <netdev@vger.kernel.org>; Tue, 01 Dec 2026 09:36:04 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dama-to.20260707.gappssmtp.com; s=20260707; t=1796146564; x=1796751364; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date:from :to:cc:subject:date:message-id:reply-to:content-type; bh=H8KZzNMqcJjupKJsPfPMnc4YVjp3tJhmz2pDEpX6b+0=; b=Fq7QhIkdWXRwtxoOju4yy+ZTxugplg/ppGbHlpra+3k9vxZ4OurG/Nm5TIBS8MN9zn axXE817gQ7z6arMaC6jUykPyhYQn+5p9iPrnTykwoA/UZhtmtgYCw8EMenqgkkDAm0Aj P2H1qxDO03sVr+gOpXSBQHWJABs06L+SRnp+9mBtyr4kFjUxJmujqrCipoOGTPJvE1E/ 2iG5L7xfUjchXaTItyRaA+oFIfgz+DnH0UHrjUwZ3jVIn0euU3PrmVSGOGAAziDOGQfl kwiXK5FW8KVj/HuXsQo1yD9n2RNRcU2i3V+uldBLgNI3v9DObrHxW7tnh3Via9J1c78J ko2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796146564; x=1796751364; h=in-reply-to:content-disposition:content-type:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :x-gm-gg:x-gm-message-state:from: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N0qtoEEq+KIEakxvK2oXh3 uQ2fic1dagQH3X2tffxv2lM75EI3QB2qpY7hCoiSa0ENVf9gmOCuwrUk/5mtTZB/QrmF6pVR9pY hLe0Kzcqu+jfXu58yEpwheVMOjP83FKvKmZMbhMMaw==
X-Received: by 2002:a05:6a21:a92:b0:3dd:a196:30a1 with SMTP id adf61e73a8af0-4014e255570mr37161086637.81.1796146563590; Tue, 01 Dec 2026 09:36:03 -0800 (PST)
X-Received: from localhost ([2a03:2880:2ff:43::]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cdebb45c972sm11780854a12.20.2026.12.01.09.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 09:36:03 -0800 (PST)
X-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
X-Mail-Followup-To: Joe Damato <joe@dama.to>, Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>, 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
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: <20261130231409.2567518-1-hamzamahfooz@linux.microsoft.com>