diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-12-19 20:08:05 -0500 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-01-09 12:08:18 -0500 |
commit | cdb08f8fd8642a6d661c920f565e85cf87a0c9be (patch) | |
tree | 038c7e30139a5d28abe8935be8935fe5a607a9f9 /drivers/net/ethernet/sfc/efx.c | |
parent | fa142b9da3393fd92b398b6bdecf3f21914e309b (diff) |
sfc: Set default parallelism to per-core by default
The previous default of per-package can be more CPU-efficient, but
users generally seem to prefer per-core. It should also allow
accelerated RFS to direct packets more precisely, if IRQ affinity
is properly spread out.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/efx.c')
-rw-r--r-- | drivers/net/ethernet/sfc/efx.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 5fcc42f7d865..d7301d2e81a7 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c | |||
@@ -162,7 +162,7 @@ static unsigned int interrupt_mode; | |||
162 | * interrupt handling. | 162 | * interrupt handling. |
163 | * | 163 | * |
164 | * Cards without MSI-X will only target one CPU via legacy or MSI interrupt. | 164 | * Cards without MSI-X will only target one CPU via legacy or MSI interrupt. |
165 | * The default (0) means to assign an interrupt to each package (level II cache) | 165 | * The default (0) means to assign an interrupt to each core. |
166 | */ | 166 | */ |
167 | static unsigned int rss_cpus; | 167 | static unsigned int rss_cpus; |
168 | module_param(rss_cpus, uint, 0444); | 168 | module_param(rss_cpus, uint, 0444); |
@@ -1148,14 +1148,14 @@ static void efx_fini_io(struct efx_nic *efx) | |||
1148 | 1148 | ||
1149 | static int efx_wanted_parallelism(void) | 1149 | static int efx_wanted_parallelism(void) |
1150 | { | 1150 | { |
1151 | cpumask_var_t core_mask; | 1151 | cpumask_var_t thread_mask; |
1152 | int count; | 1152 | int count; |
1153 | int cpu; | 1153 | int cpu; |
1154 | 1154 | ||
1155 | if (rss_cpus) | 1155 | if (rss_cpus) |
1156 | return rss_cpus; | 1156 | return rss_cpus; |
1157 | 1157 | ||
1158 | if (unlikely(!zalloc_cpumask_var(&core_mask, GFP_KERNEL))) { | 1158 | if (unlikely(!zalloc_cpumask_var(&thread_mask, GFP_KERNEL))) { |
1159 | printk(KERN_WARNING | 1159 | printk(KERN_WARNING |
1160 | "sfc: RSS disabled due to allocation failure\n"); | 1160 | "sfc: RSS disabled due to allocation failure\n"); |
1161 | return 1; | 1161 | return 1; |
@@ -1163,14 +1163,14 @@ static int efx_wanted_parallelism(void) | |||
1163 | 1163 | ||
1164 | count = 0; | 1164 | count = 0; |
1165 | for_each_online_cpu(cpu) { | 1165 | for_each_online_cpu(cpu) { |
1166 | if (!cpumask_test_cpu(cpu, core_mask)) { | 1166 | if (!cpumask_test_cpu(cpu, thread_mask)) { |
1167 | ++count; | 1167 | ++count; |
1168 | cpumask_or(core_mask, core_mask, | 1168 | cpumask_or(thread_mask, thread_mask, |
1169 | topology_core_cpumask(cpu)); | 1169 | topology_thread_cpumask(cpu)); |
1170 | } | 1170 | } |
1171 | } | 1171 | } |
1172 | 1172 | ||
1173 | free_cpumask_var(core_mask); | 1173 | free_cpumask_var(thread_mask); |
1174 | return count; | 1174 | return count; |
1175 | } | 1175 | } |
1176 | 1176 | ||