aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/cxgbetool/cxgbetool.8
blob: 81affe139d1159868af70243daeeb67229bfbfb1 (plain) (blame)
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
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
.\" Copyright (c) 2015, Chelsio Inc
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions are met:
.\"
.\" 1. Redistributions of source code must retain the above copyright notice,
.\"    this list of conditions and the following disclaimer.
.\"
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" 3. Neither the name of the Chelsio Inc nor the names of its
.\"    contributors may be used to endorse or promote products derived from
.\"    this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.\" * Other names and brands may be claimed as the property of others.
.\"
.\" $FreeBSD$
.\"
.Dd March 6, 2017
.Dt CXGBETOOL 8
.Os
.Sh NAME
.Nm cxgbetool
.Nd Userspace companion to
.Xr cxgbe 4
.Sh SYNOPSIS
.Bl -item -compact
.It
.Nm Ar nexus command Op Ar parameter ...
.Pp
.It
.Nm Ar nexus Cm clearstats Ar port_id
.It
.Nm Ar nexus Cm context Bro Cm ingress | egress | fl | cong Brc Ar cntxt_id
.It
.Nm Ar nexus Cm filter mode Op Ar match-criteria ...
.It
.Nm Ar nexus Cm filter Ar idx Bro Ar filter-specification | Cm delete Brc
.It
.Nm Ar nexus Cm filter list
.It
.Nm Ar nexus Cm i2c Ar port_id devaddr addr Op Ar len
.It
.Nm Ar nexus Cm loadcfg Ar fw-config.txt
.It
.Nm Ar nexus Cm loadcfg clear
.It
.Nm Ar nexus Cm loadfw Ar fw-image.bin
.It
.Nm Ar nexus Cm memdump Ar addr len
.It
.Nm Ar nexus Bro Cm reg | reg64 Brc Ar addr Ns Op Ar =val
.It
.Nm Ar nexus Cm regdump Op Ar register-block ...
.It
.Nm Ar nexus Cm sched-class Ar sub-command Op Ar param Ar value
.It
.Nm Ar nexus Cm sched-queue Ar port Ar queue Ar class
.It
.Nm Ar nexus Cm stdio
.It
.Nm Ar nexus Cm tcb Ar tid
.El
.Sh DESCRIPTION
.Nm
provides command-line access to features and debug facilities exported by
.Xr cxgbe 4
via private ioctls.
The target nexus device,
.Va t4nex%d
, is always the first argument.
(The parent nexus for an Ethernet port
.Va cxgbe%d
is listed in
.Va dev.cxgbe.%d.%parent
in the
.Xr sysctl 8
MIB).
The rest consists of a command and any parameters required by that command.
.Ss Commands
.Bl -ohang
.It Cm clearstats Ar port_id
Clear all transmit, receive, and error statistics of all queues associated
with a port.
The total number of ports attached to a nexus is listed in
.Va dev.t4nex.%d.nports
and the 0 based
.Ar port_id
identifies a port within this range.
.Pp
.Bl -item -compact
.It
.Cm context ingress Ar ingress_cntxt_id
.It
.Cm context cong Ar ingress_cntxt_id
.It
.Cm context egress Ar egress_cntxt_id
.It
.Cm context fl Ar flm_cntxt_id
.El
Display hardware context for an ingress queue, congestion manager, egress
queue, or freelist manager.
.Bl -tag -width ingress_cntxt_id -compact
.It Ar ingress_cntxt_id
context id of an ingress queue -- the value listed in one of
.Va dev.t4nex.%d.fwq.cntxt_id Ns ,
.Va dev.cxgbe.%d.rxq.%d.cntxt_id Ns ,
or
.Va dev.cxgbe.%d.ofld_rxq.%d.cntxt_id Ns .
.It Ar egress_cntxt_id
context id of an egress queue -- the value listed in one of
.Va dev.t4nex.%d.mgmtq.cntxt_id Ns ,
.Va dev.cxgbe.%d.txq.%d.cntxt_id Ns ,
.Va dev.cxgbe.%d.ctrlq.%d.cntxt_id Ns ,
.Va dev.cxgbe.%d.ofld_txq.%d.cntxt_id Ns ,
.Va dev.cxgbe.%d.rxq.%d.fl.cntxt_id Ns ,
or
.Va dev.cxgbe.%d.ofld_rxq.%d.fl.cntxt_id Ns .
Note that freelists are egress queues too.
.It Ar flm_cntxt_id
context id of a freelist manager.
The FLM context id is displayed in the
egress context dump of a freelist as FLMcontextID.
.El
.It Cm filter mode Op Ar match-criteria ...
Display or set the nexus's filter mode.
.Ar match-criteria
is a whitespace separated list of criteria from the table below.
Each criteria has an associated budget which is also listed in the table.
The total budget allowed is 36 and attempts to set a filter mode that
exceeds this will be rejected.
Every filter must conform to the filter mode -- multiple match criteria
per filter are allowed but only from among those in the current setting
of the filter mode.
The filter mode can only be changed when there are no existing filters.
Its default value is
.Cm ipv4 ipv6 sip dip sport dport matchtype proto vlan iport fcoe
.Pp
(Note that
.Ar mask
defaults to all 1s when not provided explicitly.
Also note that many of the items being matched are discrete numeric
values rather than bit fields and should be masked with caution.)
.TS
center expand;
cb cb cb cbw(40m)
cb c l l.
Criteria	Budget	Usage	Matches if ...
_
ipv4	0	T{
.Cm type ipv4
T}	T{
incoming packet is an IPv4 datagram.
T}
_
ipv6	0	T{
.Cm type ipv6
T}	T{
incoming packet is an IPv6 datagram.
T}
_
sip	0	T{
.Cm sip Ar addr Ns Op / Ns Ar mask
T}	T{
bitwise and of the source address in an incoming IP datagram with
.Ar mask
equals
.Ar addr Ns .
.Ar addr
can be an IPv4 or IPv6 address.
T}
_
dip	0	T{
.Cm dip Ar addr Ns Op / Ns Ar mask
T}	T{
bitwise and of the destination address in an incoming IP datagram with
.Ar mask
equals
.Ar addr Ns .
.Ar addr
can be an IPv4 or IPv6 address.
T}
_
sport	0	T{
.Cm sport Ar port Ns Op : Ns Ar mask
T}	T{
bitwise and of the source port in an incoming TCP or UDP datagram with
.Ar mask
equals
.Ar port Ns .
T}
_
dport	0	T{
.Cm dport Ar port Ns Op : Ns Ar mask
T}	T{
bitwise and of the destination port in an incoming TCP or UDP datagram with
.Ar mask
equals
.Ar port Ns .
T}
_
fcoe	1	T{
.Cm fcoe Brq 0 | 1
T}	T{
incoming frame is Fibre Channel over Ethernet(1) or not(0).
T}
_
iport	3	T{
.Cm iport Ar val Ns Op : Ns Ar mask
T}	T{
bitwise and of the ingress port with
.Ar mask
equals
.Ar val Ns .
The ingress port is a 3 bit number that identifies the port on which a
frame arrived.
Physical ports are numbered 0-3 and 4-7 are internal loopback paths
within the chip.
Note that ingress port is not a bit field so it is not always possible
to match an arbitrary subset of ingress ports with a single filter rule.
T}
_
ovlan	17	T{
.Cm ovlan Ar tag Ns Op : Ns Ar mask
T}	T{
bitwise and of the 16-bit outer VLAN tag of an incoming frame with
.Ar mask
equals
.Ar tag Ns .
T}
_
vlan	17	T{
.Cm vlan Ar tag Ns Op : Ns Ar mask
T}	T{
bitwise and of the 16-bit VLAN tag of an incoming QinQ frame with
.Ar mask
equals
.Ar tag Ns .
The inner VLAN tag is used if the incoming frame is QinQ.
T}
_
tos	8	T{
.Cm tos Ar val Ns Op : Ns Ar mask
T}	T{
bitwise and of the 8-bit IP Type of Service/IPv6 Traffic Class in an
incoming packet with
.Ar mask
equals
.Ar val Ns .
T}
_
proto	8	T{
.Cm proto Ar ipproto Ns Op : Ns Ar mask
T}	T{
bitwise and of the 8-bit IP protocol in an incoming packet with
.Ar mask
equals
.Ar ipproto Ns .
T}
_
ethtype	16	T{
.Cm ethtype Ar type Ns Op : Ns Ar mask
T}	T{
bitwise and of the 16-bit Ethernet type field of an incoming frame with
.Ar mask
equals
.Ar type Ns .
T}
_
macidx	9	T{
.Cm macidx Ar idx Ns Op : Ns Ar mask
T}	T{
bitwise and of the MAC Address Match Index of an incoming frame with
.Ar mask
equals
.Ar idx Ns .
The MAC Address Match Index refers to an entry in the MPS TCAM or in the
MPS hash.  See
.Cm matchtype
for more information.
T}
_
matchtype	3	T{
.Cm matchtype Ar type Ns Op : Ns Ar mask
T}	T{
bitwise and of the Match Type of an incoming frame with
.Ar mask
equals
.Ar idx Ns .
Match Type is one of the following:
.Bl -tag -width "n" -compact
.It 0
destination MAC in incoming frame is a unicast L2 address that is
programmed in the MPS TCAM.
.Cm macidx
can be used to match the index (and thus the MAC address) of the match
in the TCAM.
.It 1
destination MAC in incoming frame is a unicast L2 address that "hit" a
hash entry in the MPS hash table.
.Cm macidx
can be used to match the index of the entry in the MPS hash table.
.It 2
destination MAC in incoming frame is a multicast L2 address that is
programmed in the MPS TCAM.
.Cm macidx
can be used to match the index (and thus the MAC address) of the match
in the TCAM.
.It 3
destination MAC in incoming frame is a multicast L2 address that "hit"
an entry in the MPS hash table.
.It 4
interface on which incoming frame was received is in promiscuous mode
and the destination MAC in the frame is not a broadcast address, and
does not match in the MPS TCAM or the MPS hash either.  (The frame would
have been discarded if the interface wasn't in promiscuous mode.)
.It 5
interface on which incoming frame was received is in promiscuous mode
and the destination MAC in the frame is not a broadcast address; it
wasn't looked up in the MPS TCAM or the MPS hash because the chip is
configured to give precedence to promiscuous mode classification.
.It 6
destination MAC in incoming frame is a broadcast address.
.It 7
Not documented.  Do not use.
.El
T}
_
frag	1	T{
.Cm frag Brq 0 | 1
T}	T{
incoming frame is part of a fragmented IP datagram(1) or not(0).
T}
.TE
.It Cm filter Ar idx Ar filter-specification
Program a filter at the index specified by
.Ar idx Ns .
.Ar filter-specification
consists of one or more matches to try against an incoming frame and an
action to perform when all matches succeed.
.It Cm filter Ar idx Cm delete
Delete filter that is at the given index.
.It Cm filter Cm list
List all filters programmed into the hardware.
.It Cm i2c Ar port_id devaddr addr Op Ar len
.It Cm loadcfg Ar fw-config.txt
Install the firmware configuration file contained in
.Ar fw-config.txt
to the card.
Set hw.cxgbe.config_file="flash" in loader.conf to get
.Xr cxgbe 4
to use the on-flash configuration.
.It Cm loadcfg Cm clear
Erase configuration file from the card.
.It Cm loadfw Ar fw-image.bin
Install the firmware contained in
.Ar fw-image.bin
to the card.
.It Cm memdump Ar addr len
Display
.Ar len
bytes of data of the card's memory starting at
.Ar addr Ns .
The card's memory map is available in
.Va dev.t4nex.%d.misc.meminfo Ns .
.It Bro Cm reg | reg64 Brc Ar addr Ns Op Ar =val
.It Cm regdump Op Ar register-block ...
Display contents of device registers.
One or more
.Ar register-block
can be specified to limit the registers displayed.
The default is to display registers for all blocks.
Registers with read side effects are not read during a
.Cm regdump
operation.
.Ar register-block
can be
.Cm sge pci dbg mc ma edc0 edc1 cim tp ulp_rx ulp_tx pmrx pmtx mps cplsw
.Cm smb i2c mi uart pmu sf pl le ncsi xgmac Ns .
.It Cm sched-class config Op Ar param Ar value
Configure optional feature capabilities for the TX scheduler.
.Bl -ohang -offset indent
.It Sy type Ar scheduler-type
Use packet for the packet scheduler.
.It Sy minmax Ar value
A non-zero value will enable "minmax" mode; a zero value will disable "minmax" mode.
.Pp
NOTE:  Many (most) of the parameters and constraints are adapter-specific
- for instance the number of channels and classes which are available
whether various modes are implemented, etc.
Consult the adapter documentation for specific information on any limitations.
.El
.It Cm sched-class params Op Ar param Ar value
Configure parameters for a scheduling class.
.Bl -ohang -offset indent
.It Sy type Ar scheduler-type
Use packet for packet scheduler.
.It Sy level Ar scheduler-hierarchy-level
The "level" within the scheduling hierarchy which is being programed:
.Pp
.Bl -tag -width "cl-wrr" -compact -offset indent
.It Sy cl-rl
Class Rate Limiting.
.Pp
.It Sy cl-wrr
Class Weighted Round Robin.
.Pp
.It Sy cl-wrr
Channel Rate Limiting.
.El
.It Sy mode Ar scheduler-mode
The mode in which the scheduling class is going to operate:
.Pp
.Bl -tag -width "class" -compact -offset indent
.It Sy class
All of the "flows" bound to the scheduling class will be held to aggregate scheduling constraints.
.Pp
.It Sy flow
Each of the "flows" bound to the scheduling class will be held to the scheduling constraints.
.El
.Pp
E.g. if the scheduling class has a TX bandwidth of 10Mb/s, in
.Cm class
mode, all of the "flows" bound to the class would be  limited  to  an
aggregate bandwidth of 10Mb/s; but in
.Cm flow
mode, each of the "flows" bound to the scheduling class would be limited to 10Mb/s.
.It Sy rate-unit Ar scheduler-rate-unit
The units of the scheduler rate constraints:
.Pp
.Bl -tag -width "bits" -compact -offset indent
.It Sy bits
bit rate in Kb/s.
.Pp
.It Sy pkts
packets/s.
.El
.It Sy rate-mode Ar scheduler-rate-mode
The mode of the scheduler rate constraints:
.Pp
.Bl -tag -width "relative" -compact -offset indent
.It Sy relative
percent of port rate.
.Pp
.It Sy absolute
Kb/s.
.El
.It Sy channel Ar scheduler-channel-index
The scheduling channel to which the scheduling class will be bound.
.It Sy class Ar scheduler-class-index
The scheduling class being programmed.
.It Sy min-rate Ar minimum-rate
The minimum guaranteed rate to which a rate-limiting scheduling class hierarchy will have access.
.It Sy max-rate Ar maximum-rate
The maximum rate for a rate-limiting scheduling class hierarchy.
.It Sy weight Ar round-robin-weight
The weight to be used for a weighted-round-robin scheduling hierarchy.
.It Sy pkt-size Ar average-packet-size
The average packet size will be used to compute scheduler constraints for a rate-limited scheduler class hierarchy.
.Pp
NOTE:  Many (most) of the parameters and constraints are adapter-specific - for instance the number of channels and classes which are available,
whether various modes are implemented, etc.
Consult the adapter documentation for specific information on any limitations.
.El
.It Cm sched-queue Ar port queue class
Bind the indicated port's NIC TX
.Ar queue
to the specified TX Scheduler
.Ar class.
If the TX
.Ar queue
is
.Cm all, *
or any negative value, the binding will apply to
all  of  the TX queues associated with the
.Ar interface.
If the class is
.Cm unbind, clear
or any negative value, the TX queue(s) will be unbound from
any current TX Scheduler Class binding.
.It Cm stdio
Switch to interactive mode.
.It Cm tcb Ar tid
Display contents of the hardware TCB (TCP Control Block) for the
connection identfied by
.Ar tid Ns .
.El
.Sh FILES
/sys/dev/cxgbe/t4_ioctl.h
.Sh AUTHORS
This manual page was written by
.An Navdeep Parhar Aq np@FreeBSD.org .