2 # SPDX-License-Identifier: GPL-2.0
4 # Bridge FDB entries can be offloaded to DSA switches without holding the
5 # rtnl_mutex. Traditionally this mutex has conferred drivers implicit
6 # serialization, which means their code paths are not well tested in the
7 # presence of concurrency.
8 # This test creates a background task that stresses the FDB by adding and
9 # deleting an entry many times in a row without the rtnl_mutex held.
10 # It then tests the driver resistance to concurrency by calling .ndo_fdb_dump
11 # (with rtnl_mutex held) from a foreground task.
12 # Since either the FDB dump or the additions/removals can fail, but the
13 # additions and removals are performed in deferred as opposed to process
14 # context, we cannot simply check for user space error codes.
21 lib_dir
=$
(dirname "$0")
22 source "$lib_dir"/..
/..
/..
/net
/forwarding
/lib.sh
26 kill $pid && wait $pid &> /dev
/null
28 echo "Please check kernel log for errors"
34 ip link del br0
2>&1 >/dev
/null ||
:
35 ip link add br0
type bridge
&& ip link
set $eth master br0
38 bridge fdb add
00:01:02:03:04:05 dev
$eth master static
39 bridge fdb del
00:01:02:03:04:05 dev
$eth master static
43 for i
in $
(seq 1 50); do
44 bridge fdb show
> /dev
/null
46 echo "$((${i} * 2))% complete..."