]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit1064da2408bfe1dab78d4421cecca8fff06c6496
treefd90a2b546b9c8df4907dc35458d20ff4511bdb5
parenta29a246393fd663383a379a6eda5745f02c343a3
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