diff options
author | Igor Russkikh | 2018-05-07 15:10:39 +0200 |
---|---|---|
committer | David S. Miller | 2018-05-08 06:06:44 +0200 |
commit | a09bd81b5413d1b4d705c6c5303b5d311069da22 (patch) | |
tree | ad505327eef2bcdfe6e37361aaf1ea539d1bcf7a /drivers/net/ethernet/aquantia/atlantic/aq_nic.c | |
parent | net: aquantia: driver should correctly declare vlan_features bits (diff) | |
download | kernel-qcow2-linux-a09bd81b5413d1b4d705c6c5303b5d311069da22.tar.gz kernel-qcow2-linux-a09bd81b5413d1b4d705c6c5303b5d311069da22.tar.xz kernel-qcow2-linux-a09bd81b5413d1b4d705c6c5303b5d311069da22.zip |
net: aquantia: Limit number of vectors to actually allocated irqs
Driver should use pci_alloc_irq_vectors return value to correct number
of allocated vectors and napi instances. Otherwise it'll panic later
in pci_irq_vector.
Driver also should allow more than one MSI vectors to be allocated.
Error return path from pci_alloc_irq_vectors is also fixed to revert
resources in a correct sequence when error happens.
Reported-by: Long, Nicholas <nicholas.a.long@baesystems.com>
Fixes: 23ee07a ("net: aquantia: Cleanup pci functions module")
Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/aquantia/atlantic/aq_nic.c')
-rw-r--r-- | drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c index 720760d467fa..1a1a6380c128 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c @@ -95,6 +95,7 @@ void aq_nic_cfg_start(struct aq_nic_s *self) /*rss rings */ cfg->vecs = min(cfg->aq_hw_caps->vecs, AQ_CFG_VECS_DEF); cfg->vecs = min(cfg->vecs, num_online_cpus()); + cfg->vecs = min(cfg->vecs, self->irqvecs); /* cfg->vecs should be power of 2 for RSS */ if (cfg->vecs >= 8U) cfg->vecs = 8U; |