summaryrefslogtreecommitdiffstats
path: root/upstream/fedora-rawhide/man8/devlink-sb.8
blob: 5a5a9bb94c3c464613d63863c88b2cfc69a955c3 (plain)
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
.TH DEVLINK\-SB 8 "14 Apr 2016" "iproute2" "Linux"
.SH NAME
devlink-sb \- devlink shared buffer configuration
.SH SYNOPSIS
.sp
.ad l
.in +8
.ti -8
.B devlink
.RI "[ " OPTIONS " ]"
.B sb
.RI  " { " COMMAND " | "
.BR help " }"
.sp

.ti -8
.IR OPTIONS " := { "
\fB\-V\fR[\fIersion\fR] |
\fB\-n\fR[\fIno-nice-names\fR] }

.ti -8
.BR "devlink sb show "
.RI "[ " DEV " [ "
.B sb
.IR SB_INDEX " ] ]"

.ti -8
.BR "devlink sb pool show "
.RI "[ " DEV " [ "
.B sb
.IR SB_INDEX " ] "
.br
.B pool
.IR POOL_INDEX " ]"

.ti -8
.BI "devlink sb pool set " DEV "
.RB "[ " sb
.IR SB_INDEX " ] "
.br
.BI pool " POOL_INDEX "
.br
.BI size " POOL_SIZE "
.br
.BR thtype " { " static " | " dynamic " }"

.ti -8
.BR "devlink sb port pool show "
.RI "[ " DEV/PORT_INDEX " [ "
.B sb
.IR SB_INDEX " ] "
.br
.B pool
.IR POOL_INDEX " ]"

.ti -8
.BI "devlink sb port pool set " DEV/PORT_INDEX "
.RB "[ " sb
.IR SB_INDEX " ] "
.br
.BI pool " POOL_INDEX "
.br
.BI th " THRESHOLD "

.ti -8
.BR "devlink sb tc bind show "
.RI "[ " DEV/PORT_INDEX " [ "
.B sb
.IR SB_INDEX " ] "
.br
.BI tc " TC_INDEX "
.br
.B type
.RB "{ " ingress " | " egress " } ]"

.ti -8
.BI "devlink sb tc bind set " DEV/PORT_INDEX "
.RB "[ " sb
.IR SB_INDEX " ] "
.br
.BI tc " TC_INDEX "
.br
.BR type " { " ingress " | " egress " }"
.br
.BI pool " POOL_INDEX "
.br
.BI th " THRESHOLD "

.ti -8
.BR "devlink sb occupancy show "
.RI "{ " DEV " | " DEV/PORT_INDEX " } [ "
.B sb
.IR SB_INDEX " ] "

.ti -8
.BR "devlink sb occupancy snapshot "
.IR DEV " [ "
.B sb
.IR SB_INDEX " ]"

.ti -8
.BR "devlink sb occupancy clearmax "
.IR DEV " [ "
.B sb
.IR SB_INDEX " ]"

.ti -8
.B devlink sb help

.SH "DESCRIPTION"
.SS devlink sb show - display available shared buffers and their attributes

.PP
.I "DEV"
- specifies the devlink device to show shared buffers.
If this argument is omitted all shared buffers of all devices are listed.

.PP
.I "SB_INDEX"
- specifies the shared buffer.
If this argument is omitted shared buffer with index 0 is selected.
Behaviour of this argument it the same for every command.

.SS devlink sb pool show - display available pools and their attributes

.PP
.I "DEV"
- specifies the devlink device to show pools.
If this argument is omitted all pools of all devices are listed.

Display available pools listing their
.B type, size, thtype
and
.B cell_size. cell_size
is the allocation granularity of memory within the shared buffer. Drivers
may round up, round down or reject
.B size
passed to the set command if it is not multiple of
.B cell_size.

.SS devlink sb pool set - set attributes of pool

.PP
.I "DEV"
- specifies the devlink device to set pool.

.TP
.BI size " POOL_SIZE"
size of the pool in Bytes.

.TP
.BR thtype " { " static " | " dynamic " } "
pool threshold type.

.I static
- Threshold values for the pool will be passed in Bytes.

.I dynamic
- Threshold values ("to_alpha") for the pool will be used to compute alpha parameter according to formula:
.br
.in +16
alpha = 2 ^ (to_alpha - 10)
.in -16

