🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by netdev-bot+sashiko Mon, 23 Nov 2026 03:59
Re: [PATCH net-next v2 02/11] net: reserve extra TX headroom for local egress
#20696
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads