mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alexander Gordeev <agordeev@redhat.com>,
	Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: question about pci_enable_msix_range
Date: Tue, 15 Mar 2016 08:29:41 -0600	[thread overview]
Message-ID: <20160315082941.11216f19@t450s.home> (raw)
In-Reply-To: <alpine.DEB.2.10.1603151123340.2531@hadrien>

On Tue, 15 Mar 2016 11:26:50 +0100 (CET)
Julia Lawall <julia.lawall@lip6.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

  reply	other threads:[~2016-03-15 14:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 10:26 Julia Lawall
2016-03-15 14:29 ` Alex Williamson [this message]
2016-03-15 14:33   ` Julia Lawall

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=20160315082941.11216f19@t450s.home \
    --to=alex.williamson@redhat.com \
    --cc=agordeev@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®