요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
UUID creation, type link, and removal
sysfs-bus-vfio-mdev:89-113UUID를 create에 써서 mediated device를 만들고 생성 directory와 mdev_type symlink를 사용한 뒤 remove 속성으로 제거합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
1
What: /sys/.../<device>/mdev_supported_types/
2
Date: October 2016
3
Contact: Kirti Wankhede <[email protected]>
4
Description:
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.
13
What: /sys/.../<device>/mdev_supported_types/<type-id>/
14
Date: October 2016
15
Contact: Kirti Wankhede <[email protected]>
16
Description:
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.
24
What: /sys/.../mdev_supported_types/<type-id>/create
25
Date: October 2016
26
Contact: Kirti Wankhede <[email protected]>
27
Description:
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::
33
# echo "83b8f4f2-509f-382f-3c1e-e6bfe0fa1001" > \
34
/sys/devices/foo/mdev_supported_types/foo-1/create
36
What: /sys/.../mdev_supported_types/<type-id>/devices/
37
Date: October 2016
38
Contact: Kirti Wankhede <[email protected]>
39
Description:
40
This directory contains symbolic links pointing to mdev
41
devices sysfs entries which are created of this <type-id>.
43
What: /sys/.../mdev_supported_types/<type-id>/available_instances
44
Date: October 2016
45
Contact: Kirti Wankhede <[email protected]>
46
Description:
47
Reading this attribute will show the number of mediated
48
devices of type <type-id> that can be created. This is a
49
readonly file.
50
Users:
51
Userspace applications interested in creating mediated
52
device of that type. Userspace application should check
53
the number of available instances could be created before
54
creating mediated device of this type.
56
What: /sys/.../mdev_supported_types/<type-id>/device_api
57
Date: October 2016
58
Contact: Kirti Wankhede <[email protected]>
59
Description:
60
Reading this attribute will show VFIO device API supported
61
by this type. For example, "vfio-pci" for a PCI device,
62
"vfio-platform" for platform device.
64
What: /sys/.../mdev_supported_types/<type-id>/name
65
Date: October 2016
66
Contact: Kirti Wankhede <[email protected]>
67
Description:
68
Reading this attribute will show human readable name of the
69
mediated device that will get created of type <type-id>.
70
This is optional attribute. For example: "Grid M60-0Q"
71
Users:
72
Userspace applications interested in knowing the name of
73
a particular <type-id> that can help in understanding the
74
type of mediated device.
76
What: /sys/.../mdev_supported_types/<type-id>/description
77
Date: October 2016
78
Contact: Kirti Wankhede <[email protected]>
79
Description:
80
Reading this attribute will show description of the type of
81
mediated device that will get created of type <type-id>.
82
This is optional attribute. For example:
83
"2 heads, 512M FB, 2560x1600 maximum resolution"
84
Users:
85
Userspace applications interested in knowing the details of
86
a particular <type-id> that can help in understanding the
87
features provided by that type of mediated device.
89
What: /sys/.../<device>/<UUID>/
90
Date: October 2016
91
Contact: Kirti Wankhede <[email protected]>
92
Description:
93
This directory represents device directory of mediated
94
device. It contains all the attributes related to mediated
95
device.
97
What: /sys/.../<device>/<UUID>/mdev_type
98
Date: October 2016
99
Contact: Kirti Wankhede <[email protected]>
100
Description:
101
This is symbolic link pointing to supported type, <type-id>
102
directory of which this mediated device is created.
104
What: /sys/.../<device>/<UUID>/remove
105
Date: October 2016
106
Contact: Kirti Wankhede <[email protected]>
107
Description:
108
Writing '1' to this file destroys the mediated device. The
109
vendor driver can fail the remove() callback if that device
110
is active and the vendor driver doesn't support hot unplug.
111
Example::
113
# echo 1 > /sys/bus/mdev/devices/<UUID>/remove
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Parent device의 지원 mdev type 목록
1-11| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/.../<device>/mdev_supported_types/ |
| Date | 2016년 10월 |
| Contact | Kirti Wankhede <[email protected]> |
| Description | 이 directory는 <device>가 현재 지원하는 mediated device type directory 목록과 각 type의 세부 정보를 담습니다. 지원 type 속성은 Mediated device framework에 등록한 vendor driver가 정의합니다. 각 지원 type은 directory이며, 이름은 vendor driver가 제공한 문자열 앞에 device driver 문자열을 prefix로 붙여 만듭니다. |
지원 mdev type 세부 directory
13-22| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/.../<device>/mdev_supported_types/<type-id>/ |
| Date | 2016년 10월 |
| Contact | Kirti Wankhede <[email protected]> |
| Description | 이 directory는 지원 type의 name, description, available_instances, device_api 같은 세부 정보를 제공합니다. vendor driver는 device_api와 available_instances 속성을 반드시 제공해야 합니다. name, description 및 그 밖의 vendor driver-specific 속성은 선택 사항입니다. |
구분속성
필수device_api, available_instances
선택name, description, 기타 vendor-specific 속성
Vendor driver가 type directory에 제공해야 하는 필수·선택 속성입니다.
UUID로 mediated device 생성
24-34| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/.../mdev_supported_types/<type-id>/create |
| Date | 2016년 10월 |
| Contact | Kirti Wankhede <[email protected]> |
| Description | 이 file에 UUID를 쓰면 parent device <device>에 <type-id> type의 mediated device를 생성합니다. Write-only file입니다. |
# echo "83b8f4f2-509f-382f-3c1e-e6bfe0fa1001" > \
/sys/devices/foo/mdev_supported_types/foo-1/create
Type별 생성 mdev symlink 목록
36-41| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/.../mdev_supported_types/<type-id>/devices/ |
| Date | 2016년 10월 |
| Contact | Kirti Wankhede <[email protected]> |
| Description | 이 directory는 <type-id>로 생성한 mdev device의 sysfs entry를 가리키는 symbolic link들을 담습니다. |
생성 가능한 mdev instance 수
43-54| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/.../mdev_supported_types/<type-id>/available_instances |
| Date | 2016년 10월 |
| Contact | Kirti Wankhede <[email protected]> |
| Description | 읽으면 생성할 수 있는 <type-id> type mediated device 수를 표시합니다. Read-only file입니다. |
| Users | 해당 type의 mediated device를 생성하려는 userspace application이 사용합니다. Userspace application은 이 type의 mediated device를 만들기 전에 생성 가능한 instance 수를 확인해야 합니다. |
mdev type의 VFIO device API
56-62| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/.../mdev_supported_types/<type-id>/device_api |
| Date | 2016년 10월 |
| Contact | Kirti Wankhede <[email protected]> |
| Description | 읽으면 이 type이 지원하는 VFIO device API를 표시합니다. 예를 들어 PCI device는 "vfio-pci", platform device는 "vfio-platform"입니다. |
mdev type의 사람이 읽을 수 있는 이름
64-74| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/.../mdev_supported_types/<type-id>/name |
| Date | 2016년 10월 |
| Contact | Kirti Wankhede <[email protected]> |
| Description | 읽으면 <type-id>로 생성될 mediated device의 사람이 읽을 수 있는 이름을 표시합니다. 선택 속성이며 예시는 "Grid M60-0Q"입니다. |
| Users | 특정 <type-id>의 이름을 알아 해당 mediated device type을 이해하려는 userspace application이 사용합니다. |
mdev type 기능 설명
76-87| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/.../mdev_supported_types/<type-id>/description |
| Date | 2016년 10월 |
| Contact | Kirti Wankhede <[email protected]> |
| Description | 읽으면 <type-id>로 생성될 mediated device type의 설명을 표시합니다. 선택 속성이며 예시는 "2 heads, 512M FB, 2560x1600 maximum resolution"입니다. |
| Users | 특정 <type-id>의 세부 정보를 알아 해당 mediated device type이 제공하는 기능을 이해하려는 userspace application이 사용합니다. |
생성된 mediated device directory
89-95| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/.../<device>/<UUID>/ |
| Date | 2016년 10월 |
| Contact | Kirti Wankhede <[email protected]> |
| Description | Mediated device의 device directory를 나타내며 해당 mediated device와 관련된 모든 속성을 담습니다. |
생성 mdev의 type symlink
97-102| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/.../<device>/<UUID>/mdev_type |
| Date | 2016년 10월 |
| Contact | Kirti Wankhede <[email protected]> |
| Description | 이 mediated device를 생성한 지원 type의 <type-id> directory를 가리키는 symbolic link입니다. |
Mediated device 제거
104-113| 항목 | 한국어 전문 번역 |
|---|---|
| What | /sys/.../<device>/<UUID>/remove |
| Date | 2016년 10월 |
| Contact | Kirti Wankhede <[email protected]> |
| Description | 이 file에 '1'을 쓰면 mediated device를 파괴합니다. 장치가 active 상태이고 vendor driver가 hot unplug를 지원하지 않으면 vendor driver가 remove() callback을 실패시킬 수 있습니다. |
# echo 1 > /sys/bus/mdev/devices/<UUID>/remove
Type 확인: device_api와 available_instances 읽기→생성: <type-id>/create에 UUID 쓰기→사용: <UUID>/mdev_type과 device 속성 사용→제거: <UUID>/remove에 1 쓰기
지원 type의 가용 수를 확인하고 UUID를 써서 생성한 뒤 type link를 확인하고 필요할 때 제거합니다.
Supported type metadata and capacity
sysfs-bus-vfio-mdev:1-87Parent device가 지원하는 mdev type과 필수 device_api·available_instances, 선택 name·description 및 type별 생성 device link를 정의합니다.