forked from Minki/linux
selftests/bpf/test_offload.py: Remove check for program load flags match
Since we just removed the xdp_attachment_flags_ok() callback, also remove
the check for it in test_offload.py, and replace it with a test for the new
ambiguity-avoid check when multiple programs are loaded.
Fixes: 7f0a838254
("bpf, xdp: Maintain info on attached XDP BPF programs in net_device")
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/160752225858.110217.13036901876869496246.stgit@toke.dk
This commit is contained in:
parent
998f172962
commit
0b5b6e747c
@ -716,13 +716,11 @@ def test_multi_prog(simdev, sim, obj, modename, modeid):
|
||||
fail(ret == 0, "Replaced one of programs without -force")
|
||||
check_extack(err, "XDP program already attached.", args)
|
||||
|
||||
if modename == "" or modename == "drv":
|
||||
othermode = "" if modename == "drv" else "drv"
|
||||
start_test("Test multi-attachment XDP - detach...")
|
||||
ret, _, err = sim.unset_xdp(othermode, force=True,
|
||||
fail=False, include_stderr=True)
|
||||
fail(ret == 0, "Removed program with a bad mode")
|
||||
check_extack(err, "program loaded with different flags.", args)
|
||||
start_test("Test multi-attachment XDP - remove without mode...")
|
||||
ret, _, err = sim.unset_xdp("", force=True,
|
||||
fail=False, include_stderr=True)
|
||||
fail(ret == 0, "Removed program without a mode flag")
|
||||
check_extack(err, "More than one program loaded, unset mode is ambiguous.", args)
|
||||
|
||||
sim.unset_xdp("offload")
|
||||
xdp = sim.ip_link_show(xdp=True)["xdp"]
|
||||
@ -1001,16 +999,6 @@ try:
|
||||
check_extack(err,
|
||||
"native and generic XDP can't be active at the same time.",
|
||||
args)
|
||||
ret, _, err = sim.set_xdp(obj, "", force=True,
|
||||
fail=False, include_stderr=True)
|
||||
fail(ret == 0, "Replaced XDP program with a program in different mode")
|
||||
check_extack(err, "program loaded with different flags.", args)
|
||||
|
||||
start_test("Test XDP prog remove with bad flags...")
|
||||
ret, _, err = sim.unset_xdp("", force=True,
|
||||
fail=False, include_stderr=True)
|
||||
fail(ret == 0, "Removed program with a bad mode")
|
||||
check_extack(err, "program loaded with different flags.", args)
|
||||
|
||||
start_test("Test MTU restrictions...")
|
||||
ret, _ = sim.set_mtu(9000, fail=False)
|
||||
|
Loading…
Reference in New Issue
Block a user