From: subashab@codeaurora.org
To: netdev@vger.kernel.org
Cc: eric.dumazet@gmail.com, therbert@google.com
Subject: [PATCH] net: rps: fix data stall after hotplug
Date: Thu, 19 Mar 2015 19:54:46 -0000 [thread overview]
Message-ID: <b3ecb218932daa656a796cfa6e9e62b9.squirrel@www.codeaurora.org> (raw)
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
next reply other threads:[~2015-03-19 19:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 19:54 subashab [this message]
2015-03-19 21:50 ` [PATCH] net: rps: fix data stall after hotplug 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b3ecb218932daa656a796cfa6e9e62b9.squirrel@www.codeaurora.org \
--to=subashab@codeaurora.org \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).