On Tue, 9 Sep 2025 11:52:31 +0300 Nimrod Oren wrote:
In cases where the program does not return XDP_PASS, I believe dynptr has an advantage since it avoids an extra copy. Conversely, when the program returns XDP_PASS, bpf_xdp_pull_data may be preferable, as the copy will be performed in any case during skb creation.
It may make sense to split the work into two separate programs, allowing us to test both solutions independently. Alternatively, we can consider a combined approach, where the more fitting solution is applied for each use case. I welcome feedback on which direction would be most useful.
Ideally we'd make the BPF code work in either mode. But not sure it's achievable given the verification complexity. Failing that we can have two BPF objects and parameterize the test cases.
It'd be neat if we could capture if the pull actually pulled anything for a given case, so that we only bother re-running with the dynptr when we'd end up with different packet geometry. But only if it doesn't make the test code too complex.