From: "Michael S. Tsirkin" <mst@redhat.com>
To: liuhaiwei <liuhaiwei9699@126.com>
Cc: qemu-devel@nongnu.org, jasowang@redhat.com
Subject: Re: [PATCH 3/3] virtio-net: set the max of queue size to 4096
Date: Mon, 19 Sep 2022 06:23:43 -0400 [thread overview]
Message-ID: <20220919062312-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20220919093915.33003-3-liuhaiwei9699@126.com>
same comments as other patches. besides ...
On Mon, Sep 19, 2022 at 05:39:15AM -0400, liuhaiwei wrote:
> 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(-)
coding style violations all over the place
>
> 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 10:41 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 ` [PATCH 3/3] virtio-net: set the max of queue size to 4096 liuhaiwei
2022-09-19 10:23 ` Michael S. Tsirkin [this message]
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=20220919062312-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=jasowang@redhat.com \
--cc=liuhaiwei9699@126.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.