netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: rps: fix data stall after hotplug
@ 2015-03-19 19:54 subashab
  2015-03-19 21:50 ` Eric Dumazet
  0 siblings, 1 reply; 11+ messages in thread
From: subashab @ 2015-03-19 19:54 UTC (permalink / raw)
  To: netdev; +Cc: eric.dumazet, therbert

When RPS is enabled, IPI is triggered to enqueue the
backlog NAPI to the poll list. If the CPU is hotplugged
after the NAPI_STATE_SCHED bit is set on
enqueue_to_backlog but before the IPI is delivered
successfully, the poll list does not have the backlog
NAPI queued. As a consequence of this, dev_cpu_callback
does not clear the NAPI_STATE_SCHED bit on hotplug.
Since NAPI_STATE_SCHED is set even after the cpu comes
back up, packets get enqueued onto the input packet queue
but are never processed since the IPI will not be triggered.

This patch handles this race by unconditionally resetting
the NAPI state for the backlog NAPI on the offline CPU.

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
---
 net/core/dev.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 6f561de..61d9579 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -7119,12 +7119,11 @@ static int dev_cpu_callback(struct notifier_block
*nfb,
 							    poll_list);

 		list_del_init(&napi->poll_list);
-		if (napi->poll == process_backlog)
-			napi->state = 0;
-		else
+		if (napi->poll != process_backlog)
 			____napi_schedule(sd, napi);
 	}

+	oldsd->backlog.state = 0;
 	raise_softirq_irqoff(NET_TX_SOFTIRQ);
 	local_irq_enable();

--
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
 a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-03-31 23:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-19 19:54 [PATCH] net: rps: fix data stall after hotplug subashab
2015-03-19 21:50 ` Eric Dumazet
2015-03-20 11:50   ` Eric Dumazet
2015-03-20 16:40     ` subashab
2015-03-23 22:16       ` subashab
2015-03-23 22:29         ` Eric Dumazet
2015-03-25 18:54           ` subashab
2015-03-30 23:49             ` subashab
2015-03-31  4:48               ` Eric Dumazet
2015-03-31 22:02                 ` subashab
2015-03-31 23:44                   ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).