diff mbox series

[1/1] tc-bpf: added instructions to build cbpf generator

Message ID 20220425165733.240902-2-mdr@ashroe.eu (mailing list archive)
State New, archived
Delegated to: Stephen Hemminger
Headers show
Series updates to tc-bpf manpage | expand

Checks

Context Check Description
bpf/vmtest-bpf-PR fail merge-conflict
netdev/tree_selection success Not a local patch

Commit Message

Ray Kinsella April 25, 2022, 4:57 p.m. UTC
Updated the man page for tc-bpf, detailing how to build to the cbpf
generator and using it in the subsequent example.

Signed-off-by: Ray Kinsella <mdr@ashroe.eu>
---
 man/man8/tc-bpf.8 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/man/man8/tc-bpf.8 b/man/man8/tc-bpf.8
index e4f68aaa..1d3ab633 100644
--- a/man/man8/tc-bpf.8
+++ b/man/man8/tc-bpf.8
@@ -892,13 +892,21 @@  int main(int argc, char **argv)
 .fi
 .in
 
+Build this helper by compiling the source above, and linking with
+.B libpcap
+as follows:
+
+.in +4n
+.B clang -g -O2 cbpf-gen.c -lpcap -o cbpf-gen
+.in
+
 Given this small helper, any
 .B tcpdump(8)
 filter expression can be abused as a classifier where a match will
 result in the default classid:
 
 .in +4n
-.B bpftool EN10MB 'tcp[tcpflags] & tcp-syn != 0' > /var/bpf/tcp-syn
+.B cbpf-gen 'tcp[tcpflags] & tcp-syn != 0' > /var/bpf/tcp-syn
 .br
 .B tc filter add dev em1 parent 1: bpf bytecode-file /var/bpf/tcp-syn flowid 1:1
 .in