lkml.org 
[lkml]   [2014]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 5/7] vfio: Use new interfaces for MSI/MSI-X enablement
From
Date
On Fri, 2014-01-10 at 08:42 +0100, Alexander Gordeev wrote:
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>

Thanks for the changes.

Acked-by: Alex Williamson <alex.williamson@redhat.com>

> ---
> drivers/vfio/pci/vfio_pci_intrs.c | 12 ++++++++----
> 1 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c
> index 641bc87..4a9db1d 100644
> --- a/drivers/vfio/pci/vfio_pci_intrs.c
> +++ b/drivers/vfio/pci/vfio_pci_intrs.c
> @@ -482,15 +482,19 @@ static int vfio_msi_enable(struct vfio_pci_device *vdev, int nvec, bool msix)
> for (i = 0; i < nvec; i++)
> vdev->msix[i].entry = i;
>
> - ret = pci_enable_msix(pdev, vdev->msix, nvec);
> - if (ret) {
> + ret = pci_enable_msix_range(pdev, vdev->msix, 1, nvec);
> + if (ret < nvec) {
> + if (ret > 0)
> + pci_disable_msix(pdev);
> kfree(vdev->msix);
> kfree(vdev->ctx);
> return ret;
> }
> } else {
> - ret = pci_enable_msi_block(pdev, nvec);
> - if (ret) {
> + ret = pci_enable_msi_range(pdev, 1, nvec);
> + if (ret < nvec) {
> + if (ret > 0)
> + pci_disable_msi(pdev);
> kfree(vdev->ctx);
> return ret;
> }
> --
> 1.7.7.6
>





\
 
 \ /
  Last update: 2014-01-10 17:21    [W:0.066 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site