🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #20696

Re: [PATCH net-next v2 02/11] net: reserve extra TX headroom for local egress

#20696
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 03:59
81 lines
12132 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The documentation for tx_extra_headroom, added in commit "net:
  add tx_extra_headroom and netdev_get_alloc_headroom()", says without…

--

net: reserve extra TX headroom for local egress

This patch makes several allocation paths use the new
netdev_get_alloc_headroom*() helpers instead of LL_RESERVED_SPACE() and
LL_RESERVED_SPACE_EX(). The converted paths are the IPv4/IPv6
append_data paths, the IPv4/IPv6 raw hdrincl paths, the three AF_PACKET
transmit paths and AF_XDP copy mode, so their locally generated packets
get dev->tx_extra_headroom when they are allocated. Paths that expand
existing packets on demand, and the fragmentation paths, are left alone
on purpose.

> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
> index 5d6f5f5fc0ed2..dedea01c6adc6 100644
> --- a/net/ipv4/ip_output.c
> +++ b/net/ipv4/ip_output.c
> @@ -988,7 +988,7 @@ static int __ip_append_data(struct sock *sk,
>  	mtu = cork->gso_size ? IP_MAX_MTU : cork->fragsize;
>  	paged = !!cork->gso_size;
>  
> -	hh_len = LL_RESERVED_SPACE(rt->dst.dev);
> +	hh_len = netdev_get_alloc_headroom(rt->dst.dev);

[Severity: Low]
This isn't a bug, but does the documentation added earlier in the series
promise more than this patch delivers?

Documentation/networking/netdevices.rst says, with no exceptions:

  tx_extra_headroom is extra headroom for locally generated packets. The
  stack adds it when it allocates such a packet for the device, so that
  headers pushed later, for example at TC egress, fit without a
  reallocation.

The comment above netdev_get_alloc_headroom_hlen() in
include/linux/netdevice.h describes the same contract.

This is the only patch in the series that converts allocation sites.
Several places that allocate a locally generated packet for a specific
device still reserve only LL_RESERVED_SPACE(dev) at the end of the
series:

  net/ipv4/arp.c:arp_create()
  net/ipv4/igmp.c:igmpv3_newpack() and igmp_send_report()
  net/ipv4/ipconfig.c:ic_bootp_send_if()
  net/ipv6/mcast.c:mld_newpack() and igmp6_send()
  net/ipv6/ndisc.c:ndisc_alloc_skb()

For example:

net/ipv6/ndisc.c:ndisc_alloc_skb() {
    int hlen = LL_RESERVED_SPACE(dev);
    int tlen = dev->needed_tailroom;
    ...
}

So if tx_extra_headroom is set through the tcx decl tag or
VETH_INFO_TX_EXTRA_HEADROOM, ARP, ND, IGMP and MLD packets will still be
reallocated by bpf_skb_adjust_room(), or copied for XDP on the veth
peer.

Could the general sentence list the covered paths instead? A later
paragraph in the same section already lists UDP, raw, AF_PACKET and
AF_XDP copy mode for the XDP case. Another option would be to convert
these allocation sites as well.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119013830.36935-1-tianyi%40cloudflare.com
Technical Details
Message-ID: <179540634443.3135.6612168607080086679@kernel.org>
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-369008-linux-kernel-netdev=dewy.ru
References: <20261119013830.36935-3-tianyi@cloudflare.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-369008-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 02/11] net: reserve extra TX headroom for local egress
Date: Mon, 23 Nov 2026 03:59:04 +0000
Organization: Usenet Network
Message-ID: <179540634443.3135.6612168607080086679@kernel.org>
References: <20261119013830.36935-3-tianyi@cloudflare.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3785647"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:wnfvWwrR0l9tWs5Y16IatpyOBrM= sha256:JvjrmuQs/azOriqwY2OmDKabev6KR3jCbU2Rv9mhTnU=
	sha1:QpAVs3xL/7BcBgmuez6CdBMOnKI= sha256:RebAj5az8+yfM7XdlYcZyqwxqaQDzlOhB84nTp7gpNY=
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 80DAA125D8E; Mon, 23 Nov 2026 06:59:25 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, 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 G8NXKI2h-APJ;
	Mon, 23 Nov 2026 06:59:22 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369008-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 9A13A125D8C; Mon, 23 Nov 2026 06:59:13 +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 4FE7D29168; Mon, 23 Nov 2026 03:59:10 +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=1795406349;
	b=g+ngkqTaDzoF9wRTA/FbLh35LpKzwmn+YMMHZCLd1+LaRL9gU6yziQHazPBSzRyZpnjS
	 qrJ7o4CKhXMGDnKsv/IP4/2Gh2Er9fiOeaTdFu0W4xUQGsFxkyrYSwO/J2MMOQscvhCko
	 yZQhQB8M/hNtICuq1UnGLy2z67gTpVSCXi6zvmJ9/kqWDYvBnUQgoT2AiPhyfEweZgqW+
	 8qj1lDJievdAS1Hl8Aw9Pm2Ch9BE6qcBIJh7R2E1zG2CYrMO1BEKQoCAR4SPZc74zPOWt
	 fZCikvRPZvjX+ebLrlR6H/syLyQft140jXObqVM+KoNg+9WFLqsQVWMFUxkfUsf8g4g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795406349;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=40vOlkrsn5bcKQ9hugL/8J0cEKMjQf6aWMjTelXnSIM=;
	b=usNudmBs19u1g6QsHMAph+001Ju6FVRMI+R6xrAzW6EqtfB+T8dppKtu3SI0u6eXw4hT
	 WHqHUaXzp+AZ6D/RJ5rYNvSs6I2+KaxNmxm3CPVTsCfi91EgPllQywONIZZ4B/tEoehQm
	 7ptcLm55hiSkN1WB1+QP6IER/w2wu5R+E672azDQ9iOWdNIWRVIXYNOrQU6jztm/GK5S8
	 uIjecTLA5MIsGeKOWhr1UN4JeWpLnanQ87Ddp3mjob0LgYDjKyBNQOom1MqPqqg367Tf8
	 ETW38VeP73tku/pxMrgdgZtjmW54jb9Ylsi6N5Z1eteA2PcldmFZStAhuLhDOWDvLig==
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=HwpXlY9m;
	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 7C8D1606A339;
	Mon, 23 Nov 2026 03:59:09 +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=HwpXlY9m
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=1795406348;
	b=TjY2u0R/u9EeQCEmhQlcvFwDr79MSpA/bkF6DqhcmfFDraAyWQcmFPJjM67sCt2r+qDi
	 Kyy8RX96AlODIXCtxzNV77u4S0fKyfLFTiHtd/j8KxzOnWttS/SFHROElCJCHEpM0ysMj
	 ZslJ9Lh+QYgABBrbLEqkbYmpLuSMZaxECajmDRaUHDrU6ddSojzcYGiV3r82RNDDEKFzN
	 mS7pKEi2NKCLTYDD2otbELbXahlduXyo44F+is7FGuk656aPg+U4S61ETU5alx3+aeVET
	 sBhUuUl0FtJMoA8TKmqOMx48U4eTzzGhiSsAta7zMOq97a/MFJC/IXFbVZBHnEBRAUQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795406348;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=40vOlkrsn5bcKQ9hugL/8J0cEKMjQf6aWMjTelXnSIM=;
	b=SCpd7O1M7ANUn99JeYcGiIQAhiw46L6ffkGHOnlAOCh8+xN9KZLB8l0dhuNXsFMJuImg
	 m298KyzLZvNJ3kaB0MQX2GlBiKUOBrPG19l9uZi66TN4Sx4t+9o2eJwDGaiF7ZGWLk4XU
	 pjcskF1wAdjPj11xUswzJptO7aAa3ht7Q+tFQBakXWUFobqTRiiR/mH2Ad0TbDL5L5SCA
	 XZkjnvycRBTkLb+XS/DIOJlRX1b0X9PPrrtNtAE6A3xunWH+Z+ZC7RDvYPBc20VVJjEqR
	 0avsoSpLLPbnPpdXMikUWDlTC/rRUyWSdGEPPjAp0mY7cairw281trYxlmvZY9gaMSg==
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=HwpXlY9m;
	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 96E86606A31E;
	Mon, 23 Nov 2026 03:59:08 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF5911F000C6;
	Mon, 23 Nov 2026 03:59:04 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795406348;
	bh=40vOlkrsn5bcKQ9hugL/8J0cEKMjQf6aWMjTelXnSIM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=HwpXlY9m2MBcwL/YhwYMz6mfik0O2RI/E/w2eT2ygBowvuJAhkGJs7nnahQTnKTKP
	 8Ee+z834dDifrLMV3MMs4l9E4kXfenECjvkRwGNuVxKwGHL31wZ1h/lwIDC7ZEqwg1
	 NIWjlnqtgadvmpYubS9ucWnEiBUnYMYRn0obS8Apcm+UA/6crGIcJoBHE/+ZzojP6G
	 F0JqFAh8SpfCI7Mij80dA/1DlL+7oFhD4PDf57ffUCTymAInDj2Y2WS/Idz2lf4ZKw
	 DIdRTBvCz+EYWhCwRlCdQx7BFgnoMC11R4Sntu+VTZJirlUQvl7p9NcjFUdhw3fjib
	 +P3Vz1CgAegyw==
