* [PATCH] net: dpaa:reduce number of synchronize_net() calls
@ 2024-08-22 3:32 Xi Huang
2024-08-22 6:14 ` Eric Dumazet
0 siblings, 1 reply; 2+ messages in thread
From: Xi Huang @ 2024-08-22 3:32 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.
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@gmail.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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] net: dpaa:reduce number of synchronize_net() calls
2024-08-22 3:32 [PATCH] net: dpaa:reduce number of synchronize_net() calls Xi Huang
@ 2024-08-22 6:14 ` Eric Dumazet
0 siblings, 0 replies; 2+ messages in thread
From: Eric Dumazet @ 2024-08-22 6:14 UTC (permalink / raw)
To: Xi Huang; +Cc: madalin.bucur, davem, kuba, pabeni, netdev, linux-kernel
On Thu, Aug 22, 2024 at 5:32 AM Xi Huang <xuiagnh@gmail.com> 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.
> like commit 2543a6000e,5198d545db.
Correct way of citing commits is to use 12+ chars of sha1 ("patch title") as in
commit 2543a6000e59 ("gro_cells: reduce number of synchronize_net() calls")
Quoting Documentation/dev-tools/checkpatch.rst :
**GIT_COMMIT_ID**
The proper way to reference a commit id is:
commit <12+ chars of sha1> ("<title line>")
An example may be::
Commit e21d2170f36602ae2708 ("video: remove unnecessary
platform_set_drvdata()") removed the unnecessary
platform_set_drvdata(), but left the variable "dev" unused,
delete it.
See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes
> here is the function definition:
> static inline void netif_napi_del(struct napi_struct * napi)
> {
> __netif_napi_del(napi).
> synchronize_net();
> }
You do not need to include netif_napi_del() in this changelog.
Please send a V2 in ~24 hours and add this :
Reviewed-by: Eric Dumazet <edumazet@google.com>
Thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-22 6:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-22 3:32 [PATCH] net: dpaa:reduce number of synchronize_net() calls Xi Huang
2024-08-22 6:14 ` Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®