.in +10
The range of the passed value is between 0 to 20. The computed alpha is used to determine the maximum usage of the flow:
.in -10
.br
.in +16
max_usage = alpha / (1 + alpha) * Free_Buffer
.in -16

.SS devlink sb port pool show - display port-pool combinations and threshold for each
.I "DEV/PORT_INDEX"
- specifies the devlink port.

.TP
.BI pool " POOL_INDEX"
pool index.

.SS devlink sb port pool set - set port-pool threshold
.I "DEV/PORT_INDEX"
- specifies the devlink port.

.TP
.BI pool " POOL_INDEX"
pool index.

.TP
.BI th " THRESHOLD"
threshold value. Type of the value is either Bytes or "to_alpha", depends on
.B thtype
set for the pool.

.SS devlink sb tc bind show - display port-TC to pool bindings and threshold for each

.I "DEV/PORT_INDEX"
- specifies the devlink port.

.TP
.BI tc " TC_INDEX"
index of either ingress or egress TC, usually in range 0 to 8 (depends on device).

.TP
.BR type " { " ingress " | " egress " } "
TC type.

.SS devlink sb tc bind set - set port-TC to pool binding with specified threshold

.I "DEV/PORT_INDEX"
- specifies the devlink port.

.TP
.BI tc " TC_INDEX"
index of either ingress or egress TC, usually in range 0 to 8 (depends on device).

.TP
.BR type " { " ingress " | " egress " } "
TC type.

.TP
.BI pool " POOL_INDEX"
index of pool to bind this to.

.TP
.BI th " THRESHOLD"
threshold value. Type of the value is either Bytes or "to_alpha", depends on
.B thtype
set for the pool.

.SS devlink sb occupancy show - display shared buffer occupancy values for device or port

.PP
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:
.br
.in +16
current_value/max_value
.in -16
Note that before showing values, one has to issue
.B occupancy snapshot
command first.

.PP
.I "DEV"
- specifies the devlink device to show occupancy values for.

.I "DEV/PORT_INDEX"
- specifies the devlink port to show occupancy values for.

.SS devlink sb occupancy snapshot - take occupancy snapshot of shared buffer for device
This command is used to take a snapshot of shared buffer occupancy values. After that, the values can be showed using
.B occupancy show
command.

.PP
.I "DEV"
- specifies the devlink device to take occupancy snapshot on.

.SS devlink sb occupancy clearmax - clear occupancy watermarks of shared buffer for device
This command is used to reset maximal occupancy values reached for whole device. Note that before browsing reset values, one has to issue
.B occupancy snapshot
command.

.PP
.I "DEV"
- specifies the devlink device to clear occupancy watermarks on.

.SH "EXAMPLES"
.PP
devlink sb show
.RS 4
List available share buffers.
.RE
.PP
devlink sb pool show
.RS 4
List available pools and their config.
.RE
.PP
devlink sb port pool show pci/0000:03:00.0/1 pool 0
.RS 4
Show port-pool setup for specified port and pool.
.RE
.PP
sudo devlink sb port pool set pci/0000:03:00.0/1 pool 0 th 15
.RS 4
Change threshold for port specified port and pool.
.RE
.PP
devlink sb tc bind show pci/0000:03:00.0/1 tc 0 type ingress
.RS 4
Show pool binding and threshold for specified port and TC.
.RE
.PP
sudo devlink sb tc bind set pci/0000:03:00.0/1 tc 0 type ingress pool 0 th 9
.RS 4
Set pool binding and threshold for specified port and TC.
.RE
.PP
sudo devlink sb occupancy snapshot pci/0000:03:00.0
.RS 4
Make a snapshot of occupancy of shared buffer for specified devlink device.
.RE
.PP
devlink sb occupancy show pci/0000:03:00.0/1
.RS 4
Show occupancy for specified port from the snapshot.
.RE
.PP
sudo devlink sb occupancy clearmax pci/0000:03:00.0
.RS 4
Clear watermarks for shared buffer of specified devlink device.
.RE


.SH SEE ALSO
.BR devlink (8),
.BR devlink-dev (8),
.BR devlink-port (8),
.BR devlink-monitor (8),
.br

.SH AUTHOR
Jiri Pirko <jiri@mellanox.com>