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 ] [ tx_priority N ] [ tx_weight
18               N ] [ { parent NODE_NAME | noparent } ]
19
20       devlink port function rate add DEV/NODE_NAME [ tx_share VALUE ] [
21               tx_max VALUE ] [ tx_priority N ] [ tx_weight N ] [ { parent
22               NODE_NAME | noparent } ]
23
24       devlink port function rate del DEV/NODE_NAME
25
26       devlink port function rate help
27
28

DESCRIPTION

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

EXAMPLES

139       * Display all rate objects:
140
141           # devlink port function rate show
142           pci/0000:03:00.0/1 type leaf parent some_group
143           pci/0000:03:00.0/2 type leaf tx_share 12Mbit
144           pci/0000:03:00.0/some_group type node tx_share 1Gbps tx_max 5Gbps
145
146
147       * Display leaf rate object bound to the 1st devlink port of the
148       pci/0000:03:00.0 device:
149
150           # devlink port function rate show pci/0000:03:00.0/1
151           pci/0000:03:00.0/1 type leaf
152
153
154       * Display leaf rate object rate values using IEC units:
155
156           # devlink -i port function rate show pci/0000:03:00.0/2
157           pci/0000:03:00.0/2 type leaf 11718Kibit
158
159
160       * Display node rate object with name some_group of the pci/0000:03:00.0
161       device:
162
163           # devlink port function rate show pci/0000:03:00.0/some_group
164           pci/0000:03:00.0/some_group type node
165
166
167       * Display pci/0000:03:00.0/2 leaf rate object as pretty JSON output:
168
169           # devlink -jp port function rate show pci/0000:03:00.0/2
170           {
171               "rate": {
172                   "pci/0000:03:00.0/2": {
173                       "type": "leaf",
174                       "tx_share": 1500000
175                   }
176               }
177           }
178
179
180       * Create node rate object with name "1st_group" on pci/0000:03:00.0 de‐
181       vice:
182
183           # devlink port function rate add pci/0000:03:00.0/1st_group
184
185
186       * Create node rate object with specified parameters:
187
188           # devlink port function rate add pci/0000:03:00.0/2nd_group \
189                tx_share 10Mbit tx_max 30Mbit parent 1st_group
190
191
192       * Set parameters to the specified leaf rate object:
193
194           # devlink port function rate set pci/0000:03:00.0/1 \
195                tx_share 2Mbit tx_max 10Mbit
196
197
198       * Set leaf's parent to "1st_group":
199
200           # devlink port function rate set pci/0000:03:00.0/1 parent
201           1st_group
202
203
204       * Unset leaf's parent:
205
206           # devlink port function rate set pci/0000:03:00.0/1 noparent
207
208
209       * Delete node rate object:
210
211           # devlink port function rate del pci/0000:03:00.0/2nd_group
212
213

SEE ALSO

215       devlink(8), devlink-port(8)
216
217

AUTHOR

219       Dmytro Linkin <dlinkin@nvidia.com>
220
221
222
223iproute2                          12 Mar 2021                  DEVLINK-RATE(8)
Impressum