OSDN Git Service

selftests/bpf/xdp_redirect_multi: Limit the tests in netns
authorHangbin Liu <liuhangbin@gmail.com>
Wed, 27 Oct 2021 03:35:53 +0000 (11:35 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 5 Nov 2021 15:42:56 +0000 (16:42 +0100)
commit8955c1a329873385775081e029d9a7c6aa9037e1
tree9460abe59756d80b2efaebd1154387e8e0901ac1
parent648c3677062fbd14d754b853daebb295426771e8
selftests/bpf/xdp_redirect_multi: Limit the tests in netns

As I want to test both DEVMAP and DEVMAP_HASH in XDP multicast redirect, I
limited DEVMAP max entries to a small value for performace. When the test
runs after amount of interface creating/deleting tests. The interface index
will exceed the map max entries and xdp_redirect_multi will error out with
"Get interfacesInterface index to large".

Fix this issue by limit the tests in netns and specify the ifindex when
creating interfaces.

Fixes: d23292476297 ("selftests/bpf: Add xdp_redirect_multi test")
Reported-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211027033553.962413-5-liuhangbin@gmail.com
tools/testing/selftests/bpf/test_xdp_redirect_multi.sh
tools/testing/selftests/bpf/xdp_redirect_multi.c