Displaying 20 results from an estimated 31 matches for "vhost_mdev_get_vring_num".
2019 Oct 22
2
[PATCH v2] vhost: introduce mdev based hardware backend
...rn -EPERM;
+
+ if (copy_from_user(&features, featurep, sizeof(features)))
+ return -EFAULT;
+
+ if (features & ~m->features)
+ return -EINVAL;
+
+ m->acked_features = features;
+ if (ops->set_features(mdev, m->acked_features))
+ return -ENODEV;
+
+ return 0;
+}
+
+static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
+{
+ const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(m->mdev);
+ struct mdev_device *mdev = m->mdev;
+ u16 num;
+
+ num = ops->get_vq_num_max(mdev);
+
+ if (copy_to_user(argp, &num, sizeof(num)))
+ return -EFAULT;
+ return 0;
+}
+
+s...
2019 Oct 22
2
[PATCH v2] vhost: introduce mdev based hardware backend
...rn -EPERM;
+
+ if (copy_from_user(&features, featurep, sizeof(features)))
+ return -EFAULT;
+
+ if (features & ~m->features)
+ return -EINVAL;
+
+ m->acked_features = features;
+ if (ops->set_features(mdev, m->acked_features))
+ return -ENODEV;
+
+ return 0;
+}
+
+static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
+{
+ const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(m->mdev);
+ struct mdev_device *mdev = m->mdev;
+ u16 num;
+
+ num = ops->get_vq_num_max(mdev);
+
+ if (copy_to_user(argp, &num, sizeof(num)))
+ return -EFAULT;
+ return 0;
+}
+
+s...
2019 Oct 29
2
[PATCH v3] vhost: introduce mdev based hardware backend
...IG_S_FEATURES_OK)
+ return -EBUSY;
+
+ if (copy_from_user(&features, featurep, sizeof(features)))
+ return -EFAULT;
+
+ if (features & ~vhost_mdev_features[m->virtio_id])
+ return -EINVAL;
+
+ if (ops->set_features(mdev, features))
+ return -EINVAL;
+
+ return 0;
+}
+
+static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
+{
+ struct mdev_device *mdev = m->mdev;
+ const struct virtio_mdev_device_ops *ops = mdev_get_vhost_ops(mdev);
+ u16 num;
+
+ num = ops->get_vq_num_max(mdev);
+
+ if (copy_to_user(argp, &num, sizeof(num)))
+ return -EFAULT;
+
+ return 0;
+}
+
+sta...
2019 Oct 29
2
[PATCH v3] vhost: introduce mdev based hardware backend
...IG_S_FEATURES_OK)
+ return -EBUSY;
+
+ if (copy_from_user(&features, featurep, sizeof(features)))
+ return -EFAULT;
+
+ if (features & ~vhost_mdev_features[m->virtio_id])
+ return -EINVAL;
+
+ if (ops->set_features(mdev, features))
+ return -EINVAL;
+
+ return 0;
+}
+
+static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
+{
+ struct mdev_device *mdev = m->mdev;
+ const struct virtio_mdev_device_ops *ops = mdev_get_vhost_ops(mdev);
+ u16 num;
+
+ num = ops->get_vq_num_max(mdev);
+
+ if (copy_to_user(argp, &num, sizeof(num)))
+ return -EFAULT;
+
+ return 0;
+}
+
+sta...
2019 Nov 05
4
[PATCH v5] vhost: introduce mdev based hardware backend
...IG_S_FEATURES_OK)
+ return -EBUSY;
+
+ if (copy_from_user(&features, featurep, sizeof(features)))
+ return -EFAULT;
+
+ if (features & ~vhost_mdev_features[m->virtio_id])
+ return -EINVAL;
+
+ if (ops->set_features(mdev, features))
+ return -EINVAL;
+
+ return 0;
+}
+
+static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
+{
+ struct mdev_device *mdev = m->mdev;
+ const struct mdev_virtio_device_ops *ops = mdev_get_vhost_ops(mdev);
+ u16 num;
+
+ num = ops->get_vq_num_max(mdev);
+
+ if (copy_to_user(argp, &num, sizeof(num)))
+ return -EFAULT;
+
+ return 0;
+}
+
+sta...
2019 Nov 05
4
[PATCH v5] vhost: introduce mdev based hardware backend
...IG_S_FEATURES_OK)
+ return -EBUSY;
+
+ if (copy_from_user(&features, featurep, sizeof(features)))
+ return -EFAULT;
+
+ if (features & ~vhost_mdev_features[m->virtio_id])
+ return -EINVAL;
+
+ if (ops->set_features(mdev, features))
+ return -EINVAL;
+
+ return 0;
+}
+
+static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
+{
+ struct mdev_device *mdev = m->mdev;
+ const struct mdev_virtio_device_ops *ops = mdev_get_vhost_ops(mdev);
+ u16 num;
+
+ num = ops->get_vq_num_max(mdev);
+
+ if (copy_to_user(argp, &num, sizeof(num)))
+ return -EFAULT;
+
+ return 0;
+}
+
+sta...
2019 Oct 22
0
[PATCH v2] vhost: introduce mdev based hardware backend
...-EINVAL;
> +
> + m->acked_features = features;
> + if (ops->set_features(mdev, m->acked_features))
> + return -ENODEV;
-EINVAL should be better, this would be more obvious for parent that
wants to force any feature.
> +
> + return 0;
> +}
> +
> +static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
> +{
> + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(m->mdev);
> + struct mdev_device *mdev = m->mdev;
> + u16 num;
> +
> + num = ops->get_vq_num_max(mdev);
> +
> + if (copy_to_user(argp, &num, sizeof(num))...
2019 Nov 07
2
[PATCH v6] vhost: introduce mdev based hardware backend
...IG_S_FEATURES_OK)
+ return -EBUSY;
+
+ if (copy_from_user(&features, featurep, sizeof(features)))
+ return -EFAULT;
+
+ if (features & ~vhost_mdev_features[m->virtio_id])
+ return -EINVAL;
+
+ if (ops->set_features(mdev, features))
+ return -EINVAL;
+
+ return 0;
+}
+
+static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
+{
+ struct mdev_device *mdev = m->mdev;
+ const struct mdev_virtio_device_ops *ops = mdev_get_vhost_ops(mdev);
+ u16 num;
+
+ num = ops->get_vq_num_max(mdev);
+
+ if (copy_to_user(argp, &num, sizeof(num)))
+ return -EFAULT;
+
+ return 0;
+}
+
+sta...
2019 Nov 06
2
[PATCH v5] vhost: introduce mdev based hardware backend
...rn -EFAULT;
> > +
> > + if (features & ~vhost_mdev_features[m->virtio_id])
> > + return -EINVAL;
> > +
> > + if (ops->set_features(mdev, features))
> > + return -EINVAL;
> > +
> > + return 0;
> > +}
> > +
> > +static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
> > +{
> > + struct mdev_device *mdev = m->mdev;
> > + const struct mdev_virtio_device_ops *ops = mdev_get_vhost_ops(mdev);
> > + u16 num;
> > +
> > + num = ops->get_vq_num_max(mdev);
> > +
> > + if (copy_...
2019 Nov 06
2
[PATCH v5] vhost: introduce mdev based hardware backend
...rn -EFAULT;
> > +
> > + if (features & ~vhost_mdev_features[m->virtio_id])
> > + return -EINVAL;
> > +
> > + if (ops->set_features(mdev, features))
> > + return -EINVAL;
> > +
> > + return 0;
> > +}
> > +
> > +static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
> > +{
> > + struct mdev_device *mdev = m->mdev;
> > + const struct mdev_virtio_device_ops *ops = mdev_get_vhost_ops(mdev);
> > + u16 num;
> > +
> > + num = ops->get_vq_num_max(mdev);
> > +
> > + if (copy_...
2019 Oct 30
1
[PATCH v3] vhost: introduce mdev based hardware backend
...rn -EFAULT;
> > +
> > + if (features & ~vhost_mdev_features[m->virtio_id])
> > + return -EINVAL;
> > +
> > + if (ops->set_features(mdev, features))
> > + return -EINVAL;
> > +
> > + return 0;
> > +}
> > +
> > +static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
> > +{
> > + struct mdev_device *mdev = m->mdev;
> > + const struct virtio_mdev_device_ops *ops = mdev_get_vhost_ops(mdev);
> > + u16 num;
> > +
> > + num = ops->get_vq_num_max(mdev);
> > +
> > + if (copy_...
2019 Oct 29
2
[RFC] vhost_mdev: add network control vq support
...;
+ };
};
void mdev_set_virtio_ops(struct mdev_device *mdev,
diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h
index 061a2824a1b3..3693b2cba0c4 100644
--- a/include/uapi/linux/vhost.h
+++ b/include/uapi/linux/vhost.h
@@ -134,4 +134,11 @@
/* Get the max ring size. */
#define VHOST_MDEV_GET_VRING_NUM _IOR(VHOST_VIRTIO, 0x76, __u16)
+/* VHOST_MDEV device specific defines */
+
+/* Send virtio-net commands. The commands follow the same definition
+ * of the virtio-net commands defined in virtio-spec.
+ */
+#define VHOST_MDEV_NET_CTRL _IOW(VHOST_VIRTIO, 0x77, struct vhost_mdev_net_ctrl *)
+
#en...
2019 Oct 29
2
[RFC] vhost_mdev: add network control vq support
...;
+ };
};
void mdev_set_virtio_ops(struct mdev_device *mdev,
diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h
index 061a2824a1b3..3693b2cba0c4 100644
--- a/include/uapi/linux/vhost.h
+++ b/include/uapi/linux/vhost.h
@@ -134,4 +134,11 @@
/* Get the max ring size. */
#define VHOST_MDEV_GET_VRING_NUM _IOR(VHOST_VIRTIO, 0x76, __u16)
+/* VHOST_MDEV device specific defines */
+
+/* Send virtio-net commands. The commands follow the same definition
+ * of the virtio-net commands defined in virtio-spec.
+ */
+#define VHOST_MDEV_NET_CTRL _IOW(VHOST_VIRTIO, 0x77, struct vhost_mdev_net_ctrl *)
+
#en...
2019 Oct 23
2
[PATCH v2] vhost: introduce mdev based hardware backend
...gt;set_features(mdev, m->acked_features))
> > + return -ENODEV;
>
>
> -EINVAL should be better, this would be more obvious for parent that wants
> to force any feature.
+1. Agree.
>
>
> > +
> > + return 0;
> > +}
> > +
> > +static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
> > +{
> > + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(m->mdev);
> > + struct mdev_device *mdev = m->mdev;
> > + u16 num;
> > +
> > + num = ops->get_vq_num_max(mdev);
> > +
> > + if (c...
2019 Oct 23
2
[PATCH v2] vhost: introduce mdev based hardware backend
...gt;set_features(mdev, m->acked_features))
> > + return -ENODEV;
>
>
> -EINVAL should be better, this would be more obvious for parent that wants
> to force any feature.
+1. Agree.
>
>
> > +
> > + return 0;
> > +}
> > +
> > +static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
> > +{
> > + const struct virtio_mdev_device_ops *ops = mdev_get_dev_ops(m->mdev);
> > + struct mdev_device *mdev = m->mdev;
> > + u16 num;
> > +
> > + num = ops->get_vq_num_max(mdev);
> > +
> > + if (c...
2019 Nov 06
0
[PATCH v5] vhost: introduce mdev based hardware backend
...amp;features, featurep, sizeof(features)))
> + return -EFAULT;
> +
> + if (features & ~vhost_mdev_features[m->virtio_id])
> + return -EINVAL;
> +
> + if (ops->set_features(mdev, features))
> + return -EINVAL;
> +
> + return 0;
> +}
> +
> +static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
> +{
> + struct mdev_device *mdev = m->mdev;
> + const struct mdev_virtio_device_ops *ops = mdev_get_vhost_ops(mdev);
> + u16 num;
> +
> + num = ops->get_vq_num_max(mdev);
> +
> + if (copy_to_user(argp, &num, sizeof(num)))
&g...
2019 Nov 06
2
[PATCH v5] vhost: introduce mdev based hardware backend
...dev_features[m->virtio_id])
>>>> + return -EINVAL;
>>>> +
>>>> + if (ops->set_features(mdev, features))
>>>> + return -EINVAL;
>>>> +
>>>> + return 0;
>>>> +}
>>>> +
>>>> +static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
>>>> +{
>>>> + struct mdev_device *mdev = m->mdev;
>>>> + const struct mdev_virtio_device_ops *ops = mdev_get_vhost_ops(mdev);
>>>> + u16 num;
>>>> +
>>>> + num = ops->get_vq_num_ma...
2019 Nov 06
2
[PATCH v5] vhost: introduce mdev based hardware backend
...dev_features[m->virtio_id])
>>>> + return -EINVAL;
>>>> +
>>>> + if (ops->set_features(mdev, features))
>>>> + return -EINVAL;
>>>> +
>>>> + return 0;
>>>> +}
>>>> +
>>>> +static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
>>>> +{
>>>> + struct mdev_device *mdev = m->mdev;
>>>> + const struct mdev_virtio_device_ops *ops = mdev_get_vhost_ops(mdev);
>>>> + u16 num;
>>>> +
>>>> + num = ops->get_vq_num_ma...
2019 Oct 30
0
[PATCH v3] vhost: introduce mdev based hardware backend
...amp;features, featurep, sizeof(features)))
> + return -EFAULT;
> +
> + if (features & ~vhost_mdev_features[m->virtio_id])
> + return -EINVAL;
> +
> + if (ops->set_features(mdev, features))
> + return -EINVAL;
> +
> + return 0;
> +}
> +
> +static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
> +{
> + struct mdev_device *mdev = m->mdev;
> + const struct virtio_mdev_device_ops *ops = mdev_get_vhost_ops(mdev);
> + u16 num;
> +
> + num = ops->get_vq_num_max(mdev);
> +
> + if (copy_to_user(argp, &num, sizeof(num)))
&g...
2019 Nov 06
0
[PATCH v5] vhost: introduce mdev based hardware backend
...amp;features, featurep, sizeof(features)))
> + return -EFAULT;
> +
> + if (features & ~vhost_mdev_features[m->virtio_id])
> + return -EINVAL;
> +
> + if (ops->set_features(mdev, features))
> + return -EINVAL;
> +
> + return 0;
> +}
> +
> +static long vhost_mdev_get_vring_num(struct vhost_mdev *m, u16 __user *argp)
> +{
> + struct mdev_device *mdev = m->mdev;
> + const struct mdev_virtio_device_ops *ops = mdev_get_vhost_ops(mdev);
> + u16 num;
> +
> + num = ops->get_vq_num_max(mdev);
> +
> + if (copy_to_user(argp, &num, sizeof(num)))
&g...