search for: mdev_id_vhost

Displaying 20 results from an estimated 44 matches for "mdev_id_vhost".

2019 Sep 24
3
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...x/mdev.h b/include/linux/mdev.h > index 3414307311f1..73ac27b3b868 100644 > --- a/include/linux/mdev.h > +++ b/include/linux/mdev.h > @@ -126,6 +126,8 @@ struct mdev_device *mdev_from_dev(struct device *dev); > > enum { > MDEV_ID_VFIO = 1, > + MDEV_ID_VIRTIO = 2, > + MDEV_ID_VHOST = 3, MDEV_ID_VHOST isn't used yet here. Also, given the strong interdependence between the class_id and the ops structure, we might wand to define them in the same place. Thanks, Alex > /* New entries must be added here */ > }; > > diff --git a/include/linux/virtio_mdev.h...
2019 Sep 27
1
[PATCH] vhost: introduce mdev based hardware backend
On 2019/9/27 ??11:46, Jason Wang wrote: > + > +static struct mdev_class_id id_table[] = { > +??? { MDEV_ID_VHOST }, > +??? { 0 }, > +}; > + > +static struct mdev_driver vhost_mdev_driver = { > +??? .name??? = "vhost_mdev", > +??? .probe??? = vhost_mdev_probe, > +??? .remove??? = vhost_mdev_remove, > +??? .id_table = id_table, > +}; > + And you probably need to add MO...
2019 Sep 30
0
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...-- a/include/linux/mdev.h > > > +++ b/include/linux/mdev.h > > > @@ -126,6 +126,8 @@ struct mdev_device *mdev_from_dev(struct device > > > *dev); > > > > > > enum { > > > MDEV_ID_VFIO = 1, > > > + MDEV_ID_VIRTIO = 2, > > > + MDEV_ID_VHOST = 3, > > > > MDEV_ID_VHOST isn't used yet here. Also, given the strong interdependence > > between the class_id and the ops structure, we might wand to define them in > > the same place. Thanks, > > > > When mlx5_core creates mdevs (parent->ops-&g...
2019 Oct 17
2
[PATCH V3 4/7] mdev: introduce device specific ops
...e_ops = virtio_ops; >>> mdev->class_id = MDEV_ID_VIRTIO; >>> } >>> >>> void mdev_set_vhost_ops(struct mdev_device *mdev, const struct >>> virtio_mdev_ops *virtio_ops) { >>> mdev->device_ops = virtio_ops; >>> mdev->class_id = MDEV_ID_VHOST; >>> } >>> >>> void mdev_set_vendor_ops(struct mdev_device *mdev) /* no ops */ { >>> mdev->class_id = MDEV_ID_VENDOR; >>> } > One further step towards making this hard to use incorrectly might be > to return an error if class_id is already set....
2019 Oct 17
2
[PATCH V3 4/7] mdev: introduce device specific ops
...e_ops = virtio_ops; >>> mdev->class_id = MDEV_ID_VIRTIO; >>> } >>> >>> void mdev_set_vhost_ops(struct mdev_device *mdev, const struct >>> virtio_mdev_ops *virtio_ops) { >>> mdev->device_ops = virtio_ops; >>> mdev->class_id = MDEV_ID_VHOST; >>> } >>> >>> void mdev_set_vendor_ops(struct mdev_device *mdev) /* no ops */ { >>> mdev->class_id = MDEV_ID_VENDOR; >>> } > One further step towards making this hard to use incorrectly might be > to return an error if class_id is already set....
2019 Sep 25
3
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...ev.h b/include/linux/mdev.h > index 3414307311f1..73ac27b3b868 100644 > --- a/include/linux/mdev.h > +++ b/include/linux/mdev.h > @@ -126,6 +126,8 @@ struct mdev_device *mdev_from_dev(struct device > *dev); > > enum { > MDEV_ID_VFIO = 1, > + MDEV_ID_VIRTIO = 2, > + MDEV_ID_VHOST = 3, > /* New entries must be added here */ > }; > > diff --git a/include/linux/virtio_mdev.h b/include/linux/virtio_mdev.h > new file mode 100644 > index 000000000000..d1a40a739266 > --- /dev/null > +++ b/include/linux/virtio_mdev.h > @@ -0,0 +1,145 @@ > +/* SPDX-...
2019 Sep 25
3
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...ev.h b/include/linux/mdev.h > index 3414307311f1..73ac27b3b868 100644 > --- a/include/linux/mdev.h > +++ b/include/linux/mdev.h > @@ -126,6 +126,8 @@ struct mdev_device *mdev_from_dev(struct device > *dev); > > enum { > MDEV_ID_VFIO = 1, > + MDEV_ID_VIRTIO = 2, > + MDEV_ID_VHOST = 3, > /* New entries must be added here */ > }; > > diff --git a/include/linux/virtio_mdev.h b/include/linux/virtio_mdev.h > new file mode 100644 > index 000000000000..d1a40a739266 > --- /dev/null > +++ b/include/linux/virtio_mdev.h > @@ -0,0 +1,145 @@ > +/* SPDX-...
2019 Oct 17
0
[PATCH V3 4/7] mdev: introduce device specific ops
...t; mdev->class_id = MDEV_ID_VIRTIO; > >>> } > >>> > >>> void mdev_set_vhost_ops(struct mdev_device *mdev, const struct > >>> virtio_mdev_ops *virtio_ops) { > >>> mdev->device_ops = virtio_ops; > >>> mdev->class_id = MDEV_ID_VHOST; > >>> } > >>> > >>> void mdev_set_vendor_ops(struct mdev_device *mdev) /* no ops */ { > >>> mdev->class_id = MDEV_ID_VENDOR; > >>> } > > One further step towards making this hard to use incorrectly might be > > to return...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...+ return 0; + +err: + kfree(m->vqs); + kfree(m); + return r; +} + +static void vhost_mdev_remove(struct device *dev) +{ + struct vhost_mdev *m; + + m = vfio_del_group_dev(dev); + mutex_destroy(&m->mutex); + kfree(m->vqs); + kfree(m); +} + +static struct mdev_class_id id_table[] = { + { MDEV_ID_VHOST }, + { 0 }, +}; + +static struct mdev_driver vhost_mdev_driver = { + .name = "vhost_mdev", + .probe = vhost_mdev_probe, + .remove = vhost_mdev_remove, + .id_table = id_table, +}; + +static int __init vhost_mdev_init(void) +{ + return mdev_register_driver(&vhost_mdev_driver, THIS_MODUL...
2019 Sep 26
6
[PATCH] vhost: introduce mdev based hardware backend
...+ return 0; + +err: + kfree(m->vqs); + kfree(m); + return r; +} + +static void vhost_mdev_remove(struct device *dev) +{ + struct vhost_mdev *m; + + m = vfio_del_group_dev(dev); + mutex_destroy(&m->mutex); + kfree(m->vqs); + kfree(m); +} + +static struct mdev_class_id id_table[] = { + { MDEV_ID_VHOST }, + { 0 }, +}; + +static struct mdev_driver vhost_mdev_driver = { + .name = "vhost_mdev", + .probe = vhost_mdev_probe, + .remove = vhost_mdev_remove, + .id_table = id_table, +}; + +static int __init vhost_mdev_init(void) +{ + return mdev_register_driver(&vhost_mdev_driver, THIS_MODUL...
2019 Sep 25
2
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...a/include/linux/mdev.h > > > +++ b/include/linux/mdev.h > > > @@ -126,6 +126,8 @@ struct mdev_device *mdev_from_dev(struct device > > > *dev); > > > > > > enum { > > > MDEV_ID_VFIO = 1, > > > + MDEV_ID_VIRTIO = 2, > > > + MDEV_ID_VHOST = 3, > > > /* New entries must be added here */ > > > }; > > > > > > diff --git a/include/linux/virtio_mdev.h b/include/linux/virtio_mdev.h > > > new file mode 100644 > > > index 000000000000..d1a40a739266 > > > --- /dev/null >...
2019 Sep 25
2
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...a/include/linux/mdev.h > > > +++ b/include/linux/mdev.h > > > @@ -126,6 +126,8 @@ struct mdev_device *mdev_from_dev(struct device > > > *dev); > > > > > > enum { > > > MDEV_ID_VFIO = 1, > > > + MDEV_ID_VIRTIO = 2, > > > + MDEV_ID_VHOST = 3, > > > /* New entries must be added here */ > > > }; > > > > > > diff --git a/include/linux/virtio_mdev.h b/include/linux/virtio_mdev.h > > > new file mode 100644 > > > index 000000000000..d1a40a739266 > > > --- /dev/null >...
2019 Sep 25
0
[PATCH V2 0/8] mdev based hardware virtio offloading support
...ngs > - really switch to use u16 for class_id > - uevent and modpost support for mdev class_id > - vraious tweaks per comments from Parav > > Changes from RFC-V2: > > - silent compile warnings on some specific configuration > - use u16 instead u8 for class id > - reseve MDEV_ID_VHOST for future vhost-mdev work > - introduce "virtio" type for mvnet and make "vhost" type for future > work > - add entries in MAINTAINER > - tweak and typos fixes in commit log > > Changes from RFC-V1: > > - rename device id to class id > - add docs...
2019 Sep 24
0
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...inux/virtio_mdev.h diff --git a/include/linux/mdev.h b/include/linux/mdev.h index 3414307311f1..73ac27b3b868 100644 --- a/include/linux/mdev.h +++ b/include/linux/mdev.h @@ -126,6 +126,8 @@ struct mdev_device *mdev_from_dev(struct device *dev); enum { MDEV_ID_VFIO = 1, + MDEV_ID_VIRTIO = 2, + MDEV_ID_VHOST = 3, /* New entries must be added here */ }; diff --git a/include/linux/virtio_mdev.h b/include/linux/virtio_mdev.h new file mode 100644 index 000000000000..d1a40a739266 --- /dev/null +++ b/include/linux/virtio_mdev.h @@ -0,0 +1,145 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Virti...
2019 Oct 16
0
[PATCH V3 4/7] mdev: introduce device specific ops
..._ops(struct mdev_device *mdev, const struct virtio_mdev_ops *virtio_ops) { mdev->device_ops = virtio_ops; mdev->class_id = MDEV_ID_VIRTIO; } void mdev_set_vhost_ops(struct mdev_device *mdev, const struct virtio_mdev_ops *virtio_ops) { mdev->device_ops = virtio_ops; mdev->class_id = MDEV_ID_VHOST; } void mdev_set_vendor_ops(struct mdev_device *mdev) /* no ops */ { mdev->class_id = MDEV_ID_VENDOR; }
2019 Sep 24
17
[PATCH V2 0/8] mdev based hardware virtio offloading support
...x comes first - really silent compiling warnings - really switch to use u16 for class_id - uevent and modpost support for mdev class_id - vraious tweaks per comments from Parav Changes from RFC-V2: - silent compile warnings on some specific configuration - use u16 instead u8 for class id - reseve MDEV_ID_VHOST for future vhost-mdev work - introduce "virtio" type for mvnet and make "vhost" type for future work - add entries in MAINTAINER - tweak and typos fixes in commit log Changes from RFC-V1: - rename device id to class id - add docs for class id and device specific ops (device_...
2019 Sep 24
17
[PATCH V2 0/8] mdev based hardware virtio offloading support
...x comes first - really silent compiling warnings - really switch to use u16 for class_id - uevent and modpost support for mdev class_id - vraious tweaks per comments from Parav Changes from RFC-V2: - silent compile warnings on some specific configuration - use u16 instead u8 for class id - reseve MDEV_ID_VHOST for future vhost-mdev work - introduce "virtio" type for mvnet and make "vhost" type for future work - add entries in MAINTAINER - tweak and typos fixes in commit log Changes from RFC-V1: - rename device id to class id - add docs for class id and device specific ops (device_...
2019 Sep 26
0
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...dev.h >>>> +++ b/include/linux/mdev.h >>>> @@ -126,6 +126,8 @@ struct mdev_device *mdev_from_dev(struct device >>>> *dev); >>>> >>>> enum { >>>> MDEV_ID_VFIO = 1, >>>> + MDEV_ID_VIRTIO = 2, >>>> + MDEV_ID_VHOST = 3, >>>> /* New entries must be added here */ >>>> }; >>>> >>>> diff --git a/include/linux/virtio_mdev.h b/include/linux/virtio_mdev.h >>>> new file mode 100644 >>>> index 000000000000..d1a40a739266 >>>> ---...
2019 Sep 25
0
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...x 3414307311f1..73ac27b3b868 100644 >> --- a/include/linux/mdev.h >> +++ b/include/linux/mdev.h >> @@ -126,6 +126,8 @@ struct mdev_device *mdev_from_dev(struct device >> *dev); >> >> enum { >> MDEV_ID_VFIO = 1, >> + MDEV_ID_VIRTIO = 2, >> + MDEV_ID_VHOST = 3, >> /* New entries must be added here */ >> }; >> >> diff --git a/include/linux/virtio_mdev.h b/include/linux/virtio_mdev.h >> new file mode 100644 >> index 000000000000..d1a40a739266 >> --- /dev/null >> +++ b/include/linux/virtio_mdev.h >...
2019 Sep 26
1
[PATCH V2 6/8] mdev: introduce virtio device and its device ops
...--- a/include/linux/mdev.h > >> +++ b/include/linux/mdev.h > >> @@ -126,6 +126,8 @@ struct mdev_device *mdev_from_dev(struct > device > >> *dev); > >> > >> enum { > >> MDEV_ID_VFIO = 1, > >> + MDEV_ID_VIRTIO = 2, > >> + MDEV_ID_VHOST = 3, > >> /* New entries must be added here */ > >> }; > >> > >> diff --git a/include/linux/virtio_mdev.h b/include/linux/virtio_mdev.h > >> new file mode 100644 > >> index 000000000000..d1a40a739266 > >> --- /dev/null > >&gt...