@@ -515,6 +515,7 @@ typedef struct NvmeParams {
uint16_t sriov_vi_flexible;
uint8_t sriov_max_vq_per_vf;
uint8_t sriov_max_vi_per_vf;
+ bool ari_nextfn_1;
} NvmeParams;
typedef struct NvmeCtrl {
@@ -41,6 +41,7 @@
GlobalProperty hw_compat_8_0[] = {
{ "migration", "multifd-flush-after-each-section", "on"},
+ { "nvme", "ari-nextfn-1", "on"},
};
const size_t hw_compat_8_0_len = G_N_ELEMENTS(hw_compat_8_0);
@@ -8088,7 +8088,7 @@ static bool nvme_init_pci(NvmeCtrl *n, PCIDevice *pci_dev, Error **errp)
pcie_endpoint_cap_init(pci_dev, 0x80);
pcie_cap_flr_init(pci_dev);
if (n->params.sriov_max_vfs) {
- pcie_ari_init(pci_dev, 0x100, 1);
+ pcie_ari_init(pci_dev, 0x100, n->params.ari_nextfn_1 ? 1 : 0);
}
/* add one to max_ioqpairs to account for the admin queue pair */
@@ -8406,6 +8406,7 @@ static Property nvme_props[] = {
params.sriov_max_vi_per_vf, 0),
DEFINE_PROP_UINT8("sriov_max_vq_per_vf", NvmeCtrl,
params.sriov_max_vq_per_vf, 0),
+ DEFINE_PROP_BOOL("ari-nextfn-1", NvmeCtrl, params.ari_nextfn_1, false),
DEFINE_PROP_END_OF_LIST(),
};
The ARI next function number field is undefined for VF. The PF should end the linked list formed with the field by specifying 0. Fixes: 44c2c09488 ("hw/nvme: Add support for SR-IOV") Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> --- hw/nvme/nvme.h | 1 + hw/core/machine.c | 1 + hw/nvme/ctrl.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-)