From: liuhaiwei <liuhaiwei9699@126.com>
To: qemu-devel@nongnu.org
Cc: mst@redhat.com, jasowang@redhat.com, liuhaiwei <liuhaiwei9699@126.com>
Subject: [PATCH 3/3] virtio-net: set the max of queue size to 4096
Date: Mon, 19 Sep 2022 05:39:15 -0400 [thread overview]
Message-ID: <20220919093915.33003-3-liuhaiwei9699@126.com> (raw)
In-Reply-To: <20220919093915.33003-1-liuhaiwei9699@126.com>
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
next prev parent reply other threads:[~2022-09-19 9:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 9:39 [PATCH 1/3] virtio-net: fix max vring buf size when set ring num liuhaiwei
2022-09-19 9:39 ` [PATCH 2/3] virtio-net: update the default and max of rx/tx_queue_size liuhaiwei
2022-09-19 10:22 ` Michael S. Tsirkin
2022-09-19 9:39 ` liuhaiwei [this message]
2022-09-19 10:23 ` [PATCH 3/3] virtio-net: set the max of queue size to 4096 Michael S. Tsirkin
2022-09-19 10:21 ` [PATCH 1/3] virtio-net: fix max vring buf size when set ring num Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220919093915.33003-3-liuhaiwei9699@126.com \
--to=liuhaiwei9699@126.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).