netlink: specs: remove redundant type keys from attributes in subsets
[linux-2.6-block.git] / Documentation / netlink / specs / devlink.yaml
1 # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
3 name: devlink
4
5 protocol: genetlink-legacy
6
7 doc: Partial family for Devlink.
8
9 definitions:
10   -
11     type: enum
12     name: sb-pool-type
13     entries:
14       -
15         name: ingress
16       -
17         name: egress
18
19 attribute-sets:
20   -
21     name: devlink
22     name-prefix: devlink-attr-
23     attributes:
24       -
25         name: bus-name
26         type: string
27         value: 1
28       -
29         name: dev-name
30         type: string
31       -
32         name: port-index
33         type: u32
34
35       # TODO: fill in the attributes in between
36
37       -
38         name: sb-index
39         type: u32
40         value: 11
41
42       # TODO: fill in the attributes in between
43
44       -
45         name: sb-pool-index
46         type: u16
47         value: 17
48
49       -
50         name: sb-pool-type
51         type: u8
52         enum: sb-pool-type
53
54       # TODO: fill in the attributes in between
55
56       -
57         name: sb-tc-index
58         type: u16
59         value: 22
60
61       # TODO: fill in the attributes in between
62
63       -
64         name: param-name
65         type: string
66         value: 81
67
68       # TODO: fill in the attributes in between
69
70       -
71         name: region-name
72         type: string
73         value: 88
74
75       # TODO: fill in the attributes in between
76
77       -
78         name: info-driver-name
79         type: string
80         value: 98
81       -
82         name: info-serial-number
83         type: string
84       -
85         name: info-version-fixed
86         type: nest
87         multi-attr: true
88         nested-attributes: dl-info-version
89       -
90         name: info-version-running
91         type: nest
92         multi-attr: true
93         nested-attributes: dl-info-version
94       -
95         name: info-version-stored
96         type: nest
97         multi-attr: true
98         nested-attributes: dl-info-version
99       -
100         name: info-version-name
101         type: string
102       -
103         name: info-version-value
104         type: string
105
106       # TODO: fill in the attributes in between
107
108       -
109         name: health-reporter-name
110         type: string
111         value: 115
112
113       # TODO: fill in the attributes in between
114
115       -
116         name: trap-name
117         type: string
118         value: 130
119
120       # TODO: fill in the attributes in between
121
122       -
123         name: trap-group-name
124         type: string
125         value: 135
126
127       -
128         name: reload-failed
129         type: u8
130
131       # TODO: fill in the attributes in between
132
133       -
134         name: trap-policer-id
135         type: u32
136         value: 142
137
138       # TODO: fill in the attributes in between
139
140       -
141         name: reload-action
142         type: u8
143         value: 153
144
145       # TODO: fill in the attributes in between
146
147       -
148         name: dev-stats
149         type: nest
150         value: 156
151         nested-attributes: dl-dev-stats
152       -
153         name: reload-stats
154         type: nest
155         nested-attributes: dl-reload-stats
156       -
157         name: reload-stats-entry
158         type: nest
159         multi-attr: true
160         nested-attributes: dl-reload-stats-entry
161       -
162         name: reload-stats-limit
163         type: u8
164       -
165         name: reload-stats-value
166         type: u32
167       -
168         name: remote-reload-stats
169         type: nest
170         nested-attributes: dl-reload-stats
171       -
172         name: reload-action-info
173         type: nest
174         multi-attr: true
175         nested-attributes: dl-reload-act-info
176       -
177         name: reload-action-stats
178         type: nest
179         multi-attr: true
180         nested-attributes: dl-reload-act-stats
181
182       # TODO: fill in the attributes in between
183
184       -
185         name: rate-node-name
186         type: string
187         value: 168
188
189       # TODO: fill in the attributes in between
190
191       -
192         name: linecard-index
193         type: u32
194         value: 171
195
196   -
197     name: dl-dev-stats
198     subset-of: devlink
199     attributes:
200       -
201         name: reload-stats
202       -
203         name: remote-reload-stats
204   -
205     name: dl-reload-stats
206     subset-of: devlink
207     attributes:
208       -
209         name: reload-action-info
210   -
211     name: dl-reload-act-info
212     subset-of: devlink
213     attributes:
214       -
215         name: reload-action
216       -
217         name: reload-action-stats
218   -
219     name: dl-reload-act-stats
220     subset-of: devlink
221     attributes:
222       -
223         name: reload-stats-entry
224   -
225     name: dl-reload-stats-entry
226     subset-of: devlink
227     attributes:
228       -
229         name: reload-stats-limit
230       -
231         name: reload-stats-value
232   -
233     name: dl-info-version
234     subset-of: devlink
235     attributes:
236       -
237         name: info-version-name
238       -
239         name: info-version-value
240
241 operations:
242   enum-model: directional
243   list:
244     -
245       name: get
246       doc: Get devlink instances.
247       attribute-set: devlink
248       dont-validate:
249         - strict
250         - dump
251
252       do:
253         pre: devlink-nl-pre-doit
254         post: devlink-nl-post-doit
255         request:
256           value: 1
257           attributes: &dev-id-attrs
258             - bus-name
259             - dev-name
260         reply:  &get-reply
261           value: 3
262           attributes:
263             - bus-name
264             - dev-name
265             - reload-failed
266             - reload-action
267             - dev-stats
268       dump:
269         reply: *get-reply
270
271     -
272       name: port-get
273       doc: Get devlink port instances.
274       attribute-set: devlink
275       dont-validate:
276         - strict
277
278       do:
279         pre: devlink-nl-pre-doit-port
280         post: devlink-nl-post-doit
281         request:
282           value: 5
283           attributes: &port-id-attrs
284             - bus-name
285             - dev-name
286             - port-index
287         reply:
288           value: 7
289           attributes: *port-id-attrs
290       dump:
291         request:
292           attributes: *dev-id-attrs
293         reply:
294           value: 3  # due to a bug, port dump returns DEVLINK_CMD_NEW
295           attributes: *port-id-attrs
296
297       # TODO: fill in the operations in between
298
299     -
300       name: sb-get
301       doc: Get shared buffer instances.
302       attribute-set: devlink
303       dont-validate:
304         - strict
305
306       do:
307         pre: devlink-nl-pre-doit
308         post: devlink-nl-post-doit
309         request:
310           value: 11
311           attributes: &sb-id-attrs
312             - bus-name
313             - dev-name
314             - sb-index
315         reply: &sb-get-reply
316           value: 11
317           attributes: *sb-id-attrs
318       dump:
319         request:
320           attributes: *dev-id-attrs
321         reply: *sb-get-reply
322
323       # TODO: fill in the operations in between
324
325     -
326       name: sb-pool-get
327       doc: Get shared buffer pool instances.
328       attribute-set: devlink
329       dont-validate:
330         - strict
331
332       do:
333         pre: devlink-nl-pre-doit
334         post: devlink-nl-post-doit
335         request:
336           value: 15
337           attributes: &sb-pool-id-attrs
338             - bus-name
339             - dev-name
340             - sb-index
341             - sb-pool-index
342         reply: &sb-pool-get-reply
343           value: 15
344           attributes: *sb-pool-id-attrs
345       dump:
346         request:
347           attributes: *dev-id-attrs
348         reply: *sb-pool-get-reply
349
350       # TODO: fill in the operations in between
351
352     -
353       name: sb-port-pool-get
354       doc: Get shared buffer port-pool combinations and threshold.
355       attribute-set: devlink
356       dont-validate:
357         - strict
358
359       do:
360         pre: devlink-nl-pre-doit-port
361         post: devlink-nl-post-doit
362         request:
363           value: 19
364           attributes: &sb-port-pool-id-attrs
365             - bus-name
366             - dev-name
367             - port-index
368             - sb-index
369             - sb-pool-index
370         reply: &sb-port-pool-get-reply
371           value: 19
372           attributes: *sb-port-pool-id-attrs
373       dump:
374         request:
375           attributes: *dev-id-attrs
376         reply: *sb-port-pool-get-reply
377
378       # TODO: fill in the operations in between
379
380     -
381       name: sb-tc-pool-bind-get
382       doc: Get shared buffer port-TC to pool bindings and threshold.
383       attribute-set: devlink
384       dont-validate:
385         - strict
386
387       do:
388         pre: devlink-nl-pre-doit-port
389         post: devlink-nl-post-doit
390         request:
391           value: 23
392           attributes: &sb-tc-pool-bind-id-attrs
393             - bus-name
394             - dev-name
395             - port-index
396             - sb-index
397             - sb-pool-type
398             - sb-tc-index
399         reply: &sb-tc-pool-bind-get-reply
400           value: 23
401           attributes: *sb-tc-pool-bind-id-attrs
402       dump:
403         request:
404           attributes: *dev-id-attrs
405         reply: *sb-tc-pool-bind-get-reply
406
407       # TODO: fill in the operations in between
408
409     -
410       name: param-get
411       doc: Get param instances.
412       attribute-set: devlink
413       dont-validate:
414         - strict
415
416       do:
417         pre: devlink-nl-pre-doit
418         post: devlink-nl-post-doit
419         request:
420           value: 38
421           attributes: &param-id-attrs
422             - bus-name
423             - dev-name
424             - param-name
425         reply: &param-get-reply
426           value: 38
427           attributes: *param-id-attrs
428       dump:
429         request:
430           attributes: *dev-id-attrs
431         reply: *param-get-reply
432
433       # TODO: fill in the operations in between
434
435     -
436       name: region-get
437       doc: Get region instances.
438       attribute-set: devlink
439       dont-validate:
440         - strict
441
442       do:
443         pre: devlink-nl-pre-doit-port-optional
444         post: devlink-nl-post-doit
445         request:
446           value: 42
447           attributes: &region-id-attrs
448             - bus-name
449             - dev-name
450             - port-index
451             - region-name
452         reply: &region-get-reply
453           value: 42
454           attributes: *region-id-attrs
455       dump:
456         request:
457           attributes: *dev-id-attrs
458         reply: *region-get-reply
459
460       # TODO: fill in the operations in between
461
462     -
463       name: info-get
464       doc: Get device information, like driver name, hardware and firmware versions etc.
465       attribute-set: devlink
466       dont-validate:
467         - strict
468         - dump
469
470       do:
471         pre: devlink-nl-pre-doit
472         post: devlink-nl-post-doit
473         request:
474           value: 51
475           attributes: *dev-id-attrs
476         reply: &info-get-reply
477           value: 51
478           attributes:
479             - bus-name
480             - dev-name
481             - info-driver-name
482             - info-serial-number
483             - info-version-fixed
484             - info-version-running
485             - info-version-stored
486       dump:
487         reply: *info-get-reply
488
489     -
490       name: health-reporter-get
491       doc: Get health reporter instances.
492       attribute-set: devlink
493       dont-validate:
494         - strict
495
496       do:
497         pre: devlink-nl-pre-doit-port-optional
498         post: devlink-nl-post-doit
499         request:
500           attributes: &health-reporter-id-attrs
501             - bus-name
502             - dev-name
503             - port-index
504             - health-reporter-name
505         reply: &health-reporter-get-reply
506           attributes: *health-reporter-id-attrs
507       dump:
508         request:
509           attributes: *port-id-attrs
510         reply: *health-reporter-get-reply
511
512       # TODO: fill in the operations in between
513
514     -
515       name: trap-get
516       doc: Get trap instances.
517       attribute-set: devlink
518       dont-validate:
519         - strict
520
521       do:
522         pre: devlink-nl-pre-doit
523         post: devlink-nl-post-doit
524         request:
525           value: 61
526           attributes: &trap-id-attrs
527             - bus-name
528             - dev-name
529             - trap-name
530         reply: &trap-get-reply
531           value: 61
532           attributes: *trap-id-attrs
533       dump:
534         request:
535           attributes: *dev-id-attrs
536         reply: *trap-get-reply
537
538       # TODO: fill in the operations in between
539
540     -
541       name: trap-group-get
542       doc: Get trap group instances.
543       attribute-set: devlink
544       dont-validate:
545         - strict
546
547       do:
548         pre: devlink-nl-pre-doit
549         post: devlink-nl-post-doit
550         request:
551           value: 65
552           attributes: &trap-group-id-attrs
553             - bus-name
554             - dev-name
555             - trap-group-name
556         reply: &trap-group-get-reply
557           value: 65
558           attributes: *trap-group-id-attrs
559       dump:
560         request:
561           attributes: *dev-id-attrs
562         reply: *trap-group-get-reply
563
564       # TODO: fill in the operations in between
565
566     -
567       name: trap-policer-get
568       doc: Get trap policer instances.
569       attribute-set: devlink
570       dont-validate:
571         - strict
572
573       do:
574         pre: devlink-nl-pre-doit
575         post: devlink-nl-post-doit
576         request:
577           value: 69
578           attributes: &trap-policer-id-attrs
579             - bus-name
580             - dev-name
581             - trap-policer-id
582         reply: &trap-policer-get-reply
583           value: 69
584           attributes: *trap-policer-id-attrs
585       dump:
586         request:
587           attributes: *dev-id-attrs
588         reply: *trap-policer-get-reply
589
590       # TODO: fill in the operations in between
591
592     -
593       name: rate-get
594       doc: Get rate instances.
595       attribute-set: devlink
596       dont-validate:
597         - strict
598
599       do:
600         pre: devlink-nl-pre-doit
601         post: devlink-nl-post-doit
602         request:
603           value: 74
604           attributes: &rate-id-attrs
605             - bus-name
606             - dev-name
607             - port-index
608             - rate-node-name
609         reply: &rate-get-reply
610           value: 74
611           attributes: *rate-id-attrs
612       dump:
613         request:
614           attributes: *dev-id-attrs
615         reply: *rate-get-reply
616
617       # TODO: fill in the operations in between
618
619     -
620       name: linecard-get
621       doc: Get line card instances.
622       attribute-set: devlink
623       dont-validate:
624         - strict
625
626       do:
627         pre: devlink-nl-pre-doit
628         post: devlink-nl-post-doit
629         request:
630           value: 78
631           attributes: &linecard-id-attrs
632             - bus-name
633             - dev-name
634             - linecard-index
635         reply: &linecard-get-reply
636           value: 78
637           attributes: *linecard-id-attrs
638       dump:
639         request:
640           attributes: *dev-id-attrs
641         reply: *linecard-get-reply
642
643       # TODO: fill in the operations in between
644
645     -
646       name: selftests-get
647       doc: Get device selftest instances.
648       attribute-set: devlink
649       dont-validate:
650         - strict
651         - dump
652
653       do:
654         pre: devlink-nl-pre-doit
655         post: devlink-nl-post-doit
656         request:
657           value: 82
658           attributes: *dev-id-attrs
659         reply: &selftests-get-reply
660           value: 82
661           attributes: *dev-id-attrs
662       dump:
663         reply: *selftests-get-reply