From: Igor Mammedov <imammedo@redhat.com>
To: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
Ani Sinha <anisinha@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
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 v3 2/2] pcie: Specify 0 for ARI next function numbers
Date: Tue, 4 Jul 2023 14:03:23 +0200 [thread overview]
Message-ID: <20230704140323.013c2dda@imammedo.users.ipa.redhat.com> (raw)
In-Reply-To: <20230702120229.66978-3-akihiko.odaki@daynix.com>
On Sun, 2 Jul 2023 21:02:27 +0900
Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> The current implementers of ARI are all SR-IOV devices. The ARI next
> function number field is undefined for VF. The PF should end the linked
> list formed with the field by specifying 0.
this should also describe compat behavior changes.
> Fixes: 2503461691 ("pcie: Add some SR/IOV API documentation in docs/pcie_sriov.txt")
> Fixes: 44c2c09488 ("hw/nvme: Add support for SR-IOV")
> Fixes: 3a977deebe ("Intrdocue igb device emulation")
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
> include/hw/pci/pci.h | 2 ++
> hw/core/machine.c | 1 +
> hw/pci/pci.c | 2 ++
> hw/pci/pcie.c | 2 +-
> 4 files changed, 6 insertions(+), 1 deletion(-)
>
> GlobalProperty hw_compat_8_0[] = {
> { "migration", "multifd-flush-after-each-section", "on"},
> + { TYPE_PCI_DEVICE, "x-pcie-ari-nextfn-1", "on" },
> };
[...]
> + DEFINE_PROP_BIT("x-pcie-ari-nextfn-1", PCIDevice, cap_present,
> + QEMU_PCIE_ARI_NEXTFN_1_BITNR, true),
now, I'm confused a bit. So above line says that default
x-pcie-ari-nextfn-1=on
then compat also sets it to 'on', so question is why do
we have compat entry at all?
If default state doesn't change why do we need involve compat
machinery and add "x-pcie-ari-nextfn-1" property?
> DEFINE_PROP_END_OF_LIST()
> };
>
> diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
> index 9a3f6430e8..cf09e03a10 100644
> --- a/hw/pci/pcie.c
> +++ b/hw/pci/pcie.c
> @@ -1030,7 +1030,7 @@ void pcie_sync_bridge_lnk(PCIDevice *bridge_dev)
> /* ARI */
> void pcie_ari_init(PCIDevice *dev, uint16_t offset)
> {
> - uint16_t nextfn = 1;
> + uint16_t nextfn = dev->cap_present & QEMU_PCIE_ARI_NEXTFN_1 ? 1 : 0;
>
> pcie_add_capability(dev, PCI_EXT_CAP_ID_ARI, PCI_ARI_VER,
> offset, PCI_ARI_SIZEOF);
next prev parent reply other threads:[~2023-07-04 12:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-02 12:02 [PATCH v3 0/2] pcie: Fix ARI next function numbers Akihiko Odaki
2023-07-02 12:02 ` [PATCH v3 1/2] pcie: Use common ARI next function number Akihiko Odaki
2023-07-02 12:02 ` [PATCH v3 2/2] pcie: Specify 0 for ARI next function numbers Akihiko Odaki
2023-07-04 12:03 ` Igor Mammedov [this message]
2023-07-02 12:43 ` [PATCH v3 0/2] pcie: Fix " Michael S. Tsirkin
2023-07-03 3:17 ` Akihiko Odaki
2023-07-03 4:52 ` Michael S. Tsirkin
2023-07-03 4:54 ` Akihiko Odaki
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=20230704140323.013c2dda@imammedo.users.ipa.redhat.com \
--to=imammedo@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=mst@redhat.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).