Netdev List
 help / color / mirror / Atom feed
From: Liping Zhang <zlpnobody@163.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, therbert@google.com,
	Liping Zhang <zlpnobody@gmail.com>
Subject: [PATCH net-next] net: rps: don't skip offline cpus when set rps_cpus
Date: Mon, 15 May 2017 20:55:52 +0800	[thread overview]
Message-ID: <20170515125552.2971-1-zlpnobody@163.com> (raw)

From: Liping Zhang <zlpnobody@gmail.com>

On our 4-core system, sometimes I can enable all CPUs to process packets.
But sometimes I can't, if all the CPUs become offline except core 0, I
will get the following result, which is really annoying for my script:
 # echo f > /sys/class/net/eth0/queues/rx-0/rps_cpus
 # cat /sys/class/net/eth0/queues/rx-0/rps_cpus
 1

Since we won't steer the packets to these offline cpus, it's reasonable
to enable all configed cpus to the rps_map, even if they are offline for
the time being.

Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
---
 net/core/net-sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 65ea0ff..8adb36d 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -731,7 +731,7 @@ static ssize_t store_rps_map(struct netdev_rx_queue *queue,
 	}
 
 	i = 0;
-	for_each_cpu_and(cpu, mask, cpu_online_mask)
+	for_each_cpu_and(cpu, mask, cpu_possible_mask)
 		map->cpus[i++] = cpu;
 
 	if (i)
-- 
2.9.3

             reply	other threads:[~2017-05-15 12:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 12:55 Liping Zhang [this message]
2017-05-15 14:23 ` [PATCH net-next] net: rps: don't skip offline cpus when set rps_cpus David Miller

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=20170515125552.2971-1-zlpnobody@163.com \
    --to=zlpnobody@163.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.com \
    --cc=zlpnobody@gmail.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