1================ 2bpftool-net 3================ 4------------------------------------------------------------------------------- 5tool for inspection of netdev/tc related bpf prog attachments 6------------------------------------------------------------------------------- 7 8:Manual section: 8 9 10SYNOPSIS 11======== 12 13 **bpftool** [*OPTIONS*] **net** *COMMAND* 14 15 *OPTIONS* := { [{ **-j** | **--json** }] [{ **-p** | **--pretty** }] } 16 17 *COMMANDS* := 18 { **show** | **list** } [ **dev** name ] | **help** 19 20NET COMMANDS 21============ 22 23| **bpftool** **net { show | list } [ dev name ]** 24| **bpftool** **net help** 25 26DESCRIPTION 27=========== 28 **bpftool net { show | list } [ dev name ]** 29 List bpf program attachments in the kernel networking subsystem. 30 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. 41 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. 49 50 **bpftool net help** 51 Print short help message. 52 53OPTIONS 54======= 55 -h, --help 56 Print short generic help message (similar to **bpftool help**). 57 58 -V, --version 59 Print version number (similar to **bpftool version**). 60 61 -j, --json 62 Generate JSON output. For commands that cannot produce JSON, this 63 option has no effect. 64 65 -p, --pretty 66 Generate human-readable JSON output. Implies **-j**. 67 68 -d, --debug 69 Print all logs available from libbpf, including debug-level 70 information. 71 72EXAMPLES 73======== 74 75| **# bpftool net** 76 77:: 78 79 xdp: 80 eth0(2) driver id 198 81 82 tc: 83 eth0(2) htb name prefix_matcher.o:[cls_prefix_matcher_htb] id 111727 act [] 84 eth0(2) clsact/ingress fbflow_icmp id 130246 act [] 85 eth0(2) clsact/egress prefix_matcher.o:[cls_prefix_matcher_clsact] id 111726 86 eth0(2) clsact/egress cls_fg_dscp id 108619 act [] 87 eth0(2) clsact/egress fbflow_egress id 130245 88 89| 90| **# bpftool -jp net** 91 92:: 93 94 [{ 95 "xdp": [{ 96 "devname": "eth0", 97 "ifindex": 2, 98 "mode": "driver", 99 "id": 198 100 } 101 ], 102 "tc": [{ 103 "devname": "eth0", 104 "ifindex": 2, 105 "kind": "htb", 106 "name": "prefix_matcher.o:[cls_prefix_matcher_htb]", 107 "id": 111727, 108 "act": [] 109 },{ 110 "devname": "eth0", 111 "ifindex": 2, 112 "kind": "clsact/ingress", 113 "name": "fbflow_icmp", 114 "id": 130246, 115 "act": [] 116 },{ 117 "devname": "eth0", 118 "ifindex": 2, 119 "kind": "clsact/egress", 120 "name": "prefix_matcher.o:[cls_prefix_matcher_clsact]", 121 "id": 111726, 122 },{ 123 "devname": "eth0", 124 "ifindex": 2, 125 "kind": "clsact/egress", 126 "name": "cls_fg_dscp", 127 "id": 108619, 128 "act": [] 129 },{ 130 "devname": "eth0", 131 "ifindex": 2, 132 "kind": "clsact/egress", 133 "name": "fbflow_egress", 134 "id": 130245, 135 } 136 ] 137 } 138 ] 139 140 141SEE ALSO 142======== 143 **bpf**\ (2), 144 **bpf-helpers**\ (7), 145 **bpftool**\ (8), 146 **bpftool-prog**\ (8), 147 **bpftool-map**\ (8), 148 **bpftool-cgroup**\ (8), 149 **bpftool-feature**\ (8), 150 **bpftool-perf**\ (8), 151 **bpftool-btf**\ (8) 152