[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 7/7] vhost-vdpa: backend feature should set only once
From: |
Jason Wang |
Subject: |
Re: [PATCH 7/7] vhost-vdpa: backend feature should set only once |
Date: |
Wed, 30 Mar 2022 17:28:46 +0800 |
On Wed, Mar 30, 2022 at 2:33 PM Si-Wei Liu <si-wei.liu@oracle.com> wrote:
>
> The vhost_vdpa_one_time_request() branch in
> vhost_vdpa_set_backend_cap() incorrectly sends down
> iotls on vhost_dev with non-zero index. This may
> end up with multiple VHOST_SET_BACKEND_FEATURES
> ioctl calls sent down on the vhost-vdpa fd that is
> shared between all these vhost_dev's.
>
> To fix it, send down ioctl only once via the first
> vhost_dev with index 0. Toggle the polarity of the
> vhost_vdpa_one_time_request() test would do the trick.
>
> Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
Acked-by: Jason Wang <jasowang@redhat.com>
> ---
> hw/virtio/vhost-vdpa.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
> index c5ed7a3..27ea706 100644
> --- a/hw/virtio/vhost-vdpa.c
> +++ b/hw/virtio/vhost-vdpa.c
> @@ -665,7 +665,7 @@ static int vhost_vdpa_set_backend_cap(struct vhost_dev
> *dev)
>
> features &= f;
>
> - if (vhost_vdpa_one_time_request(dev)) {
> + if (!vhost_vdpa_one_time_request(dev)) {
> r = vhost_vdpa_call(dev, VHOST_SET_BACKEND_FEATURES, &features);
> if (r) {
> return -EFAULT;
> --
> 1.8.3.1
>
- Re: [PATCH 4/7] virtio: don't read pending event on host notifier if disabled, (continued)
[PATCH 3/7] virtio-net: Only enable userland vq if using tap backend, Si-Wei Liu, 2022/03/30
[PATCH 2/7] virtio-net: Fix indentation, Si-Wei Liu, 2022/03/30
[PATCH 6/7] vhost-net: fix improper cleanup in vhost_net_start, Si-Wei Liu, 2022/03/30
[PATCH 7/7] vhost-vdpa: backend feature should set only once, Si-Wei Liu, 2022/03/30
Re: [PATCH 7/7] vhost-vdpa: backend feature should set only once, Eugenio Perez Martin, 2022/03/30