mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Dragos Tatulea <dtatulea@nvidia.com>,
	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>,
	Alasdair McWilliam <alasdair@mcwilliam.dev>,
	"open list:BPF [RINGBUF]" <bpf@vger.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 21:01:07 +0200	[thread overview]
Message-ID: <a8f2f84e-7dc0-473d-afb1-af710d621f69@iogearbox.net> (raw)
In-Reply-To: <bba453eb-769e-458b-88f7-8cc9bcafc1db@nvidia.com>

On 10/16/26 8:48 PM, Dragos Tatulea wrote:
> 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.
Fwiw, there was some work in this area here in the past ...

   - b9ed315d3c4c ("netkit: Allow for configuring needed_{head,tail}room")
   - b73b8146d7ff ("rtnetlink: add needed_{head,tail}room attributes")

... which we've integrated into Cilium which orchestrates the K8s
Pods + BPF progs, so it can calc needed headroom for the Pod's netdev
based on the config/needs in the hostns (e.g. tunneling).

Cheers,
Daniel

      reply	other threads:[~2026-10-16 19:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 23:53 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
2026-10-16 19:01     ` Daniel Borkmann [this message]

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=a8f2f84e-7dc0-473d-afb1-af710d621f69@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=alasdair@mcwilliam.dev \
    --cc=bpf@vger.kernel.org \
    --cc=dkeogh@amazon.com \
    --cc=dtatulea@nvidia.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

all inboxes | Powered by JetHome®