[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9ac027eb-e1fa-43b7-9b36-f5a267e461f8@linux.dev>
Date: Fri, 5 Sep 2025 10:20:01 -0700
From: Martin KaFai Lau <martin.lau@...ux.dev>
To: Amery Hung <ameryhung@...il.com>
Cc: Nimrod Oren <noren@...dia.com>, bpf@...r.kernel.org,
netdev@...r.kernel.org, alexei.starovoitov@...il.com, andrii@...nel.org,
daniel@...earbox.net, kuba@...nel.org, martin.lau@...nel.org,
mohsin.bashr@...il.com, saeedm@...dia.com, tariqt@...dia.com,
mbloch@...dia.com, maciej.fijalkowski@...el.com, kernel-team@...a.com,
Dragos Tatulea <dtatulea@...dia.com>
Subject: Re: [RFC bpf-next v1 0/7] Add kfunc bpf_xdp_pull_data
On 9/4/25 10:28 AM, Amery Hung wrote:
> On Fri, Aug 29, 2025 at 11:22 AM Martin KaFai Lau <martin.lau@...ux.dev> wrote:
>>
>> On 8/28/25 6:39 AM, Nimrod Oren wrote:
>>> I'm currently working on a series that converts the xdp_native program
>>> to use dynptr for accessing header data. If accepted, it should provide
>>> better performance, since dynptr can access without copying the data.
>>
>> The bpf_xdp_adjust_tail is aware of xdp_buff_has_frags. Is there a reason that
>> bpf_xdp_adjust_head cannot handle frags also?
>
> I am not aware of reasons that would stop this.
>
> Are you suggesting another way to pop headers? E.g., use
> bpf_xdp_adjust_head() to shrink the first frag from the front and call
> bpf_xdp_store_bytes() to move the remaining headers
bpf_xdp_pull_data is useful on its own, nothing change there. On top of that,
bpf_xdp_adjust_head() should be useful also for bpf prog that does not care
about the linear/frag layout and stay with the bpf_dynptr helpers (or the
bpf_xdp_{store,load}_bytes you mentioned). Also, if I read it correctly,
bpf_xdp_adjust_head can increase the head of multi buf xdp but not shrinking it
while the bpf_xdp_adjust_tail can do both. It could be a surprise to use. The
adjust_head support can be a followup though. I think some of your work in this
series is pretty close to having adjust_head support also, so I was wondering if
there is reason that adjust_head cannot be supported.
Powered by blists - more mailing lists