Article View: linux.kernel.netdev
Article #15508Re: [PATCH net-next v4 0/5] net: devmem: size TX net_iovs from the dmabuf layout
From: Stanislav Fomichev
Date: Thu, 12 Nov 2026 23:00
Date: Thu, 12 Nov 2026 23:00
79 lines
14606 bytes
14606 bytes
On 11/12, Paolo Abeni wrote: > Hi, > > A few (late) questions/comments to check I'm not missing relevant > points, > > On 11/11/26 23:47, Stanislav Fomichev wrote: > > TX bindings use PAGE_SIZE net_iovs, so a frag covers at most a page. > > A 64KB skb needs 16 frags, and MAX_SKB_FRAGS caps devmem skbs at about > > 68KB, which makes BIG TCP ineffective for devmem TX. > > ... with default .config. You could set MAX_SKB_FRAGS to 45 and reach > ~180K... > > This series picks the TX net_iov size from the dmabuf sg table instead: > > the largest power of 2, up to 2MB, which aligns every DMA segment. With > > a 2MB hugepage-backed udmabuf a BIG TCP skb takes a few frags. There's > > no UAPI change since TX addresses are dmabuf offsets. > > ... still this option should be more effective because the limit would be > higher and the skb would use less cachelines for the shared_info, > > I'm wondering if making a comparison vs MAX_SKB_FRAGS==45 would be > complex and if you could do that, too. Originally I did not want to include bigtcp to keep it apples to apples: same tso size, just 16 frags in skb vs 1 (in ideal case). I just tried running mlx5 with 45 frags configured and it fails to start with the following error: mlx5e_attach_netdev() warns "MLX5E: Max SQ WQEBBs firmware capability: 16, needed 23" and returns -EIO. (fwiw quick review with llm claims that mlx5 only supports up to 20 skb frags) What I also tried just now is `gso_max_size 524280` (on top of this series) and it ups single flow throughput from 200Gbps to 240Gbps (presumably by making the receiver go faster with 512K TSOs vs 64K TSOs) and halves the sender softirq.. I hope this gives you more data, not sure running with 20 frags is worth it (vs 16)? LMK if you disagree or want me to run something else. > > This doesn't make skbs larger. TCP still sizes them with size_goal. > > Only the frags get larger, and a single frag can now cover the whole > > skb. > > > > An skb stays under 64KB unless BIG TCP is enabled. With BIG TCP, > > MSG_ZEROCOPY from huge pages can already create frags of 64KB or > > more. So drivers already have to handle them: > > - mlx5 has a 31-bit length per data segment > > - gve splits frags into 16KB descriptors > > - fbnic doesn't enable BIG TCP > > - bnxt has a 16-bit BD length. It is broken for such page frags today > > and will be fixed separately. > > > > Tested on two mlx5 400Gb/s hosts with kperf (udmabuf, 32KB RX > > net_iovs, 2MB hugepage-backed TX buffer), series backported to a 7.1 > > kernel on the sender only. 1 flow, MTU 4200, receiver tcp_rmem capped > > at 16MB so it doesn't drop, median of 5 x 60s runs: > > > > before after > > frags per skb (sender) 16-17 1-2 > > throughput (Gb/s) 208.6 211.2 > > sender sendmsg CPU (sys) 40.8% 19.5% (-52%) > > > > The receiver's CPU is the bottleneck, so the gain is CPU, not > > throughput. More of the transmit runs from the ACK path, so the > > sender's softirq grows (52% -> 59%), but sys + sirq still drops by 16%. > > is the receiver using GRO H/W offload/big TCP? Which are the gro_max_size/ > gso_max_size limits? In the `after` scenario, is the 2nd frag used for the > headers? hw gro, no big tcp (default tso of 64k). The headers are still in the linear part and most of the time we get 1 frag. I'm assuming 2 frags are happening sometimes because of tcp sending something over that 2MB boundary. So that one single range has to be expressed by to frags.
Technical Details
Message-ID:
<avZC2hp_0ODMQ4SG@devvm16445.scu0.facebook.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362254-linux-kernel-netdev=dewy.ruReferences:
<20261111224740.2744522-1-sdf@fomichev.me> <1b764043-2efd-4e65-adb9-a47c0136446b@redhat.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362254-linux-kernel-netdev=dewy.ru
From: sdf.kernel@gmail.com (Stanislav Fomichev)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v4 0/5] net: devmem: size TX net_iovs from the
dmabuf layout
Date: Thu, 12 Nov 2026 15:00:09 -0800
Organization: Usenet Network
Message-ID: <avZC2hp_0ODMQ4SG@devvm16445.scu0.facebook.com>
References: <20261111224740.2744522-1-sdf@fomichev.me>
<1b764043-2efd-4e65-adb9-a47c0136446b@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Injection-Info: usenet.network;
logging-data="1230680"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:MecW3+JVpZsnBR3dYtJ2yPRhfpc= sha256:l2KDseuOFL8xXmqFmAkSTtKmvcaBMxs4xjngl5nRZeo=
sha1:PXtJ34FeYKfRw+V4ZqQhCqxeLRo= sha256:SJXo4gTB1HFvrjicdfrSh6h8BvSAd9P0+umMR+Y177w=
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 97FD4114434; Fri, 13 Nov 2026 05:04:29 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, 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] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.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 Y_qG4QM5w-mg;
Fri, 13 Nov 2026 05:04:26 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-362254-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id CDCE0114432; Fri, 13 Nov 2026 05:04:17 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 3F6596685B; Thu, 12 Nov 2026 23:02:51 +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=1794524417;
b=Vi0N+AfgfV7cM0Ea5lFURG1q7Y8XnmydLEMIxDzMCJRPxi6SsdwFRE8UeLPD/eui2W0h
6bhhX3SO2rkj0wlgL8GF+gQuDj64K/kMkpOp/1B6laz7Qq55yAKtGZuolyW8Frf/2yAf2
I04n5FnvSSrLOPTeHQ4CmIaTN09dc/ULLfQepkpAzXmGQhkyJysCQtCVBo3NXxpbE+7+y
jO1zonKTDqpV443gVBtqh+coM5HY+5d8y1/rsX5SKcGIX7b0BENZs1mEHhvQeG1EqBnsI
fYykHfLumYLYROezUNytAK57qZew0Zj6wPkMiGqUnND2GuN8DoS1tqVOv1J6P/w7AKA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794524417;
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: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=EBkgmCwzSSGPUQEDHuaBTutli2Jfo6B14aVph4B8jx0=;
b=KBS9FxHwxCovrnrppCemsauR9/YVUyt5RDyMM/UiT/CV/WGgCzbBsjJ0USe0HXn4cyt4
47SS4p8+Duz95plGFzJJ6ffMGb/WrBvuUtOhfSPydtSrEzC8Mtqf1VYFYt6+sPKGUsMjk
bW1Hcv779oRo9M7OKAT/BPc7S7BADINx4mvVup+CKr1YAfhaM5y3R3JISpY+6S43j5HgF
E5TbwAQmjZijLNCpv9SbAZQEGP0eAlpIkUUsPmVX1IqQ89e5hvvwT3qTsJI5pdd4VQn26
T1w4qfhyp7qiWqi52f4ALGfVM9lb7GGAOlSHCnge411+uVIqCd/NE30UMmQs7XD7qvA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="UEmdS/dd";
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
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 55FB4606A33F;
Thu, 12 Nov 2026 23:00:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=UEmdS/dd
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.229.4
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794524416;
b=T/Q2G7kgqYY+izoGIJOzRFI6QyNqC9Za9fSJWk2+xi6xajM44GCbIMjNjA0HnnC3QJGl
1HcfNCr1ndeGBhU0yH6YHvsy5WES7wlQTS1FWX8DSnUkgS9cEp5+0dH2/bsuc3oPLpuin
VR5Z9r5NNR5KSaPWtUJPEl2jfhkqiThj8mh68jqyuJ3TWAmM5uH2/C15/I3SnZfaBAOgk
yhXWGJ/yOR/akyxk+6fCemgfWa24LhvNE/mCbxSDnhCrVhHvn1e0qraSnVvTg57gEwK4F
FMKAmQnveKwPfOLtKQtfWBH+6+6DcuPxCZsumd0kHmwBZ4miS9FpniEvPDDwVLO5suA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794524416;
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:References:MIME-Version:Content-Type:
Content-Disposition:In-Reply-To;
bh=EBkgmCwzSSGPUQEDHuaBTutli2Jfo6B14aVph4B8jx0=;
b=oOVxBP5tOVm4R5D4w82c2BXVj1brnHicPR8vbJqxt/cYJqzUWPh538WYMyZZpP73gFj0
x/R97OlaXJ8Kp1JK79BAS65+OlsI1mubMKxiTu6dG6W7PiTA9r/tLDP5Nzb6szqcQe4Hs
IYARQy3++8QKr7pkLQWYuUW+n3FLa8qZjiJHAGU833ym97v9i8zLe/Ue5iiWtYnEsCu5k
Ztv7yb4hp3eaxMPeHR+EGA9HFK+RE0TYX5pr1tuzPoytoHIf/duYiWTqhacc2DYNehLRL
d/M3LQWhT60c/VOstVxjJLEwDHH69KgURw+qgDYPlb0GNZZ4dOB84PhA0tqhi4yKPnQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="UEmdS/dd";
arc=none smtp.remote-ip=74.125.229.4
X-Received: from mail-dy2-f4.google.com (mail-dy2-f4.google.com [74.125.229.4])
(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 26BC1606A880
for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 23:00:15 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 26BC1606A880
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dy2-f4.google.com with SMTP id 5a478bee46e88-36f758312e0so123943eec.0
for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 15:00:15 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1794524415; x=1795129215; darn=vger.kernel.org;
h=in-reply-to:content-disposition:content-type:mime-version
:references:message-id:subject:cc:to:from:date:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=EBkgmCwzSSGPUQEDHuaBTutli2Jfo6B14aVph4B8jx0=;
b=UEmdS/ddxgea87Jmi4D6KGO0cwNBW0iN6pjH4MYdOo/9psUz72Te3wCs/WBVGWCYin
oLAdMFp7CIubzlvzOBmyRG/Lj4TRocdsaMYZRyRloCp5icyGrXTBcF0NN3YDIdpbziPD
9dCoQysz795JPTNbOOEjaH/EeLGkosuG4aQkxwOskX09xUil/r1gN92uAD9OMsSjKiDB
F0lH6/nzBn/sVPwCLsDSnGNtu6ltHUoqDrztZuFogvL6rw+gfNvucXjpxiD1Anf0Up7c
0j1KXXL6s2KWDR5t1ZzoobkG3mM+v03VwLyiHohMh0pxNELAMXLgF+TZ4oIQZUO8hFiw
1I8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794524415; x=1795129215;
h=in-reply-to:content-disposition:content-type:mime-version
:references:message-id:subject:cc:to:from:date:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=EBkgmCwzSS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ObPU6D62l4NBfbam6wSfVGrwOyQrGVOqjVrjPI1XdYd1DL/XSLrr7p1k+27Y
vGwgURoa08aJZy0hVwO7Kn8=
X-Received: by 2002:a05:701b:454f:10b0:1b2:4998:a0df with SMTP id a92af1059eb24-1b5030db655mr763014c88.35.1794524414765;
Thu, 12 Nov 2026 15:00:14 -0800 (PST)
X-Received: from localhost ([2a03:2880:9ff:60::])
by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5031b98e5sm2014845c88.14.2026.11.12.15.00.13
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 12 Nov 2026 15:00:13 -0800 (PST)
X-Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, michael.chan@broadcom.com, pavan.chebbi@broadcom.com,
andrew+netdev@lunn.ch, edumazet@kernel.org, horms@kernel.org, shuah@kernel.org,
almasrymina@google.com, sdf@fomichev.me, leitao@debian.org, dtatulea@nvidia.com,
asml.silence@gmail.com, bobbyeshleman@meta.com, daniel@iogearbox.net,
razor@blackwall.org, linux-kernel@vger.kernel.org, linux-kselftest@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: <1b764043-2efd-4e65-adb9-a47c0136446b@redhat.com>