Displaying 20 results from an estimated 31 matches for "mdev_device_cr".
Did you mean:
mdev_device_id
2019 Oct 15
1
[PATCH V3 1/7] mdev: class id support
...* @dev: device structure representing parent device.
> * @ops: Parent device operation structure to be registered.
> + * @id: class id.
> *
> * Add device to list of registered parent devices.
> * Returns a negative value on error, otherwise 0.
> @@ -324,6 +331,9 @@ int mdev_device_create(struct kobject *kobj,
> if (ret)
> goto ops_create_fail;
>
> + if (!mdev->class_id)
This is a sanity test failure of the parent driver on a privileged
path, I think it's fair to print a warning when this occurs rather than
only return an errno to the user. In fact, r...
2019 Oct 11
0
[PATCH V3 1/7] mdev: class id support
...ter_device : Register a device
* @dev: device structure representing parent device.
* @ops: Parent device operation structure to be registered.
+ * @id: class id.
*
* Add device to list of registered parent devices.
* Returns a negative value on error, otherwise 0.
@@ -324,6 +331,9 @@ int mdev_device_create(struct kobject *kobj,
if (ret)
goto ops_create_fail;
+ if (!mdev->class_id)
+ goto class_id_fail;
+
ret = device_add(&mdev->dev);
if (ret)
goto add_fail;
@@ -340,6 +350,7 @@ int mdev_device_create(struct kobject *kobj,
sysfs_fail:
device_del(&mdev->dev);
+cl...
2019 Sep 24
1
[PATCH V2 2/8] mdev: class id support
...mdev_driver *mdrv = to_mdev_driver(drv);
> + const struct mdev_class_id *ids = mdrv->id_table;
> +
> + for (i = 0; ids[i].id; i++)
> + if (ids[i].id == mdev->class_id)
With the proposed API here, mdev->class_id can be NULL, do we allow
devices to exist in that state or should mdev_device_create() generate
an error if the .create() callback doesn't register a type? Or a
warn_once and assume MDEV_ID_VFIO? The latter seems pretty sketchy
when we get to patch 5/8. Thanks,
Alex
> + return 1;
> + return 0;
> +}
> +
> struct bus_type mdev_bus_type = {
> .name...
2019 Oct 16
0
[PATCH V3 1/7] mdev: class id support
...representing parent device.
>> * @ops: Parent device operation structure to be registered.
>> + * @id: class id.
>> *
>> * Add device to list of registered parent devices.
>> * Returns a negative value on error, otherwise 0.
>> @@ -324,6 +331,9 @@ int mdev_device_create(struct kobject *kobj,
>> if (ret)
>> goto ops_create_fail;
>>
>> + if (!mdev->class_id)
>> + goto class_id_fail;
>> +
>> ret = device_add(&mdev->dev);
>> if (ret)
>> goto add_fail;
>> @@ -340,6 +350,7 @@ int...
2019 Oct 24
2
[PATCH V5 1/6] mdev: class id support
...; >> * @ops: Parent device operation structure to be registered.
> >> + * @id: class id.
> >> *
> >> * Add device to list of registered parent devices.
> >> * Returns a negative value on error, otherwise 0.
> >> @@ -324,6 +335,13 @@ int mdev_device_create(struct kobject *kobj,
> >> if (ret)
> >> goto ops_create_fail;
> >>
> >> + if (!mdev->class_id) {
> >> + ret = -EINVAL;
> >> + WARN(1, "class id must be specified for device %s\n",
> >> + dev_name(dev)...
2019 Oct 24
2
[PATCH V5 1/6] mdev: class id support
...; >> * @ops: Parent device operation structure to be registered.
> >> + * @id: class id.
> >> *
> >> * Add device to list of registered parent devices.
> >> * Returns a negative value on error, otherwise 0.
> >> @@ -324,6 +335,13 @@ int mdev_device_create(struct kobject *kobj,
> >> if (ret)
> >> goto ops_create_fail;
> >>
> >> + if (!mdev->class_id) {
> >> + ret = -EINVAL;
> >> + WARN(1, "class id must be specified for device %s\n",
> >> + dev_name(dev)...
2019 Oct 23
2
[PATCH V5 1/6] mdev: class id support
...* @dev: device structure representing parent device.
> * @ops: Parent device operation structure to be registered.
> + * @id: class id.
> *
> * Add device to list of registered parent devices.
> * Returns a negative value on error, otherwise 0.
> @@ -324,6 +335,13 @@ int mdev_device_create(struct kobject *kobj,
> if (ret)
> goto ops_create_fail;
>
> + if (!mdev->class_id) {
> + ret = -EINVAL;
> + WARN(1, "class id must be specified for device %s\n",
> + dev_name(dev));
Nit, dev_warn(dev, "mdev vendor driver failed to specify...
2019 Oct 23
2
[PATCH V5 1/6] mdev: class id support
...* @dev: device structure representing parent device.
> * @ops: Parent device operation structure to be registered.
> + * @id: class id.
> *
> * Add device to list of registered parent devices.
> * Returns a negative value on error, otherwise 0.
> @@ -324,6 +335,13 @@ int mdev_device_create(struct kobject *kobj,
> if (ret)
> goto ops_create_fail;
>
> + if (!mdev->class_id) {
> + ret = -EINVAL;
> + WARN(1, "class id must be specified for device %s\n",
> + dev_name(dev));
Nit, dev_warn(dev, "mdev vendor driver failed to specify...
2019 Oct 24
0
[PATCH V5 1/6] mdev: class id support
...ent device operation structure to be registered.
> > >> + * @id: class id.
> > >> *
> > >> * Add device to list of registered parent devices.
> > >> * Returns a negative value on error, otherwise 0.
> > >> @@ -324,6 +335,13 @@ int mdev_device_create(struct kobject *kobj,
> > >> if (ret)
> > >> goto ops_create_fail;
> > >>
> > >> + if (!mdev->class_id) {
> > >> + ret = -EINVAL;
> > >> + WARN(1, "class id must be specified for device %s\n",
>...
2019 Nov 05
0
[PATCH V8 1/6] mdev: class id support
...called during
+ * create() callback.
+ */
+void mdev_set_class(struct mdev_device *mdev, u16 id)
+{
+ WARN_ON(mdev->class_id);
+ mdev->class_id = id;
+}
+EXPORT_SYMBOL(mdev_set_class);
+
struct device *mdev_dev(struct mdev_device *mdev)
{
return &mdev->dev;
@@ -324,6 +335,12 @@ int mdev_device_create(struct kobject *kobj,
if (ret)
goto ops_create_fail;
+ if (!mdev->class_id) {
+ ret = -EINVAL;
+ dev_warn(dev, "mdev vendor driver failed to specify device class\n");
+ goto add_fail;
+ }
+
ret = device_add(&mdev->dev);
if (ret)
goto add_fail;
diff --git a/d...
2019 Nov 04
0
[PATCH V7 1/6] mdev: class id support
...called during
+ * create() callback.
+ */
+void mdev_set_class(struct mdev_device *mdev, u16 id)
+{
+ WARN_ON(mdev->class_id);
+ mdev->class_id = id;
+}
+EXPORT_SYMBOL(mdev_set_class);
+
struct device *mdev_dev(struct mdev_device *mdev)
{
return &mdev->dev;
@@ -324,6 +334,12 @@ int mdev_device_create(struct kobject *kobj,
if (ret)
goto ops_create_fail;
+ if (!mdev->class_id) {
+ ret = -EINVAL;
+ dev_warn(dev, "mdev vendor driver failed to specify device class\n");
+ goto add_fail;
+ }
+
ret = device_add(&mdev->dev);
if (ret)
goto add_fail;
diff --git a/d...
2019 Oct 23
0
[PATCH V5 1/6] mdev: class id support
...er_device : Register a device
* @dev: device structure representing parent device.
* @ops: Parent device operation structure to be registered.
+ * @id: class id.
*
* Add device to list of registered parent devices.
* Returns a negative value on error, otherwise 0.
@@ -324,6 +335,13 @@ int mdev_device_create(struct kobject *kobj,
if (ret)
goto ops_create_fail;
+ if (!mdev->class_id) {
+ ret = -EINVAL;
+ WARN(1, "class id must be specified for device %s\n",
+ dev_name(dev));
+ goto add_fail;
+ }
+
ret = device_add(&mdev->dev);
if (ret)
goto add_fail;
diff -...
2019 Oct 24
0
[PATCH V5 1/6] mdev: class id support
...epresenting parent device.
>> * @ops: Parent device operation structure to be registered.
>> + * @id: class id.
>> *
>> * Add device to list of registered parent devices.
>> * Returns a negative value on error, otherwise 0.
>> @@ -324,6 +335,13 @@ int mdev_device_create(struct kobject *kobj,
>> if (ret)
>> goto ops_create_fail;
>>
>> + if (!mdev->class_id) {
>> + ret = -EINVAL;
>> + WARN(1, "class id must be specified for device %s\n",
>> + dev_name(dev));
> Nit, dev_warn(dev, "md...
2019 Oct 11
17
[PATCH V3 0/7] mdev based hardware virtio offloading support
Hi all:
There are hardware that can do virtio datapath offloading while having
its own control path. This path tries to implement a mdev based
unified API to support using kernel virtio driver to drive those
devices. This is done by introducing a new mdev transport for virtio
(virtio_mdev) and register itself as a new kind of mdev driver. Then
it provides a unified way for kernel virtio driver to
2019 Oct 11
17
[PATCH V3 0/7] mdev based hardware virtio offloading support
Hi all:
There are hardware that can do virtio datapath offloading while having
its own control path. This path tries to implement a mdev based
unified API to support using kernel virtio driver to drive those
devices. This is done by introducing a new mdev transport for virtio
(virtio_mdev) and register itself as a new kind of mdev driver. Then
it provides a unified way for kernel virtio driver to
2019 Nov 04
1
[PATCH V7 1/6] mdev: class id support
...ev_set_class(struct mdev_device *mdev, u16 id)
> +{
> + WARN_ON(mdev->class_id);
> + mdev->class_id = id;
> +}
> +EXPORT_SYMBOL(mdev_set_class);
> +
> struct device *mdev_dev(struct mdev_device *mdev)
> {
> return &mdev->dev;
> @@ -324,6 +334,12 @@ int mdev_device_create(struct kobject *kobj,
> if (ret)
> goto ops_create_fail;
>
> + if (!mdev->class_id) {
> + ret = -EINVAL;
> + dev_warn(dev, "mdev vendor driver failed to specify device class\n");
> + goto add_fail;
> + }
> +
> ret = device_add(&mdev->...
2019 Oct 23
10
[PATCH V5 0/6] mdev based hardware virtio offloading support
Hi all:
There are hardwares that can do virtio datapath offloading while
having its own control path. This path tries to implement a mdev based
unified API to support using kernel virtio driver to drive those
devices. This is done by introducing a new mdev transport for virtio
(virtio_mdev) and register itself as a new kind of mdev driver. Then
it provides a unified way for kernel virtio driver
2019 Oct 23
10
[PATCH V5 0/6] mdev based hardware virtio offloading support
Hi all:
There are hardwares that can do virtio datapath offloading while
having its own control path. This path tries to implement a mdev based
unified API to support using kernel virtio driver to drive those
devices. This is done by introducing a new mdev transport for virtio
(virtio_mdev) and register itself as a new kind of mdev driver. Then
it provides a unified way for kernel virtio driver
2019 Nov 04
9
[PATCH V7 0/6] mdev based hardware virtio offloading support
Hi all:
There are hardwares that can do virtio datapath offloading while
having its own control path. This path tries to implement a mdev based
unified API to support using kernel virtio driver to drive those
devices. This is done by introducing a new mdev transport for virtio
(virtio_mdev) and register itself as a new kind of mdev driver. Then
it provides a unified way for kernel virtio driver
2019 Sep 24
3
[PATCH V2 5/8] mdev: introduce device specific ops
On Tue, 24 Sep 2019 21:53:29 +0800
Jason Wang <jasowang at redhat.com> wrote:
> Currently, except for the create and remove, the rest of
> mdev_parent_ops is designed for vfio-mdev driver only and may not help
> for kernel mdev driver. With the help of class id, this patch
> introduces device specific callbacks inside mdev_device
> structure. This allows different set of