On 9/9/25 1:52 AM, Nimrod Oren wrote:
- if (bpf_dynptr_read(tmp_buff, hdr_len, &ptr, 0, 0) < 0) return -1;
- if (bpf_xdp_store_bytes(ctx, 0, tmp_buff, hdr_len) < 0)
- if (bpf_dynptr_write(&ptr, offset, tmp_buff, hdr_len, 0) < 0)
Instead of bpf_dynptr_read() and then bpf_dynptr_write(), try to use bpf_dynptr_copy(). I think you have also noticed that Amery is also modifying xdp_native.bpf.c to test the linear access (i.e. data/data_end) with the bpf_xdp_pull_data addition. Not sure if xdp_native.bpf.c wants to keep testing both (data/data_end and dynptr). In the bpf selftests, it does want to have test coverage for both and have some existing selftests for that.
return -1;
- if (bpf_xdp_adjust_head(ctx, offset) < 0) return -1;
return 0;