selftests/bpf/test_offload.py: Reset ethtool features after failed setting

When setting the ethtool feature flag fails (as expected for the test), the
kernel now tracks that the feature was requested to be 'off' and refuses to
subsequently disable it again. So reset it back to 'on' so a subsequent
disable (that's not supposed to fail) can succeed.

Fixes: 417ec26477 ("selftests/bpf: add offload test based on netdevsim")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/bpf/160752226280.110217.10696241563705667871.stgit@toke.dk
This commit is contained in:
Toke Høiland-Jørgensen 2020-12-09 14:57:42 +01:00 committed by Daniel Borkmann
parent 852c2ee338
commit 766e62b7fc
1 changed files with 1 additions and 0 deletions

View File

@ -946,6 +946,7 @@ try:
start_test("Test disabling TC offloads is rejected while filters installed...") start_test("Test disabling TC offloads is rejected while filters installed...")
ret, _ = sim.set_ethtool_tc_offloads(False, fail=False) ret, _ = sim.set_ethtool_tc_offloads(False, fail=False)
fail(ret == 0, "Driver should refuse to disable TC offloads with filters installed...") fail(ret == 0, "Driver should refuse to disable TC offloads with filters installed...")
sim.set_ethtool_tc_offloads(True)
start_test("Test qdisc removal frees things...") start_test("Test qdisc removal frees things...")
sim.tc_flush_filters() sim.tc_flush_filters()