Skip to content

Commit 6b1c35c

Browse files
committed
xdp-forward: Add test for attaching to a high ifindex
Add a test that creates an interface with a high ifindex and verify that xdp-forward can attach to it. Signed-off-by: Toke Høiland-Jørgensen <[email protected]>
1 parent f8819ea commit 6b1c35c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

xdp-forward/tests/test-xdp-forward.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
XDP_LOADER=${XDP_LOADER:-./xdp-loader}
22
XDP_FORWARD=${XDP_FORWARD:-./xdp-forward}
3-
ALL_TESTS="test_ping test_load test_fwd_full test_fwd_direct test_flowtable"
3+
ALL_TESTS="test_ping test_load test_load_high_ifindex test_fwd_full test_fwd_direct test_flowtable"
44

55
test_ping()
66
{
@@ -21,6 +21,19 @@ test_load()
2121
check_run $XDP_FORWARD unload ${NS_NAMES[@]}
2222
}
2323

24+
test_load_high_ifindex()
25+
{
26+
# Add a bunch of interfaces to run up the ifindex counter
27+
for i in $(seq 64); do
28+
ip link add dev veth-forw-test type veth
29+
ip link del dev veth-forw-test
30+
done
31+
32+
ip link add dev veth-forw-test type veth
33+
check_run $XDP_FORWARD load veth-forw-test
34+
check_run $XDP_FORWARD unload veth-forw-test
35+
}
36+
2437
test_fwd_full()
2538
{
2639
# veth NAPI GRO support added this symbol; forwarding won't work without it
@@ -137,5 +150,6 @@ cleanup_tests()
137150
$XDP_LOADER unload $NS --all
138151
check_run ip netns exec ${NS_NAMES[-1]} nft flush ruleset
139152
check_run nft flush ruleset
153+
ip link del dev veth-forw-test
140154
} >/dev/null 2>&1
141155
}

0 commit comments

Comments
 (0)