All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests: bpf: Add missing symbol declarations to common header
@ 2025-08-01  2:52 chenyuan_fl
  2025-08-01  3:08 ` Yonghong Song
  0 siblings, 1 reply; 2+ messages in thread
From: chenyuan_fl @ 2025-08-01  2:52 UTC (permalink / raw)
  To: ast, daniel, andrii; +Cc: bpf, linux-kselftest, linux-kernel, Yuan Chen

From: Yuan Chen <chenyuan@kylinos.cn>

Fix implicit function declaration errors in bpf_qdisc_xxx.c by adding
the required kernel symbol declarations to the shared header file
bpf_qdisc_common.h. This ensures all qdisc BPF programs can properly
resolve these kernel functions.

The added declarations include:
- bpf_qdisc_skb_drop
- bpf_qdisc_bstats_update
- bpf_kfree_skb
- bpf_skb_get_hash
- bpf_qdisc_watchdog_schedule

Using a common header prevents duplication and ensures consistency
across different qdisc implementations.

Signed-off-by: Yuan Chen <chenyuan@kylinos.cn>
---
 tools/testing/selftests/bpf/progs/bpf_qdisc_common.h | 9 +++++++++
 1 file changed, 9 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..4c896b3e0f65 100644
--- a/tools/testing/selftests/bpf/progs/bpf_qdisc_common.h
+++ b/tools/testing/selftests/bpf/progs/bpf_qdisc_common.h
@@ -14,6 +14,15 @@
 
 struct bpf_sk_buff_ptr;
 
+extern void bpf_qdisc_skb_drop(struct sk_buff *skb,
+			       struct bpf_sk_buff_ptr *to_free_list) __ksym;
+extern void bpf_qdisc_bstats_update(struct Qdisc *sch,
+				    const struct sk_buff *skb) __ksym;
+extern void bpf_kfree_skb(struct sk_buff *skb) __ksym;
+extern u32 bpf_skb_get_hash(struct sk_buff *skb) __ksym;
+extern void bpf_qdisc_watchdog_schedule(struct Qdisc *sch, u64 expire,
+					u64 delta_ns) __ksym;
+
 static struct qdisc_skb_cb *qdisc_skb_cb(const struct sk_buff *skb)
 {
 	return (struct qdisc_skb_cb *)skb->cb;
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-01  3:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-01  2:52 [PATCH] selftests: bpf: Add missing symbol declarations to common header chenyuan_fl
2025-08-01  3:08 ` Yonghong Song

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.