Debian Codegraph @

upstream/debian-trixie/man8/devlink-rate.8

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