1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
|
.TH DEVLINK\-RATE 8 "12 Mar 2021" "iproute2" "Linux"
.SH NAME
devlink-rate \- devlink rate management
.SH SYNOPSIS
.sp
.ad l
.in +8
.ti -8
.B devlink
.RI "[ " OPTIONS " ]"
.B port function rate
.RI " { " COMMAND " | "
.BR help " }"
.sp
.ti -8
.IR OPTIONS " := { "
.BR -j [ \fIson "] | " -p [ \fIretty "] | " -i [ \fIec "] }"
.ti -8
.B devlink port function rate show
.RI "[ { " DEV/PORT_INDEX " | " DEV/NODE_NAME " } ]"
.ti -8
.B devlink port function rate set
.RI "{ " DEV/PORT_INDEX " | " DEV/NODE_NAME " } "
.RB [ " tx_share \fIVALUE " ]
.RB [ " tx_max \fIVALUE " ]
.RB [ " tx_priority \fIN " ]
.RB [ " tx_weight \fIN " ]
.RB "[ {" " parent \fINODE_NAME " | " noparent " "} ]"
.ti -8
.BI "devlink port function rate add " DEV/NODE_NAME
.RB [ " tx_share \fIVALUE " ]
.RB [ " tx_max \fIVALUE " ]
.RB [ " tx_priority \fIN " ]
.RB [ " tx_weight \fIN " ]
.RB "[ {" " parent \fINODE_NAME " | " noparent " "} ]"
.ti -8
.BI "devlink port function rate del " DEV/NODE_NAME
.ti -8
.B devlink port function rate help
.SH "DESCRIPTION"
.SS devlink port function rate show - display rate objects.
Displays specified rate object or, if not specified, all rate objects. Rate
object can be presented by one of the two types:
.TP 8
.B leaf
Represents a single devlink port; created/destroyed by the driver and bound to
the devlink port. As example, some driver may create leaf rate object for every
devlink port associated with VF. Since leaf have 1to1 mapping to it's devlink
port, in user space it is referred as corresponding devlink port
\fIDEV/PORT_INDEX\fR;
.TP 8
.B node
Represents a group of rate objects; created/deleted by the user (see command
below) and bound to the devlink device rather then to the devlink port. In
userspace it is referred as \fIDEV/NODE_NAME\fR, where node name can be any,
except decimal number, to avoid collisions with leafs.
.PP
Command output show rate object identifier, it's type and rate values along with
parent node name. Rate values printed in SI units which are more suitable to
represent specific value. To print values in IEC units \fB-i\fR switch is
used. JSON (\fB-j\fR) output always print rate values in bytes per second. Zero
rate values means "unlimited" rates and omitted in output, as well as parent
node name.
.SS devlink port function rate set - set rate object parameters.
Allows set rate object's parameters. If any parameter specified multiple times
the last occurrence is used.
.PP
.I DEV/PORT_INDEX
- specifies devlink leaf rate object.
.br
.I DEV/NODE_NAME
- specifies devlink node rate object.
.PP
.BI tx_share " VALUE"
- specifies minimal tx rate value shared among all rate objects. If rate object
is a part of some rate group, then this value shared with rate objects of this
rate group.
.PP
.BI tx_max " VALUE"
- specifies maximum tx rate value.
.PP
.BI tx_priority " N"
- allows for usage of strict priority arbiter among siblings. This arbitration
scheme attempts to schedule nodes based on their priority as long as the nodes
remain within their bandwidth limit. The higher the priority the higher the
probability that the node will get selected for scheduling.
.PP
.BI tx_weight " N"
- allows for usage of Weighted Fair Queuing arbitration scheme among siblings.
This arbitration scheme can be used simultaneously with the strict priority.
As a node is configured with a higher rate it gets more BW relative to it's
siblings. Values are relative like a percentage points, they basically tell
how much BW should node take relative to it's siblings.
.PP
.TP 8
.I VALUE
These parameter accept a floating point number, possibly followed by either a
unit (both SI and IEC units supported).
.RS
.TP
bit or a bare number
Bits per second
.TP
kbit
Kilobits per second
.TP
mbit
Megabits per second
.TP
gbit
Gigabits per second
.TP
tbit
Terabits per second
.TP
bps
Bytes per second
.TP
kbps
Kilobytes per second
.TP
mbps
Megabytes per second
.TP
gbps
Gigabytes per second
.TP
tbps
Terabytes per second
.P
To specify in IEC units, replace the SI prefix (k-, m-, g-, t-) with IEC prefix
(ki-, mi-, gi- and ti-) respectively. Input is case-insensitive.
.RE
.PP
.TP 8
.I N
These parameter accept integer meaning weight or priority of a node.
.PP
.BI parent " NODE_NAME \fR| " noparent
- set rate object parent to existing node with name \fINODE_NAME\fR or unset
parent. Rate limits of the parent node applied to all it's children. Actual
behaviour is details of driver's implementation. Setting parent to empty ("")
name due to the kernel logic threated as parent unset.
.SS devlink port function rate add - create node rate object with specified parameters.
Creates rate object of type node and sets parameters. Parameters same as for the
"set" command.
.PP
.I DEV/NODE_NAME
- specifies the devlink node rate object to create.
.SS devlink port function rate del - delete node rate object
Delete specified devlink node rate object. Node can't be deleted if there is any
child, user must explicitly unset the parent.
.PP
.I DEV/NODE_NAME
- specifies devlink node rate object to delete.
.SS devlink port function rate help - display usage information
Display devlink rate usage information
.SH "EXAMPLES"
.PP
\fB*\fR Display all rate objects:
.RS 4
.PP
# devlink port function rate show
.br
pci/0000:03:00.0/1 type leaf parent some_group
.br
pci/0000:03:00.0/2 type leaf tx_share 12Mbit
.br
pci/0000:03:00.0/some_group type node tx_share 1Gbps tx_max 5Gbps
.RE
.PP
\fB*\fR Display leaf rate object bound to the 1st devlink port of the
pci/0000:03:00.0 device:
.RS 4
.PP
# devlink port function rate show pci/0000:03:00.0/1
.br
pci/0000:03:00.0/1 type leaf
.br
.RE
.PP
\fB*\fR Display leaf rate object rate values using IEC units:
.RS 4
.PP
# devlink -i port function rate show pci/0000:03:00.0/2
.br
pci/0000:03:00.0/2 type leaf 11718Kibit
.br
.RE
.PP
\fB*\fR Display node rate object with name some_group of the pci/0000:03:00.0 device:
.RS 4
.PP
# devlink port function rate show pci/0000:03:00.0/some_group
.br
pci/0000:03:00.0/some_group type node
.br
.RE
.PP
\fB*\fR Display pci/0000:03:00.0/2 leaf rate object as pretty JSON output:
.RS 4
.PP
# devlink -jp port function rate show pci/0000:03:00.0/2
.br
{
.br
"rate": {
.br
"pci/0000:03:00.0/2": {
.br
"type": "leaf",
.br
"tx_share": 1500000
.br
}
.br
}
.br
}
.RE
.PP
\fB*\fR Create node rate object with name "1st_group" on pci/0000:03:00.0 device:
.RS 4
.PP
# devlink port function rate add pci/0000:03:00.0/1st_group
.RE
.PP
\fB*\fR Create node rate object with specified parameters:
.RS 4
.PP
# devlink port function rate add pci/0000:03:00.0/2nd_group \\
.br
tx_share 10Mbit tx_max 30Mbit parent 1st_group
.RE
.PP
\fB*\fR Set parameters to the specified leaf rate object:
.RS 4
.PP
# devlink port function rate set pci/0000:03:00.0/1 \\
.br
tx_share 2Mbit tx_max 10Mbit
.RE
.PP
\fB*\fR Set leaf's parent to "1st_group":
.RS 4
.PP
# devlink port function rate set pci/0000:03:00.0/1 parent 1st_group
.RE
.PP
\fB*\fR Unset leaf's parent:
.RS 4
.PP
# devlink port function rate set pci/0000:03:00.0/1 noparent
.RE
.PP
\fB*\fR Delete node rate object:
.RS 4
.PP
# devlink port function rate del pci/0000:03:00.0/2nd_group
.RE
.SH SEE ALSO
.BR devlink (8),
.BR devlink-port (8)
.br
.SH AUTHOR
Dmytro Linkin <dlinkin@nvidia.com>
|