2020-06-23 13:42:59 +00:00
|
|
|
From c86a807b0ba3c42e49539839c06055e81dc1f8c5 Mon Sep 17 00:00:00 2001
|
|
|
|
Message-Id: <c86a807b0ba3c42e49539839c06055e81dc1f8c5.1592846147.git.zanussi@kernel.org>
|
|
|
|
In-Reply-To: <07cd0dbc80b976663c80755496a03f288decfe5a.1592846146.git.zanussi@kernel.org>
|
|
|
|
References: <07cd0dbc80b976663c80755496a03f288decfe5a.1592846146.git.zanussi@kernel.org>
|
2018-08-27 14:32:32 +00:00
|
|
|
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
|
|
Date: Fri, 16 Jun 2017 19:03:16 +0200
|
2020-06-23 13:42:59 +00:00
|
|
|
Subject: [PATCH 122/330] net/core: use local_bh_disable() in netif_rx_ni()
|
|
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.127-rt55.tar.xz
|
2018-08-27 14:32:32 +00:00
|
|
|
|
|
|
|
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>
|
|
|
|
---
|
2019-04-08 23:49:20 +00:00
|
|
|
net/core/dev.c | 6 ++----
|
2018-08-27 14:32:32 +00:00
|
|
|
1 file changed, 2 insertions(+), 4 deletions(-)
|
|
|
|
|
2019-04-08 23:49:20 +00:00
|
|
|
diff --git a/net/core/dev.c b/net/core/dev.c
|
2020-06-23 13:42:59 +00:00
|
|
|
index 0e4cff101523..d4b73961f54b 100644
|
2018-08-27 14:32:32 +00:00
|
|
|
--- a/net/core/dev.c
|
|
|
|
+++ b/net/core/dev.c
|
2020-06-22 13:14:16 +00:00
|
|
|
@@ -4532,11 +4532,9 @@ int netif_rx_ni(struct sk_buff *skb)
|
2018-08-27 14:32:32 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2020-01-03 23:36:11 +00:00
|
|
|
--
|
2020-06-22 13:14:16 +00:00
|
|
|
2.17.1
|
2020-01-03 23:36:11 +00:00
|
|
|
|