From: Keith Busch <keith.busch@intel.com>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Linux PCI <linux-pci@vger.kernel.org>,
Jonathan Derrick <jonathan.derrick@intel.com>,
Scott Bauer <scott.bauer@intel.com>
Subject: Re: [PATCHv2] PCI: vmd: Use affinity to chain child device interrupts
Date: Tue, 13 Mar 2018 14:08:41 -0600 [thread overview]
Message-ID: <20180313200840.GA28002@localhost.localdomain> (raw)
In-Reply-To: <20180313171039.GB20373@e107981-ln.cambridge.arm.com>
On Tue, Mar 13, 2018 at 05:10:39PM +0000, Lorenzo Pieralisi wrote:
> On Tue, Feb 06, 2018 at 01:22:25PM -0700, Keith Busch wrote:
> > @@ -233,9 +266,11 @@ static int vmd_msi_prepare(struct irq_domain *domain, struct device *dev,
> > struct pci_dev *pdev = to_pci_dev(dev);
> > struct vmd_dev *vmd = vmd_from_bus(pdev->bus);
> >
> > - if (nvec > vmd->msix_count)
> > + if (nvec > vmd->msix_count) {
> > + if (vmd->msix_count > 1)
> > + return vmd->msix_count - 1;
> > return vmd->msix_count;
>
> I am about to apply this patch but I do not understand what's this hunk
> is there for, to me vmd_msi_prepare() should just return an error in
> this code path unless I am getting this wrong.
Hi Lorenzo,
It's not really an error if a driver requests more vectors than
can be allocated. The return here ultimately propogates back to
__pci_enable_msix, which returns 0 for sucess, < 0 for error, and >
0 if the requested count was too high.
The change above is fixing an off-by-one. It is really a bug fix on its
own, but it wasn't really harmful without the affinity awareness this
patch adds, where not having it starts to negatively affect performance.
Thanks,
Keith
next prev parent reply other threads:[~2018-03-13 20:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-06 20:22 [PATCHv2] PCI: vmd: Use affinity to chain child device interrupts Keith Busch
2018-03-13 17:10 ` Lorenzo Pieralisi
2018-03-13 20:08 ` Keith Busch [this message]
2018-03-13 20:18 ` Keith Busch
2018-03-13 23:24 ` Keith Busch
2018-03-14 11:05 ` Lorenzo Pieralisi
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=20180313200840.GA28002@localhost.localdomain \
--to=keith.busch@intel.com \
--cc=bhelgaas@google.com \
--cc=jonathan.derrick@intel.com \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=scott.bauer@intel.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).