aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vfio/pci
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-04-18 17:12:58 -0400
committerBjorn Helgaas <bhelgaas@google.com>2013-04-24 13:35:56 -0400
commita9047f24df85b06d3fd443ff76e9993bc127c570 (patch)
tree25a9cd1957bb67b6bf4f571e3d66a8873838df52 /drivers/vfio/pci
parent508d1aa602ef0679a9cfc181ce918fbc4a2b3a45 (diff)
vfio-pci: Use cached MSI/MSI-X capabilities
We now cache the MSI/MSI-X capability offsets in the struct pci_dev, so no need to find the capabilities again. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/pci')
-rw-r--r--drivers/vfio/pci/vfio_pci.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
index 10626e825f41..05afe883f038 100644
--- a/drivers/vfio/pci/vfio_pci.c
+++ b/drivers/vfio/pci/vfio_pci.c
@@ -70,7 +70,7 @@ static int vfio_pci_enable(struct vfio_pci_device *vdev)
70 pci_write_config_word(pdev, PCI_COMMAND, cmd); 70 pci_write_config_word(pdev, PCI_COMMAND, cmd);
71 } 71 }
72 72
73 msix_pos = pci_find_capability(pdev, PCI_CAP_ID_MSIX); 73 msix_pos = pdev->msix_cap;
74 if (msix_pos) { 74 if (msix_pos) {
75 u16 flags; 75 u16 flags;
76 u32 table; 76 u32 table;
@@ -183,7 +183,7 @@ static int vfio_pci_get_irq_count(struct vfio_pci_device *vdev, int irq_type)
183 u8 pos; 183 u8 pos;
184 u16 flags; 184 u16 flags;
185 185
186 pos = pci_find_capability(vdev->pdev, PCI_CAP_ID_MSI); 186 pos = vdev->pdev->msi_cap;
187 if (pos) { 187 if (pos) {
188 pci_read_config_word(vdev->pdev, 188 pci_read_config_word(vdev->pdev,
189 pos + PCI_MSI_FLAGS, &flags); 189 pos + PCI_MSI_FLAGS, &flags);
@@ -194,7 +194,7 @@ static int vfio_pci_get_irq_count(struct vfio_pci_device *vdev, int irq_type)
194 u8 pos; 194 u8 pos;
195 u16 flags; 195 u16 flags;
196 196
197 pos = pci_find_capability(vdev->pdev, PCI_CAP_ID_MSIX); 197 pos = vdev->pdev->msix_cap;
198 if (pos) { 198 if (pos) {
199 pci_read_config_word(vdev->pdev, 199 pci_read_config_word(vdev->pdev,
200 pos + PCI_MSIX_FLAGS, &flags); 200 pos + PCI_MSIX_FLAGS, &flags);