X-Cc: netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com,
 edumazet@kernel.org, davem@davemloft.net, horms@kernel.org, dkeogh@amazon.com,
 hawk@kernel.org, daniel@iogearbox.net, dwmw2@infradead.org,
 dtatulea@nvidia.com, noren@nvidia.com, alasdair@mcwilliam.dev,
 willemdebruijn.kernel@gmail.com, maciej.fijalkowski@intel.com,
 sdf@fomichev.me, magnus.karlsson@intel.com, dsahern@kernel.org,
 idosch@nvidia.com, ast@kernel.org, john.fastabend@gmail.com,
 donald.hunter@gmail.com, andrew+netdev@lunn.ch, corbet@lwn.net,
 skhan@linuxfoundation.org, shuah@kernel.org, rdunlap@infradead.org,
 leitao@debian.org, ast@fiberby.net, danieller@nvidia.com, kuniyu@google.com,
 bpf@vger.kernel.org, linux-doc@vger.kernel.org,
 linux-kselftest@vger.kernel.org, kernel-team@cloudflare.com,
 nh-open-source@amazon.com, stephen@networkplumber.org, gustavoars@kernel.org,
 one-d-wide@protonmail.com, ameryhung@gmail.com, andrii@kernel.org,
 aroulin@nvidia.com, anilkaushikwireless@gmail.com, demosthenes.ra@gmail.com,
 eddyz87@gmail.com, emil@etsalapatis.com, hangbin.liu@linux.dev,
 ihor.solodrai@linux.dev, jiayuan.chen@linux.dev, jolsa@kernel.org,
 joe@dama.to, memxor@gmail.com, lirongqing@baidu.com, louis.scalbert@6wind.com,
 mkl@pengutronix.de, martin.lau@linux.dev, mkarsten@uwaterloo.ca,
 mattbobrowski@google.com, michael.bommarito@gmail.com, razor@blackwall.org,
 runyu.xiao@seu.edu.cn, song@kernel.org, linux@leemhuis.info,
 wang.zhan@smartx.com, yonghong.song@linux.dev, n0ps1edzz@gmail.com,
 tianyi.gao@linux.dev
X-In-Reply-To: <20261119013830.36935-3-tianyi@cloudflare.com>
X-sashiko-severity: Low
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