From: "Michael S. Tsirkin" <mst@redhat.com>
To: Ani Sinha <anisinha@redhat.com>
Cc: Akihiko Odaki <akihiko.odaki@daynix.com>,
qemu-devel <qemu-devel@nongnu.org>,
qemu-block@nongnu.org,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
Sriram Yagnaraman <sriram.yagnaraman@est.tech>,
Jason Wang <jasowang@redhat.com>, Keith Busch <kbusch@kernel.org>,
Klaus Jensen <its@irrelevant.dk>
Subject: Re: [PATCH 4/4] pci: Compare function number and ARI next function number
Date: Tue, 11 Jul 2023 04:33:56 -0400 [thread overview]
Message-ID: <20230711043101-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <805445D0-111B-4D7B-A02F-71A4B90FA848@redhat.com>
On Tue, Jul 11, 2023 at 12:40:47PM +0530, Ani Sinha wrote:
>
>
> > On 01-Jul-2023, at 12:31 PM, Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> >
> > The function number must be lower than the next function number
> > advertised with ARI.
> >
> > Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> > ---
> > hw/pci/pci.c | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> >
> > diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> > index e2eb4c3b4a..568665ee42 100644
> > --- a/hw/pci/pci.c
> > +++ b/hw/pci/pci.c
> > @@ -2059,6 +2059,8 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp)
> > Error *local_err = NULL;
> > bool is_default_rom;
> > uint16_t class_id;
> > + uint16_t ari;
> > + uint16_t nextfn;
> >
> > /*
> > * capped by systemd (see: udev-builtin-net_id.c)
> > @@ -2121,6 +2123,19 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp)
> > }
> > }
> >
> > + if (pci_is_express(pci_dev)) {
> > + ari = pcie_find_capability(pci_dev, PCI_EXT_CAP_ID_ARI);
> > + if (ari) {
> > + nextfn = (pci_get_long(pci_dev->config + ari + PCI_ARI_CAP) >> 8) & 0xff;
> > + if (nextfn && (pci_dev->devfn & 0xff) >= nextfn) {
> > + error_setg(errp, "PCI: function number %u is not lower than ARI next function number %u",
> > + pci_dev->devfn & 0xff, nextfn);
> > + pci_qdev_unrealize(DEVICE(pci_dev));
> > + return;
> > + }
> > + }
> > + }
> > +
>
> So I kind of got lost in all the patches. What was the ultimate decision regarding checking this?
We still need to fix ARI for multi-function PFs.
I feel the right thing to do is to init Next Function in the ARI
capability, automatically.
For now, we have merely changed ARI setting next function to 0.
At least that's more correct for the common case of ARI PF with VFs.
> > if (pci_dev->failover_pair_id) {
> > if (!pci_bus_is_express(pci_get_bus(pci_dev))) {
> > error_setg(errp, "failover primary device must be on "
> > --
> > 2.41.0
> >
next prev parent reply other threads:[~2023-07-11 8:34 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-01 7:01 [PATCH 0/4] pci: Compare function number and ARI next function number Akihiko Odaki
2023-07-01 7:01 ` [PATCH 1/4] docs: Fix next function numbers in SR/IOV documentation Akihiko Odaki
2023-07-01 14:31 ` Ani Sinha
2023-07-02 3:51 ` Akihiko Odaki
2023-07-01 7:01 ` [PATCH 2/4] hw/nvme: Fix ARI next function numbers Akihiko Odaki
2023-07-01 7:01 ` [PATCH 3/4] igb: " Akihiko Odaki
2023-07-02 5:05 ` Michael S. Tsirkin
2023-07-02 8:38 ` Akihiko Odaki
2023-07-02 8:40 ` Michael S. Tsirkin
2023-07-01 7:01 ` [PATCH 4/4] pci: Compare function number and ARI next function number Akihiko Odaki
2023-07-02 4:58 ` Michael S. Tsirkin
2023-07-02 8:46 ` Akihiko Odaki
2023-07-02 8:55 ` Michael S. Tsirkin
2023-07-02 8:57 ` Michael S. Tsirkin
2023-07-11 7:10 ` Ani Sinha
2023-07-11 8:33 ` Michael S. Tsirkin [this message]
2023-07-02 5:10 ` [PATCH 0/4] " Michael S. Tsirkin
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=20230711043101-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=akihiko.odaki@daynix.com \
--cc=anisinha@redhat.com \
--cc=its@irrelevant.dk \
--cc=jasowang@redhat.com \
--cc=kbusch@kernel.org \
--cc=marcel.apfelbaum@gmail.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sriram.yagnaraman@est.tech \
/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).