Netdev List
 help / color / mirror / Atom feed
From: Dragos Tatulea <dtatulea@nvidia.com>
To: David Woodhouse <dwmw2@infradead.org>,
	David Keogh <dkeogh@amazon.com>,
	netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@kernel.org>
Cc: Nimrod Oren <noren@nvidia.com>,
	nh-open-source@amazon.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC net-next 0/6] net: configurable extra TX headroom for local egress
Date: Fri, 16 Oct 2026 20:48:09 +0200	[thread overview]
Message-ID: <bba453eb-769e-458b-88f7-8cc9bcafc1db@nvidia.com> (raw)
In-Reply-To: <b8914a523b4a6b80424c5001d3d8012c6a98fd04.camel@infradead.org>

On 16.10.26 10:02, David Woodhouse wrote:
> On Thu, 2026-10-15 at 23:53 +0000, David Keogh wrote:
>>
>> Measurements (net-next at commit 05b5019b0, veth, 500000 UDP datagrams, a
>> 20-byte ip-in-ip push attached at TC egress, only tx_extra_headroom varied):
>>
>>   tx_extra_headroom   pskb_expand_head reallocs / 500k
>>   0 (off)             500003   (~1 per packet)
>>   64                  4        (background)
>>   128                 2        (background)
> 
> I remember frowning at this years ago, in the context of PPPoE.
> 
> I have the same question I had back then: why, if *every* packet ends
> up having to call pskb_expand_head() because it didn't have enough
> headroom, does our kernel need to be *told* by userspace that it needs
> to expand the allocations?
> 
> We gained dev->needed_headroom and ip_tunnel_adj_headroom() since then,
> and the kernel doesn't actually need to be told.
> 
> You explained why you don't want to use dev->needed_headroom; I don't
> have much of an opinion on that front. But if you do want to introduce
> a new tx_extra_headroom, could we try really hard to have it auto-
> tuning?
For TC-BPF I suppose only the BPF program knows how much extra
headroom is needed.

Maybe this tx_extra_headroom could be declared as a BTF decl tag
in the program. If this is the only usecase there's no need for a
rtnetlink uAPI.

Thanks,
Dragos

  reply	other threads:[~2026-10-16 18:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 23:53 [RFC net-next 0/6] net: configurable extra TX headroom for local egress David Keogh
2026-10-15 23:53 ` [RFC net-next 1/6] net: add tx_extra_headroom and LL_ALLOC_SPACE() David Keogh
2026-10-15 23:53 ` [RFC net-next 2/6] net: reserve extra TX headroom for local egress David Keogh
2026-10-15 23:53 ` [RFC net-next 3/6] rtnetlink: add IFLA_TX_EXTRA_HEADROOM David Keogh
2026-10-15 23:53 ` [RFC net-next 4/6] selftests: net: add tx_extra_headroom test David Keogh
2026-10-15 23:53 ` [RFC net-next 5/6] selftests/bpf: add tx_extra_headroom data-plane programs David Keogh
2026-10-15 23:53 ` [RFC net-next 6/6] selftests/net: add tx_extra_headroom data-plane test David Keogh
2026-10-16  8:02 ` [RFC net-next 0/6] net: configurable extra TX headroom for local egress David Woodhouse
2026-10-16 18:48   ` Dragos Tatulea [this message]
2026-10-16 19:01     ` Daniel Borkmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bba453eb-769e-458b-88f7-8cc9bcafc1db@nvidia.com \
    --to=dtatulea@nvidia.com \
    --cc=dkeogh@amazon.com \
    --cc=dwmw2@infradead.org \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nh-open-source@amazon.com \
    --cc=noren@nvidia.com \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox