summaryrefslogtreecommitdiffstats
path: root/man/man8/devlink-dev.8
blob: e9d091df48d85060b39a604e5512adb1d311a512 (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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
.TH DEVLINK\-DEV 8 "14 Mar 2016" "iproute2" "Linux"
.SH NAME
devlink-dev \- devlink device configuration
.SH SYNOPSIS
.sp
.ad l
.in +8
.ti -8
.B devlink
.RI "[ " OPTIONS " ]"
.B dev
.RI  " { " COMMAND " | "
.BR help " }"
.sp

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

.ti -8
.B devlink dev show
.RI "[ " DEV " ]"

.ti -8
.B devlink dev help

.ti -8
.B devlink dev eswitch set
.I DEV
[
.BR mode " { " legacy " | " switchdev " } "
] [
.BR inline-mode " { " none " | " link " | " network " | " transport " } "
] [
.BR encap-mode " { " none " | " basic " } "
]

.ti -8
.B devlink dev eswitch show
.I DEV

.ti -8
.B devlink dev param set
.I DEV
.B name
.I PARAMETER
.B value
.I VALUE
.BR cmode " { " runtime " | " driverinit " | " permanent " } "

.ti -8
.B devlink dev param show
[
.I DEV
.B name
.I PARAMETER
]

.ti -8
.B devlink dev reload
.I DEV
[
.B netns
.RI "{ " PID " | " NAME " | " ID " }"
] [
.BR action " { " driver_reinit " | " fw_activate " }"
] [
.B limit no_reset
]

.ti -8
.B devlink dev info
[
.I DEV
]

.ti -8
.B devlink dev flash
.I DEV
.B file
.I PATH
[
.B target
.I ID
]

.ti -8
.B devlink dev selftests show
[
.I DEV
]

.ti -8
.B devlink dev selftests run
.I DEV
[
.B id
.I ID...
]

.SH "DESCRIPTION"
.SS devlink dev show - display devlink device attributes

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

.in +4
Format is:
.in +2
BUS_NAME/BUS_ADDRESS

.SS devlink dev eswitch show - display devlink device eswitch attributes
.SS devlink dev eswitch set  - sets devlink device eswitch attributes

.TP
.BR mode " { " legacy " | " switchdev " } "
Set eswitch mode

.I legacy
- Legacy SRIOV

.I switchdev
- SRIOV switchdev offloads

.TP
.BR inline-mode " { " none " | " link " | " network " | " transport " } "
Some HWs need the VF driver to put part of the packet headers on the TX descriptor so the e-switch can do proper matching and steering.

.I none
- None

.I link
- L2 mode

.I network
- L3 mode

.I transport
- L4 mode

.TP
.BR encap-mode " { " none " | " basic " } "
Set eswitch encapsulation support

.I none
- Disable encapsulation support

.I basic
- Enable encapsulation support

.SS devlink dev param set  - set new value to devlink device configuration parameter

.TP
.BI name " PARAMETER"
Specify parameter name to set.

.TP
.BI value " VALUE"
New value to set.

.TP
.BR cmode " { " runtime " | " driverinit " | " permanent " } "
Configuration mode in which the new value is set.

.I runtime
- Set new value while driver is running. This configuration mode doesn't require any reset to apply the new value.

.I driverinit
- Set new value which will be applied during driver initialization. This configuration mode requires restart driver by devlink reload command to apply the new value.

.I permanent
- New value is written to device's non-volatile memory. This configuration mode requires hard reset to apply the new value.

.SS devlink dev param show - display devlink device supported configuration parameters attributes

.B name
.I PARAMETER
Specify parameter name to show.
If this argument is omitted all parameters supported by devlink devices are listed.

.SS devlink dev reload - perform hot reload of the driver.

.PP
.I "DEV"
- Specifies the devlink device to reload.

.B netns
.RI { " PID " | " NAME " | " ID " }
- Specifies the network namespace to reload into, either by pid, name or id.

.BR action " { " driver_reinit " | " fw_activate " }"
- Specifies the reload action required.
If this argument is omitted
.I driver_reinit
action will be used.
Note that even though user asks for a specific action, the driver implementation
might require to perform another action alongside with it. For example, some
driver do not support driver reinitialization being performed without fw
activation. Therefore, the devlink reload command returns the list of actions
which were actrually performed.

.I driver_reinit
- Driver entities re-initialization, applying devlink-param and
devlink-resource values.

.I fw_activate
- Activates new firmware if such image is stored and pending activation. If no
limitation specified this action may involve firmware reset. If no new image
pending this action will reload current firmware image.

.B limit no_reset
- Specifies limitation on reload action.
If this argument is omitted limit is unspecified and the reload action is not
limited. In such case driver implementation may include reset or downtime as
needed to perform the actions.

.I no_reset
- No reset allowed, no down time allowed, no link flap and no configuration is
lost.

.SS devlink dev info - display device information.
Display device information provided by the driver. This command can be used
to query versions of the hardware components or device components which
can't be updated (
.I fixed
) as well as device firmware which can be updated. For firmware components
.I running
displays the versions of firmware currently loaded into the device, while
.I stored
reports the versions in device's flash.
.I Running
and
.I stored
versions may differ after flash has been updated, but before reboot.

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

