Skip to content

Commit 40b2956

Browse files
YijingWangdavem330
authored andcommitted
myri10ge: clean up unnecessary MSI/MSI-X capability find
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 <[email protected]> Cc: Andrew Gallatin <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent ae2104b commit 40b2956

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/net/ethernet/myricom/myri10ge/myri10ge.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3625,13 +3625,12 @@ static void myri10ge_probe_slices(struct myri10ge_priv *mgp)
36253625
struct pci_dev *pdev = mgp->pdev;
36263626
char *old_fw;
36273627
bool old_allocated;
3628-
int i, status, ncpus, msix_cap;
3628+
int i, status, ncpus;
36293629

36303630
mgp->num_slices = 1;
3631-
msix_cap = pci_find_capability(pdev, PCI_CAP_ID_MSIX);
36323631
ncpus = netif_get_num_default_rss_queues();
36333632

3634-
if (myri10ge_max_slices == 1 || msix_cap == 0 ||
3633+
if (myri10ge_max_slices == 1 || !pdev->msix_cap ||
36353634
(myri10ge_max_slices == -1 && ncpus < 2))
36363635
return;
36373636

0 commit comments

Comments
 (0)