From: Xi Huang Date: Thu, 22 Aug 2024 07:20:42 +0000 (+0800) Subject: net: dpaa: reduce number of synchronize_net() calls X-Git-Tag: v6.12-rc1~232^2~176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c163922de69983e6ccedeb5c00dec85b6a17283;p=thirdparty%2Flinux.git net: dpaa: reduce number of synchronize_net() calls In the function dpaa_napi_del(), we execute the netif_napi_del() for each cpu, which is actually a high overhead operation because each call to netif_napi_del() contains a synchronize_net(), i.e. an RCU operation. In fact, it is only necessary to call __netif_napi_del and use synchronize_net() once outside of the loop. This change is similar to commit 2543a6000e593a ("gro_cells: reduce number of synchronize_net() calls") and commit 5198d545dba8ad (" net: remove napi_hash_del() from driver-facing API") 5198d545db. Signed-off-by: Xi Huang Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/20240822072042.42750-1-xuiagnh@gmail.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index cfe6b57b1da0e..5d99cfb4e9948 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -3156,8 +3156,9 @@ static void dpaa_napi_del(struct net_device *net_dev) for_each_possible_cpu(cpu) { percpu_priv = per_cpu_ptr(priv->percpu_priv, cpu); - netif_napi_del(&percpu_priv->np.napi); + __netif_napi_del(&percpu_priv->np.napi); } + synchronize_net(); } static inline void dpaa_bp_free_pf(const struct dpaa_bp *bp,