mlxsw: spectrum_switchdev: Optimize SFN records processing
authorJiri Pirko <jiri@mellanox.com>
Wed, 26 Feb 2020 08:39:17 +0000 (09:39 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Feb 2020 04:44:42 +0000 (20:44 -0800)
commit648e53cac7da6a978536dbe57268fe5709994374
treedf40c11c130927e3bb65a139b1231584f63e9d7b
parentc535f9203209be19b60421b363b0bb2c7e90f298
mlxsw: spectrum_switchdev: Optimize SFN records processing

Currently, only one SFN query is done from repetitive work at a time,
processing 64 entries. Another work iteration is scheduled in 100ms,
that means that the max rate of learned FDB entries is limited to 6400/s.
That is slow. Fix this by doing 2 optimizations:
1) Run 10 SFN queries at a time.
2) In case the SFN is not drained, schedule work with 0 delay to allow
   to continue processing rest of the records.

On a testing setup with 500K entries the time to process decreased
from 870secs to 10secs.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Tested-by: Alex Kushnarov <alexanderk@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/reg.h
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c