.SS devlink dev flash - write device's non-volatile memory.

.PP
.I "DEV"
- specifies the devlink device to write to.

.B file
.I PATH
- Path to the file which will be written into device's flash. The path needs
to be relative to one of the directories searched by the kernel firmware loader,
such as /lib/firmware.

.B component
.I NAME
- If device stores multiple firmware images in non-volatile memory, this
parameter may be used to indicate which firmware image should be written.
The value of
.I NAME
should match the component names from
.B "devlink dev info"
and may be driver-dependent.

.SS devlink dev selftests show - shows supported selftests on devlink device.

.PP
.I "DEV"
- specifies the devlink device.
If this argument is omitted all selftests for devlink devices are listed.

.SS devlink dev selftests run - runs selftests on devlink device.

.PP
.I "DEV"
- specifies the devlink device to execute selftests.

.B id
.I  ID...
- The value of
.I ID(s)
should match the selftests shown in
.B "devlink dev selftests show"
to execute selftests on the devlink device.
If this argument is omitted all selftests supported by devlink devices are executed.

.SH "EXAMPLES"
.PP
devlink dev show
.RS 4
Shows the state of all devlink devices on the system.
.RE
.PP
devlink dev show pci/0000:01:00.0
.RS 4
Shows the state of specified devlink device.
.RE
.PP
devlink dev eswitch show pci/0000:01:00.0
.RS 4
Shows the eswitch mode of specified devlink device.
.RE
.PP
devlink dev eswitch set pci/0000:01:00.0 mode switchdev
.RS 4
Sets the eswitch mode of specified devlink device to switchdev.
.RE
.PP
devlink dev param show pci/0000:01:00.0 name max_macs
.RS 4
Shows the parameter max_macs attributes.
.RE
.PP
devlink dev param set pci/0000:01:00.0 name internal_error_reset value true cmode runtime
.RS 4
Sets the parameter internal_error_reset of specified devlink device to true.
.RE
.PP
devlink dev reload pci/0000:01:00.0
.RS 4
Performs hot reload of specified devlink device.
.RE
.PP
devlink dev flash pci/0000:01:00.0 file firmware.bin
.RS 4
Flashes the specified devlink device with provided firmware file name. If the driver supports it, user gets updates about the flash status. For example:
.br
Preparing to flash
.br
Flashing 100%
.br
Flashing done
.RE
.PP
devlink dev selftests show pci/0000:01:00.0
.RS 4
Shows the supported selftests by the devlink device.
.RE
.PP
devlink dev selftests run pci/0000:01:00.0 id flash
.RS 4
Perform a flash test on the devlink device.
.RE

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

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