Simon Sundberg e9db312ad5 pping: Add fallback entry for aggregation maps
The aggregation maps may become full, in which case the BPF programs
will fail to create new entries for any IP-prefixes not currently in
the map. This would previously result in stats from traffic that
cannot fit into any aggregation entry to be missed.

Add a fallback entry for each map, so that in case the aggregation map
is full stats from any new IP-prefix will be added to this fallback
entry instead. The fallback entry is reported as 0.0.0.0/0 (for IPv4)
or ::/0 (for IPv6) in the output.

Note that this is implemented by adding specific "magic values" as
special keys in the aggregation maps (see IPV{4,6}_BACKUP_KEY in
pping.h). These special keys have been selected so that no real
traffic should collide with them by using prefixes from blocks
reserved for documentation. Furthermore, these entries are added by
the user space program AFTER the BPF programs are attached (as it's
not possible to do it in-between loading and attaching when using
libxdp). In case the BPF programs manage to fill the maps before the
user space component can create the backup entries, it will fail and
abort the program.

Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
2023-07-06 18:01:57 +02:00
2021-06-21 22:51:57 +02:00
2022-03-06 21:54:01 +08:00
2023-03-30 18:09:55 +02:00
2022-11-22 12:58:43 +01:00
2021-11-06 12:33:09 +00:00

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 it 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 script). It is a declared goal to make BPF programming more consumable by detecting and reporting issues (when possible).

Description
No description provided
Readme 25 MiB
Languages
C 93.6%
Shell 4.7%
Makefile 1.6%