diff mbox series

[PATCHv2] net: dpaa:reduce number of synchronize_net() calls

Message ID 20240822072042.42750-1-xuiagnh@gmail.com (mailing list archive)
State Accepted
Commit 2c163922de69983e6ccedeb5c00dec85b6a17283
Delegated to: Netdev Maintainers
Headers show
Series [PATCHv2] net: dpaa:reduce number of synchronize_net() calls | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 21 this patch: 21
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-25--21-00 (tests: 714)

Commit Message

XI HUANG Aug. 22, 2024, 7:20 a.m. UTC
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(-)

Comments

Jakub Kicinski Aug. 22, 2024, 3:12 p.m. UTC | #1
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
XI HUANG Aug. 22, 2024, 4:03 p.m. UTC | #2
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!
patchwork-bot+netdevbpf@kernel.org Aug. 26, 2024, 10:30 p.m. UTC | #3
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!
diff mbox series

Patch

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,