xref: /linux/Documentation/ABI/testing/sysfs-bus-vfio-mdev (revision 71e2f4dd5a65bd8dbca0b77661e75eea471168f8)
1What:           /sys/.../<device>/mdev_supported_types/
2Date:           October 2016
3Contact:        Kirti Wankhede <kwankhede@nvidia.com>
4Description:
5                This directory contains list of directories of currently
6		supported mediated device types and their details for
7		<device>. Supported type attributes are defined by the
8		vendor driver who registers with Mediated device framework.
9		Each supported type is a directory whose name is created
10		by adding the device driver string as a prefix to the
11		string provided by the vendor driver.
12
13What:           /sys/.../<device>/mdev_supported_types/<type-id>/
14Date:           October 2016
15Contact:        Kirti Wankhede <kwankhede@nvidia.com>
16Description:
17                This directory gives details of supported type, like name,
18		description, available_instances, device_api etc.
19		'device_api' and 'available_instances' are mandatory
20		attributes to be provided by vendor driver. 'name',
21		'description' and other vendor driver specific attributes
22		are optional.
23
24What:           /sys/.../mdev_supported_types/<type-id>/create
25Date:           October 2016
26Contact:        Kirti Wankhede <kwankhede@nvidia.com>
27Description:
28		Writing UUID to this file will create mediated device of
29		type <type-id> for parent device <device>. This is a
30		write-only file.
31		For example:
32		# echo "83b8f4f2-509f-382f-3c1e-e6bfe0fa1001" >	\
33		       /sys/devices/foo/mdev_supported_types/foo-1/create
34
35What:           /sys/.../mdev_supported_types/<type-id>/devices/
36Date:           October 2016
37Contact:        Kirti Wankhede <kwankhede@nvidia.com>
38Description:
39		This directory contains symbolic links pointing to mdev
40		devices sysfs entries which are created of this <type-id>.
41
42What:           /sys/.../mdev_supported_types/<type-id>/available_instances
43Date:           October 2016
44Contact:        Kirti Wankhede <kwankhede@nvidia.com>
45Description:
46		Reading this attribute will show the number of mediated
47		devices of type <type-id> that can be created. This is a
48		readonly file.
49Users:
50		Userspace applications interested in creating mediated
51		device of that type. Userspace application should check
52		the number of available instances could be created before
53		creating mediated device of this type.
54
55What:           /sys/.../mdev_supported_types/<type-id>/device_api
56Date:           October 2016
57Contact:        Kirti Wankhede <kwankhede@nvidia.com>
58Description:
59		Reading this attribute will show VFIO device API supported
60		by this type. For example, "vfio-pci" for a PCI device,
61		"vfio-platform" for platform device.
62
63What:           /sys/.../mdev_supported_types/<type-id>/name
64Date:           October 2016
65Contact:        Kirti Wankhede <kwankhede@nvidia.com>
66Description:
67		Reading this attribute will show human readable name of the
68		mediated device that will get created of type <type-id>.
69		This is optional attribute. For example: "Grid M60-0Q"
70Users:
71		Userspace applications interested in knowing the name of
72		a particular <type-id> that can help in understanding the
73		type of mediated device.
74
75What:           /sys/.../mdev_supported_types/<type-id>/description
76Date:           October 2016
77Contact:        Kirti Wankhede <kwankhede@nvidia.com>
78Description:
79		Reading this attribute will show description of the type of
80		mediated device that will get created of type <type-id>.
81		This is optional attribute. For example:
82		"2 heads, 512M FB, 2560x1600 maximum resolution"
83Users:
84		Userspace applications interested in knowing the details of
85		a particular <type-id> that can help in understanding the
86		features provided by that type of mediated device.
87
88What:           /sys/.../<device>/<UUID>/
89Date:           October 2016
90Contact:        Kirti Wankhede <kwankhede@nvidia.com>
91Description:
92		This directory represents device directory of mediated
93		device. It contains all the attributes related to mediated
94		device.
95
96What:           /sys/.../<device>/<UUID>/mdev_type
97Date:           October 2016
98Contact:        Kirti Wankhede <kwankhede@nvidia.com>
99Description:
100		This is symbolic link pointing to supported type, <type-id>
101		directory of which this mediated device is created.
102
103What:           /sys/.../<device>/<UUID>/remove
104Date:           October 2016
105Contact:        Kirti Wankhede <kwankhede@nvidia.com>
106Description:
107		Writing '1' to this file destroys the mediated device. The
108		vendor driver can fail the remove() callback if that device
109		is active and the vendor driver doesn't support hot unplug.
110		Example:
111		# echo 1 > /sys/bus/mdev/devices/<UUID>/remove
112