qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Si-Wei Liu <si-wei.liu@oracle.com>, qemu-devel@nongnu.org
Cc: eperezma@redhat.com, sgarzare@redhat.com, eli@mellanox.com,
	mst@redhat.com
Subject: Re: [PATCH v2 1/5] virtio-net: setup vhost_dev and notifiers for cvq only when feature is negotiated
Date: Fri, 29 Apr 2022 10:14:02 +0800	[thread overview]
Message-ID: <198abd64-9c55-1f96-bf4b-0e56ad1e8edb@redhat.com> (raw)
In-Reply-To: <1651048216-3365-2-git-send-email-si-wei.liu@oracle.com>


在 2022/4/27 16:30, Si-Wei Liu 写道:
> When the control virtqueue feature is absent or not negotiated,
> vhost_net_start() still tries to set up vhost_dev and install
> vhost notifiers for the control virtqueue, which results in
> erroneous ioctl calls with incorrect queue index sending down
> to driver. Do that only when needed.
>
> Fixes: 22288fe ("virtio-net: vhost control virtqueue support")
> Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>


Acked-by: Jason Wang <jasowang@redhat.com>


> ---
>   hw/net/virtio-net.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 1067e72..ffb3475 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -245,7 +245,8 @@ static void virtio_net_vhost_status(VirtIONet *n, uint8_t status)
>       VirtIODevice *vdev = VIRTIO_DEVICE(n);
>       NetClientState *nc = qemu_get_queue(n->nic);
>       int queue_pairs = n->multiqueue ? n->max_queue_pairs : 1;
> -    int cvq = n->max_ncs - n->max_queue_pairs;
> +    int cvq = virtio_vdev_has_feature(vdev, VIRTIO_NET_F_CTRL_VQ) ?
> +              n->max_ncs - n->max_queue_pairs : 0;
>   
>       if (!get_vhost_net(nc->peer)) {
>           return;



  reply	other threads:[~2022-04-29  2:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27  8:30 [PATCH v2 0/5] vhost-vdpa multiqueue fixes Si-Wei Liu
2022-04-27  8:30 ` [PATCH v2 1/5] virtio-net: setup vhost_dev and notifiers for cvq only when feature is negotiated Si-Wei Liu
2022-04-29  2:14   ` Jason Wang [this message]
2022-04-27  8:30 ` [PATCH v2 2/5] virtio-net: align ctrl_vq index for non-mq guest for vhost_vdpa Si-Wei Liu
2022-04-29  2:23   ` Jason Wang
2022-04-29  2:24     ` Jason Wang
2022-04-30  1:13       ` Si-Wei Liu
2022-04-30  1:12     ` Si-Wei Liu
2022-05-05  8:25       ` Jason Wang
2022-04-27  8:30 ` [PATCH v2 3/5] vhost-vdpa: fix improper cleanup in net_init_vhost_vdpa Si-Wei Liu
2022-04-27  8:30 ` [PATCH v2 4/5] vhost-net: fix improper cleanup in vhost_net_start Si-Wei Liu
2022-04-27  8:30 ` [PATCH v2 5/5] vhost-vdpa: backend feature should set only once Si-Wei Liu

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=198abd64-9c55-1f96-bf4b-0e56ad1e8edb@redhat.com \
    --to=jasowang@redhat.com \
    --cc=eli@mellanox.com \
    --cc=eperezma@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    --cc=si-wei.liu@oracle.com \
    /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).