BPF selftests compilation fails on systems with CONFIG_NET_SCH_BPF=n. The reason is that qdisc-related kfuncs are included via vmlinux.h but when qdisc is disabled, they are not defined and do not appear in vmlinux.h. Fix the issue by defining the kfunc prototypes explicitly in bpf_qdisc_common.h. They were originally there but were removed by the fixed commit mentioned below. Fixes: 2f9838e25790 ("selftests/bpf: Cleanup bpf qdisc selftests") Signed-off-by: Viktor Malik <vmalik@xxxxxxxxxx> --- tools/testing/selftests/bpf/progs/bpf_qdisc_common.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/bpf/progs/bpf_qdisc_common.h b/tools/testing/selftests/bpf/progs/bpf_qdisc_common.h index 3754f581b328..7e7f2fe04f22 100644 --- a/tools/testing/selftests/bpf/progs/bpf_qdisc_common.h +++ b/tools/testing/selftests/bpf/progs/bpf_qdisc_common.h @@ -14,6 +14,12 @@ struct bpf_sk_buff_ptr; +u32 bpf_skb_get_hash(struct sk_buff *p) __ksym; +void bpf_kfree_skb(struct sk_buff *p) __ksym; +void bpf_qdisc_skb_drop(struct sk_buff *p, struct bpf_sk_buff_ptr *to_free) __ksym; +void bpf_qdisc_watchdog_schedule(struct Qdisc *sch, u64 expire, u64 delta_ns) __ksym; +void bpf_qdisc_bstats_update(struct Qdisc *sch, const struct sk_buff *skb) __ksym; + static struct qdisc_skb_cb *qdisc_skb_cb(const struct sk_buff *skb) { return (struct qdisc_skb_cb *)skb->cb; -- 2.50.0