-
Notifications
You must be signed in to change notification settings - Fork 132
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: Integrate test_xsk.c to test_progs framework #8670
base: bpf-next_base
Are you sure you want to change the base?
Conversation
Upstream branch: 46d38f4 |
720c696
to
c17650d
Compare
Upstream branch: 956e816 |
682c6c2
to
231679c
Compare
c17650d
to
7879197
Compare
Upstream branch: 2d7597d |
231679c
to
f07a9f4
Compare
7879197
to
dc8d1d6
Compare
Upstream branch: 2d7597d |
f07a9f4
to
4aa22e2
Compare
dc8d1d6
to
c16ba17
Compare
Upstream branch: 8c10109 |
4aa22e2
to
794fd8f
Compare
c16ba17
to
84222f6
Compare
bitmap is used before being initialized. Initialize it to zero before using it. Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
Some tests introduce memory leaks by not freeing all the pkt_stream objects they're creating. Fix these memory leaks. Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
xskxceiver depends on kselftests which prevent from integrating it into the test_progs framework. Wrap the ksft_*() calls behind macros to ease the future integration into test_progs. Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
init_iface() doesn't have any return value while it can fail. In case of failure it calls exit_on_error() which will terminate the test immediately. Add a return value to init_iface() so errors can be handled more smoothly. Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
xsk_reattach_xdp calls exit_on_error() on failures. This exits the program immediately and can lead to memory leaks. Add a return value to the functions handling XDP attachments to handle errors more smoothly. Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
exit_on_error() is called when gettimeofday() fails. This exits the program immediately and can lead to memory leaks. Return TEST_FAILURE instead of calling exit_on_error() Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
TX and RX workers can fail in many places. These failures trigger a call to exit_on_error() which exits the program immediately and can lead to memory leak. Add return value to functions that can fail. Handle failures more smoothly through report_failure(). Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
…ails __testapp_validate_traffic() calls exit_on_error() on failures. This exits the program immediately and can lead to memory leaks. Return TEST_FAILURE instead of calling exit_on_error(). Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
If any allocation in the pkt_stream_*() helpers fail, exit_on_error() is called. This terminates the program immediately and can lead to memory leaks. Return NULL in case of allocation failure. Return TEST_FAILURE when something goes wrong in the packet generation. Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
AF_XDP features are tested by the test_xsk.sh script but not by the test_progs framework. The tests used by the script are defined in xksxceiver.c which can't be integrated in the test_progs framework as is. Extract these test definitions from xskxceiver{.c/.h} to put them in new test_xsk{.c/.h} files. Keep the main() function and its unshared dependencies in xksxceiver to avoid impacting the test_xsk.sh script which is often used to test real hardware. Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
test_xsk.c uses the kselftest framework. This isn't compatible with the test_progs framework. Add a XSK_SELTFEST define that allows to enable/disable the kselftest usage. Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
Some tests are flaky (especially on s390). So they don't fit in the CI. Remove flaky tests from the tests table so they won't be run by the CI in upcoming patch. Create a flaky_tests table to hold them. Use the flaky table in xskxceiver.c so the tests remain available for HW in test_xsk.sh. Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
test_xsk.c isn't part of the test_progs framework. Integrate the tests defined by test_xsk.c into the test_progs framework through a new file : prog_tests/xsk.c. ZeroCopy mode isn't tested in it as veth peers don't support it. Move test_xsk{.c/.h} to prog_tests/. Add the find_bit library to test_progs sources in the Makefile as it is is used by test_xsk.c Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
Upstream branch: bb2243f |
794fd8f
to
1556503
Compare
Pull request for series with
subject: selftests/bpf: Integrate test_xsk.c to test_progs framework
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=943477