Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dpaa2-eth: Remove preempt_disable() from seed_pool()

According to the comment, the preempt_disable() statement is required
due to synchronisation in napi_alloc_frag(). The awful truth is that
local_bh_disable() is required because otherwise the NAPI poll callback
can be invoked while the open function setup buffers. This isn't
unlikely since the dpaa2 provides multiple devices.

The usage of napi_alloc_frag() has been removed in commit

27c874867c4e9 ("dpaa2-eth: Use a single page per Rx buffer")

which means that the comment is not accurate and the preempt_disable()
statement is not required.

Remove the outdated comment and the no longer required
preempt_disable().

Cc: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Acked-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Sebastian Andrzej Siewior and committed by
David S. Miller
f9dae555 92dcabd7

-9
-9
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
··· 997 997 int i, j; 998 998 int new_count; 999 999 1000 - /* This is the lazy seeding of Rx buffer pools. 1001 - * dpaa2_add_bufs() is also used on the Rx hotpath and calls 1002 - * napi_alloc_frag(). The trouble with that is that it in turn ends up 1003 - * calling this_cpu_ptr(), which mandates execution in atomic context. 1004 - * Rather than splitting up the code, do a one-off preempt disable. 1005 - */ 1006 - preempt_disable(); 1007 1000 for (j = 0; j < priv->num_channels; j++) { 1008 1001 for (i = 0; i < DPAA2_ETH_NUM_BUFS; 1009 1002 i += DPAA2_ETH_BUFS_PER_CMD) { ··· 1004 1011 priv->channel[j]->buf_count += new_count; 1005 1012 1006 1013 if (new_count < DPAA2_ETH_BUFS_PER_CMD) { 1007 - preempt_enable(); 1008 1014 return -ENOMEM; 1009 1015 } 1010 1016 } 1011 1017 } 1012 - preempt_enable(); 1013 1018 1014 1019 return 0; 1015 1020 }