Commit 9d463f78 authored by Aleksei Oladko's avatar Aleksei Oladko Committed by Jakub Kicinski
Browse files

selftests: net: io_uring_zerocopy: enable io_uring for the test



The io_uring_zerocopy.sh kselftest assumes that io_uring support is
enabled on the host system. When io_uring is disabled via the
kernel.io_uring_disabled sysctl, the test fails.

Explicitly enable io_uring for the test by setting
kernel.io_uring_disabled=0.

Save the original value of kernel.io_uring_disabled before changing
it and restore it in cleanup handler to ensure the system state is
restored regardless of test outcome.

Signed-off-by: default avatarAleksei Oladko <aleksey.oladko@virtuozzo.com>
Signed-off-by: default avatarKonstantin Khorenko <khorenko@virtuozzo.com>
Link: https://patch.msgid.link/20260321215908.175465-5-aleksey.oladko@virtuozzo.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a897e194
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -77,9 +77,13 @@ esac

# Start of state changes: install cleanup handler

old_io_uring_disabled=0
cleanup() {
	ip netns del "${NS2}"
	ip netns del "${NS1}"
	if [ "$old_io_uring_disabled" -ne 0 ]; then
		sysctl -w -q kernel.io_uring_disabled="$old_io_uring_disabled" 2>/dev/null || true
	fi
}

trap cleanup EXIT
@@ -122,5 +126,10 @@ do_test() {
	wait
}

old_io_uring_disabled=$(sysctl -n kernel.io_uring_disabled 2>/dev/null || echo "0")
if [ "$old_io_uring_disabled" -ne 0 ]; then
	sysctl -w -q kernel.io_uring_disabled=0
fi

do_test "${EXTRA_ARGS}"
echo ok