ebpfbpfxdp-bpf

How to bpf_prog_test_run_opts to a program that extends xdp_dispatcher


This is somewhat a follow-up question from another post.

In the previous post, I had a problem where bpf_prog_test_run_opts would return errno 524 ENOTSUPP. From what I understood, it was due to the fact that xdp_dispatcher program was loaded, making my XDP program "ext" type. Since "ext" type isn't supported by bpf_prog_test_run_opts, that errno would be returned. And after creating a program that doesn't load a xdp_dispatcher, i.e. load my XDP program directly, I was able to run bpf_prog_test_run_opts normally.

However, I would like to know if there is any way to call bpf_prog_test_run_opts on an XDP program that extends xdp_dispatcher. Would it be possible to get the file descriptor of the dispatcher and use it in bpf_prog_test_run_opts call?


Solution

  • I learned that there is a function from libxdp that does exactly this, and it is called xdp_program__test_run()