This series adds unstable conntrack lookup helpers using BPF kfunc support. The patch adding the lookup helper is based off of Maxim's recent patch to aid in rebasing their series on top of this, all adjusted to work with kfunc support [0]. This is an RFC series, as I'm unsure whether the reference tracking for PTR_TO_BTF_ID will be accepted. If not, we can go back to doing it the typical way with PTR_TO_NF_CONN type, guarded with #if IS_ENABLED(CONFIG_NF_CONNTRACK). Also, I want to understand whether it would make sense to introduce check_helper_call style bpf_func_proto based argument checking for kfuncs, or continue with how it is right now, since it doesn't seem correct that PTR_TO_MEM can be passed where PTR_TO_BTF_ID may be expected. Only PTR_TO_CTX is enforced. [0]: https://lore.kernel.org/bpf/20211019144655.3483197-8-maximmi@xxxxxxxxxx Kumar Kartikeya Dwivedi (6): bpf: Refactor bpf_check_mod_kfunc_call bpf: Remove DEFINE_KFUNC_BTF_ID_SET bpf: Extend kfunc with PTR_TO_CTX and PTR_TO_MEM arguments bpf: Add reference tracking support to kfunc returned PTR_TO_BTF_ID net: netfilter: Add unstable CT lookup helper for XDP and TC-BPF selftests/bpf: Add referenced PTR_TO_BTF_ID selftest include/linux/bpf.h | 29 +- include/linux/btf.h | 54 +++- kernel/bpf/btf.c | 188 ++++++++++--- kernel/bpf/verifier.c | 101 ++++++- net/bpf/test_run.c | 55 ++++ net/core/filter.c | 56 ++++ net/core/net_namespace.c | 1 + net/ipv4/tcp_bbr.c | 5 +- net/ipv4/tcp_cubic.c | 5 +- net/ipv4/tcp_dctcp.c | 5 +- net/netfilter/nf_conntrack_core.c | 255 ++++++++++++++++++ tools/testing/selftests/bpf/Makefile | 2 +- tools/testing/selftests/bpf/bpf_tcp_helpers.h | 5 + .../selftests/bpf/bpf_testmod/bpf_testmod.c | 5 +- .../selftests/bpf/prog_tests/kfunc_call.c | 18 +- .../selftests/bpf/progs/kfunc_call_test.c | 21 ++ 16 files changed, 741 insertions(+), 64 deletions(-) -- 2.33.1