Displaying 20 results from an estimated 46 matches for "available_instances".
2019 Nov 20
1
Re: Descriptions of mdev types?
...; <name>GRID M60-2B4</name>
>> <deviceAPI>vfio-pci</deviceAPI>
>> <availableInstances>4</availableInstances>
>> </type>
>> ...
>> </capability>
>>
>> Besides device_api, available_instances and (optional) `name',
>> `description' of the given mdev type may be optionally provided in
>> /sys/.../mdev_supported_types/... for each of the available mdev types.
>> I can see in the sources that libvirt doesn't try to retrieve it -- is
>> it intentionally o...
2019 Nov 19
2
Descriptions of mdev types?
...;mdev_types'>
<type id='nvidia-210'>
<name>GRID M60-2B4</name>
<deviceAPI>vfio-pci</deviceAPI>
<availableInstances>4</availableInstances>
</type>
...
</capability>
Besides device_api, available_instances and (optional) `name',
`description' of the given mdev type may be optionally provided in
/sys/.../mdev_supported_types/... for each of the available mdev types.
I can see in the sources that libvirt doesn't try to retrieve it -- is
it intentionally or is it just an omission? If the la...
2019 Nov 19
0
Re: Descriptions of mdev types?
...'nvidia-210'>
> <name>GRID M60-2B4</name>
> <deviceAPI>vfio-pci</deviceAPI>
> <availableInstances>4</availableInstances>
> </type>
> ...
> </capability>
>
> Besides device_api, available_instances and (optional) `name',
> `description' of the given mdev type may be optionally provided in
> /sys/.../mdev_supported_types/... for each of the available mdev types.
> I can see in the sources that libvirt doesn't try to retrieve it -- is
> it intentionally or is it just an...
2019 Sep 23
1
[PATCH 1/6] mdev: class id support
...90/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c
> index 5c0f53c6dde7..7487fc39d2c5 100644
> --- a/drivers/s390/crypto/vfio_ap_ops.c
> +++ b/drivers/s390/crypto/vfio_ap_ops.c
> @@ -1295,7 +1295,8 @@ int vfio_ap_mdev_register(void)
> {
> atomic_set(&matrix_dev->available_instances, MAX_ZDEV_ENTRIES_EXT);
>
> - return mdev_register_device(&matrix_dev->device, &vfio_ap_matrix_ops);
> + return mdev_register_vfio_device(&matrix_dev->device,
> + &vfio_ap_matrix_ops);
> }
>
> void vfio_ap_mdev_unregister(void)
> diff --git a...
2019 Sep 17
1
[RFC PATCH 1/2] mdev: device id support
...ypto/vfio_ap_ops.c
> b/drivers/s390/crypto/vfio_ap_ops.c
> index 0604b49a4d32..eacbde3c7a97 100644
> --- a/drivers/s390/crypto/vfio_ap_ops.c
> +++ b/drivers/s390/crypto/vfio_ap_ops.c
> @@ -1295,7 +1295,8 @@ int vfio_ap_mdev_register(void)
> {
> atomic_set(&matrix_dev->available_instances,
> MAX_ZDEV_ENTRIES_EXT);
>
> - return mdev_register_device(&matrix_dev->device,
> &vfio_ap_matrix_ops);
> + return mdev_register_vfio_device(&matrix_dev->device,
> + &vfio_ap_matrix_ops);
> }
>
> void vfio_ap_mdev_unregister(void)
> diff...
2019 Sep 12
0
[RFC PATCH 1/2] mdev: device id support
...*sch)
diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c
index 0604b49a4d32..eacbde3c7a97 100644
--- a/drivers/s390/crypto/vfio_ap_ops.c
+++ b/drivers/s390/crypto/vfio_ap_ops.c
@@ -1295,7 +1295,8 @@ int vfio_ap_mdev_register(void)
{
atomic_set(&matrix_dev->available_instances, MAX_ZDEV_ENTRIES_EXT);
- return mdev_register_device(&matrix_dev->device, &vfio_ap_matrix_ops);
+ return mdev_register_vfio_device(&matrix_dev->device,
+ &vfio_ap_matrix_ops);
}
void vfio_ap_mdev_unregister(void)
diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers...
2019 Sep 23
0
[PATCH 1/6] mdev: class id support
...*sch)
diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c
index 5c0f53c6dde7..7487fc39d2c5 100644
--- a/drivers/s390/crypto/vfio_ap_ops.c
+++ b/drivers/s390/crypto/vfio_ap_ops.c
@@ -1295,7 +1295,8 @@ int vfio_ap_mdev_register(void)
{
atomic_set(&matrix_dev->available_instances, MAX_ZDEV_ENTRIES_EXT);
- return mdev_register_device(&matrix_dev->device, &vfio_ap_matrix_ops);
+ return mdev_register_vfio_device(&matrix_dev->device,
+ &vfio_ap_matrix_ops);
}
void vfio_ap_mdev_unregister(void)
diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers...
2019 Oct 21
0
[RFC 2/2] vhost: IFC VF vdpa layer
...bject *kobj, struct device
>>> *dev,
>>> +?????????????????? char *buf)
>>> +{
>>> +??? return sprintf(buf, "%s\n", VIRTIO_MDEV_DEVICE_API_STRING);
>>> +}
>>> +MDEV_TYPE_ATTR_RO(device_api);
>>> +
>>> +static ssize_t available_instances_show(struct kobject *kobj,
>>> +??????????????????? struct device *dev, char *buf)
>>> +{
>>> +??? struct pci_dev *pdev = to_pci_dev(dev);
>>> +??? struct ifcvf_adapter *adapter = pci_get_drvdata(pdev);
>>> +
>>> +??? return sprintf(buf, "%...
2019 Oct 16
0
[RFC 2/2] vhost: IFC VF vdpa layer
...t; +MDEV_TYPE_ATTR_RO(name);
> +
> +static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> + char *buf)
> +{
> + return sprintf(buf, "%s\n", VIRTIO_MDEV_DEVICE_API_STRING);
> +}
> +MDEV_TYPE_ATTR_RO(device_api);
> +
> +static ssize_t available_instances_show(struct kobject *kobj,
> + struct device *dev, char *buf)
> +{
> + struct pci_dev *pdev = to_pci_dev(dev);
> + struct ifcvf_adapter *adapter = pci_get_drvdata(pdev);
> +
> + return sprintf(buf, "%d\n", adapter->mdev_count);
> +}
> +
> +MDEV_TYPE_ATTR_...
2019 Sep 24
0
[PATCH 1/6] mdev: class id support
...ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c
>> index 5c0f53c6dde7..7487fc39d2c5 100644
>> --- a/drivers/s390/crypto/vfio_ap_ops.c
>> +++ b/drivers/s390/crypto/vfio_ap_ops.c
>> @@ -1295,7 +1295,8 @@ int vfio_ap_mdev_register(void) {
>> atomic_set(&matrix_dev->available_instances,
>> MAX_ZDEV_ENTRIES_EXT);
>>
>> - return mdev_register_device(&matrix_dev->device,
>> &vfio_ap_matrix_ops);
>> + return mdev_register_vfio_device(&matrix_dev->device,
>> + &vfio_ap_matrix_ops);
>> }
>>
>> void vfio_...
2019 Nov 06
0
[PATCH 2/2] IFC VDPA layer
...t; +MDEV_TYPE_ATTR_RO(name);
> +
> +static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> + char *buf)
> +{
> + return sprintf(buf, "%s\n", VIRTIO_MDEV_DEVICE_API_STRING);
> +}
> +MDEV_TYPE_ATTR_RO(device_api);
> +
> +static ssize_t available_instances_show(struct kobject *kobj,
> + struct device *dev, char *buf)
> +{
> + struct pci_dev *pdev;
> + struct ifcvf_adapter *adapter;
> +
> + pdev = to_pci_dev(dev);
> + adapter = pci_get_drvdata(pdev);
> +
> + return sprintf(buf, "%d\n", adapter->mdev_count);...
2019 Sep 10
1
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...; +
> + snprintf(name, MVNET_STRING_LEN, "%s", dev_driver_string(dev));
> + if (!strcmp(kobj->name, name))
> + return sprintf(buf, "%s\n", name_str);
> +
> + return -EINVAL;
> +}
> +
> +static MDEV_TYPE_ATTR_RO(name);
> +
> +static ssize_t
> +available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
> +{
> + return sprintf(buf, "%d\n", INT_MAX);
> +}
> +
> +static MDEV_TYPE_ATTR_RO(available_instances);
?
> +
> +static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
> + cha...
2019 Nov 05
0
[PATCH V8 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...G_LEN];
+ const char *name_str = "virtio-net";
+
+ snprintf(name, MVNET_STRING_LEN, "%s", dev_driver_string(dev));
+ if (!strcmp(kobj->name, name))
+ return sprintf(buf, "%s\n", name_str);
+
+ return -EINVAL;
+}
+
+static MDEV_TYPE_ATTR_RO(name);
+
+static ssize_t
+available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
+{
+ return sprintf(buf, "%d\n", INT_MAX);
+}
+
+static MDEV_TYPE_ATTR_RO(available_instances);
+
+static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
+ char *buf)
+{
+ return sprintf(buf, "%s\n&q...
2019 Sep 10
0
[RFC PATCH 4/4] docs: Sample driver to demonstrate how to implement virtio-mdev framework
...G_LEN];
+ const char *name_str = "virtio-net";
+
+ snprintf(name, MVNET_STRING_LEN, "%s", dev_driver_string(dev));
+ if (!strcmp(kobj->name, name))
+ return sprintf(buf, "%s\n", name_str);
+
+ return -EINVAL;
+}
+
+static MDEV_TYPE_ATTR_RO(name);
+
+static ssize_t
+available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
+{
+ return sprintf(buf, "%d\n", INT_MAX);
+}
+
+static MDEV_TYPE_ATTR_RO(available_instances);
+
+static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
+ char *buf)
+{
+ return sprintf(buf, "%s\n&q...
2019 Oct 30
0
[PATCH V6 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...G_LEN];
+ const char *name_str = "virtio-net";
+
+ snprintf(name, MVNET_STRING_LEN, "%s", dev_driver_string(dev));
+ if (!strcmp(kobj->name, name))
+ return sprintf(buf, "%s\n", name_str);
+
+ return -EINVAL;
+}
+
+static MDEV_TYPE_ATTR_RO(name);
+
+static ssize_t
+available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
+{
+ return sprintf(buf, "%d\n", INT_MAX);
+}
+
+static MDEV_TYPE_ATTR_RO(available_instances);
+
+static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
+ char *buf)
+{
+ return sprintf(buf, "%s\n&q...
2019 Nov 07
0
[PATCH V11 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...G_LEN];
+ const char *name_str = "virtio-net";
+
+ snprintf(name, MVNET_STRING_LEN, "%s", dev_driver_string(dev));
+ if (!strcmp(kobj->name, name))
+ return sprintf(buf, "%s\n", name_str);
+
+ return -EINVAL;
+}
+
+static MDEV_TYPE_ATTR_RO(name);
+
+static ssize_t
+available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
+{
+ return sprintf(buf, "%d\n", INT_MAX);
+}
+
+static MDEV_TYPE_ATTR_RO(available_instances);
+
+static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
+ char *buf)
+{
+ return sprintf(buf, "%s\n&q...
2019 Nov 06
0
[PATCH V9 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...G_LEN];
+ const char *name_str = "virtio-net";
+
+ snprintf(name, MVNET_STRING_LEN, "%s", dev_driver_string(dev));
+ if (!strcmp(kobj->name, name))
+ return sprintf(buf, "%s\n", name_str);
+
+ return -EINVAL;
+}
+
+static MDEV_TYPE_ATTR_RO(name);
+
+static ssize_t
+available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
+{
+ return sprintf(buf, "%d\n", INT_MAX);
+}
+
+static MDEV_TYPE_ATTR_RO(available_instances);
+
+static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
+ char *buf)
+{
+ return sprintf(buf, "%s\n&q...
2019 Nov 06
0
[PATCH V10 6/6] docs: sample driver to demonstrate how to implement virtio-mdev framework
...G_LEN];
+ const char *name_str = "virtio-net";
+
+ snprintf(name, MVNET_STRING_LEN, "%s", dev_driver_string(dev));
+ if (!strcmp(kobj->name, name))
+ return sprintf(buf, "%s\n", name_str);
+
+ return -EINVAL;
+}
+
+static MDEV_TYPE_ATTR_RO(name);
+
+static ssize_t
+available_instances_show(struct kobject *kobj, struct device *dev, char *buf)
+{
+ return sprintf(buf, "%d\n", INT_MAX);
+}
+
+static MDEV_TYPE_ATTR_RO(available_instances);
+
+static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
+ char *buf)
+{
+ return sprintf(buf, "%s\n&q...
2018 Apr 02
2
[RFC] vhost: introduce mdev based hardware vhost backend
...struct vdpa_dev *vdpa_alloc(struct mdev_device *mdev, void *private,
int max_vrings);
void vdpa_free(struct vdpa_dev *vdpa);
A simple example
================
# Query the number of available mdev instances
$ cat /sys/class/mdev_bus/0000:06:00.2/mdev_supported_types/ifcvf_vdpa-vdpa_virtio/available_instances
# Create a mdev instance
$ echo $UUID > /sys/class/mdev_bus/0000:06:00.2/mdev_supported_types/ifcvf_vdpa-vdpa_virtio/create
# Launch QEMU with a virtio-net device
$ qemu \
...... \
-netdev type=vhost-vfio,sysfsdev=/sys/bus/mdev/devices/$UUID,id=$ID \
-device virtio-net-pci,netdev=$ID
-----...
2018 Apr 02
2
[RFC] vhost: introduce mdev based hardware vhost backend
...struct vdpa_dev *vdpa_alloc(struct mdev_device *mdev, void *private,
int max_vrings);
void vdpa_free(struct vdpa_dev *vdpa);
A simple example
================
# Query the number of available mdev instances
$ cat /sys/class/mdev_bus/0000:06:00.2/mdev_supported_types/ifcvf_vdpa-vdpa_virtio/available_instances
# Create a mdev instance
$ echo $UUID > /sys/class/mdev_bus/0000:06:00.2/mdev_supported_types/ifcvf_vdpa-vdpa_virtio/create
# Launch QEMU with a virtio-net device
$ qemu \
...... \
-netdev type=vhost-vfio,sysfsdev=/sys/bus/mdev/devices/$UUID,id=$ID \
-device virtio-net-pci,netdev=$ID
-----...