aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/efx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/sfc/efx.c')
-rw-r--r--drivers/net/sfc/efx.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 6eff9ca6c6c8..00c23b1babca 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -894,20 +894,27 @@ static void efx_fini_io(struct efx_nic *efx)
894 * interrupts across them. */ 894 * interrupts across them. */
895static int efx_wanted_rx_queues(void) 895static int efx_wanted_rx_queues(void)
896{ 896{
897 cpumask_t core_mask; 897 cpumask_var_t core_mask;
898 int count; 898 int count;
899 int cpu; 899 int cpu;
900 900
901 cpus_clear(core_mask); 901 if (!alloc_cpumask_var(&core_mask, GFP_KERNEL)) {
902 printk(KERN_WARNING
903 "efx.c: allocation failure, irq balancing hobbled\n");
904 return 1;
905 }
906
907 cpumask_clear(core_mask);
902 count = 0; 908 count = 0;
903 for_each_online_cpu(cpu) { 909 for_each_online_cpu(cpu) {
904 if (!cpu_isset(cpu, core_mask)) { 910 if (!cpumask_test_cpu(cpu, core_mask)) {
905 ++count; 911 ++count;
906 cpus_or(core_mask, core_mask, 912 cpumask_or(core_mask, core_mask,
907 topology_core_siblings(cpu)); 913 topology_core_cpumask(cpu));
908 } 914 }
909 } 915 }
910 916
917 free_cpumask_var(core_mask);
911 return count; 918 return count;
912} 919}
913 920