[PATCH vhost v7 4/6] virtio: vring_create_virtqueue: pass struct instead of multi parameters
Halil Pasic
pasic at linux.ibm.com
Tue Apr 2 13:42:56 PDT 2024
On Thu, 28 Mar 2024 16:03:46 +0800
Xuan Zhuo <xuanzhuo at linux.alibaba.com> wrote:
> --- a/drivers/s390/virtio/virtio_ccw.c
> +++ b/drivers/s390/virtio/virtio_ccw.c
> @@ -503,6 +503,7 @@ static struct virtqueue *virtio_ccw_setup_vq(struct virtio_device *vdev,
> struct virtio_vq_config *cfg)
> {
> struct virtio_ccw_device *vcdev = to_vc_device(vdev);
> + struct vq_transport_config tp_cfg = {};
> bool (*notify)(struct virtqueue *vq);
> int err;
> struct virtqueue *vq = NULL;
> @@ -536,13 +537,14 @@ static struct virtqueue *virtio_ccw_setup_vq(struct virtio_device *vdev,
> goto out_err;
> }
> may_reduce = vcdev->revision > 0;
> - vq = vring_create_virtqueue(i, info->num, KVM_VIRTIO_CCW_RING_ALIGN,
> - vdev, true, may_reduce,
> - cfg->ctx ? cfg->ctx[i] : false,
> - notify,
> - cfg->callbacks[i],
> - cfg->names[i]);
>
> + tp_cfg.num = info->num;
> + tp_cfg.vring_align = KVM_VIRTIO_CCW_RING_ALIGN;
> + tp_cfg.weak_barriers = true;
> + tp_cfg.may_reduce_num = may_reduce;
> + tp_cfg.notify = notify;
> +
> + vq = vring_create_virtqueue(vdev, i, &tp_cfg, cfg);
> if (!vq) {
> /* For now, we fail if we can't get the requested size. */
> dev_warn(&vcdev->cdev->dev, "no vq\n");
For the virtio-ccw part:
Acked-by: Halil Pasic <pasic at linux.ibm.com>
More information about the linux-um
mailing list