aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf.h
diff options
context:
space:
mode:
authorAmery Hung <[email protected]>2025-04-09 21:46:03 +0000
committerMartin KaFai Lau <[email protected]>2025-04-17 17:54:41 +0000
commit4b15121da7e5217636ae2edccb12cf7fc49709b3 (patch)
tree71d80e2627ee095e48033d6f209451066440aa30 /tools/lib/bpf/libbpf.h
parentbpf: net_sched: Disable attaching bpf qdisc to non root (diff)
downloadkernel-4b15121da7e5217636ae2edccb12cf7fc49709b3.tar.gz
kernel-4b15121da7e5217636ae2edccb12cf7fc49709b3.zip
libbpf: Support creating and destroying qdisc
Extend struct bpf_tc_hook with handle, qdisc name and a new attach type, BPF_TC_QDISC, to allow users to add or remove any qdisc specified in addition to clsact. Signed-off-by: Amery Hung <[email protected]> Signed-off-by: Martin KaFai Lau <[email protected]> Acked-by: Toke Høiland-Jørgensen <[email protected]> Link: https://patch.msgid.link/[email protected]
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r--tools/lib/bpf/libbpf.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index e0605403f977..fdcee6a71e0f 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -1283,6 +1283,7 @@ enum bpf_tc_attach_point {
BPF_TC_INGRESS = 1 << 0,
BPF_TC_EGRESS = 1 << 1,
BPF_TC_CUSTOM = 1 << 2,
+ BPF_TC_QDISC = 1 << 3,
};
#define BPF_TC_PARENT(a, b) \
@@ -1297,9 +1298,11 @@ struct bpf_tc_hook {
int ifindex;
enum bpf_tc_attach_point attach_point;
__u32 parent;
+ __u32 handle;
+ const char *qdisc;
size_t :0;
};
-#define bpf_tc_hook__last_field parent
+#define bpf_tc_hook__last_field qdisc
struct bpf_tc_opts {
size_t sz;