summaryrefslogtreecommitdiffstats
path: root/include/linux/cpumask.h
diff options
context:
space:
mode:
authorAmritha Nambiar2018-06-30 06:26:41 +0200
committerDavid S. Miller2018-07-02 02:06:23 +0200
commit80d19669ecd34423e85ca04f2210b0e42a47cb16 (patch)
treedb6eb66398a8ff0c5befd17f2d1056d83776b241 /include/linux/cpumask.h
parentMerge branch 'mlxsw-Add-resource-scale-tests' (diff)
downloadkernel-qcow2-linux-80d19669ecd34423e85ca04f2210b0e42a47cb16.tar.gz
kernel-qcow2-linux-80d19669ecd34423e85ca04f2210b0e42a47cb16.tar.xz
kernel-qcow2-linux-80d19669ecd34423e85ca04f2210b0e42a47cb16.zip
net: Refactor XPS for CPUs and Rx queues
Refactor XPS code to support Tx queue selection based on CPU(s) map or Rx queue(s) map. Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/cpumask.h')
-rw-r--r--include/linux/cpumask.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index bf53d893ad02..57f20a0a7794 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -115,12 +115,17 @@ extern struct cpumask __cpu_active_mask;
#define cpu_active(cpu) ((cpu) == 0)
#endif
-/* verify cpu argument to cpumask_* operators */
-static inline unsigned int cpumask_check(unsigned int cpu)
+static inline void cpu_max_bits_warn(unsigned int cpu, unsigned int bits)
{
#ifdef CONFIG_DEBUG_PER_CPU_MAPS
- WARN_ON_ONCE(cpu >= nr_cpumask_bits);
+ WARN_ON_ONCE(cpu >= bits);
#endif /* CONFIG_DEBUG_PER_CPU_MAPS */
+}
+
+/* verify cpu argument to cpumask_* operators */
+static inline unsigned int cpumask_check(unsigned int cpu)
+{
+ cpu_max_bits_warn(cpu, nr_cpumask_bits);
return cpu;
}