Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squash to "selftests/bpf: Add bpf_first test"
''' This patch extends the MPTCP test base to support MPTCP packet scheduler tests. Add a new test to use the default in-kernel scheduler. In the new helper sched_init(), invoke create_netns() to create a net namespace, and invoke endpoint_init() to add two veth net devices to simulate the multiple addresses case and add the new endpoint ADDR_2 to PM netlink. Use sysctl to set net.mptcp.scheduler to use the given sched. Invoke start_mptcp_server() to start the server on ADDR_1, and invoke connect_to_fd() to connect with the server from the client. Then invoke send_data() to send data. Some code in send_data() is from prog_tests/bpf_tcp_ca.c. Add time metrics for BPF tests to compare the performance of each schedulers. Run prog_tests with '-v' option can print out the running time of each test. Use the new helper has_bytes_sent() to check the bytes_sent filed of 'ss' output after send_data() to make sure no data has been sent on ADDR_2. All data has been sent on the first subflow. Invoke the new helper sched_cleanup() to set back net.mptcp.scheduler to default, flush all mptcp endpoints, and delete the veth net devices. Then this patch adds the bpf_first scheduler test: test_first(). Use sysctl to set net.mptcp.scheduler to use this sched. Add two veth net devices to simulate the multiple addresses case. Use 'ip mptcp endpoint' command to add the new endpoint ADDR_2 to PM netlink. Send data and check bytes_sent of 'ss' output after it to make sure the data has been only sent on the first subflow ADDR_1. ''' Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
- Loading branch information