[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/3] virtio-net: set the max of queue size to 4096
From: |
liuhaiwei |
Subject: |
[PATCH 3/3] virtio-net: set the max of queue size to 4096 |
Date: |
Mon, 19 Sep 2022 05:39:15 -0400 |
Signed-off-by: liuhaiwei <liuhaiwei9699@126.com>
---
hw/net/virtio-net.c | 8 ++++----
hw/virtio/virtio.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index d63ef24e6a..df16995146 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3479,23 +3479,23 @@ static void virtio_net_device_realize(DeviceState *dev,
Error **errp)
* help from us (using virtio 1 and up).
*/
if (n->net_conf.rx_queue_size < VIRTIO_NET_RX_QUEUE_MIN_SIZE ||
- n->net_conf.rx_queue_size > VIRTQUEUE_MAX_SIZE ||
+ n->net_conf.rx_queue_size > VIRTIO_NET_VQ_MAX_SIZE ||
!is_power_of_2(n->net_conf.rx_queue_size)) {
error_setg(errp, "Invalid rx_queue_size (= %" PRIu16 "), "
"must be a power of 2 between %d and %d.",
n->net_conf.rx_queue_size, VIRTIO_NET_RX_QUEUE_MIN_SIZE,
- VIRTQUEUE_MAX_SIZE);
+ VIRTIO_NET_VQ_MAX_SIZE);
virtio_cleanup(vdev);
return;
}
if (n->net_conf.tx_queue_size < VIRTIO_NET_TX_QUEUE_MIN_SIZE ||
- n->net_conf.tx_queue_size > VIRTQUEUE_MAX_SIZE ||
+ n->net_conf.tx_queue_size > VIRTIO_NET_VQ_MAX_SIZE ||
!is_power_of_2(n->net_conf.tx_queue_size)) {
error_setg(errp, "Invalid tx_queue_size (= %" PRIu16 "), "
"must be a power of 2 between %d and %d",
n->net_conf.tx_queue_size, VIRTIO_NET_TX_QUEUE_MIN_SIZE,
- VIRTQUEUE_MAX_SIZE);
+ VIRTIO_NET_VQ_MAX_SIZE );
virtio_cleanup(vdev);
return;
}
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index d93c20d747..2f0c99e357 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2427,7 +2427,7 @@ VirtQueue *virtio_add_queue(VirtIODevice *vdev, int
queue_size,
break;
}
- if (i == VIRTIO_QUEUE_MAX || queue_size > VIRTQUEUE_MAX_SIZE)
+ if (i == VIRTIO_QUEUE_MAX )
abort();
vdev->vq[i].vring.num = queue_size;
--
2.27.0