Commit 2e0d8fef authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

net: accept an empty mask in /sys/class/net/*/queues/rx-*/rps_cpus

We must accept an empty mask in store_rps_map(), or we are not able
to disable RPS on a queue.

Fixes: 07bbecb3 ("net: Restrict receive packets queuing to housekeeping CPUs")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reported-by: default avatarMaciej Żenczykowski <maze@google.com>
Cc: Alex Belits <abelits@marvell.com>
Cc: Nitesh Narayan Lal <nitesh@redhat.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: default avatarMaciej Żenczykowski <maze@google.com>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: default avatarNitesh Narayan Lal <nitesh@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ae8bd302
...@@ -757,12 +757,14 @@ static ssize_t store_rps_map(struct netdev_rx_queue *queue, ...@@ -757,12 +757,14 @@ static ssize_t store_rps_map(struct netdev_rx_queue *queue,
return err; return err;
} }
if (!cpumask_empty(mask)) {
hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ; hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ;
cpumask_and(mask, mask, housekeeping_cpumask(hk_flags)); cpumask_and(mask, mask, housekeeping_cpumask(hk_flags));
if (cpumask_empty(mask)) { if (cpumask_empty(mask)) {
free_cpumask_var(mask); free_cpumask_var(mask);
return -EINVAL; return -EINVAL;
} }
}
map = kzalloc(max_t(unsigned int, map = kzalloc(max_t(unsigned int,
RPS_MAP_SIZE(cpumask_weight(mask)), L1_CACHE_BYTES), RPS_MAP_SIZE(cpumask_weight(mask)), L1_CACHE_BYTES),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment