Skip to content

Commit 2e0d8fe

Browse files
edumazetdavem330
authored andcommitted
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: 07bbecb ("net: Restrict receive packets queuing to housekeeping CPUs") Signed-off-by: Eric Dumazet <[email protected]> Reported-by: Maciej Żenczykowski <[email protected]> Cc: Alex Belits <[email protected]> Cc: Nitesh Narayan Lal <[email protected]> Cc: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Maciej Żenczykowski <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Nitesh Narayan Lal <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ae8bd30 commit 2e0d8fe

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

net/core/net-sysfs.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -757,11 +757,13 @@ static ssize_t store_rps_map(struct netdev_rx_queue *queue,
757757
return err;
758758
}
759759

760-
hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ;
761-
cpumask_and(mask, mask, housekeeping_cpumask(hk_flags));
762-
if (cpumask_empty(mask)) {
763-
free_cpumask_var(mask);
764-
return -EINVAL;
760+
if (!cpumask_empty(mask)) {
761+
hk_flags = HK_FLAG_DOMAIN | HK_FLAG_WQ;
762+
cpumask_and(mask, mask, housekeeping_cpumask(hk_flags));
763+
if (cpumask_empty(mask)) {
764+
free_cpumask_var(mask);
765+
return -EINVAL;
766+
}
765767
}
766768

767769
map = kzalloc(max_t(unsigned int,

0 commit comments

Comments
 (0)