On Sun, Dec 20, 2020 at 10:16 PM Maxime Coquelin
<maxime.coque...@redhat.com> wrote:
> diff --git a/drivers/net/virtio/virtio_user/vhost_kernel.c 
> b/drivers/net/virtio/virtio_user/vhost_kernel.c
> index 2f1b4840ee..1805aee7f7 100644
> --- a/drivers/net/virtio/virtio_user/vhost_kernel.c
> +++ b/drivers/net/virtio/virtio_user/vhost_kernel.c
> @@ -259,11 +259,44 @@ vhost_kernel_get_vring_base(struct virtio_user_dev 
> *dev, struct vhost_vring_stat
>         return vhost_kernel_set_vring(dev, VHOST_GET_VRING_BASE, state);
>  }
>
> +static int
> +vhost_kernel_set_vring_file(struct virtio_user_dev *dev, uint64_t req,
> +               struct vhost_vring_file *file)
> +{
> +       int ret, fd;
> +       uint32_t index = file->index;
> +
> +       /* Convert from queue index to queue-pair & offset */
> +       fd = dev->vhostfds[file->index / 2];
> +       file->index %= 2;
> +
> +       ret = vhost_kernel_ioctl(fd, req, file);
> +       if (ret < 0) {
> +               PMD_DRV_LOG(ERR, "Failed to set vring file (request %lu)", 
> req);

Breaks 32bits build.

> +               return -1;
> +       }
> +
> +       /* restore index back to queue index */
> +       file->index = index;
> +
> +       return 0;
> +}
> +


-- 
David Marchand

Reply via email to