-
Notifications
You must be signed in to change notification settings - Fork 5
selftests/bpf: convert test_tc_edt.sh into test_progs #6440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
selftests/bpf: convert test_tc_edt.sh into test_progs #6440
Conversation
|
Upstream branch: 688b745 |
8c83cb5 to
f015201
Compare
|
Upstream branch: 19f4091 |
c147faa to
0f38a15
Compare
f015201 to
884c5bc
Compare
|
Upstream branch: bd5bdd2 |
0f38a15 to
7f80369
Compare
884c5bc to
4355736
Compare
The test_tc_edt BPF program uses a custom section name, which works fine when manually loading it with tc, but prevents it from being loaded with libbpf. Update the program section name to "tc" to be able to manipulate it with a libbpf-based C test. Signed-off-by: Alexis Lothoré (eBPF Foundation) <[email protected]>
|
Upstream branch: 34235a3 |
test_tc_edt.sh uses a pair of veth and a BPF program attached to the TX veth to shape the traffic to 5MBps. It then checks that the amount of received bytes (at interface level), compared to the TX duration, indeed matches 5Mbps. Convert this test script to the test_progs framework: - keep the double veth setup, isolated in two veths - run a small tcp server, and connect client to server - push a pre-configured amount of bytes, and measure how much time has been needed to push those - ensure that this rate is in a 2% error margin around the target rate This two percent value, while being tight, is hopefully large enough to not make the test too flaky in CI, while also turning it into a small example of BPF-based shaping. Signed-off-by: Alexis Lothoré (eBPF Foundation) <[email protected]>
Now that test_tc_edt has been integrated in test_progs, remove the legacy shell script. Signed-off-by: Alexis Lothoré (eBPF Foundation) <[email protected]>
test_tc_edt currently defines the target rate in both the userspace and BPF parts. This value could be defined once in the userspace part if we make it able to configure the BPF program before starting the test. Add a target_rate variable in the BPF part, and make the userspace part set it to the desired rate before attaching the shaping program. Signed-off-by: Alexis Lothoré (eBPF Foundation) <[email protected]>
7f80369 to
b6205f4
Compare
5bece43 to
52f5a27
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1028802 irrelevant now. Closing PR. |
Pull request for series with
subject: selftests/bpf: convert test_tc_edt.sh into test_progs
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1028802