Re: [RFC bpf-next v1 0/7] Add kfunc bpf_xdp_pull_data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/4/25 10:28 AM, Amery Hung wrote:
On Fri, Aug 29, 2025 at 11:22 AM Martin KaFai Lau <martin.lau@xxxxxxxxx> 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.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux