summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2016-12-06 17:50:30 -0500
committerSteven Rostedt <rostedt@goodmis.org>2017-08-02 20:15:31 -0400
commit2581273d5e006b7bf26f15a0c1eaeefac1eae1d6 (patch)
tree3d9399175113f8f2faf7405aab355f31f8d8f866 /net
parent2939759a2215c2a98bf02c2352a4740533257210 (diff)
downloadlinux-rt-2581273d5e006b7bf26f15a0c1eaeefac1eae1d6.tar.gz
net: Have __napi_schedule_irqoff() disable interrupts on RT
A customer hit a crash where the napi sd->poll_list became corrupted. The customer had the bnx2x driver, which does a __napi_schedule_irqoff() in its interrupt handler. Unfortunately, when running with CONFIG_PREEMPT_RT_FULL, this interrupt handler is run as a thread and is preemptable. The call to ____napi_schedule() must be done with interrupts disabled to protect the per cpu softnet_data's "poll_list, which is protected by disabling interrupts (disabling preemption is enough when all interrupts are threaded and local_bh_disable() can't preempt)." As bnx2x isn't the only driver that does this, the safest thing to do is to make __napi_schedule_irqoff() call __napi_schedule() instead when CONFIG_PREEMPT_RT_FULL is enabled, which will call local_irq_save() before calling ____napi_schedule(). Cc: stable-rt@vger.kernel.org Signed-off-by: Steven Rostedt (Red Hat) <rostedt@goodmis.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 319d38c89f12..15b0f54d3145 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4749,6 +4749,7 @@ void __napi_schedule(struct napi_struct *n)
}
EXPORT_SYMBOL(__napi_schedule);
+#ifndef CONFIG_PREEMPT_RT_FULL
/**
* __napi_schedule_irqoff - schedule for receive
* @n: entry to schedule
@@ -4760,6 +4761,7 @@ void __napi_schedule_irqoff(struct napi_struct *n)
____napi_schedule(this_cpu_ptr(&softnet_data), n);
}
EXPORT_SYMBOL(__napi_schedule_irqoff);
+#endif
void __napi_complete(struct napi_struct *n)
{