Fairly straight-forward mechanical transformation from bpf_prog_test_run and bpf_prog_test_run_xattr to the bpf_prog_test_run_opts goodness. Most of the changes are in tests, though bpftool and libbpf (xsk.c) have one call site each as well. The only aspect that's still a bit RFC is that prog_run_xattr is testing behavior specific to bpf_prog_test_run_xattr, which does not exist in prog_run_opts. Namely, -EINVAL return on data_out == NULL && data_size_out > 0. Adding this behavior to prog_test_run_opts is one option, keeping the test as-is and cloning it to use bpf_prog_test_run_opts is another possibility. The current version just suppresses the deprecation warning. As an aside, checkpatch really doesn't like that LIBBPF_OPTS looks like a function call but is formatted like a struct declaration. If anyone cares about formatting, now would be a good time to mention it. v1 -> v2: Split selftests/bpf changes into two commits to appease the mailing list. Delyan Kratunov (4): selftests: bpf: migrate from bpf_prog_test_run selftests: bpf: migrate from bpf_prog_test_run_xattr bpftool: migrate from bpf_prog_test_run_xattr libbpf: Deprecate bpf_prog_test_run_xattr and bpf_prog_test_run tools/bpf/bpftool/prog.c | 55 ++-- tools/lib/bpf/bpf.h | 8 +- tools/lib/bpf/xsk.c | 11 +- .../selftests/bpf/prog_tests/atomics.c | 86 +++--- .../testing/selftests/bpf/prog_tests/bpf_nf.c | 10 +- .../selftests/bpf/prog_tests/check_mtu.c | 47 ++-- .../selftests/bpf/prog_tests/cls_redirect.c | 30 +-- .../selftests/bpf/prog_tests/dummy_st_ops.c | 31 +-- .../selftests/bpf/prog_tests/fentry_fexit.c | 33 ++- .../selftests/bpf/prog_tests/fentry_test.c | 9 +- .../selftests/bpf/prog_tests/fexit_bpf2bpf.c | 33 ++- .../selftests/bpf/prog_tests/fexit_stress.c | 26 +- .../selftests/bpf/prog_tests/fexit_test.c | 9 +- .../selftests/bpf/prog_tests/flow_dissector.c | 75 +++--- .../prog_tests/flow_dissector_load_bytes.c | 27 +- .../selftests/bpf/prog_tests/for_each.c | 32 ++- .../bpf/prog_tests/get_func_args_test.c | 14 +- .../bpf/prog_tests/get_func_ip_test.c | 12 +- .../selftests/bpf/prog_tests/global_data.c | 25 +- .../bpf/prog_tests/global_func_args.c | 13 +- .../selftests/bpf/prog_tests/kfree_skb.c | 16 +- .../selftests/bpf/prog_tests/kfunc_call.c | 46 ++-- .../selftests/bpf/prog_tests/ksyms_module.c | 23 +- .../selftests/bpf/prog_tests/l4lb_all.c | 35 ++- .../selftests/bpf/prog_tests/map_lock.c | 15 +- .../selftests/bpf/prog_tests/map_ptr.c | 18 +- .../selftests/bpf/prog_tests/modify_return.c | 38 +-- .../selftests/bpf/prog_tests/pkt_access.c | 27 +- .../selftests/bpf/prog_tests/pkt_md_access.c | 15 +- .../selftests/bpf/prog_tests/prog_run_xattr.c | 5 + .../bpf/prog_tests/queue_stack_map.c | 43 +-- .../bpf/prog_tests/raw_tp_test_run.c | 85 +++--- .../bpf/prog_tests/raw_tp_writable_test_run.c | 16 +- .../selftests/bpf/prog_tests/signal_pending.c | 24 +- .../selftests/bpf/prog_tests/skb_ctx.c | 93 +++---- .../selftests/bpf/prog_tests/skb_helpers.c | 16 +- .../selftests/bpf/prog_tests/sockmap_basic.c | 19 +- .../selftests/bpf/prog_tests/spinlock.c | 15 +- .../selftests/bpf/prog_tests/syscall.c | 12 +- .../selftests/bpf/prog_tests/tailcalls.c | 245 ++++++++++-------- .../selftests/bpf/prog_tests/test_profiler.c | 16 +- .../bpf/prog_tests/test_skb_pkt_end.c | 15 +- .../testing/selftests/bpf/prog_tests/timer.c | 9 +- .../selftests/bpf/prog_tests/timer_mim.c | 9 +- .../selftests/bpf/prog_tests/trace_ext.c | 28 +- tools/testing/selftests/bpf/prog_tests/xdp.c | 35 ++- .../bpf/prog_tests/xdp_adjust_frags.c | 34 ++- .../bpf/prog_tests/xdp_adjust_tail.c | 148 ++++++----- .../selftests/bpf/prog_tests/xdp_bpf2bpf.c | 16 +- .../selftests/bpf/prog_tests/xdp_noinline.c | 45 ++-- .../selftests/bpf/prog_tests/xdp_perf.c | 19 +- tools/testing/selftests/bpf/test_lru_map.c | 11 +- tools/testing/selftests/bpf/test_progs.h | 2 + tools/testing/selftests/bpf/test_verifier.c | 16 +- 54 files changed, 993 insertions(+), 802 deletions(-) -- 2.30.2