selftests: net: bridge: Parameterize ageing timeout
authorTobias Waldekranz <tobias@waldekranz.com>
Thu, 3 Feb 2022 10:16:57 +0000 (11:16 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Feb 2022 14:05:56 +0000 (14:05 +0000)
Allow the ageing timeout that is set on bridges to be customized from
forwarding.config. This allows the tests to be run on hardware which
does not support a 10s timeout (e.g. mv88e6xxx).

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh
tools/testing/selftests/net/forwarding/bridge_vlan_unaware.sh
tools/testing/selftests/net/forwarding/forwarding.config.sample
tools/testing/selftests/net/forwarding/lib.sh

index b90dff8..64bd00f 100755 (executable)
@@ -28,8 +28,9 @@ h2_destroy()
 
 switch_create()
 {
-       # 10 Seconds ageing time.
-       ip link add dev br0 type bridge vlan_filtering 1 ageing_time 1000 \
+       ip link add dev br0 type bridge \
+               vlan_filtering 1 \
+               ageing_time $LOW_AGEING_TIME \
                mcast_snooping 0
 
        ip link set dev $swp1 master br0
index c15c6c8..1c8a260 100755 (executable)
@@ -27,8 +27,9 @@ h2_destroy()
 
 switch_create()
 {
-       # 10 Seconds ageing time.
-       ip link add dev br0 type bridge ageing_time 1000 mcast_snooping 0
+       ip link add dev br0 type bridge \
+               ageing_time $LOW_AGEING_TIME \
+               mcast_snooping 0
 
        ip link set dev $swp1 master br0
        ip link set dev $swp2 master br0
index b0980a2..4a54650 100644 (file)
@@ -41,6 +41,8 @@ NETIF_CREATE=yes
 # Timeout (in seconds) before ping exits regardless of how many packets have
 # been sent or received
 PING_TIMEOUT=5
+# Minimum ageing_time (in centiseconds) supported by hardware
+LOW_AGEING_TIME=1000
 # Flag for tc match, supposed to be skip_sw/skip_hw which means do not process
 # filter by software/hardware
 TC_FLAG=skip_hw
index 7da783d..e7e434a 100644 (file)
@@ -24,6 +24,7 @@ PING_COUNT=${PING_COUNT:=10}
 PING_TIMEOUT=${PING_TIMEOUT:=5}
 WAIT_TIMEOUT=${WAIT_TIMEOUT:=20}
 INTERFACE_TIMEOUT=${INTERFACE_TIMEOUT:=600}
+LOW_AGEING_TIME=${LOW_AGEING_TIME:=1000}
 REQUIRE_JQ=${REQUIRE_JQ:=yes}
 REQUIRE_MZ=${REQUIRE_MZ:=yes}