| 1 |
.TH DEVLINK\-SB 8 "14 Apr 2016" "iproute2" "Linux" |
| 2 |
.SH NAME |
| 3 |
devlink-sb \- devlink shared buffer configuration |
| 4 |
.SH SYNOPSIS |
| 5 |
.sp |
| 6 |
.ad l |
| 7 |
.in +8 |
| 8 |
.ti -8 |
| 9 |
.B devlink |
| 10 |
.RI "[ " OPTIONS " ]" |
| 11 |
.B sb |
| 12 |
.RI " { " COMMAND " | " |
| 13 |
.BR help " }" |
| 14 |
.sp |
| 15 |
|
| 16 |
.ti -8 |
| 17 |
.IR OPTIONS " := { " |
| 18 |
\fB\-V\fR[\fIersion\fR] | |
| 19 |
\fB\-n\fR[\fIno-nice-names\fR] } |
| 20 |
|
| 21 |
.ti -8 |
| 22 |
.BR "devlink sb show " |
| 23 |
.RI "[ " DEV " [ " |
| 24 |
.B sb |
| 25 |
.IR SB_INDEX " ] ]" |
| 26 |
|
| 27 |
.ti -8 |
| 28 |
.BR "devlink sb pool show " |
| 29 |
.RI "[ " DEV " [ " |
| 30 |
.B sb |
| 31 |
.IR SB_INDEX " ] " |
| 32 |
.br |
| 33 |
.B pool |
| 34 |
.IR POOL_INDEX " ]" |
| 35 |
|
| 36 |
.ti -8 |
| 37 |
.BI "devlink sb pool set " DEV " |
| 38 |
.RB "[ " sb |
| 39 |
.IR SB_INDEX " ] " |
| 40 |
.br |
| 41 |
.BI pool " POOL_INDEX " |
| 42 |
.br |
| 43 |
.BI size " POOL_SIZE " |
| 44 |
.br |
| 45 |
.BR thtype " { " static " | " dynamic " }" |
| 46 |
|
| 47 |
.ti -8 |
| 48 |
.BR "devlink sb port pool show " |
| 49 |
.RI "[ " DEV/PORT_INDEX " [ " |
| 50 |
.B sb |
| 51 |
.IR SB_INDEX " ] " |
| 52 |
.br |
| 53 |
.B pool |
| 54 |
.IR POOL_INDEX " ]" |
| 55 |
|
| 56 |
.ti -8 |
| 57 |
.BI "devlink sb port pool set " DEV/PORT_INDEX " |
| 58 |
.RB "[ " sb |
| 59 |
.IR SB_INDEX " ] " |
| 60 |
.br |
| 61 |
.BI pool " POOL_INDEX " |
| 62 |
.br |
| 63 |
.BI th " THRESHOLD " |
| 64 |
|
| 65 |
.ti -8 |
| 66 |
.BR "devlink sb tc bind show " |
| 67 |
.RI "[ " DEV/PORT_INDEX " [ " |
| 68 |
.B sb |
| 69 |
.IR SB_INDEX " ] " |
| 70 |
.br |
| 71 |
.BI tc " TC_INDEX " |
| 72 |
.br |
| 73 |
.B type |
| 74 |
.RB "{ " ingress " | " egress " } ]" |
| 75 |
|
| 76 |
.ti -8 |
| 77 |
.BI "devlink sb tc bind set " DEV/PORT_INDEX " |
| 78 |
.RB "[ " sb |
| 79 |
.IR SB_INDEX " ] " |
| 80 |
.br |
| 81 |
.BI tc " TC_INDEX " |
| 82 |
.br |
| 83 |
.BR type " { " ingress " | " egress " }" |
| 84 |
.br |
| 85 |
.BI pool " POOL_INDEX " |
| 86 |
.br |
| 87 |
.BI th " THRESHOLD " |
| 88 |
|
| 89 |
.ti -8 |
| 90 |
.BR "devlink sb occupancy show " |
| 91 |
.RI "{ " DEV " | " DEV/PORT_INDEX " } [ " |
| 92 |
.B sb |
| 93 |
.IR SB_INDEX " ] " |
| 94 |
|
| 95 |
.ti -8 |
| 96 |
.BR "devlink sb occupancy snapshot " |
| 97 |
.IR DEV " [ " |
| 98 |
.B sb |
| 99 |
.IR SB_INDEX " ]" |
| 100 |
|
| 101 |
.ti -8 |
| 102 |
.BR "devlink sb occupancy clearmax " |
| 103 |
.IR DEV " [ " |
| 104 |
.B sb |
| 105 |
.IR SB_INDEX " ]" |
| 106 |
|
| 107 |
.ti -8 |
| 108 |
.B devlink sb help |
| 109 |
|
| 110 |
.SH "DESCRIPTION" |
| 111 |
.SS devlink sb show - display available shared buffers and their attributes |
| 112 |
|
| 113 |
.PP |
| 114 |
.I "DEV" |
| 115 |
- specifies the devlink device to show shared buffers. |
| 116 |
If this argument is omitted all shared buffers of all devices are listed. |
| 117 |
|
| 118 |
.PP |
| 119 |
.I "SB_INDEX" |
| 120 |
- specifies the shared buffer. |
| 121 |
If this argument is omitted shared buffer with index 0 is selected. |
| 122 |
Behaviour of this argument it the same for every command. |
| 123 |
|
| 124 |
.SS devlink sb pool show - display available pools and their attributes |
| 125 |
|
| 126 |
.PP |
| 127 |
.I "DEV" |
| 128 |
- specifies the devlink device to show pools. |
| 129 |
If this argument is omitted all pools of all devices are listed. |
| 130 |
|
| 131 |
Display available pools listing their |
| 132 |
.B type, size, thtype |
| 133 |
and |
| 134 |
.B cell_size. cell_size |
| 135 |
is the allocation granularity of memory within the shared buffer. Drivers |
| 136 |
may round up, round down or reject |
| 137 |
.B size |
| 138 |
passed to the set command if it is not multiple of |
| 139 |
.B cell_size. |
| 140 |
|
| 141 |
.SS devlink sb pool set - set attributes of pool |
| 142 |
|
| 143 |
.PP |
| 144 |
.I "DEV" |
| 145 |
- specifies the devlink device to set pool. |
| 146 |
|
| 147 |
.TP |
| 148 |
.BI size " POOL_SIZE" |
| 149 |
size of the pool in Bytes. |
| 150 |
|
| 151 |
.TP |
| 152 |
.BR thtype " { " static " | " dynamic " } " |
| 153 |
pool threshold type. |
| 154 |
|
| 155 |
.I static |
| 156 |
- Threshold values for the pool will be passed in Bytes. |
| 157 |
|
| 158 |
.I dynamic |
| 159 |
- Threshold values ("to_alpha") for the pool will be used to compute alpha parameter according to formula: |
| 160 |
.br |
| 161 |
.in +16 |
| 162 |
alpha = 2 ^ (to_alpha - 10) |
| 163 |
.in -16 |
| 164 |
|
| 165 |
.in +10 |
| 166 |
The range of the passed value is between 0 to 20. The computed alpha is used to determine the maximum usage of the flow: |
| 167 |
.in -10 |
| 168 |
.br |
| 169 |
.in +16 |
| 170 |
max_usage = alpha / (1 + alpha) * Free_Buffer |
| 171 |
.in -16 |
| 172 |
|
| 173 |
.SS devlink sb port pool show - display port-pool combinations and threshold for each |
| 174 |
.I "DEV/PORT_INDEX" |
| 175 |
- specifies the devlink port. |
| 176 |
|
| 177 |
.TP |
| 178 |
.BI pool " POOL_INDEX" |
| 179 |
pool index. |
| 180 |
|
| 181 |
.SS devlink sb port pool set - set port-pool threshold |
| 182 |
.I "DEV/PORT_INDEX" |
| 183 |
- specifies the devlink port. |
| 184 |
|
| 185 |
.TP |
| 186 |
.BI pool " POOL_INDEX" |
| 187 |
pool index. |
| 188 |
|
| 189 |
.TP |
| 190 |
.BI th " THRESHOLD" |
| 191 |
threshold value. Type of the value is either Bytes or "to_alpha", depends on |
| 192 |
.B thtype |
| 193 |
set for the pool. |
| 194 |
|
| 195 |
.SS devlink sb tc bind show - display port-TC to pool bindings and threshold for each |
| 196 |
|
| 197 |
.I "DEV/PORT_INDEX" |
| 198 |
- specifies the devlink port. |
| 199 |
|
| 200 |
.TP |
| 201 |
.BI tc " TC_INDEX" |
| 202 |
index of either ingress or egress TC, usually in range 0 to 8 (depends on device). |
| 203 |
|
| 204 |
.TP |
| 205 |
.BR type " { " ingress " | " egress " } " |
| 206 |
TC type. |
| 207 |
|
| 208 |
.SS devlink sb tc bind set - set port-TC to pool binding with specified threshold |
| 209 |
|
| 210 |
.I "DEV/PORT_INDEX" |
| 211 |
- specifies the devlink port. |
| 212 |
|
| 213 |
.TP |
| 214 |
.BI tc " TC_INDEX" |
| 215 |
index of either ingress or egress TC, usually in range 0 to 8 (depends on device). |
| 216 |
|
| 217 |
.TP |
| 218 |
.BR type " { " ingress " | " egress " } " |
| 219 |
TC type. |
| 220 |
|
| 221 |
.TP |
| 222 |
.BI pool " POOL_INDEX" |
| 223 |
index of pool to bind this to. |
| 224 |
|
| 225 |
.TP |
| 226 |
.BI th " THRESHOLD" |
| 227 |
threshold value. Type of the value is either Bytes or "to_alpha", depends on |
| 228 |
.B thtype |
| 229 |
set for the pool. |
| 230 |
|
| 231 |
.SS devlink sb occupancy show - display shared buffer occupancy values for device or port |
| 232 |
|
| 233 |
.PP |
| 234 |
This command is used to browse shared buffer occupancy values. Values are showed for every port-pool combination as well as for all port-TC combinations (with pool this port-TC is bound to). Format of value is: |
| 235 |
.br |
| 236 |
.in +16 |
| 237 |
current_value/max_value |
| 238 |
.in -16 |
| 239 |
Note that before showing values, one has to issue |
| 240 |
.B occupancy snapshot |
| 241 |
command first. |
| 242 |
|
| 243 |
.PP |
| 244 |
.I "DEV" |
| 245 |
- specifies the devlink device to show occupancy values for. |
| 246 |
|
| 247 |
.I "DEV/PORT_INDEX" |
| 248 |
- specifies the devlink port to show occupancy values for. |
| 249 |
|
| 250 |
.SS devlink sb occupancy snapshot - take occupancy snapshot of shared buffer for device |
| 251 |
This command is used to take a snapshot of shared buffer occupancy values. After that, the values can be showed using |
| 252 |
.B occupancy show |
| 253 |
command. |
| 254 |
|
| 255 |
.PP |
| 256 |
.I "DEV" |
| 257 |
- specifies the devlink device to take occupancy snapshot on. |
| 258 |
|
| 259 |
.SS devlink sb occupancy clearmax - clear occupancy watermarks of shared buffer for device |
| 260 |
This command is used to reset maximal occupancy values reached for whole device. Note that before browsing reset values, one has to issue |
| 261 |
.B occupancy snapshot |
| 262 |
command. |
| 263 |
|
| 264 |
.PP |
| 265 |
.I "DEV" |
| 266 |
- specifies the devlink device to clear occupancy watermarks on. |
| 267 |
|
| 268 |
.SH "EXAMPLES" |
| 269 |
.PP |
| 270 |
devlink sb show |
| 271 |
.RS 4 |
| 272 |
List available share buffers. |
| 273 |
.RE |
| 274 |
.PP |
| 275 |
devlink sb pool show |
| 276 |
.RS 4 |
| 277 |
List available pools and their config. |
| 278 |
.RE |
| 279 |
.PP |
| 280 |
devlink sb port pool show pci/0000:03:00.0/1 pool 0 |
| 281 |
.RS 4 |
| 282 |
Show port-pool setup for specified port and pool. |
| 283 |
.RE |
| 284 |
.PP |
| 285 |
sudo devlink sb port pool set pci/0000:03:00.0/1 pool 0 th 15 |
| 286 |
.RS 4 |
| 287 |
Change threshold for port specified port and pool. |
| 288 |
.RE |
| 289 |
.PP |
| 290 |
devlink sb tc bind show pci/0000:03:00.0/1 tc 0 type ingress |
| 291 |
.RS 4 |
| 292 |
Show pool binding and threshold for specified port and TC. |
| 293 |
.RE |
| 294 |
.PP |
| 295 |
sudo devlink sb tc bind set pci/0000:03:00.0/1 tc 0 type ingress pool 0 th 9 |
| 296 |
.RS 4 |
| 297 |
Set pool binding and threshold for specified port and TC. |
| 298 |
.RE |
| 299 |
.PP |
| 300 |
sudo devlink sb occupancy snapshot pci/0000:03:00.0 |
| 301 |
.RS 4 |
| 302 |
Make a snapshot of occupancy of shared buffer for specified devlink device. |
| 303 |
.RE |
| 304 |
.PP |
| 305 |
devlink sb occupancy show pci/0000:03:00.0/1 |
| 306 |
.RS 4 |
| 307 |
Show occupancy for specified port from the snapshot. |
| 308 |
.RE |
| 309 |
.PP |
| 310 |
sudo devlink sb occupancy clearmax pci/0000:03:00.0 |
| 311 |
.RS 4 |
| 312 |
Clear watermarks for shared buffer of specified devlink device. |
| 313 |
.RE |
| 314 |
|
| 315 |
|
| 316 |
.SH SEE ALSO |
| 317 |
.BR devlink (8), |
| 318 |
.BR devlink-dev (8), |
| 319 |
.BR devlink-port (8), |
| 320 |
.BR devlink-monitor (8), |
| 321 |
.br |
| 322 |
|
| 323 |
.SH AUTHOR |
| 324 |
Jiri Pirko <[email protected]> |