aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/aquantia/atlantic/aq_nic.c3
-rw-r--r--drivers/net/ethernet/aquantia/atlantic/aq_nic.h1
-rw-r--r--drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c20
3 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index 32f6d2e24d66..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)
95 /*rss rings */ 95 /*rss rings */
96 cfg->vecs = min(cfg->aq_hw_caps->vecs, AQ_CFG_VECS_DEF); 96 cfg->vecs = min(cfg->aq_hw_caps->vecs, AQ_CFG_VECS_DEF);
97 cfg->vecs = min(cfg->vecs, num_online_cpus()); 97 cfg->vecs = min(cfg->vecs, num_online_cpus());
98 cfg->vecs = min(cfg->vecs, self->irqvecs);
98 /* cfg->vecs should be power of 2 for RSS */ 99 /* cfg->vecs should be power of 2 for RSS */
99 if (cfg->vecs >= 8U) 100 if (cfg->vecs >= 8U)
100 cfg->vecs = 8U; 101 cfg->vecs = 8U;
@@ -246,6 +247,8 @@ void aq_nic_ndev_init(struct aq_nic_s *self)
246 247
247 self->ndev->hw_features |= aq_hw_caps->hw_features; 248 self->ndev->hw_features |= aq_hw_caps->hw_features;
248 self->ndev->features = aq_hw_caps->hw_features; 249 self->ndev->features = aq_hw_caps->hw_features;
250 self->ndev->vlan_features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM |
251 NETIF_F_RXHASH | NETIF_F_SG | NETIF_F_LRO;
249 self->ndev->priv_flags = aq_hw_caps->hw_priv_flags; 252 self->ndev->priv_flags = aq_hw_caps->hw_priv_flags;
250 self->ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE; 253 self->ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
251 254
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
index 219b550d1665..faa533a0ec47 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.h
@@ -80,6 +80,7 @@ struct aq_nic_s {
80 80
81 struct pci_dev *pdev; 81 struct pci_dev *pdev;
82 unsigned int msix_entry_mask; 82 unsigned int msix_entry_mask;
83 u32 irqvecs;
83}; 84};
84 85
85static inline struct device *aq_nic_get_dev(struct aq_nic_s *self) 86static inline struct device *aq_nic_get_dev(struct aq_nic_s *self)
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
index ecc6306f940f..a50e08bb4748 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c
@@ -267,16 +267,16 @@ static int aq_pci_probe(struct pci_dev *pdev,
267 numvecs = min(numvecs, num_online_cpus()); 267 numvecs = min(numvecs, num_online_cpus());
268 /*enable interrupts */ 268 /*enable interrupts */
269#if !AQ_CFG_FORCE_LEGACY_INT 269#if !AQ_CFG_FORCE_LEGACY_INT
270 err = pci_alloc_irq_vectors(self->pdev, numvecs, numvecs, 270 numvecs = pci_alloc_irq_vectors(self->pdev, 1, numvecs,
271 PCI_IRQ_MSIX); 271 PCI_IRQ_MSIX | PCI_IRQ_MSI |
272 272 PCI_IRQ_LEGACY);
273 if (err < 0) { 273
274 err = pci_alloc_irq_vectors(self->pdev, 1, 1, 274 if (numvecs < 0) {
275 PCI_IRQ_MSI | PCI_IRQ_LEGACY); 275 err = numvecs;
276 if (err < 0) 276 goto err_hwinit;
277 goto err_hwinit;
278 } 277 }
279#endif 278#endif
279 self->irqvecs = numvecs;
280 280
281 /* net device init */ 281 /* net device init */
282 aq_nic_cfg_start(self); 282 aq_nic_cfg_start(self);
@@ -298,9 +298,9 @@ err_free_aq_hw:
298 kfree(self->aq_hw); 298 kfree(self->aq_hw);
299err_ioremap: 299err_ioremap:
300 free_netdev(ndev); 300 free_netdev(ndev);
301err_pci_func:
302 pci_release_regions(pdev);
303err_ndev: 301err_ndev:
302 pci_release_regions(pdev);
303err_pci_func:
304 pci_disable_device(pdev); 304 pci_disable_device(pdev);
305 return err; 305 return err;
306} 306}