Re: [RFC net-next 04/15] net: Let memory providers set RX buffer headroom
From: Björn Töpel
Date: Mon Oct 12 2026 - 09:45:30 EST
Stanislav Fomichev <sdf.kernel@xxxxxxxxx> writes:
> On 10/02, Björn Töpel wrote:
>> AF_XDP lets userspace choose a headroom in front of the packet data
>> in each UMEM chunk, and the kernel adds XDP_PACKET_HEADROOM to it. A
>> driver whose buffers come from an AF_XDP memory provider must put
>> packets after this headroom. The driver sees only the page pool, so
>> it has no generic way to learn the value, and nothing checks that
>> the driver supports it.
>>
>> Add rx_headroom to the provider parameters and to the queue
>> configuration. It is the full headroom, including
>> XDP_PACKET_HEADROOM; zero means the driver default. Add
>> QCFG_RX_HEADROOM. A provider that sets a headroom can only be
>> installed on a queue that supports it; otherwise the install fails
>> with -EOPNOTSUPP. The driver checks the value with the rest of the
>> queue configuration.
>>
>> Signed-off-by: Björn Töpel <bjorn@xxxxxxxxxx>
>
> This is also a bit confusing to read on its own. Do we not need to
> convert existing users? The next patch does not seem to use this new rx_headroom?
Existing providers leave it at zero and keep their defaults. XSK sets it
in patch 9, and fbnic uses it in patch 13. I'll fix the split so the
users are easier to follow.
Björn