diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-07-18 14:03:10 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-07-22 19:44:15 -0400 |
commit | aa6ef27ea906e74bd23d14f43f095c012469d9c7 (patch) | |
tree | b3021a33a78593153c145b1ef6b382288e96d253 | |
parent | 8d9853d911b9d3fb767c3886066530c0e39b78ba (diff) |
sfc: Create one RX queue and interrupt per CPU package by default
Using multiple cores in the same package to handle received traffic
does not appear to provide a performance benefit. Therefore use CPU
topology information to count CPU packages and use that as the default
number of RX queues and interrupts. We rely on interrupt balancing to
spread the interrupts across packages.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/net/sfc/efx.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 7b2a81866232..45c72eebb3a7 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/in.h> | 19 | #include <linux/in.h> |
20 | #include <linux/crc32.h> | 20 | #include <linux/crc32.h> |
21 | #include <linux/ethtool.h> | 21 | #include <linux/ethtool.h> |
22 | #include <linux/topology.h> | ||
22 | #include "net_driver.h" | 23 | #include "net_driver.h" |
23 | #include "gmii.h" | 24 | #include "gmii.h" |
24 | #include "ethtool.h" | 25 | #include "ethtool.h" |
@@ -832,7 +833,23 @@ static void efx_probe_interrupts(struct efx_nic *efx) | |||
832 | if (efx->interrupt_mode == EFX_INT_MODE_MSIX) { | 833 | if (efx->interrupt_mode == EFX_INT_MODE_MSIX) { |
833 | BUG_ON(!pci_find_capability(efx->pci_dev, PCI_CAP_ID_MSIX)); | 834 | BUG_ON(!pci_find_capability(efx->pci_dev, PCI_CAP_ID_MSIX)); |
834 | 835 | ||
835 | efx->rss_queues = rss_cpus ? rss_cpus : num_online_cpus(); | 836 | if (rss_cpus == 0) { |
837 | cpumask_t core_mask; | ||
838 | int cpu; | ||
839 | |||
840 | cpus_clear(core_mask); | ||
841 | efx->rss_queues = 0; | ||
842 | for_each_online_cpu(cpu) { | ||
843 | if (!cpu_isset(cpu, core_mask)) { | ||
844 | ++efx->rss_queues; | ||
845 | cpus_or(core_mask, core_mask, | ||
846 | topology_core_siblings(cpu)); | ||
847 | } | ||
848 | } | ||
849 | } else { | ||
850 | efx->rss_queues = rss_cpus; | ||
851 | } | ||
852 | |||
836 | efx->rss_queues = min(efx->rss_queues, max_channel + 1); | 853 | efx->rss_queues = min(efx->rss_queues, max_channel + 1); |
837 | efx->rss_queues = min(efx->rss_queues, EFX_MAX_CHANNELS); | 854 | efx->rss_queues = min(efx->rss_queues, EFX_MAX_CHANNELS); |
838 | 855 | ||