diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2017-06-16 19:03:16 +0200 |
---|---|---|
committer | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2018-08-07 16:20:20 +0200 |
commit | 6c884c0636d99d5509a55a8dbc63eaa1d933dd75 (patch) | |
tree | 4a9ff71cee9eb89062670cfe29e5e9e955e7f521 /net | |
parent | ba37352e84467e38d14950ae693852cfcb0942d6 (diff) | |
download | linux-rt-6c884c0636d99d5509a55a8dbc63eaa1d933dd75.tar.gz |
net/core: use local_bh_disable() in netif_rx_ni()
In 2004 netif_rx_ni() gained a preempt_disable() section around
netif_rx() and its do_softirq() + testing for it. The do_softirq() part
is required because netif_rx() raises the softirq but does not invoke
it. The preempt_disable() is required to remain on the same CPU which added the
skb to the per-CPU list.
All this can be avoided be putting this into a local_bh_disable()ed
section. The local_bh_enable() part will invoke do_softirq() if
required.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index caeab10bf4dc..9688ed6c6113 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4252,11 +4252,9 @@ int netif_rx_ni(struct sk_buff *skb) trace_netif_rx_ni_entry(skb); - preempt_disable(); + local_bh_disable(); err = netif_rx_internal(skb); - if (local_softirq_pending()) - do_softirq(); - preempt_enable(); + local_bh_enable(); return err; } |