netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] mlxsw: spectrum_router: Only perform atomic nexthop bucket replacement when requested
@ 2021-03-30  6:58 Ido Schimmel
  2021-03-31  1:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Ido Schimmel @ 2021-03-30  6:58 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, jiri, petrm, colin.king, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@nvidia.com>

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: 617a77f044ed ("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>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
index 6ccaa194733b..41259c0004d1 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
@@ -5068,8 +5068,9 @@ mlxsw_sp_nexthop_obj_bucket_adj_update(struct mlxsw_sp *mlxsw_sp,
 	/* No point in trying an atomic replacement if the idle timer interval
 	 * is smaller than the interval in which we query and clear activity.
 	 */
-	force = info->nh_res_bucket->idle_timer_ms <
-		MLXSW_SP_NH_GRP_ACTIVITY_UPDATE_INTERVAL;
+	if (!force && info->nh_res_bucket->idle_timer_ms <
+	    MLXSW_SP_NH_GRP_ACTIVITY_UPDATE_INTERVAL)
+		force = true;
 
 	adj_index = nh->nhgi->adj_index + bucket_index;
 	err = mlxsw_sp_nexthop_update(mlxsw_sp, adj_index, nh, force, ratr_pl);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] mlxsw: spectrum_router: Only perform atomic nexthop bucket replacement when requested
  2021-03-30  6:58 [PATCH net-next] mlxsw: spectrum_router: Only perform atomic nexthop bucket replacement when requested Ido Schimmel
@ 2021-03-31  1:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-03-31  1:00 UTC (permalink / raw)
  To: Ido Schimmel; +Cc: netdev, davem, kuba, jiri, petrm, colin.king, mlxsw, idosch

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Tue, 30 Mar 2021 09:58:41 +0300 you wrote:
> From: Ido Schimmel <idosch@nvidia.com>
> 
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next] mlxsw: spectrum_router: Only perform atomic nexthop bucket replacement when requested
    https://git.kernel.org/netdev/net-next/c/7866f265b824

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-31  1:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30  6:58 [PATCH net-next] mlxsw: spectrum_router: Only perform atomic nexthop bucket replacement when requested Ido Schimmel
2021-03-31  1:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).