]> Gentwo Git Trees - linux/.git/commit
selftests/bpf: test_xsk: Don't exit immediately on allocation failures
authorBastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
Fri, 31 Oct 2025 08:04:49 +0000 (09:04 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 31 Oct 2025 16:24:39 +0000 (09:24 -0700)
commit7a96615f2e2d8db3e768d379c34d3ec94f45083b
treeee8c517c7d5791748de73ef7483cad9d488392b4
parent844b13a9ff547c927f496a47293c8f1739364e40
selftests/bpf: test_xsk: Don't exit immediately on allocation failures

If any allocation in the pkt_stream_*() helpers fail, exit_with_error() is
called. This terminates the program immediately. It prevents the following
tests from running and isn't compliant with the CI.

Return NULL in case of allocation failure.
Return TEST_FAILURE when something goes wrong in the packet generation.
Clean up the resources if a failure happens between two steps of a test.

Move exit_with_error()'s definition into xskxceiver.c as it isn't used
anywhere else now.

Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
Link: https://lore.kernel.org/r/20251031-xsk-v7-13-39fe486593a3@bootlin.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/test_xsk.c
tools/testing/selftests/bpf/test_xsk.h
tools/testing/selftests/bpf/xskxceiver.c