]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum_router: Only perform atomic nexthop bucket replacement when requested
authorIdo Schimmel <idosch@nvidia.com>
Tue, 30 Mar 2021 06:58:41 +0000 (09:58 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 31 Mar 2021 00:51:21 +0000 (17:51 -0700)
commite5275fcdf679e3fd1956333faf4fbde3339e91e5
tree6b7ea04c41ae9bd47dad8f95244c15b32262c953
parent755d8e8eaa51e631936b8a4c2283805788dac0f9
mlxsw: spectrum_router: Only perform atomic nexthop bucket replacement when requested

When cleared, the 'force' parameter in nexthop bucket replacement
notifications indicates that a driver should try to perform an atomic
replacement. Meaning, only update the contents of the bucket if it is
inactive.

Since mlxsw only queries buckets' activity once every second, there is
no point in trying an atomic replacement if the idle timer interval is
smaller than 1 second.

Currently, mlxsw ignores the original value of 'force' and will always
try an atomic replacement if the idle timer is not smaller than 1
second.

Fix this by taking the original value of 'force' into account and never
promoting a non-atomic replacement to an atomic one.

Fixes: f0259c021ad4 ("mlxsw: spectrum_router: Add nexthop bucket replacement support")
Reported-by: Colin Ian King <colin.king@canonical.com>
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