Split the print statements for RTTs into two parts to avoid inet_ntoa
overwriting one of the IP-addresses (causing both source and
destitionation address to appear the same). Also flip the order of
source and destination to be the same as Pollere's pping.
Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
Copy setup from traffic-pacing-edt to use BTF-defined map if configure
detects that iproute2 has libbpf support, otherwise fall back on
bpf_elf_map. Also fix a minor bug with setting default value for SEC
in bpf_egress_loader.sh.
Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
Switch order so XDP program loads first, so the ts_start map is
automatically pinned by libbpf (solves issue with tc not preserving
the name of the map).
Unload the TCP-BPF program (or rather remove the entire clsact qdisc
it is attached to) using bpg_egress_loader script once program
exits. Also unpin ts_start map on program shutdown.
Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
Make loader use libbpf's existing functionality for reusing pinned
maps. The name for map not kept by tc, so cannot get fd of map by
name. Use fd of first encountered map as temporary workaround.
Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
Format the header files in the Linux kernel style (missed in previous
commit). Also fix a formating error in TODO.md that cause empty
checkboxes to not display correctly.
Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
Format the code using the .clang-format from the kernel source tree,
with a few manual tweaks here and there. Also, remove the TODO list
from comment of pping.c and instead put it in TODO.md.
Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
Make tc pin the ts_start map when loading the TC-BPF program, and
rewrite XDP loader to reuse map pinned by tc.
Also add comment with TODO list in pping.c.
Testing pping by adding a delay through a netem qdisc in the test
environment shows that the reported RTT will approach 100ms for any
delay lower than 100ms, but the correct RTT for any delay over
100ms. Root cause is unknown, but Pollere's original pping
implementation (as well as a bpftrace based pping implementation)
shows the same issue. This issue has not been observed when running on
real interfaces without a netem qdisc.
Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
Split and rename files so there is one userspace program (pping) and
two kernel-space ones (one for XDP and one for TC-BPF).
Copy the shell script for loading the TC-BPF program from
traffic-pacing-edt folder, but add support for loading a specific
section.
The XDP and TC-BPF programs do not share the ts_start map, so program
does not work.
Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
The XDP program pushes the calculated RTTs to userspace through the
perf-buffer and the userspace program polls it to print them out
Signed-off-by: Simon Sundberg <simon.sundberg@kau.se>
When installing libbpf headers into 'lib/libbpf/src/root/' then the git
submodule for libbpf is marked dirty. This result in stgit complains under
different operations.
This patch fix the issue by installing libbpf outside submodule directory.
Choose directory 'lib/libbpf-install/' to emphasize relation to 'lib/libbpf/'.
V2: Don't install the library only the header files as before. Also
installing the should be a separate commit. Patch still statically
link with libbpf/src/libbpf.a.
Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
SPDX-License should be first line in file.
This Makefile is for bpf-examples not xdp-tools.
Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
We run 'make install' inside the libbpf subdirectory which will mark it as
'dirty' as far as the parent repo is concerned. Since we're not doing any
libbpf development in this repository, just ignoring it should not bring
any issues; we'll still get a notification if the committed content of the
submodule changes.
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
On production setup i40e driver sends all packets to CPU-6 (RX).
Thus, we want to exclude CPU-6 itself from processing/pacing
packets itself.
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
Implement configure script that detect support, and Makefile
defines that propagate to BPF-C file, making it possible to
use and compile with BTF type maps.
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
The bpftrace programs use bpf_ktime_get_boot_ns, for underlying 'nsecs'
keyword. Switch TC-BPF prog to use the same, to make sure that we
don't report false result when detecting/measureing EDT accuracy.
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
This can be used by bpftrace programs to identify different
stages, when trying to determine the EDT accuracy.
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
Also found measurement tool can disturb timing.
I might have to write this in BPF-C directly to avoid overhead.
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
The hard drop horizon (T_HORIZON_DROP) can be increased (to 40ms)
as codel target latency (T_HORIZON_TARGET) is taking care of
signaling TCP downloads via drops (after codel scheme).
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>