[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V2 03/11] virito: introduce bus specific queue l
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH V2 03/11] virito: introduce bus specific queue limit |
Date: |
Thu, 26 Feb 2015 13:57:17 +0100 |
On Thu, 26 Feb 2015 15:04:38 +0800
Jason Wang <address@hidden> wrote:
> This patch introduces a bus specific queue limitation. It will be
> useful for increasing the limit for one of the bus without disturbing
> other buses.
>
> Cc: Anthony Liguori <address@hidden>
> Cc: Michael S. Tsirkin <address@hidden>
> Cc: Alexander Graf <address@hidden>
> Cc: Richard Henderson <address@hidden>
> Cc: Cornelia Huck <address@hidden>
> Cc: Christian Borntraeger <address@hidden>
> Cc: Paolo Bonzini <address@hidden>
> Signed-off-by: Jason Wang <address@hidden>
> ---
> hw/net/virtio-net.c | 4 ++--
> hw/s390x/s390-virtio-bus.c | 1 +
> hw/s390x/virtio-ccw.c | 1 +
> hw/scsi/virtio-scsi.c | 4 ++--
> hw/virtio/virtio-mmio.c | 1 +
> hw/virtio/virtio-pci.c | 1 +
> hw/virtio/virtio.c | 52
> +++++++++++++++++++++++++++++++-----------
> include/hw/virtio/virtio-bus.h | 1 +
> include/hw/virtio/virtio.h | 1 +
> 9 files changed, 49 insertions(+), 17 deletions(-)
>
> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> index ffc22e8..5a806b5 100644
> --- a/hw/virtio/virtio.c
> +++ b/hw/virtio/virtio.c
> @@ -541,6 +541,14 @@ void virtio_update_irq(VirtIODevice *vdev)
> virtio_notify_vector(vdev, VIRTIO_NO_VECTOR);
> }
>
> +int virtio_get_queue_max(VirtIODevice *vdev)
> +{
> + BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
> + VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
> +
> + return k->queue_max;
> +}
> +
Are all callers of this in the slow path? So we don't introduce
processing overhead.
> void virtio_set_status(VirtIODevice *vdev, uint8_t val)
> {
> VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);
(...)
> @@ -777,27 +790,35 @@ void virtio_queue_notify(VirtIODevice *vdev, int n)
>
> uint16_t virtio_queue_vector(VirtIODevice *vdev, int n)
> {
> - return n < VIRTIO_PCI_QUEUE_MAX ? vdev->vq[n].vector :
> + BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
> + VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
> +
> + return n < k->queue_max ? vdev->vq[n].vector :
Any reason you're not using the newly introduced virtio_get_queue_max()?
> VIRTIO_NO_VECTOR;
> }
Do we need to care about migration if the target supports a different
number of queues?
I'm also not sure whether it would be sufficient to allow transports to
limit queues to a lower number than the core supports. We'd basically
only need to block off queue creation in the individual transports, I
think.
[Qemu-devel] [PATCH V2 05/11] virtio-serial-bus: switch to bus specific queue limit, Jason Wang, 2015/02/26
[Qemu-devel] [PATCH V2 04/11] virtio-ccw: introduce ccw specific queue limit, Jason Wang, 2015/02/26
[Qemu-devel] [PATCH V2 07/11] virtio-mmio: switch to bus specific queue limit, Jason Wang, 2015/02/26