aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/test_progs.h
diff options
context:
space:
mode:
authorbrakmo <brakmo@fb.com>2019-03-01 12:38:49 -0800
committerAlexei Starovoitov <ast@kernel.org>2019-03-02 10:48:27 -0800
commita1270fe95b74eb3195b107c494ed1f11b932a278 (patch)
tree4e5c9ed3db58c84fc9bc094ef6a3f11d72147f89 /tools/testing/selftests/bpf/test_progs.h
parentbpf: Sample HBM BPF program to limit egress bw (diff)
downloadlinux-dev-a1270fe95b74eb3195b107c494ed1f11b932a278.tar.xz
linux-dev-a1270fe95b74eb3195b107c494ed1f11b932a278.zip
bpf: User program for testing HBM
The program nrm creates a cgroup and attaches a BPF program to the cgroup for testing HBM (Host Bandwidth Manager) for egress traffic. One still needs to create network traffic. This can be done through netesto, netperf or iperf3. A follow-up patch contains a script to create traffic. USAGE: hbm [-d] [-l] [-n <id>] [-r <rate>] [-s] [-t <secs>] [-w] [-h] [prog] Where: -d Print BPF trace debug buffer -l Also limit flows doing loopback -n <#> To create cgroup "/hbm#" and attach prog. Default is /nrm1 This is convenient when testing HBM in more than 1 cgroup -r <rate> Rate limit in Mbps -s Get HBM stats (marked, dropped, etc.) -t <time> Exit after specified seconds (deault is 0) -w Work conserving flag. cgroup can increase its bandwidth beyond the rate limit specified while there is available bandwidth. Current implementation assumes there is only NIC (eth0), but can be extended to support multiple NICs. Currrently only supported for egress. Note, this is just a proof of concept. -h Print this info prog BPF program file name. Name defaults to hbm_out_kern.o More information about HBM can be found in the paper "BPF Host Resource Management" presented at the 2018 Linux Plumbers Conference, Networking Track (http://vger.kernel.org/lpc_net2018_talks/LPC%20BPF%20Network%20Resource%20Paper.pdf) Signed-off-by: Lawrence Brakmo <brakmo@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/test_progs.h')
0 files changed, 0 insertions, 0 deletions