[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v4 42/83] virtio-rng-pci: Allow setting nvectors, so we can use MS
From: |
Michael S. Tsirkin |
Subject: |
[PULL v4 42/83] virtio-rng-pci: Allow setting nvectors, so we can use MSI-X |
Date: |
Mon, 7 Nov 2022 17:50:56 -0500 |
From: David Daney <david.daney@fungible.com>
Most other virtio-pci devices allow MSI-X, let's have it for rng too.
Signed-off-by: David Daney <david.daney@fungible.com>
Reviewed-by: Marcin Nowakowski <marcin.nowakowski@fungible.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@fungible.com>
Message-Id: <20221014160947.66105-1-philmd@fungible.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/virtio/virtio-rng-pci.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/hw/virtio/virtio-rng-pci.c b/hw/virtio/virtio-rng-pci.c
index 151ece6f94..6e76f8b57b 100644
--- a/hw/virtio/virtio-rng-pci.c
+++ b/hw/virtio/virtio-rng-pci.c
@@ -13,6 +13,7 @@
#include "hw/virtio/virtio-pci.h"
#include "hw/virtio/virtio-rng.h"
+#include "hw/qdev-properties.h"
#include "qapi/error.h"
#include "qemu/module.h"
#include "qom/object.h"
@@ -31,11 +32,23 @@ struct VirtIORngPCI {
VirtIORNG vdev;
};
+static Property virtio_rng_properties[] = {
+ DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags,
+ VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true),
+ DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
+ DEV_NVECTORS_UNSPECIFIED),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void virtio_rng_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
{
VirtIORngPCI *vrng = VIRTIO_RNG_PCI(vpci_dev);
DeviceState *vdev = DEVICE(&vrng->vdev);
+ if (vpci_dev->nvectors == DEV_NVECTORS_UNSPECIFIED) {
+ vpci_dev->nvectors = 2;
+ }
+
if (!qdev_realize(vdev, BUS(&vpci_dev->bus), errp)) {
return;
}
@@ -54,6 +67,7 @@ static void virtio_rng_pci_class_init(ObjectClass *klass,
void *data)
pcidev_k->device_id = PCI_DEVICE_ID_VIRTIO_RNG;
pcidev_k->revision = VIRTIO_PCI_ABI_VERSION;
pcidev_k->class_id = PCI_CLASS_OTHERS;
+ device_class_set_props(dc, virtio_rng_properties);
}
static void virtio_rng_initfn(Object *obj)
--
MST
- [PULL v4 32/83] virtio-pci: support queue enable, (continued)
- [PULL v4 32/83] virtio-pci: support queue enable, Michael S. Tsirkin, 2022/11/07
- [PULL v4 34/83] vhost: expose vhost_virtqueue_stop(), Michael S. Tsirkin, 2022/11/07
- [PULL v4 35/83] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_reset(), Michael S. Tsirkin, 2022/11/07
- [PULL v4 36/83] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_restart(), Michael S. Tsirkin, 2022/11/07
- [PULL v4 38/83] virtio-net: support queue reset, Michael S. Tsirkin, 2022/11/07
- [PULL v4 39/83] virtio-net: support queue_enable, Michael S. Tsirkin, 2022/11/07
- [PULL v4 37/83] virtio-net: introduce flush_or_purge_queued_packets(), Michael S. Tsirkin, 2022/11/07
- [PULL v4 40/83] vhost: vhost-kernel: enable vq reset feature, Michael S. Tsirkin, 2022/11/07
- [PULL v4 41/83] virtio-net: enable vq reset feature, Michael S. Tsirkin, 2022/11/07
- [PULL v4 43/83] vhost-user: Fix out of order vring host notification handling, Michael S. Tsirkin, 2022/11/07
- [PULL v4 42/83] virtio-rng-pci: Allow setting nvectors, so we can use MSI-X,
Michael S. Tsirkin <=
- [PULL v4 44/83] acpi: pc: vga: use AcpiDevAmlIf interface to build VGA device descriptors, Michael S. Tsirkin, 2022/11/07
- Re: [PULL v4 44/83] acpi: pc: vga: use AcpiDevAmlIf interface to build VGA device descriptors, Ani Sinha, 2022/11/09
[PULL v4 45/83] tests: acpi: whitelist DSDT before generating PCI-ISA bridge AML automatically, Michael S. Tsirkin, 2022/11/07