lkml.org 
[lkml]   [2021]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mlxsw: core: Switch to kvfree_rcu() API
Date
Instead of invoking a synchronize_rcu() to free a pointer
after a grace period we can directly make use of new API
that does the same but in more efficient way.

TO: David S. Miller <davem@davemloft.net>
TO: Jakub Kicinski <kuba@kernel.org>
TO: netdev@vger.kernel.org
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
drivers/net/ethernet/mellanox/mlxsw/core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/core.c b/drivers/net/ethernet/mellanox/mlxsw/core.c
index 3fd3812b8f31..47c29769759b 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core.c
@@ -2190,8 +2190,7 @@ void mlxsw_core_rx_listener_unregister(struct mlxsw_core *mlxsw_core,
if (!rxl_item)
return;
list_del_rcu(&rxl_item->list);
- synchronize_rcu();
- kfree(rxl_item);
+ kvfree_rcu(rxl_item);
}
EXPORT_SYMBOL(mlxsw_core_rx_listener_unregister);

--
2.30.2
\
 
 \ /
  Last update: 2021-12-15 12:19    [W:1.847 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site