Skip to content

Commit 91432fe

Browse files
committed
tc-policy: Update README with info on inspecting loaded BPF-progs
Signed-off-by: Jesper Dangaard Brouer <[email protected]>
1 parent 71d1479 commit 91432fe

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tc-policy/README.org

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,32 @@ Or as oneliner:
8787
#+begin_src sh
8888
bpftrace -e 't:net:net_dev_start_xmit {@txq[str(args->name, 15)]=lhist(args->queue_mapping, 0,32,1)}'
8989
#+end_src
90+
91+
* Inspecting loaded BPF
92+
93+
How do you see if these BPF TC-hook programs are loaded?
94+
95+
** bpftool
96+
97+
The cmdline =bpftool net= can list any network related BPF program:
98+
99+
#+begin_example
100+
root@main-ctrl2:~ # bpftool net
101+
xdp:
102+
eth1(5) driver id 59
103+
104+
tc:
105+
eth1(5) clsact/egress not_txq_zero:[17] id 17
106+
#+end_example
107+
108+
There we see both the *XDP* BPF-program used by AF_XDP to redirect frames, and
109+
the *TC* hook BPF-prog loaded and attached.
110+
111+
** tc egress
112+
113+
The tc command need to be longer and more explicit:
114+
#+begin_example
115+
root@main-ctrl2:~ # tc filter show dev eth1 egress
116+
filter protocol all pref 49199 bpf chain 0
117+
filter protocol all pref 49199 bpf chain 0 handle 0x1 not_txq_zero:[17] direct-action not_in_hw id 17 tag a761e11074b78959 jited
118+
#+end_example

0 commit comments

Comments
 (0)