summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/xsk_prereqs.sh
diff options
context:
space:
mode:
authorMaciej Fijalkowski <maciej.fijalkowski@intel.com>2023-07-19 16:24:21 +0300
committerAlexei Starovoitov <ast@kernel.org>2023-07-19 19:56:51 +0300
commit3666bccab43a33904372eaa26936dabef3232497 (patch)
treea88c7e4e4a7561ed8c3987fa627481c2e3d2903e /tools/testing/selftests/bpf/xsk_prereqs.sh
parent807bf4da204938f01ad2e994ba92e82ac486ea2b (diff)
downloadlinux-3666bccab43a33904372eaa26936dabef3232497.tar.xz
selftests/xsk: reset NIC settings to default after running test suite
Currently, when running ZC test suite, after finishing first run of test suite and then switching to busy-poll tests within xskxceiver, such errors are observed: libbpf: Kernel error message: ice: MTU is too large for linear frames and XDP prog does not support frags 1..26 libbpf: Kernel error message: Native and generic XDP can't be active at the same time Error attaching XDP program not ok 1 [xskxceiver.c:xsk_reattach_xdp:1568]: ERROR: 17/"File exists" this is because test suite ends with 9k MTU and native xdp program being loaded. Busy-poll tests start non-multi-buffer tests for generic mode. To fix this, let us introduce bash function that will reset NIC settings to default (e.g. 1500 MTU and no xdp progs loaded) so that test suite can continue without interrupts. It also means that after busy-poll tests NIC will have those default settings, whereas right now it is left with 9k MTU and xdp prog loaded in native mode. Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Link: https://lore.kernel.org/r/20230719132421.584801-25-maciej.fijalkowski@intel.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/xsk_prereqs.sh')
-rwxr-xr-xtools/testing/selftests/bpf/xsk_prereqs.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/xsk_prereqs.sh b/tools/testing/selftests/bpf/xsk_prereqs.sh
index ae697a10a056..29175682c44d 100755
--- a/tools/testing/selftests/bpf/xsk_prereqs.sh
+++ b/tools/testing/selftests/bpf/xsk_prereqs.sh
@@ -53,6 +53,13 @@ test_exit()
exit 1
}
+cleanup_iface()
+{
+ ip link set $1 mtu $2
+ ip link set $1 xdp off
+ ip link set $1 xdpgeneric off
+}
+
clear_configs()
{
[ $(ip link show $1 &>/dev/null; echo $?;) == 0 ] &&