XDP_LOADER=${XDP_LOADER:-./xdp-loader}
XDP_FORWARD=${XDP_FORWARD:-./xdp-forward}
-ALL_TESTS="test_ping test_load test_fwd_full test_fwd_direct test_flowtable"
+ALL_TESTS="test_ping test_load test_load_high_ifindex test_fwd_full test_fwd_direct test_flowtable"
test_ping()
{
check_run $XDP_FORWARD unload ${NS_NAMES[@]}
}
+test_load_high_ifindex()
+{
+ # Add a bunch of interfaces to run up the ifindex counter
+ for i in $(seq 64); do
+ ip link add dev veth-forw-test type veth
+ ip link del dev veth-forw-test
+ done
+
+ ip link add dev veth-forw-test type veth
+ check_run $XDP_FORWARD load veth-forw-test
+ check_run $XDP_FORWARD unload veth-forw-test
+}
+
test_fwd_full()
{
# veth NAPI GRO support added this symbol; forwarding won't work without it
$XDP_LOADER unload $NS --all
check_run ip netns exec ${NS_NAMES[-1]} nft flush ruleset
check_run nft flush ruleset
+ ip link del dev veth-forw-test
} >/dev/null 2>&1
}