aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/falcon/efx.c
diff options
context:
space:
mode:
authorBert Kenward <bkenward@solarflare.com>2017-04-12 17:06:52 +0100
committerDavid S. Miller <davem@davemloft.net>2017-04-17 11:01:19 -0400
commit271a8b428f8361f3ad4c599835ccd34dd458b212 (patch)
tree1a829c8abc89357c0b91cc73942350eeec6a53c9 /drivers/net/ethernet/sfc/falcon/efx.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input (diff)
downloadlinux-271a8b428f8361f3ad4c599835ccd34dd458b212.tar.xz
linux-271a8b428f8361f3ad4c599835ccd34dd458b212.zip
sfc: limit the number of receive queues
The number of rx queues is determined by the rss_cpus parameter or the cpu topology. If that is higher than EFX_MAX_RX_QUEUES the driver can corrupt state. Fixes: 8ceee660aacb ("New driver "sfc" for Solarstorm SFC4000 controller.") Signed-off-by: Bert Kenward <bkenward@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/falcon/efx.c')
-rw-r--r--drivers/net/ethernet/sfc/falcon/efx.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/falcon/efx.c b/drivers/net/ethernet/sfc/falcon/efx.c
index f5e5cd1659a1..29614da91cbf 100644
--- a/drivers/net/ethernet/sfc/falcon/efx.c
+++ b/drivers/net/ethernet/sfc/falcon/efx.c
@@ -1354,6 +1354,13 @@ static unsigned int ef4_wanted_parallelism(struct ef4_nic *efx)
free_cpumask_var(thread_mask);
}
+ if (count > EF4_MAX_RX_QUEUES) {
+ netif_cond_dbg(efx, probe, efx->net_dev, !rss_cpus, warn,
+ "Reducing number of rx queues from %u to %u.\n",
+ count, EF4_MAX_RX_QUEUES);
+ count = EF4_MAX_RX_QUEUES;
+ }
+
return count;
}