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: 07bbecb341 ("net: Restrict receive packets queuing to housekeeping CPUs")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Maciej Ż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: Maciej Żenczykowski <maze@google.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Nitesh Narayan Lal <nitesh@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eric Dumazet 2020-08-11 18:34:40 -07:00 коммит произвёл David S. Miller
Родитель ae8bd3021c
Коммит 2e0d8fef5f
1 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -757,11 +757,13 @@ static ssize_t store_rps_map(struct netdev_rx_queue *queue,
return err; return err;
} }
hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ; if (!cpumask_empty(mask)) {
cpumask_and(mask, mask, housekeeping_cpumask(hk_flags)); hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ;
if (cpumask_empty(mask)) { cpumask_and(mask, mask, housekeeping_cpumask(hk_flags));
free_cpumask_var(mask); if (cpumask_empty(mask)) {
return -EINVAL; free_cpumask_var(mask);
return -EINVAL;
}
} }
map = kzalloc(max_t(unsigned int, map = kzalloc(max_t(unsigned int,