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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
|
.TH DEVLINK\-PORT 8 "14 Mar 2016" "iproute2" "Linux"
.SH NAME
devlink-port \- devlink port configuration
.SH SYNOPSIS
.sp
.ad l
.in +8
.ti -8
.B devlink
.RI "[ " OPTIONS " ]"
.B port
.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 port set "
.IR DEV/PORT_INDEX
.RI "[ "
.BR type " { " eth " | " ib " | " auto " }"
.RI "]"
.ti -8
.BR "devlink port split "
.IR DEV/PORT_INDEX
.BR count
.IR COUNT
.ti -8
.BR "devlink port unsplit "
.IR DEV/PORT_INDEX
.ti -8
.B devlink port show
.RI "[ " DEV/PORT_INDEX " ]"
.ti -8
.B devlink port health
.RI "{ " show " | " recover " | " diagnose " | " dump " | " set " }"
.ti -8
.BI "devlink port add"
.RB "{"
.IR "DEV | DEV/PORT_INDEX"
.RB "} "
.RB "[ " flavour
.IR FLAVOUR " ]"
.RB "[ " pfnum
.IR PFNUMBER " ]"
.RB "[ " sfnum
.IR SFNUMBER " ]"
.RB "[ " controller
.IR CNUM " ]"
.br
.ti -8
.B devlink port del
.IR DEV/PORT_INDEX
.ti -8
.BR "devlink port function set "
.IR DEV/PORT_INDEX
.RI "[ "
.BR "hw_addr "
.RI "ADDR ]"
.RI "[ "
.BR state " { " active " | " inactive " }"
.RI "]"
.RI "[ "
.BR roce " { " enable " | " disable " }"
.RI "]"
.RI "[ "
.BR migratable " { " enable " | " disable " }"
.RI "]"
.RI "[ "
.BR ipsec_crypto " { " enable " | " disable " }"
.RI "]"
.RI "[ "
.BR ipsec_packet " { " enable " | " disable " }"
.RI "]"
.ti -8
.BR "devlink port function rate "
.RI "{ " show " | " set " | " add " | " del " | " help " }"
.ti -8
.B devlink dev param set
.I DEV/PORT_INDEX
.B name
.I PARAMETER
.B value
.I VALUE
.BR cmode " { " runtime " | " driverinit " | " permanent " } "
.ti -8
.B devlink dev param show
[
.I DEV/PORT_INDEX
.B name
.I PARAMETER
]
.ti -8
.B devlink port help
.SH "DESCRIPTION"
.SS devlink port set - change devlink port attributes
.PP
.I "DEV/PORT_INDEX"
- specifies the devlink port to operate on.
.in +4
Format is:
.in +2
BUS_NAME/BUS_ADDRESS/PORT_INDEX
.TP
.BR type " { " eth " | " ib " | " auto " } "
set port type
.I eth
- Ethernet
.I ib
- Infiniband
.I auto
- autoselect
.SS devlink port split - split devlink port into more
.PP
.I "DEV/PORT_INDEX"
- specifies the devlink port to operate on.
.TP
.BI count " COUNT"
number of ports to split to.
.SS devlink port unsplit - unsplit previously split devlink port
Could be performed on any split port of the same split group.
.PP
.I "DEV/PORT_INDEX"
- specifies the devlink port to operate on.
.SS devlink port show - display devlink port attributes
.PP
.I "DEV/PORT_INDEX"
- specifies the devlink port to show.
If this argument is omitted all ports are listed.
.SS devlink port health - devlink health reporting and recovery
Is an alias for
.BR devlink-health (8).
.ti -8
.SS devlink port add - add a devlink port
.PP
.I "DEV"
- specifies the devlink device to operate on. or
.PP
.I "DEV/PORT_INDEX"
- specifies the devlink port index to use for the requested new port.
This is optional. When omitted, driver allocates unique port index.
.TP
.BR flavour " { " pcipf " | " pcisf " } "
set port flavour
.I pcipf
- PCI PF port
.I pcisf
- PCI SF port
.TP
.BI pfnum " PFNUMBER "
Specifies PCI pfnumber to use on which a SF device to create
.TP
.BI sfnum " SFNUMBER "
Specifies sfnumber to assign to the device of the SF.
This field is optional for those devices which supports auto assignment of the
SF number.
.TP
.BI controller " CNUM "
Specifies controller number for which the SF port is created.
This field is optional. It is used only when SF port is created for the
external controller.
.ti -8
.SS devlink port function set - Set the port function attribute(s).
.PP
.I "DEV/PORT_INDEX"
- specifies the devlink port to operate on.
.TP
.BI hw_addr " ADDR"
Hardware address of the function to set. This is a Ethernet MAC address when
port type is Ethernet.
.TP
.BR state " { " active " | " inactive " } "
New state of the function to change to.
.I active
- Once configuration of the function is done, activate the function.
.I inactive
- To inactivate the function and its device(s), set to inactive.
.TP
.BR roce " { " enable " | " disable " } "
Set the RoCE capability of the function.
.TP
.BR migratable " { " enable " | " disable " } "
Set the migratable capability of the function.
.TP
.BR ipsec_crypto " { " enable " | " disable " } "
Set the IPsec crypto offload capability of the function. Controls XFRM state
crypto operation (Encrypt/Decrypt) offload.
.TP
.BR ipsec_packet " { " enable " | " disable " } "
Set the IPsec packet offload capability of the function. Controls XFRM state
and policy offload (Encrypt/Decrypt operation and IPsec encapsulation).
.ti -8
.SS devlink port del - delete a devlink port
.PP
.I "DEV/PORT_INDEX"
- specifies the devlink port to delete.
.ti -8
.SS devlink port param set - set new value to devlink port configuration parameter
.PP
.I "DEV/PORT_INDEX"
- specifies the devlink port to operate on.
.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 port param show - display devlink port supported configuration parameters attributes
.PP
.I "DEV/PORT_INDEX"
- specifies the devlink port to operate on.
.B name
.I PARAMETER
Specify parameter name to show.
If this argument, as well as port index, are omitted - all parameters supported by devlink device ports are listed.
.SS devlink port function rate - manage devlink rate objects
Is an alias for
.BR devlink-rate (8).
.SH "EXAMPLES"
.PP
devlink port show
.RS 4
Shows the state of all devlink ports on the system.
.RE
.PP
devlink port show pci/0000:01:00.0/1
.RS 4
Shows the state of specified devlink port.
.RE
.PP
devlink port set pci/0000:01:00.0/1 type eth
.RS 4
Set type of specified devlink port to Ethernet.
.RE
.PP
devlink port split pci/0000:01:00.0/1 count 4
.RS 4
Split the specified devlink port into four ports.
.RE
.PP
devlink port unsplit pci/0000:01:00.0/1
.RS 4
Unplit the specified previously split devlink port.
.RE
.PP
devlink port health show
.RS 4
Shows status and configuration of all supported reporters registered on all devlink ports.
.RE
.PP
devlink port health show pci/0000:01:00.0/1 reporter tx
.RS 4
Shows status and configuration of tx reporter registered on pci/0000:01:00.0/1 devlink port.
.RE
.PP
devlink port add pci/0000:06:00.0 flavour pcisf pfnum 0 sfnum 88
.RS 4
Add a devlink port of flavour PCI SF on PCI PF having number 0 with SF number 88.
To make use of the function an example sequence is to add a port, configure the
function attribute and activate the function. Once function usage is completed,
inactivate the function and finally delete the port. When there is desire to
reuse the port without deletion, it can be reconfigured and activated again when
function is in inactive state and function's operational state is detached.
.RE
.PP
devlink port del pci/0000:06:00.0/1
.RS 4
Delete previously created devlink port. It is recommended to first deactivate
the function if the function supports state management.
.RE
.PP
devlink port function set pci/0000:01:00.0/1 hw_addr 00:00:00:11:22:33
.RS 4
Configure hardware address of the PCI function represented by devlink port.
If the port supports change in function state, hardware address must be configured
before activating the function.
.RE
.PP
devlink port function set pci/0000:01:00.0/1 state active
.RS 4
Activate the function. This will initiate the function enumeration and driver loading.
.RE
.PP
devlink port function set pci/0000:01:00.0/1 state inactive
.RS 4
Deactivate the function. This will initiate the function teardown which results
in driver unload and device removal.
.RE
.PP
devlink port function set pci/0000:01:00.0/1 roce enable
.RS 4
This will enable the RoCE functionality of the function.
.RE
.PP
devlink port function set pci/0000:01:00.0/1 migratable enable
.RS 4
This will enable the migratable functionality of the function.
.RE
.PP
devlink port function set pci/0000:01:00.0/1 ipsec_crypto enable
.RS 4
This will enable the IPsec crypto offload functionality of the function.
.RE
.PP
devlink port function set pci/0000:01:00.0/1 ipsec_packet enable
.RS 4
This will enable the IPsec packet offload functionality of the function.
.RE
.PP
devlink port function set pci/0000:01:00.0/1 hw_addr 00:00:00:11:22:33 state active
.RS 4
Configure hardware address and also active the function. When a function is
activated together with other configuration in a single command, all the
configuration is applied first before changing the state to active.
.RE
.PP
devlink dev param show
.RS 4
Shows (dumps) all the port parameters across all the devices registered in the devlink.
.RE
.PP
devlink dev param set pci/0000:01:00.0/1 name internal_error_reset value true cmode runtime
.RS 4
Sets the parameter internal_error_reset of specified devlink port (#1) to true.
.RE
.PP
devlink port add pci/0000:06:00.0 flavour pcisf pfnum 0 sfnum 88 controller 1
.RS 4
Add a devlink port of flavour PCI SF on controller 1 which has PCI PF of number
0 with SF number 88. To make use of the function an example sequence is to add
a port, configure the function attribute and activate the function. Once
the function usage is completed, deactivate the function and finally delete
the port. When there is desire to reuse the port without deletion, it can be
reconfigured and activated again when function is in inactive state and
function's operational state is detached.
.RE
.SH SEE ALSO
.BR devlink (8),
.BR devlink-dev (8),
.BR devlink-sb (8),
.BR devlink-monitor (8),
.BR devlink-health (8),
.br
.SH AUTHOR
Jiri Pirko <jiri@mellanox.com>
|