Displaying 20 results from an estimated 23 matches for "mdev_get_vhost_ops".
2019 Oct 29
2
[PATCH v3] vhost: introduce mdev based hardware backend
...t_ops(struct mdev_device *mdev,
+ const struct virtio_mdev_device_ops *vhost_ops)
+{
+ mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
+ mdev->vhost_ops = vhost_ops;
+}
+EXPORT_SYMBOL(mdev_set_vhost_ops);
+
+/* Get the vhost device ops for the mdev device. */
+const struct virtio_mdev_device_ops *
+mdev_get_vhost_ops(struct mdev_device *mdev)
+{
+ WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
+ return mdev->vhost_ops;
+}
+EXPORT_SYMBOL(mdev_get_vhost_ops);
+
struct device *mdev_dev(struct mdev_device *mdev)
{
return &mdev->dev;
diff --git a/drivers/vfio/mdev/mdev_private.h b/drivers/vfio/mdev...
2019 Oct 29
2
[PATCH v3] vhost: introduce mdev based hardware backend
...t_ops(struct mdev_device *mdev,
+ const struct virtio_mdev_device_ops *vhost_ops)
+{
+ mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
+ mdev->vhost_ops = vhost_ops;
+}
+EXPORT_SYMBOL(mdev_set_vhost_ops);
+
+/* Get the vhost device ops for the mdev device. */
+const struct virtio_mdev_device_ops *
+mdev_get_vhost_ops(struct mdev_device *mdev)
+{
+ WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
+ return mdev->vhost_ops;
+}
+EXPORT_SYMBOL(mdev_get_vhost_ops);
+
struct device *mdev_dev(struct mdev_device *mdev)
{
return &mdev->dev;
diff --git a/drivers/vfio/mdev/mdev_private.h b/drivers/vfio/mdev...
2019 Nov 05
4
[PATCH v5] vhost: introduce mdev based hardware backend
..._ops(struct mdev_device *mdev,
+ const struct mdev_virtio_device_ops *vhost_ops)
+{
+ mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
+ mdev->virtio_ops = vhost_ops;
+}
+EXPORT_SYMBOL(mdev_set_vhost_ops);
+
+/* Get the vhost device ops for the mdev device. */
+const struct mdev_virtio_device_ops *
+mdev_get_vhost_ops(struct mdev_device *mdev)
+{
+ WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
+ return mdev->virtio_ops;
+}
+EXPORT_SYMBOL(mdev_get_vhost_ops);
+
struct device *mdev_dev(struct mdev_device *mdev)
{
return &mdev->dev;
diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig
index...
2019 Nov 05
4
[PATCH v5] vhost: introduce mdev based hardware backend
..._ops(struct mdev_device *mdev,
+ const struct mdev_virtio_device_ops *vhost_ops)
+{
+ mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
+ mdev->virtio_ops = vhost_ops;
+}
+EXPORT_SYMBOL(mdev_set_vhost_ops);
+
+/* Get the vhost device ops for the mdev device. */
+const struct mdev_virtio_device_ops *
+mdev_get_vhost_ops(struct mdev_device *mdev)
+{
+ WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
+ return mdev->virtio_ops;
+}
+EXPORT_SYMBOL(mdev_get_vhost_ops);
+
struct device *mdev_dev(struct mdev_device *mdev)
{
return &mdev->dev;
diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig
index...
2019 Nov 07
2
[PATCH v6] vhost: introduce mdev based hardware backend
..._ops(struct mdev_device *mdev,
+ const struct mdev_virtio_device_ops *vhost_ops)
+{
+ mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
+ mdev->virtio_ops = vhost_ops;
+}
+EXPORT_SYMBOL(mdev_set_vhost_ops);
+
+/* Get the vhost device ops for the mdev device. */
+const struct mdev_virtio_device_ops *
+mdev_get_vhost_ops(struct mdev_device *mdev)
+{
+ WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
+ return mdev->virtio_ops;
+}
+EXPORT_SYMBOL(mdev_get_vhost_ops);
+
struct device *mdev_dev(struct mdev_device *mdev)
{
return &mdev->dev;
diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig
index...
2019 Nov 06
2
[PATCH v5] vhost: introduce mdev based hardware backend
...t; +{
> > + mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
> > + mdev->virtio_ops = vhost_ops;
> > +}
> > +EXPORT_SYMBOL(mdev_set_vhost_ops);
> > +
> > +/* Get the vhost device ops for the mdev device. */
> > +const struct mdev_virtio_device_ops *
> > +mdev_get_vhost_ops(struct mdev_device *mdev)
> > +{
> > + WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
> > + return mdev->virtio_ops;
> > +}
> > +EXPORT_SYMBOL(mdev_get_vhost_ops);
> > +
> > struct device *mdev_dev(struct mdev_device *mdev)
> > {
> >...
2019 Nov 06
2
[PATCH v5] vhost: introduce mdev based hardware backend
...t; +{
> > + mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
> > + mdev->virtio_ops = vhost_ops;
> > +}
> > +EXPORT_SYMBOL(mdev_set_vhost_ops);
> > +
> > +/* Get the vhost device ops for the mdev device. */
> > +const struct mdev_virtio_device_ops *
> > +mdev_get_vhost_ops(struct mdev_device *mdev)
> > +{
> > + WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
> > + return mdev->virtio_ops;
> > +}
> > +EXPORT_SYMBOL(mdev_get_vhost_ops);
> > +
> > struct device *mdev_dev(struct mdev_device *mdev)
> > {
> >...
2019 Oct 30
1
[PATCH v3] vhost: introduce mdev based hardware backend
...gt; +{
> > + mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
> > + mdev->vhost_ops = vhost_ops;
> > +}
> > +EXPORT_SYMBOL(mdev_set_vhost_ops);
> > +
> > +/* Get the vhost device ops for the mdev device. */
> > +const struct virtio_mdev_device_ops *
> > +mdev_get_vhost_ops(struct mdev_device *mdev)
> > +{
> > + WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
> > + return mdev->vhost_ops;
> > +}
> > +EXPORT_SYMBOL(mdev_get_vhost_ops);
> > +
> > struct device *mdev_dev(struct mdev_device *mdev)
> > {
> > r...
2019 Nov 06
0
[PATCH v5] vhost: introduce mdev based hardware backend
...ct mdev_virtio_device_ops *vhost_ops)
> +{
> + mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
> + mdev->virtio_ops = vhost_ops;
> +}
> +EXPORT_SYMBOL(mdev_set_vhost_ops);
> +
> +/* Get the vhost device ops for the mdev device. */
> +const struct mdev_virtio_device_ops *
> +mdev_get_vhost_ops(struct mdev_device *mdev)
> +{
> + WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
> + return mdev->virtio_ops;
> +}
> +EXPORT_SYMBOL(mdev_get_vhost_ops);
> +
> struct device *mdev_dev(struct mdev_device *mdev)
> {
> return &mdev->dev;
> diff --git a/d...
2019 Nov 06
2
[PATCH v5] vhost: introduce mdev based hardware backend
..._ID_VHOST);
>>>> + mdev->virtio_ops = vhost_ops;
>>>> +}
>>>> +EXPORT_SYMBOL(mdev_set_vhost_ops);
>>>> +
>>>> +/* Get the vhost device ops for the mdev device. */
>>>> +const struct mdev_virtio_device_ops *
>>>> +mdev_get_vhost_ops(struct mdev_device *mdev)
>>>> +{
>>>> + WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
>>>> + return mdev->virtio_ops;
>>>> +}
>>>> +EXPORT_SYMBOL(mdev_get_vhost_ops);
>>>> +
>>>> struct device *mdev_dev(...
2019 Nov 06
2
[PATCH v5] vhost: introduce mdev based hardware backend
..._ID_VHOST);
>>>> + mdev->virtio_ops = vhost_ops;
>>>> +}
>>>> +EXPORT_SYMBOL(mdev_set_vhost_ops);
>>>> +
>>>> +/* Get the vhost device ops for the mdev device. */
>>>> +const struct mdev_virtio_device_ops *
>>>> +mdev_get_vhost_ops(struct mdev_device *mdev)
>>>> +{
>>>> + WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
>>>> + return mdev->virtio_ops;
>>>> +}
>>>> +EXPORT_SYMBOL(mdev_get_vhost_ops);
>>>> +
>>>> struct device *mdev_dev(...
2019 Oct 30
0
[PATCH v3] vhost: introduce mdev based hardware backend
...uct virtio_mdev_device_ops *vhost_ops)
> +{
> + mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
> + mdev->vhost_ops = vhost_ops;
> +}
> +EXPORT_SYMBOL(mdev_set_vhost_ops);
> +
> +/* Get the vhost device ops for the mdev device. */
> +const struct virtio_mdev_device_ops *
> +mdev_get_vhost_ops(struct mdev_device *mdev)
> +{
> + WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
> + return mdev->vhost_ops;
> +}
> +EXPORT_SYMBOL(mdev_get_vhost_ops);
> +
> struct device *mdev_dev(struct mdev_device *mdev)
> {
> return &mdev->dev;
> diff --git a/dr...
2019 Nov 06
0
[PATCH v5] vhost: introduce mdev based hardware backend
...ct mdev_virtio_device_ops *vhost_ops)
> +{
> + mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
> + mdev->virtio_ops = vhost_ops;
> +}
> +EXPORT_SYMBOL(mdev_set_vhost_ops);
> +
> +/* Get the vhost device ops for the mdev device. */
> +const struct mdev_virtio_device_ops *
> +mdev_get_vhost_ops(struct mdev_device *mdev)
> +{
> + WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
> + return mdev->virtio_ops;
> +}
> +EXPORT_SYMBOL(mdev_get_vhost_ops);
> +
> struct device *mdev_dev(struct mdev_device *mdev)
> {
> return &mdev->dev;
> diff --git...
2019 Oct 31
2
[PATCH v4] vhost: introduce mdev based hardware backend
...t_ops(struct mdev_device *mdev,
+ const struct virtio_mdev_device_ops *vhost_ops)
+{
+ mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
+ mdev->vhost_ops = vhost_ops;
+}
+EXPORT_SYMBOL(mdev_set_vhost_ops);
+
+/* Get the vhost device ops for the mdev device. */
+const struct virtio_mdev_device_ops *
+mdev_get_vhost_ops(struct mdev_device *mdev)
+{
+ WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
+ return mdev->vhost_ops;
+}
+EXPORT_SYMBOL(mdev_get_vhost_ops);
+
struct device *mdev_dev(struct mdev_device *mdev)
{
return &mdev->dev;
diff --git a/drivers/vfio/mdev/mdev_private.h b/drivers/vfio/mdev...
2019 Oct 31
2
[PATCH v4] vhost: introduce mdev based hardware backend
...t_ops(struct mdev_device *mdev,
+ const struct virtio_mdev_device_ops *vhost_ops)
+{
+ mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
+ mdev->vhost_ops = vhost_ops;
+}
+EXPORT_SYMBOL(mdev_set_vhost_ops);
+
+/* Get the vhost device ops for the mdev device. */
+const struct virtio_mdev_device_ops *
+mdev_get_vhost_ops(struct mdev_device *mdev)
+{
+ WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
+ return mdev->vhost_ops;
+}
+EXPORT_SYMBOL(mdev_get_vhost_ops);
+
struct device *mdev_dev(struct mdev_device *mdev)
{
return &mdev->dev;
diff --git a/drivers/vfio/mdev/mdev_private.h b/drivers/vfio/mdev...
2019 Nov 06
0
[PATCH v5] vhost: introduce mdev based hardware backend
...ev, MDEV_CLASS_ID_VHOST);
> > > + mdev->virtio_ops = vhost_ops;
> > > +}
> > > +EXPORT_SYMBOL(mdev_set_vhost_ops);
> > > +
> > > +/* Get the vhost device ops for the mdev device. */
> > > +const struct mdev_virtio_device_ops *
> > > +mdev_get_vhost_ops(struct mdev_device *mdev)
> > > +{
> > > + WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
> > > + return mdev->virtio_ops;
> > > +}
> > > +EXPORT_SYMBOL(mdev_get_vhost_ops);
> > > +
> > > struct device *mdev_dev(struct mdev_dev...
2019 Nov 06
0
[PATCH v5] vhost: introduce mdev based hardware backend
...ps = vhost_ops;
> > > > > +}
> > > > > +EXPORT_SYMBOL(mdev_set_vhost_ops);
> > > > > +
> > > > > +/* Get the vhost device ops for the mdev device. */
> > > > > +const struct mdev_virtio_device_ops *
> > > > > +mdev_get_vhost_ops(struct mdev_device *mdev)
> > > > > +{
> > > > > + WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
> > > > > + return mdev->virtio_ops;
> > > > > +}
> > > > > +EXPORT_SYMBOL(mdev_get_vhost_ops);
> > > > >...
2019 Nov 01
0
[PATCH v4] vhost: introduce mdev based hardware backend
...uct virtio_mdev_device_ops *vhost_ops)
> +{
> + mdev_set_class(mdev, MDEV_CLASS_ID_VHOST);
> + mdev->vhost_ops = vhost_ops;
> +}
> +EXPORT_SYMBOL(mdev_set_vhost_ops);
> +
> +/* Get the vhost device ops for the mdev device. */
> +const struct virtio_mdev_device_ops *
> +mdev_get_vhost_ops(struct mdev_device *mdev)
> +{
> + WARN_ON(mdev->class_id != MDEV_CLASS_ID_VHOST);
> + return mdev->vhost_ops;
> +}
> +EXPORT_SYMBOL(mdev_get_vhost_ops);
> +
> struct device *mdev_dev(struct mdev_device *mdev)
> {
> return &mdev->dev;
> diff --git a...
2019 Oct 29
2
[RFC] vhost_mdev: add network control vq support
...tl(struct vhost_mdev *m, unsigned int cmd,
return r;
}
+/*
+ * Device specific (e.g. network) ioctls.
+ */
+static long vhost_mdev_dev_ioctl(struct vhost_mdev *m, unsigned int cmd,
+ void __user *argp)
+{
+ struct mdev_device *mdev = m->mdev;
+ const struct virtio_mdev_device_ops *ops = mdev_get_vhost_ops(mdev);
+
+ switch (m->virtio_id) {
+ case VIRTIO_ID_NET:
+ switch (cmd) {
+ case VHOST_MDEV_NET_CTRL:
+ if (!ops->net.ctrl)
+ return -ENOTSUPP;
+ return ops->net.ctrl(mdev, argp);
+ }
+ break;
+ }
+
+ return -ENOIOCTLCMD;
+}
+
static int vhost_mdev_open(void *device_data)
{...
2019 Oct 29
2
[RFC] vhost_mdev: add network control vq support
...tl(struct vhost_mdev *m, unsigned int cmd,
return r;
}
+/*
+ * Device specific (e.g. network) ioctls.
+ */
+static long vhost_mdev_dev_ioctl(struct vhost_mdev *m, unsigned int cmd,
+ void __user *argp)
+{
+ struct mdev_device *mdev = m->mdev;
+ const struct virtio_mdev_device_ops *ops = mdev_get_vhost_ops(mdev);
+
+ switch (m->virtio_id) {
+ case VIRTIO_ID_NET:
+ switch (cmd) {
+ case VHOST_MDEV_NET_CTRL:
+ if (!ops->net.ctrl)
+ return -ENOTSUPP;
+ return ops->net.ctrl(mdev, argp);
+ }
+ break;
+ }
+
+ return -ENOIOCTLCMD;
+}
+
static int vhost_mdev_open(void *device_data)
{...