[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH V2 08/11] virtio-pci: switch to use bus specific que
From: |
Jason Wang |
Subject: |
[Qemu-devel] [PATCH V2 08/11] virtio-pci: switch to use bus specific queue limit |
Date: |
Thu, 26 Feb 2015 15:04:43 +0800 |
Instead of depending on a macro, switch to use a bus specific queue
limit.
Cc: Anthony Liguori <address@hidden>
Cc: Michael S. Tsirkin <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
---
hw/virtio/virtio-pci.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 7fa8141..23c4649 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -215,7 +215,7 @@ static void virtio_pci_start_ioeventfd(VirtIOPCIProxy
*proxy)
return;
}
- for (n = 0; n < VIRTIO_PCI_QUEUE_MAX; n++) {
+ for (n = 0; n < virtio_get_queue_max(vdev); n++) {
if (!virtio_queue_get_num(vdev, n)) {
continue;
}
@@ -251,7 +251,7 @@ static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy)
return;
}
- for (n = 0; n < VIRTIO_PCI_QUEUE_MAX; n++) {
+ for (n = 0; n < virtio_get_queue_max(vdev); n++) {
if (!virtio_queue_get_num(vdev, n)) {
continue;
}
@@ -287,11 +287,11 @@ static void virtio_ioport_write(void *opaque, uint32_t
addr, uint32_t val)
virtio_queue_set_addr(vdev, vdev->queue_sel, pa);
break;
case VIRTIO_PCI_QUEUE_SEL:
- if (val < VIRTIO_PCI_QUEUE_MAX)
+ if (val < virtio_get_queue_max(vdev))
vdev->queue_sel = val;
break;
case VIRTIO_PCI_QUEUE_NOTIFY:
- if (val < VIRTIO_PCI_QUEUE_MAX) {
+ if (val < virtio_get_queue_max(vdev)) {
virtio_queue_notify(vdev, val);
}
break;
@@ -792,7 +792,7 @@ static int virtio_pci_set_guest_notifiers(DeviceState *d,
int nvqs, bool assign)
bool with_irqfd = msix_enabled(&proxy->pci_dev) &&
kvm_msi_via_irqfd_enabled();
- nvqs = MIN(nvqs, VIRTIO_PCI_QUEUE_MAX);
+ nvqs = MIN(nvqs, virtio_get_queue_max(vdev));
/* When deassigning, pass a consistent nvqs value
* to avoid leaking notifiers.
--
1.9.1
- Re: [Qemu-devel] [PATCH V2 03/11] virito: introduce bus specific queue limit, (continued)
- [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
- [Qemu-devel] [PATCH V2 06/11] virtio-s390: switch to bus specific queue limit, Jason Wang, 2015/02/26
- [Qemu-devel] [PATCH V2 09/11] virtio-pci: increase the maximum number of virtqueues to 513, Jason Wang, 2015/02/26
- [Qemu-devel] [PATCH V2 08/11] virtio-pci: switch to use bus specific queue limit,
Jason Wang <=
- [Qemu-devel] [PATCH V2 10/11] pci: remove hard-coded bar size in msix_init_exclusive_bar(), Jason Wang, 2015/02/26
- [Qemu-devel] [PATCH V2 11/11] virtio-pci: introduce auto_msix_bar_size property, Jason Wang, 2015/02/26