[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240822033243.38443-1-xuiagnh@gmail.com>
Date: Thu, 22 Aug 2024 11:32:43 +0800
From: Xi Huang <xuiagnh@...il.com>
To: madalin.bucur@....com,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
xuiagnh@...il.com
Subject: [PATCH] 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.
like commit 2543a6000e,5198d545db. here is the function definition:
static inline void netif_napi_del(struct napi_struct * napi)
{
__netif_napi_del(napi).
synchronize_net();
}
Signed-off-by: Xi Huang <xuiagnh@...il.com>
---
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
index cfe6b57b1..5d99cfb4e 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,
--
2.34.1
Powered by blists - more mailing lists