From: Alex Williamson <alex.williamson@redhat.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org, Gavin Shan <shangw@linux.vnet.ibm.com>
Subject: Re: [PATCH v4 22/22] vfio-pci: Use cached MSI/MSI-X capabilities
Date: Tue, 23 Apr 2013 14:13:55 -0600 [thread overview]
Message-ID: <1366748035.2918.652.camel@bling.home> (raw)
In-Reply-To: <20130422231242.32621.38158.stgit@bhelgaas-glaptop>
On Mon, 2013-04-22 at 17:12 -0600, Bjorn Helgaas wrote:
> 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>
> CC: Alex Williamson <alex.williamson@redhat.com>
> ---
> drivers/vfio/pci/vfio_pci.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
> index 10626e8..05afe88 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)
> pci_write_config_word(pdev, PCI_COMMAND, cmd);
> }
>
> - msix_pos = pci_find_capability(pdev, PCI_CAP_ID_MSIX);
> + msix_pos = pdev->msix_cap;
> if (msix_pos) {
> u16 flags;
> u32 table;
> @@ -183,7 +183,7 @@ static int vfio_pci_get_irq_count(struct vfio_pci_device *vdev, int irq_type)
> u8 pos;
> u16 flags;
>
> - pos = pci_find_capability(vdev->pdev, PCI_CAP_ID_MSI);
> + pos = vdev->pdev->msi_cap;
> if (pos) {
> pci_read_config_word(vdev->pdev,
> pos + PCI_MSI_FLAGS, &flags);
> @@ -194,7 +194,7 @@ static int vfio_pci_get_irq_count(struct vfio_pci_device *vdev, int irq_type)
> u8 pos;
> u16 flags;
>
> - pos = pci_find_capability(vdev->pdev, PCI_CAP_ID_MSIX);
> + pos = vdev->pdev->msix_cap;
> if (pos) {
> pci_read_config_word(vdev->pdev,
> pos + PCI_MSIX_FLAGS, &flags);
>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
next prev parent reply other threads:[~2013-04-23 20:13 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-22 23:10 [PATCH v4 00/22] PCI: Cache MSI/MSI-X capability offsets, other cleanup Bjorn Helgaas
2013-04-22 23:10 ` [PATCH v4 01/22] [SCSI] megaraid_sas: Use correct #define for MSI-X capability Bjorn Helgaas
2013-04-22 23:52 ` Radford, Adam
2013-04-22 23:10 ` [PATCH v4 02/22] PCI: Use u8, not int, for PM capability offset Bjorn Helgaas
2013-04-22 23:32 ` Rafael J. Wysocki
2013-04-22 23:10 ` [PATCH v4 03/22] PCI: Cache MSI/MSI-X capability offsets in struct pci_dev Bjorn Helgaas
2013-04-22 23:10 ` [PATCH v4 04/22] PCI: Remove MSI/MSI-X cap check in pci_msi_check_device() Bjorn Helgaas
2013-04-22 23:10 ` [PATCH v4 05/22] PCI: Use cached MSI cap while enabling MSI interrupts Bjorn Helgaas
2013-04-22 23:10 ` [PATCH v4 06/22] PCI: Use cached MSI-X cap while enabling MSI-X Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 07/22] PCI: Clean up MSI/MSI-X capability #defines Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 08/22] PCI: Use cached MSI/MSI-X offsets from dev, not from msi_desc Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 09/22] PCI: Drop msi_control_reg() macro and use PCI_MSI_FLAGS directly Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 10/22] PCI: Drop msi_lower_address_reg() and msi_upper_address_reg() macros Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 11/22] PCI: Drop msi_data_reg() macro Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 12/22] PCI: Drop is_64bit_address() and is_mask_bit_support() macros Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 13/22] PCI: Drop msix_table_offset_reg() and msix_pba_offset_reg() macros Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 14/22] PCI: Use msix_table_size() directly, drop multi_msix_capable() Bjorn Helgaas
2013-04-22 23:11 ` [PATCH v4 15/22] PCI: Drop msi_mask_reg() and remove drivers/pci/msi.h Bjorn Helgaas
2013-04-22 23:12 ` [PATCH v4 16/22] PCI: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK Bjorn Helgaas
2013-04-22 23:12 ` [PATCH v4 17/22] PCI: Remove "extern" from function declarations Bjorn Helgaas
2013-04-22 23:12 ` [PATCH v4 18/22] xen/pci: Pay attention to PCI_MSIX_TABLE_OFFSET Bjorn Helgaas
2013-04-24 16:34 ` Bjorn Helgaas
2013-04-25 9:40 ` [Xen-devel] " Jan Beulich
2013-04-25 16:42 ` Bjorn Helgaas
2013-04-26 7:16 ` Jan Beulich
2013-04-26 14:50 ` Bjorn Helgaas
2013-04-22 23:12 ` [PATCH v4 19/22] xen/pci: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK Bjorn Helgaas
2013-04-24 16:35 ` Bjorn Helgaas
2013-04-22 23:12 ` [PATCH v4 20/22] xen/pci: Used cached MSI-X capability offset Bjorn Helgaas
2013-04-24 16:35 ` Bjorn Helgaas
2013-04-22 23:12 ` [PATCH v4 21/22] vfio-pci: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK Bjorn Helgaas
2013-04-23 20:12 ` Alex Williamson
2013-04-22 23:12 ` [PATCH v4 22/22] vfio-pci: Use cached MSI/MSI-X capabilities Bjorn Helgaas
2013-04-23 20:13 ` Alex Williamson [this message]
2013-04-24 17:48 ` [PATCH v4 00/22] PCI: Cache MSI/MSI-X capability offsets, other cleanup Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1366748035.2918.652.camel@bling.home \
--to=alex.williamson@redhat.com \
--cc=bhelgaas@google.com \
--cc=linux-pci@vger.kernel.org \
--cc=shangw@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).