xref: /linux/Documentation/netlink/specs/netdev.yaml (revision beb8592d041626532d01dc42f8010ba37953c1fc)
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        enum-as-flags: true
78      -
79        name: xdp-zc-max-segs
80        doc: max fragment count supported by ZC driver
81        type: u32
82        checks:
83          min: 1
84      -
85        name: xdp-rx-metadata-features
86        doc: Bitmask of supported XDP receive metadata features.
87             See Documentation/networking/xdp-rx-metadata.rst for more details.
88        type: u64
89        enum: xdp-rx-metadata
90        enum-as-flags: true
91
92operations:
93  list:
94    -
95      name: dev-get
96      doc: Get / dump information about a netdev.
97      attribute-set: dev
98      do:
99        request:
100          attributes:
101            - ifindex
102        reply: &dev-all
103          attributes:
104            - ifindex
105            - xdp-features
106            - xdp-zc-max-segs
107            - xdp-rx-metadata-features
108      dump:
109        reply: *dev-all
110    -
111      name: dev-add-ntf
112      doc: Notification about device appearing.
113      notify: dev-get
114      mcgrp: mgmt
115    -
116      name: dev-del-ntf
117      doc: Notification about device disappearing.
118      notify: dev-get
119      mcgrp: mgmt
120    -
121      name: dev-change-ntf
122      doc: Notification about device configuration being changed.
123      notify: dev-get
124      mcgrp: mgmt
125
126mcast-groups:
127  list:
128    -
129      name: mgmt
130