From: "Michael S. Tsirkin" <mst@redhat.com>
To: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org,
Ani Sinha <anisinha@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 v2 3/4] igb: Fix ARI next function numbers
Date: Sun, 2 Jul 2023 06:33:45 -0400 [thread overview]
Message-ID: <20230702063136-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20230702094631.39111-4-akihiko.odaki@daynix.com>
On Sun, Jul 02, 2023 at 06:46:27PM +0900, Akihiko Odaki wrote:
> The ARI next function number field is undefined for VF so the PF should
> end the linked list formed with the field by specifying 0.
>
> Fixes: 3a977deebe ("Intrdocue igb device emulation")
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> ---
> hw/core/machine.c | 3 ++-
> hw/net/igb.c | 5 ++++-
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index f984a767a2..1f5aacd1dc 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -41,7 +41,8 @@
>
> GlobalProperty hw_compat_8_0[] = {
> { "migration", "multifd-flush-after-each-section", "on"},
> - { "nvme", "ari-nextfn-1", "on"},
> + { "igb", "ari-nextfn-1", "on" },
> + { "nvme", "ari-nextfn-1", "on" },
> };
> const size_t hw_compat_8_0_len = G_N_ELEMENTS(hw_compat_8_0);
>
> diff --git a/hw/net/igb.c b/hw/net/igb.c
> index 1c989d7677..d37d43c155 100644
> --- a/hw/net/igb.c
> +++ b/hw/net/igb.c
> @@ -78,6 +78,8 @@ struct IGBState {
> uint32_t ioaddr;
>
> IGBCore core;
> +
> + bool ari_nextfn_1;
Document this field please, explaining why it's there.
> };
>
> #define IGB_CAP_SRIOV_OFFSET (0x160)
> @@ -431,7 +433,7 @@ static void igb_pci_realize(PCIDevice *pci_dev, Error **errp)
> hw_error("Failed to initialize AER capability");
> }
>
> - pcie_ari_init(pci_dev, 0x150, 1);
> + pcie_ari_init(pci_dev, 0x150, s->ari_nextfn_1 ? 1 : 0);
Why don't we move the logic to pci core, and drop code duplication
completely?
>
> pcie_sriov_pf_init(pci_dev, IGB_CAP_SRIOV_OFFSET, TYPE_IGBVF,
> IGB_82576_VF_DEV_ID, IGB_MAX_VF_FUNCTIONS, IGB_MAX_VF_FUNCTIONS,
> @@ -582,6 +584,7 @@ static const VMStateDescription igb_vmstate = {
>
> static Property igb_properties[] = {
> DEFINE_NIC_PROPERTIES(IGBState, conf),
> + DEFINE_PROP_BOOL("ari-nextfn-1", IGBState, ari_nextfn_1, false),
> DEFINE_PROP_END_OF_LIST(),
> };
This really needs to be a non stable property (prefix with "x-").
> --
> 2.41.0
next prev parent reply other threads:[~2023-07-02 10:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-02 9:46 [PATCH v2 0/4] pcie: Fix ARI next function numbers Akihiko Odaki
2023-07-02 9:46 ` [PATCH v2 1/4] docs: Fix next function numbers in SR/IOV documentation Akihiko Odaki
2023-07-02 10:40 ` Michael S. Tsirkin
2023-07-02 11:19 ` Akihiko Odaki
2023-07-02 13:24 ` Michael S. Tsirkin
2023-07-02 9:46 ` [PATCH v2 2/4] hw/nvme: Fix ARI next function numbers Akihiko Odaki
2023-07-02 9:46 ` [PATCH v2 3/4] igb: " Akihiko Odaki
2023-07-02 10:33 ` Michael S. Tsirkin [this message]
2023-07-02 9:46 ` [PATCH v2 4/4] pcie: Note a caveat regarding ARI next function number 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=20230702063136-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.