OSDN Git Service

selftests/bpf: Test switching TCP Congestion Control algorithms.
authorKui-Feng Lee <kuifeng@meta.com>
Thu, 23 Mar 2023 03:24:05 +0000 (20:24 -0700)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 23 Mar 2023 05:53:25 +0000 (22:53 -0700)
commit06da9f3bd6418e06719f15340202996f7a4c258d
tree4122c213c03490408526d5efbce58bc853c742f4
parent809a69d61899f6b79a8e9de474cd93249580fdaf
selftests/bpf: Test switching TCP Congestion Control algorithms.

Create a pair of sockets that utilize the congestion control algorithm
under a particular name. Then switch up this congestion control
algorithm to another implementation and check whether newly created
connections using the same cc name now run the new implementation.

Also, try to update a link with a struct_ops that is without
BPF_F_LINK or with a wrong or different name.  These cases should fail
due to the violation of assumptions.  To update a bpf_link of a
struct_ops, it must be replaced with another struct_ops that is
identical in type and name and has the BPF_F_LINK flag.

The other test case is to create links from the same struct_ops more
than once.  It makes sure a struct_ops can be used repeatly.

Signed-off-by: Kui-Feng Lee <kuifeng@meta.com>
Link: https://lore.kernel.org/r/20230323032405.3735486-9-kuifeng@meta.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
tools/testing/selftests/bpf/progs/tcp_ca_update.c [new file with mode: 0644]