selftests: forwarding: Add MDB dump test cases
authorIdo Schimmel <idosch@nvidia.com>
Thu, 9 Feb 2023 07:18:52 +0000 (09:18 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 11 Feb 2023 03:21:13 +0000 (19:21 -0800)
commit049139126ec7ab55b568b2935aa7db5e6657258c
treede4f9b180dad3811f29604bafd023b7920665e19
parent170afa71e3a2bd4ddaa3bac44512ce0b828a026f
selftests: forwarding: Add MDB dump test cases

The kernel maintains three markers for the MDB dump:

1. The last bridge device from which the MDB was dumped.
2. The last MDB entry from which the MDB was dumped.
3. The last port-group entry that was dumped.

Add test cases for large scale MDB dump to make sure that all the
configured entries are dumped and that the markers are used correctly.

Specifically, create 2 bridges with 32 ports and add 256 MDB entries in
which all the ports are member of. Test that each bridge reports 8192
(256 * 32) permanent entries. Do that with IPv4, IPv6 and L2 MDB
entries.

On my system, MDB dump of the above is contained in about 50 netlink
messages.

Example output:

 # ./bridge_mdb.sh
 [...]
 INFO: # Large scale dump tests
 TEST: IPv4 large scale dump tests                                   [ OK ]
 TEST: IPv6 large scale dump tests                                   [ OK ]
 TEST: L2 large scale dump tests                                     [ OK ]
 [...]

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/forwarding/bridge_mdb.sh