mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
93b6c0eafa18d13d44466ae0b3e17b64f7ed0289
Merge the pping_kern_tc.c, pping_kern_xdp.c and pping_helpers.h into the single file pping_kern.c. Do not change any of the BPF code, except renaming the map ts_start to packet_ts. To handle both BPF programs kept in single ELF-file, change loading mechanism to extract and attach both tc and XDP programs from it. Also refactor main-method into several smaller functions to reduce its size. Finally, added the --force (-f) and --cleanup-interval (-c) options to the argument parsing, and improved the parsing of the --rate-limit (-r) option. NOTE: The verifier rejects program in it's current state as too large (over 1 million instructions). Setting the TCP_MAX_OPTIONS in pping_kern.c to 5 (or less) solves this. Unsure at the moment what causes the verifier to think the program is so large, as the code in pping_kern.c is identical to the one from the three files it was merged from. Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
Practical BPF examples
This git repository contains a diverse set of practical BPF examples that solve (or demonstrate) a specific use-case using BPF.
It is meant to ease doing rapid prototyping and development, writing C-code BPF programs using libbpf. The goal is to make is easier for developers to get started coding.
Many developers struggle to get a working BPF build environment. The repo enviroment makes it easy to build/compile BPF programs by doing the necessary libbpf setup transparently and detect missing compile dependencies (via the (configure)[configure] script). It is a declared goal to make BPF programming more consumable by detecting and reporting issues (when possible).
Description
Languages
C
93.6%
Shell
4.7%
Makefile
1.6%