1# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
3name: devlink
4
5protocol: genetlink-legacy
6
7doc: Partial family for Devlink.
8
9attribute-sets:
10  -
11    name: devlink
12    attributes:
13      -
14        name: bus-name
15        type: string
16        value: 1
17      -
18        name: dev-name
19        type: string
20      -
21        name: port-index
22        type: u32
23
24      # TODO: fill in the attributes in between
25
26      -
27        name: info-driver-name
28        type: string
29        value: 98
30      -
31        name: info-serial-number
32        type: string
33      -
34        name: info-version-fixed
35        type: nest
36        multi-attr: true
37        nested-attributes: dl-info-version
38      -
39        name: info-version-running
40        type: nest
41        multi-attr: true
42        nested-attributes: dl-info-version
43      -
44        name: info-version-stored
45        type: nest
46        multi-attr: true
47        nested-attributes: dl-info-version
48      -
49        name: info-version-name
50        type: string
51      -
52        name: info-version-value
53        type: string
54
55      # TODO: fill in the attributes in between
56
57      -
58        name: reload-failed
59        type: u8
60        value: 136
61
62      # TODO: fill in the attributes in between
63
64      -
65        name: reload-action
66        type: u8
67        value: 153
68
69      # TODO: fill in the attributes in between
70
71      -
72        name: dev-stats
73        type: nest
74        value: 156
75        nested-attributes: dl-dev-stats
76      -
77        name: reload-stats
78        type: nest
79        nested-attributes: dl-reload-stats
80      -
81        name: reload-stats-entry
82        type: nest
83        multi-attr: true
84        nested-attributes: dl-reload-stats-entry
85      -
86        name: reload-stats-limit
87        type: u8
88      -
89        name: reload-stats-value
90        type: u32
91      -
92        name: remote-reload-stats
93        type: nest
94        nested-attributes: dl-reload-stats
95      -
96        name: reload-action-info
97        type: nest
98        nested-attributes: dl-reload-act-info
99      -
100        name: reload-action-stats
101        type: nest
102        nested-attributes: dl-reload-act-stats
103  -
104    name: dl-dev-stats
105    subset-of: devlink
106    attributes:
107      -
108        name: reload-stats
109        type: nest
110      -
111        name: remote-reload-stats
112        type: nest
113  -
114    name: dl-reload-stats
115    subset-of: devlink
116    attributes:
117      -
118        name: reload-action-info
119        type: nest
120  -
121    name: dl-reload-act-info
122    subset-of: devlink
123    attributes:
124      -
125        name: reload-action
126        type: u8
127      -
128        name: reload-action-stats
129        type: nest
130  -
131    name: dl-reload-act-stats
132    subset-of: devlink
133    attributes:
134      -
135        name: reload-stats-entry
136        type: nest
137  -
138    name: dl-reload-stats-entry
139    subset-of: devlink
140    attributes:
141      -
142        name: reload-stats-limit
143        type: u8
144      -
145        name: reload-stats-value
146        type: u32
147  -
148    name: dl-info-version
149    subset-of: devlink
150    attributes:
151      -
152        name: info-version-name
153        type: string
154      -
155        name: info-version-value
156        type: string
157
158operations:
159  enum-model: directional
160  list:
161    -
162      name: get
163      doc: Get devlink instances.
164      attribute-set: devlink
165
166      do:
167        request:
168          value: 1
169          attributes: &dev-id-attrs
170            - bus-name
171            - dev-name
172        reply:  &get-reply
173          value: 3
174          attributes:
175            - bus-name
176            - dev-name
177            - reload-failed
178            - reload-action
179            - dev-stats
180      dump:
181        reply: *get-reply
182
183      # TODO: fill in the operations in between
184
185    -
186      name: info-get
187      doc: Get device information, like driver name, hardware and firmware versions etc.
188      attribute-set: devlink
189
190      do:
191        request:
192          value: 51
193          attributes: *dev-id-attrs
194        reply:
195          value: 51
196          attributes:
197            - bus-name
198            - dev-name
199