[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/13] virtio-ccw: support VIRTIO_QUEUE_MAX virtqueue
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 10/13] virtio-ccw: support VIRTIO_QUEUE_MAX virtqueues |
Date: |
Fri, 24 Feb 2017 10:22:56 +0100 |
From: Halil Pasic <address@hidden>
The maximal number of virtqueues per device can be limited on a per
transport basis. For virtio-ccw this limit is defined by
VIRTIO_CCW_QUEUE_MAX, however the limitation used to come form the
number of adapter routes supported by flic (via notifiers).
Recently the limitation of the flic was adjusted so that it can
accommodate VIRTIO_QUEUE_MAX queues, and is in the meanwhile checked for
separately too.
Let us remove the transport specific limitation of virtio-ccw by
dropping VIRTIO_CCW_QUEUE_MAX and using VIRTIO_QUEUE_MAX instead.
Signed-off-by: Halil Pasic <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/s390x/s390-virtio-ccw.c | 2 +-
hw/s390x/virtio-ccw.c | 16 ++++++++--------
include/hw/s390x/s390_flic.h | 1 -
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index ea244bbf55..4f0d62b2d8 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -63,7 +63,7 @@ static int virtio_ccw_hcall_notify(const uint64_t *args)
if (!sch || !css_subch_visible(sch)) {
return -EINVAL;
}
- if (queue >= VIRTIO_CCW_QUEUE_MAX) {
+ if (queue >= VIRTIO_QUEUE_MAX) {
return -EINVAL;
}
virtio_queue_notify(virtio_ccw_get_vdev(sch), queue);
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index a2ea95947f..00b3bde4e9 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -128,7 +128,7 @@ static int virtio_ccw_set_vqs(SubchDev *sch, VqInfoBlock
*info,
uint16_t num = info ? info->num : linfo->num;
uint64_t desc = info ? info->desc : linfo->queue;
- if (index >= VIRTIO_CCW_QUEUE_MAX) {
+ if (index >= VIRTIO_QUEUE_MAX) {
return -EINVAL;
}
@@ -164,7 +164,7 @@ static int virtio_ccw_set_vqs(SubchDev *sch, VqInfoBlock
*info,
virtio_queue_set_vector(vdev, index, index);
}
/* tell notify handler in case of config change */
- vdev->config_vector = VIRTIO_CCW_QUEUE_MAX;
+ vdev->config_vector = VIRTIO_QUEUE_MAX;
return 0;
}
@@ -565,7 +565,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw)
ccw.cda,
MEMTXATTRS_UNSPECIFIED,
NULL);
- if (vq_config.index >= VIRTIO_CCW_QUEUE_MAX) {
+ if (vq_config.index >= VIRTIO_QUEUE_MAX) {
ret = -EINVAL;
break;
}
@@ -960,11 +960,11 @@ static void virtio_ccw_notify(DeviceState *d, uint16_t
vector)
uint64_t indicators;
/* queue indicators + secondary indicators */
- if (vector >= VIRTIO_CCW_QUEUE_MAX + 64) {
+ if (vector >= VIRTIO_QUEUE_MAX + 64) {
return;
}
- if (vector < VIRTIO_CCW_QUEUE_MAX) {
+ if (vector < VIRTIO_QUEUE_MAX) {
if (!dev->indicators) {
return;
}
@@ -1325,10 +1325,10 @@ static void virtio_ccw_device_plugged(DeviceState *d,
Error **errp)
dev->max_rev = 0;
}
- if (virtio_get_num_queues(vdev) > VIRTIO_CCW_QUEUE_MAX) {
+ if (virtio_get_num_queues(vdev) > VIRTIO_QUEUE_MAX) {
error_setg(errp, "The number of virtqueues %d "
- "exceeds ccw limit %d", n,
- VIRTIO_CCW_QUEUE_MAX);
+ "exceeds virtio limit %d", n,
+ VIRTIO_QUEUE_MAX);
return;
}
if (virtio_get_num_queues(vdev) > flic->adapter_routes_max_batch) {
diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h
index 7f8ec7541b..f9e6890c90 100644
--- a/include/hw/s390x/s390_flic.h
+++ b/include/hw/s390x/s390_flic.h
@@ -24,7 +24,6 @@
* maximum right now.
*/
#define ADAPTER_ROUTES_MAX_GSI VIRTIO_QUEUE_MAX
-#define VIRTIO_CCW_QUEUE_MAX 64
typedef struct AdapterRoutes {
AdapterInfo adapter;
--
2.11.0
- [Qemu-devel] [PULL 00/13] s390x patches for 2.9, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 01/13] s390x/s390-virtio: get rid of DPRINTF, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 05/13] virtio-ccw: add virtio-crypto-ccw device, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 02/13] s390x/kvm: detect some program check loops, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 03/13] s390x/flic: fail migration on source already, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 06/13] virtio-ccw: Check the number of vqs in CCW_CMD_SET_IND, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 04/13] virtio-ccw: handle virtio 1 only devices, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 07/13] s390x: add property adapter_routes_max_batch, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 09/13] s390x: bump ADAPTER_ROUTES_MAX_GSI, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 08/13] virtio-ccw: check flic->adapter_routes_max_batch, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 10/13] virtio-ccw: support VIRTIO_QUEUE_MAX virtqueues,
Cornelia Huck <=
- [Qemu-devel] [PULL 12/13] s390x/arch_dump: pass cpuid into notes sections, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 13/13] s390x/css: handle format-0 TIC CCW correctly, Cornelia Huck, 2017/02/24
- [Qemu-devel] [PULL 11/13] s390x/arch_dump: use proper note name and note size, Cornelia Huck, 2017/02/24
- Re: [Qemu-devel] [PULL 00/13] s390x patches for 2.9, Peter Maydell, 2017/02/25