Skip to content

Commit 2c16392

Browse files
XIUANGHkuba-moo
authored andcommitted
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 2543a60 ("gro_cells: reduce number of synchronize_net() calls") and commit 5198d54 (" net: remove napi_hash_del() from driver-facing API") 5198d54. Signed-off-by: Xi Huang <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 89683b4 commit 2c16392

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/freescale/dpaa/dpaa_eth.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3156,8 +3156,9 @@ static void dpaa_napi_del(struct net_device *net_dev)
31563156
for_each_possible_cpu(cpu) {
31573157
percpu_priv = per_cpu_ptr(priv->percpu_priv, cpu);
31583158

3159-
netif_napi_del(&percpu_priv->np.napi);
3159+
__netif_napi_del(&percpu_priv->np.napi);
31603160
}
3161+
synchronize_net();
31613162
}
31623163

31633164
static inline void dpaa_bp_free_pf(const struct dpaa_bp *bp,

0 commit comments

Comments
 (0)