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