* [PATCH 08/16] myri10ge: clean up unnecessary MSI/MSI-X capability find
@ 2013-08-08 13:02 Yijing Wang
2013-08-09 20:50 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Yijing Wang @ 2013-08-08 13:02 UTC (permalink / raw)
To: David S. Miller
Cc: Hanjun Guo, jiang.liu, Yijing Wang, Andrew Gallatin, netdev
PCI core will initialize device MSI/MSI-X capability in
pci_msi_init_pci_dev(). So device driver should use
pci_dev->msi_cap/msix_cap to determine whether the device
support MSI/MSI-X instead of using
pci_find_capability(pci_dev, PCI_CAP_ID_MSI/MSIX).
Access to PCIe device config space again will consume more time.
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: Andrew Gallatin <gallatin@myri.com>
Cc: netdev@vger.kernel.org
---
drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index 967bae8..8772bb5 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -3625,13 +3625,12 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp)
struct pci_dev *pdev = mgp->pdev;
char *old_fw;
bool old_allocated;
- int i, status, ncpus, msix_cap;
+ int i, status, ncpus;
mgp->num_slices = 1;
- msix_cap = pci_find_capability(pdev, PCI_CAP_ID_MSIX);
ncpus = netif_get_num_default_rss_queues();
- if (myri10ge_max_slices == 1 || msix_cap == 0 ||
+ if (myri10ge_max_slices == 1 || !pdev->msix_cap ||
(myri10ge_max_slices == -1 && ncpus < 2))
return;
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 08/16] myri10ge: clean up unnecessary MSI/MSI-X capability find
2013-08-08 13:02 [PATCH 08/16] myri10ge: clean up unnecessary MSI/MSI-X capability find Yijing Wang
@ 2013-08-09 20:50 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-08-09 20:50 UTC (permalink / raw)
To: wangyijing; +Cc: guohanjun, jiang.liu, gallatin, netdev
From: Yijing Wang <wangyijing@huawei.com>
Date: Thu, 8 Aug 2013 21:02:44 +0800
> PCI core will initialize device MSI/MSI-X capability in
> pci_msi_init_pci_dev(). So device driver should use
> pci_dev->msi_cap/msix_cap to determine whether the device
> support MSI/MSI-X instead of using
> pci_find_capability(pci_dev, PCI_CAP_ID_MSI/MSIX).
> Access to PCIe device config space again will consume more time.
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-09 20:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-08 13:02 [PATCH 08/16] myri10ge: clean up unnecessary MSI/MSI-X capability find Yijing Wang
2013-08-09 20:50 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).