[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160315082941.11216f19@t450s.home>
Date: Tue, 15 Mar 2016 08:29:41 -0600
From: Alex Williamson <alex.williamson@...hat.com>
To: Julia Lawall <julia.lawall@...6.fr>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
Alexander Gordeev <agordeev@...hat.com>,
Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: question about pci_enable_msix_range
On Tue, 15 Mar 2016 11:26:50 +0100 (CET)
Julia Lawall <julia.lawall@...6.fr> wrote:
> Hello,
>
> I was looking at the following code in the file
> drivers/vfio/pci/vfio_pci_intrs.c:
>
> 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;
> }
>
> I was wondering what is the point of using a range of 1 .. nvec if there
> is going to be a failure if the number of allocated irqs is less than
> nvec?
Hi Julia,
The intention is that on failure we can indicate to the user a value
that might work. If we were to call with {nvec, nvec} we'd only get
back -ENOSPC and the user could only arbitrarily decrease the request
by some amount and try again. By using {1, nvec} we can hopefully
provide a useful next step. On the other hand, we haven't enabled the
number of vectors the user requested, so it doesn't seem to make sense
to leave any enabled. Thanks,
Alex
Powered by blists - more mailing lists