4 -------------------------------------------------------------------------------
5 tool for inspection of netdev/tc related bpf prog attachments
6 -------------------------------------------------------------------------------
13 **bpftool** [*OPTIONS*] **net** *COMMAND*
15 *OPTIONS* := { [{ **-j** | **--json** }] [{ **-p** | **--pretty** }] }
18 { **show** | **list** } [ **dev** name ] | **help**
23 | **bpftool** **net { show | list } [ dev name ]**
24 | **bpftool** **net help**
28 **bpftool net { show | list } [ dev name ]**
29 List bpf program attachments in the kernel networking subsystem.
31 Currently, only device driver xdp attachments and tc filter
32 classification/action attachments are implemented, i.e., for
33 program types **BPF_PROG_TYPE_SCHED_CLS**,
34 **BPF_PROG_TYPE_SCHED_ACT** and **BPF_PROG_TYPE_XDP**.
35 For programs attached to a particular cgroup, e.g.,
36 **BPF_PROG_TYPE_CGROUP_SKB**, **BPF_PROG_TYPE_CGROUP_SOCK**,
37 **BPF_PROG_TYPE_SOCK_OPS** and **BPF_PROG_TYPE_CGROUP_SOCK_ADDR**,
38 users can use **bpftool cgroup** to dump cgroup attachments.
39 For sk_{filter, skb, msg, reuseport} and lwt/seg6
40 bpf programs, users should consult other tools, e.g., iproute2.
42 The current output will start with all xdp program attachments, followed by
43 all tc class/qdisc bpf program attachments. Both xdp programs and
44 tc programs are ordered based on ifindex number. If multiple bpf
45 programs attached to the same networking device through **tc filter**,
46 the order will be first all bpf programs attached to tc classes, then
47 all bpf programs attached to non clsact qdiscs, and finally all
48 bpf programs attached to root and clsact qdisc.
51 Print short help message.
56 Print short generic help message (similar to **bpftool help**).
59 Print version number (similar to **bpftool version**).
62 Generate JSON output. For commands that cannot produce JSON, this
66 Generate human-readable JSON output. Implies **-j**.
79 eth0(2) htb name prefix_matcher.o:[cls_prefix_matcher_htb] id 111727 act []
80 eth0(2) clsact/ingress fbflow_icmp id 130246 act []
81 eth0(2) clsact/egress prefix_matcher.o:[cls_prefix_matcher_clsact] id 111726
82 eth0(2) clsact/egress cls_fg_dscp id 108619 act []
83 eth0(2) clsact/egress fbflow_egress id 130245
86 | **# bpftool -jp net**
102 "name": "prefix_matcher.o:[cls_prefix_matcher_htb]",
108 "kind": "clsact/ingress",
109 "name": "fbflow_icmp",
115 "kind": "clsact/egress",
116 "name": "prefix_matcher.o:[cls_prefix_matcher_clsact]",
121 "kind": "clsact/egress",
122 "name": "cls_fg_dscp",
128 "kind": "clsact/egress",
129 "name": "fbflow_egress",
140 **bpf-helpers**\ (7),
142 **bpftool-prog**\ (8),
143 **bpftool-map**\ (8),
144 **bpftool-cgroup**\ (8),
145 **bpftool-perf**\ (8)