1# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
3name: netdev
4
5doc:
6  netdev configuration over generic netlink.
7
8definitions:
9  -
10    type: flags
11    name: xdp-act
12    render-max: true
13    entries:
14      -
15        name: basic
16        doc:
17          XDP features set supported by all drivers
18          (XDP_ABORTED, XDP_DROP, XDP_PASS, XDP_TX)
19      -
20        name: redirect
21        doc:
22          The netdev supports XDP_REDIRECT
23      -
24        name: ndo-xmit
25        doc:
26          This feature informs if netdev implements ndo_xdp_xmit callback.
27      -
28        name: xsk-zerocopy
29        doc:
30          This feature informs if netdev supports AF_XDP in zero copy mode.
31      -
32        name: hw-offload
33        doc:
34         This feature informs if netdev supports XDP hw offloading.
35      -
36        name: rx-sg
37        doc:
38          This feature informs if netdev implements non-linear XDP buffer
39          support in the driver napi callback.
40      -
41        name: ndo-xmit-sg
42        doc:
43          This feature informs if netdev implements non-linear XDP buffer
44          support in ndo_xdp_xmit callback.
45  -
46    type: flags
47    name: xdp-rx-metadata
48    render-max: true
49    entries:
50      -
51        name: timestamp
52        doc:
53          Device is capable of exposing receive HW timestamp via bpf_xdp_metadata_rx_timestamp().
54      -
55        name: hash
56        doc:
57          Device is capable of exposing receive packet hash via bpf_xdp_metadata_rx_hash().
58
59attribute-sets:
60  -
61    name: dev
62    attributes:
63      -
64        name: ifindex
65        doc: netdev ifindex
66        type: u32
67        checks:
68          min: 1
69      -
70        name: pad
71        type: pad
72      -
73        name: xdp-features
74        doc: Bitmask of enabled xdp-features.
75        type: u64
76        enum: xdp-act
77      -
78        name: xdp-zc-max-segs
79        doc: max fragment count supported by ZC driver
80        type: u32
81        checks:
82          min: 1
83      -
84        name: xdp-rx-metadata-features
85        doc: Bitmask of supported XDP receive metadata features.
86             See Documentation/networking/xdp-rx-metadata.rst for more details.
87        type: u64
88        enum: xdp-rx-metadata
89
90operations:
91  list:
92    -
93      name: dev-get
94      doc: Get / dump information about a netdev.
95      attribute-set: dev
96      do:
97        request:
98          attributes:
99            - ifindex
100        reply: &dev-all
101          attributes:
102            - ifindex
103            - xdp-features
104            - xdp-zc-max-segs
105            - xdp-rx-metadata-features
106      dump:
107        reply: *dev-all
108    -
109      name: dev-add-ntf
110      doc: Notification about device appearing.
111      notify: dev-get
112      mcgrp: mgmt
113    -
114      name: dev-del-ntf
115      doc: Notification about device disappearing.
116      notify: dev-get
117      mcgrp: mgmt
118    -
119      name: dev-change-ntf
120      doc: Notification about device configuration being changed.
121      notify: dev-get
122      mcgrp: mgmt
123
124mcast-groups:
125  list:
126    -
127      name: mgmt
128