1DEVLINK-RATE(8)                      Linux                     DEVLINK-RATE(8)
2
3
4

NAME

6       devlink-rate - devlink rate management
7

SYNOPSIS

9       devlink [ OPTIONS ] port function rate  { COMMAND | help }
10
11
12       OPTIONS := { -j[son] | -p[retty] | -i[ec] }
13
14       devlink port function rate show [ { DEV/PORT_INDEX | DEV/NODE_NAME } ]
15
16       devlink port function rate set { DEV/PORT_INDEX | DEV/NODE_NAME } [
17               tx_share VALUE ] [ tx_max VALUE ] [ { parent NODE_NAME | nopar‐
18               ent } ]
19
20       devlink port function rate add DEV/NODE_NAME [ tx_share VALUE ] [
21               tx_max VALUE ] [ { parent NODE_NAME | noparent } ]
22
23       devlink port function rate del DEV/NODE_NAME
24
25       devlink port function rate help
26
27

DESCRIPTION

29   devlink port function rate show - display rate objects.
30       Displays specified rate object or, if not specified, all rate objects.
31       Rate object can be presented by one of the two types:
32
33       leaf    Represents a single devlink port; created/destroyed by the
34               driver and bound to the devlink port. As example, some driver
35               may create leaf rate object for every devlink port associated
36               with VF. Since leaf have 1to1 mapping to it's devlink port, in
37               user space it is referred as corresponding devlink port
38               DEV/PORT_INDEX;
39
40       node    Represents a group of rate objects; created/deleted by the user
41               (see command below) and bound to the devlink device rather then
42               to the devlink port. In userspace it is referred as
43               DEV/NODE_NAME, where node name can be any, except decimal num‐
44               ber, to avoid collisions with leafs.
45
46       Command output show rate object identifier, it's type and rate values
47       along with parent node name. Rate values printed in SI units which are
48       more suitable to represent specific value. To print values in IEC units
49       -i switch is used. JSON (-j) output always print rate values in bytes
50       per second. Zero rate values means "unlimited" rates and omitted in
51       output, as well as parent node name.
52
53
54   devlink port function rate set - set rate object parameters.
55       Allows set rate object's parameters. If any parameter specified multi‐
56       ple times the last occurrence is used.
57
58       DEV/PORT_INDEX - specifies devlink leaf rate object.
59       DEV/NODE_NAME - specifies devlink node rate object.
60
61       tx_share VALUE - specifies minimal tx rate value shared among all rate
62       objects. If rate object is a part of some rate group, then this value
63       shared with rate objects of this rate group.
64
65       tx_max VALUE - specifies maximum tx rate value.
66
67       VALUE   These parameter accept a floating point number, possibly fol‐
68               lowed by either a unit (both SI and IEC units supported).
69
70               bit or a bare number
71                      Bits per second
72
73               kbit   Kilobits per second
74
75               mbit   Megabits per second
76
77               gbit   Gigabits per second
78
79               tbit   Terabits per second
80
81               bps    Bytes per second
82
83               kbps   Kilobytes per second
84
85               mbps   Megabytes per second
86
87               gbps   Gigabytes per second
88
89               tbps   Terabytes per second
90
91               To specify in IEC units, replace the SI prefix (k-, m-, g-, t-)
92               with IEC prefix (ki-, mi-, gi- and ti-) respectively. Input is
93               case-insensitive.
94
95       parent NODE_NAME | noparent - set rate object parent to existing node
96       with name NODE_NAME or unset parent. Rate limits of the parent node ap‐
97       plied to all it's children. Actual behaviour is details of driver's im‐
98       plementation. Setting parent to empty ("") name due to the kernel logic
99       threated as parent unset.
100
101
102   devlink port function rate add - create node rate object with specified pa‐
103       rameters.
104       Creates rate object of type node and sets parameters. Parameters same
105       as for the "set" command.
106
107       DEV/NODE_NAME - specifies the devlink node rate object to create.
108
109
110   devlink port function rate del - delete node rate object
111       Delete specified devlink node rate object. Node can't be deleted if
112       there is any child, user must explicitly unset the parent.
113
114       DEV/NODE_NAME - specifies devlink node rate object to delete.
115
116
117   devlink port function rate help - display usage information
118       Display devlink rate usage information
119
120

EXAMPLES

122       * Display all rate objects:
123
124           # devlink port function rate show
125           pci/0000:03:00.0/1 type leaf parent some_group
126           pci/0000:03:00.0/2 type leaf tx_share 12Mbit
127           pci/0000:03:00.0/some_group type node tx_share 1Gbps tx_max 5Gbps
128
129
130       * Display leaf rate object bound to the 1st devlink port of the
131       pci/0000:03:00.0 device:
132
133           # devlink port function rate show pci/0000:03:00.0/1
134           pci/0000:03:00.0/1 type leaf
135
136
137       * Display leaf rate object rate values using IEC units:
138
139           # devlink -i port function rate show pci/0000:03:00.0/2
140           pci/0000:03:00.0/2 type leaf 11718Kibit
141
142
143       * Display node rate object with name some_group of the pci/0000:03:00.0
144       device:
145
146           # devlink port function rate show pci/0000:03:00.0/some_group
147           pci/0000:03:00.0/some_group type node
148
149
150       * Display pci/0000:03:00.0/2 leaf rate object as pretty JSON output:
151
152           # devlink -jp port function rate show pci/0000:03:00.0/2
153           {
154               "rate": {
155                   "pci/0000:03:00.0/2": {
156                       "type": "leaf",
157                       "tx_share": 1500000
158                   }
159               }
160           }
161
162
163       * Create node rate object with name "1st_group" on pci/0000:03:00.0 de‐
164       vice:
165
166           # devlink port function rate add pci/0000:03:00.0/1st_group
167
168
169       * Create node rate object with specified parameters:
170
171           # devlink port function rate add pci/0000:03:00.0/2nd_group \
172                tx_share 10Mbit tx_max 30Mbit parent 1st_group
173
174
175       * Set parameters to the specified leaf rate object:
176
177           # devlink port function rate set pci/0000:03:00.0/1 \
178                tx_share 2Mbit tx_max 10Mbit
179
180
181       * Set leaf's parent to "1st_group":
182
183           # devlink port function rate set pci/0000:03:00.0/1 parent
184           1st_group
185
186
187       * Unset leaf's parent:
188
189           # devlink port function rate set pci/0000:03:00.0/1 noparent
190
191
192       * Delete node rate object:
193
194           # devlink port function rate del pci/0000:03:00.0/2nd_group
195
196

SEE ALSO

198       devlink(8), devlink-port(8)
199
200

AUTHOR

202       Dmytro Linkin <dlinkin@nvidia.com>
203
204
205
206iproute2                          12 Mar 2021                  DEVLINK-RATE(8)
Impressum