mlxsw: spectrum_router: Only query neighbour activity when necessary
authorIdo Schimmel <idosch@nvidia.com>
Wed, 4 May 2022 06:29:09 +0000 (09:29 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 May 2022 10:21:33 +0000 (11:21 +0100)
commitcff9437605d5c282c1fe00c63ea5f312a7465646
treefd90a2b546b9c8df4907dc35458d20ff4511bdb5
parentb8950003849de2a78f7aed9e348233e2b678b755
mlxsw: spectrum_router: Only query neighbour activity when necessary

The driver periodically queries the device for activity of neighbour
entries in order to report it to the kernel's neighbour table.

Avoid unnecessary activity query when no neighbours are installed. Use
an atomic variable to track the number of neighbours, as it is read
without any locks.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h