* [PATCHv2] net: dpaa:reduce number of synchronize_net() calls
@ 2024-08-22 7:20 Xi Huang
2024-08-22 15:12 ` Jakub Kicinski
2024-08-26 22:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Xi Huang @ 2024-08-22 7:20 UTC (permalink / raw)
To: madalin.bucur, davem, edumazet, kuba, pabeni, netdev,
linux-kernel, xuiagnh
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 <xuiagnh@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
---
V1 -> V2: Modify the cited commit format and remove useless information
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCHv2] net: dpaa:reduce number of synchronize_net() calls
2024-08-22 7:20 [PATCHv2] net: dpaa:reduce number of synchronize_net() calls Xi Huang
@ 2024-08-22 15:12 ` Jakub Kicinski
2024-08-22 16:03 ` XI HUANG
2024-08-26 22:30 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2024-08-22 15:12 UTC (permalink / raw)
To: Xi Huang; +Cc: madalin.bucur, davem, edumazet, pabeni, netdev, linux-kernel
On Thu, 22 Aug 2024 15:20:42 +0800 Xi Huang wrote:
> 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 <xuiagnh@gmail.com>
> Reviewed-by: Eric Dumazet <edumazet@google.com>
You missed the part of Eric's response that told you to wait 24 hours:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html
--
pv-bot: 24h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv2] net: dpaa:reduce number of synchronize_net() calls
2024-08-22 15:12 ` Jakub Kicinski
@ 2024-08-22 16:03 ` XI HUANG
0 siblings, 0 replies; 4+ messages in thread
From: XI HUANG @ 2024-08-22 16:03 UTC (permalink / raw)
To: Jakub Kicinski
Cc: madalin.bucur, davem, edumazet, pabeni, netdev, linux-kernel
I am very sorry, I misunderstood the meaning of “Please send a V2 in
~24 hours”, I mistakenly thought that it could be sent within 24
hours. Do I need to resend the patchv2 24 hours after the first
patchv1?Sorry again and thanks so much for the heads up!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCHv2] net: dpaa:reduce number of synchronize_net() calls
2024-08-22 7:20 [PATCHv2] net: dpaa:reduce number of synchronize_net() calls Xi Huang
2024-08-22 15:12 ` Jakub Kicinski
@ 2024-08-26 22:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-08-26 22:30 UTC (permalink / raw)
To: XI HUANG; +Cc: madalin.bucur, davem, edumazet, kuba, pabeni, netdev,
linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 22 Aug 2024 15:20:42 +0800 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [PATCHv2] net: dpaa:reduce number of synchronize_net() calls
https://git.kernel.org/netdev/net-next/c/2c163922de69
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] 4+ messages in thread
end of thread, other threads:[~2024-08-26 22:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-22 7:20 [PATCHv2] net: dpaa:reduce number of synchronize_net() calls Xi Huang
2024-08-22 15:12 ` Jakub Kicinski
2024-08-22 16:03 ` XI HUANG
2024-08-26 22:30 ` 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).