]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - usr.sbin/cxgbetool/cxgbetool.8
MFC r314579,r314785:
[FreeBSD/stable/10.git] / usr.sbin / cxgbetool / cxgbetool.8
1 .\" Copyright (c) 2015, Chelsio Inc
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions are met:
6 .\"
7 .\" 1. Redistributions of source code must retain the above copyright notice,
8 .\"    this list of conditions and the following disclaimer.
9 .\"
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" 3. Neither the name of the Chelsio Inc nor the names of its
15 .\"    contributors may be used to endorse or promote products derived from
16 .\"    this software without specific prior written permission.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
29 .\"
30 .\" * Other names and brands may be claimed as the property of others.
31 .\"
32 .\" $FreeBSD$
33 .\"
34 .Dd March 6, 2017
35 .Dt CXGBETOOL 8
36 .Os
37 .Sh NAME
38 .Nm cxgbetool
39 .Nd Userspace companion to
40 .Xr cxgbe 4
41 .Sh SYNOPSIS
42 .Bl -item -compact
43 .It
44 .Nm Ar nexus command Op Ar parameter ...
45 .Pp
46 .It
47 .Nm Ar nexus Cm clearstats Ar port_id
48 .It
49 .Nm Ar nexus Cm context Bro Cm ingress | egress | fl | cong Brc Ar cntxt_id
50 .It
51 .Nm Ar nexus Cm filter mode Op Ar match-criteria ...
52 .It
53 .Nm Ar nexus Cm filter Ar idx Bro Ar filter-specification | Cm delete Brc
54 .It
55 .Nm Ar nexus Cm filter list
56 .It
57 .Nm Ar nexus Cm i2c Ar port_id devaddr addr Op Ar len
58 .It
59 .Nm Ar nexus Cm loadcfg Ar fw-config.txt
60 .It
61 .Nm Ar nexus Cm loadcfg clear
62 .It
63 .Nm Ar nexus Cm loadfw Ar fw-image.bin
64 .It
65 .Nm Ar nexus Cm memdump Ar addr len
66 .It
67 .Nm Ar nexus Bro Cm reg | reg64 Brc Ar addr Ns Op Ar =val
68 .It
69 .Nm Ar nexus Cm regdump Op Ar register-block ...
70 .It
71 .Nm Ar nexus Cm sched-class Ar sub-command Op Ar param Ar value
72 .It
73 .Nm Ar nexus Cm sched-queue Ar port Ar queue Ar class
74 .It
75 .Nm Ar nexus Cm stdio
76 .It
77 .Nm Ar nexus Cm tcb Ar tid
78 .El
79 .Sh DESCRIPTION
80 .Nm
81 provides command-line access to features and debug facilities exported by
82 .Xr cxgbe 4
83 via private ioctls.
84 The target nexus device,
85 .Va t4nex%d
86 , is always the first argument.
87 (The parent nexus for an Ethernet port
88 .Va cxgbe%d
89 is listed in
90 .Va dev.cxgbe.%d.%parent
91 in the
92 .Xr sysctl 8
93 MIB).
94 The rest consists of a command and any parameters required by that command.
95 .Ss Commands
96 .Bl -ohang
97 .It Cm clearstats Ar port_id
98 Clear all transmit, receive, and error statistics of all queues associated
99 with a port.
100 The total number of ports attached to a nexus is listed in
101 .Va dev.t4nex.%d.nports
102 and the 0 based
103 .Ar port_id
104 identifies a port within this range.
105 .Pp
106 .Bl -item -compact
107 .It
108 .Cm context ingress Ar ingress_cntxt_id
109 .It
110 .Cm context cong Ar ingress_cntxt_id
111 .It
112 .Cm context egress Ar egress_cntxt_id
113 .It
114 .Cm context fl Ar flm_cntxt_id
115 .El
116 Display hardware context for an ingress queue, congestion manager, egress
117 queue, or freelist manager.
118 .Bl -tag -width ingress_cntxt_id -compact
119 .It Ar ingress_cntxt_id
120 context id of an ingress queue -- the value listed in one of
121 .Va dev.t4nex.%d.fwq.cntxt_id Ns ,
122 .Va dev.cxgbe.%d.rxq.%d.cntxt_id Ns ,
123 or
124 .Va dev.cxgbe.%d.ofld_rxq.%d.cntxt_id Ns .
125 .It Ar egress_cntxt_id
126 context id of an egress queue -- the value listed in one of
127 .Va dev.t4nex.%d.mgmtq.cntxt_id Ns ,
128 .Va dev.cxgbe.%d.txq.%d.cntxt_id Ns ,
129 .Va dev.cxgbe.%d.ctrlq.%d.cntxt_id Ns ,
130 .Va dev.cxgbe.%d.ofld_txq.%d.cntxt_id Ns ,
131 .Va dev.cxgbe.%d.rxq.%d.fl.cntxt_id Ns ,
132 or
133 .Va dev.cxgbe.%d.ofld_rxq.%d.fl.cntxt_id Ns .
134 Note that freelists are egress queues too.
135 .It Ar flm_cntxt_id
136 context id of a freelist manager.
137 The FLM context id is displayed in the
138 egress context dump of a freelist as FLMcontextID.
139 .El
140 .It Cm filter mode Op Ar match-criteria ...
141 Display or set the nexus's filter mode.
142 .Ar match-criteria
143 is a whitespace separated list of criteria from the table below.
144 Each criteria has an associated budget which is also listed in the table.
145 The total budget allowed is 36 and attempts to set a filter mode that
146 exceeds this will be rejected.
147 Every filter must conform to the filter mode -- multiple match criteria
148 per filter are allowed but only from among those in the current setting
149 of the filter mode.
150 The filter mode can only be changed when there are no existing filters.
151 Its default value is
152 .Cm ipv4 ipv6 sip dip sport dport matchtype proto vlan iport fcoe
153 .Pp
154 (Note that
155 .Ar mask
156 defaults to all 1s when not provided explicitly.
157 Also note that many of the items being matched are discrete numeric
158 values rather than bit fields and should be masked with caution.)
159 .TS
160 center expand;
161 cb cb cb cbw(40m)
162 cb c l l.
163 Criteria        Budget  Usage   Matches if ...
164 _
165 ipv4    0       T{
166 .Cm type ipv4
167 T}      T{
168 incoming packet is an IPv4 datagram.
169 T}
170 _
171 ipv6    0       T{
172 .Cm type ipv6
173 T}      T{
174 incoming packet is an IPv6 datagram.
175 T}
176 _
177 sip     0       T{
178 .Cm sip Ar addr Ns Op / Ns Ar mask
179 T}      T{
180 bitwise and of the source address in an incoming IP datagram with
181 .Ar mask
182 equals
183 .Ar addr Ns .
184 .Ar addr
185 can be an IPv4 or IPv6 address.
186 T}
187 _
188 dip     0       T{
189 .Cm dip Ar addr Ns Op / Ns Ar mask
190 T}      T{
191 bitwise and of the destination address in an incoming IP datagram with
192 .Ar mask
193 equals
194 .Ar addr Ns .
195 .Ar addr
196 can be an IPv4 or IPv6 address.
197 T}
198 _
199 sport   0       T{
200 .Cm sport Ar port Ns Op : Ns Ar mask
201 T}      T{
202 bitwise and of the source port in an incoming TCP or UDP datagram with
203 .Ar mask
204 equals
205 .Ar port Ns .
206 T}
207 _
208 dport   0       T{
209 .Cm dport Ar port Ns Op : Ns Ar mask
210 T}      T{
211 bitwise and of the destination port in an incoming TCP or UDP datagram with
212 .Ar mask
213 equals
214 .Ar port Ns .
215 T}
216 _
217 fcoe    1       T{
218 .Cm fcoe Brq 0 | 1
219 T}      T{
220 incoming frame is Fibre Channel over Ethernet(1) or not(0).
221 T}
222 _
223 iport   3       T{
224 .Cm iport Ar val Ns Op : Ns Ar mask
225 T}      T{
226 bitwise and of the ingress port with
227 .Ar mask
228 equals
229 .Ar val Ns .
230 The ingress port is a 3 bit number that identifies the port on which a
231 frame arrived.
232 Physical ports are numbered 0-3 and 4-7 are internal loopback paths
233 within the chip.
234 Note that ingress port is not a bit field so it is not always possible
235 to match an arbitrary subset of ingress ports with a single filter rule.
236 T}
237 _
238 ovlan   17      T{
239 .Cm ovlan Ar tag Ns Op : Ns Ar mask
240 T}      T{
241 bitwise and of the 16-bit outer VLAN tag of an incoming frame with
242 .Ar mask
243 equals
244 .Ar tag Ns .
245 T}
246 _
247 vlan    17      T{
248 .Cm vlan Ar tag Ns Op : Ns Ar mask
249 T}      T{
250 bitwise and of the 16-bit VLAN tag of an incoming QinQ frame with
251 .Ar mask
252 equals
253 .Ar tag Ns .
254 The inner VLAN tag is used if the incoming frame is QinQ.
255 T}
256 _
257 tos     8       T{
258 .Cm tos Ar val Ns Op : Ns Ar mask
259 T}      T{
260 bitwise and of the 8-bit IP Type of Service/IPv6 Traffic Class in an
261 incoming packet with
262 .Ar mask
263 equals
264 .Ar val Ns .
265 T}
266 _
267 proto   8       T{
268 .Cm proto Ar ipproto Ns Op : Ns Ar mask
269 T}      T{
270 bitwise and of the 8-bit IP protocol in an incoming packet with
271 .Ar mask
272 equals
273 .Ar ipproto Ns .
274 T}
275 _
276 ethtype 16      T{
277 .Cm ethtype Ar type Ns Op : Ns Ar mask
278 T}      T{
279 bitwise and of the 16-bit Ethernet type field of an incoming frame with
280 .Ar mask
281 equals
282 .Ar type Ns .
283 T}
284 _
285 macidx  9       T{
286 .Cm macidx Ar idx Ns Op : Ns Ar mask
287 T}      T{
288 bitwise and of the MAC Address Match Index of an incoming frame with
289 .Ar mask
290 equals
291 .Ar idx Ns .
292 The MAC Address Match Index refers to an entry in the MPS TCAM or in the
293 MPS hash.  See
294 .Cm matchtype
295 for more information.
296 T}
297 _
298 matchtype       3       T{
299 .Cm matchtype Ar type Ns Op : Ns Ar mask
300 T}      T{
301 bitwise and of the Match Type of an incoming frame with
302 .Ar mask
303 equals
304 .Ar idx Ns .
305 Match Type is one of the following:
306 .Bl -tag -width "n" -compact
307 .It 0
308 destination MAC in incoming frame is a unicast L2 address that is
309 programmed in the MPS TCAM.
310 .Cm macidx
311 can be used to match the index (and thus the MAC address) of the match
312 in the TCAM.
313 .It 1
314 destination MAC in incoming frame is a unicast L2 address that "hit" a
315 hash entry in the MPS hash table.
316 .Cm macidx
317 can be used to match the index of the entry in the MPS hash table.
318 .It 2
319 destination MAC in incoming frame is a multicast L2 address that is
320 programmed in the MPS TCAM.
321 .Cm macidx
322 can be used to match the index (and thus the MAC address) of the match
323 in the TCAM.
324 .It 3
325 destination MAC in incoming frame is a multicast L2 address that "hit"
326 an entry in the MPS hash table.
327 .It 4
328 interface on which incoming frame was received is in promiscuous mode
329 and the destination MAC in the frame is not a broadcast address, and
330 does not match in the MPS TCAM or the MPS hash either.  (The frame would
331 have been discarded if the interface wasn't in promiscuous mode.)
332 .It 5
333 interface on which incoming frame was received is in promiscuous mode
334 and the destination MAC in the frame is not a broadcast address; it
335 wasn't looked up in the MPS TCAM or the MPS hash because the chip is
336 configured to give precedence to promiscuous mode classification.
337 .It 6
338 destination MAC in incoming frame is a broadcast address.
339 .It 7
340 Not documented.  Do not use.
341 .El
342 T}
343 _
344 frag    1       T{
345 .Cm frag Brq 0 | 1
346 T}      T{
347 incoming frame is part of a fragmented IP datagram(1) or not(0).
348 T}
349 .TE
350 .It Cm filter Ar idx Ar filter-specification
351 Program a filter at the index specified by
352 .Ar idx Ns .
353 .Ar filter-specification
354 consists of one or more matches to try against an incoming frame and an
355 action to perform when all matches succeed.
356 .It Cm filter Ar idx Cm delete
357 Delete filter that is at the given index.
358 .It Cm filter Cm list
359 List all filters programmed into the hardware.
360 .It Cm i2c Ar port_id devaddr addr Op Ar len
361 .It Cm loadcfg Ar fw-config.txt
362 Install the firmware configuration file contained in
363 .Ar fw-config.txt
364 to the card.
365 Set hw.cxgbe.config_file="flash" in loader.conf to get
366 .Xr cxgbe 4
367 to use the on-flash configuration.
368 .It Cm loadcfg Cm clear
369 Erase configuration file from the card.
370 .It Cm loadfw Ar fw-image.bin
371 Install the firmware contained in
372 .Ar fw-image.bin
373 to the card.
374 .It Cm memdump Ar addr len
375 Display
376 .Ar len
377 bytes of data of the card's memory starting at
378 .Ar addr Ns .
379 The card's memory map is available in
380 .Va dev.t4nex.%d.misc.meminfo Ns .
381 .It Bro Cm reg | reg64 Brc Ar addr Ns Op Ar =val
382 .It Cm regdump Op Ar register-block ...
383 Display contents of device registers.
384 One or more
385 .Ar register-block
386 can be specified to limit the registers displayed.
387 The default is to display registers for all blocks.
388 Registers with read side effects are not read during a
389 .Cm regdump
390 operation.
391 .Ar register-block
392 can be
393 .Cm sge pci dbg mc ma edc0 edc1 cim tp ulp_rx ulp_tx pmrx pmtx mps cplsw
394 .Cm smb i2c mi uart pmu sf pl le ncsi xgmac Ns .
395 .It Cm sched-class config Op Ar param Ar value
396 Configure optional feature capabilities for the TX scheduler.
397 .Bl -ohang -offset indent
398 .It Sy type Ar scheduler-type
399 Use packet for the packet scheduler.
400 .It Sy minmax Ar value
401 A non-zero value will enable "minmax" mode; a zero value will disable "minmax" mode.
402 .Pp
403 NOTE:  Many (most) of the parameters and constraints are adapter-specific
404 - for instance the number of channels and classes which are available
405 whether various modes are implemented, etc.
406 Consult the adapter documentation for specific information on any limitations.
407 .El
408 .It Cm sched-class params Op Ar param Ar value
409 Configure parameters for a scheduling class.
410 .Bl -ohang -offset indent
411 .It Sy type Ar scheduler-type
412 Use packet for packet scheduler.
413 .It Sy level Ar scheduler-hierarchy-level
414 The "level" within the scheduling hierarchy which is being programed:
415 .Pp
416 .Bl -tag -width "cl-wrr" -compact -offset indent
417 .It Sy cl-rl
418 Class Rate Limiting.
419 .Pp
420 .It Sy cl-wrr
421 Class Weighted Round Robin.
422 .Pp
423 .It Sy cl-wrr
424 Channel Rate Limiting.
425 .El
426 .It Sy mode Ar scheduler-mode
427 The mode in which the scheduling class is going to operate:
428 .Pp
429 .Bl -tag -width "class" -compact -offset indent
430 .It Sy class
431 All of the "flows" bound to the scheduling class will be held to aggregate scheduling constraints.
432 .Pp
433 .It Sy flow
434 Each of the "flows" bound to the scheduling class will be held to the scheduling constraints.
435 .El
436 .Pp
437 E.g. if the scheduling class has a TX bandwidth of 10Mb/s, in
438 .Cm class
439 mode, all of the "flows" bound to the class would be  limited  to  an
440 aggregate bandwidth of 10Mb/s; but in
441 .Cm flow
442 mode, each of the "flows" bound to the scheduling class would be limited to 10Mb/s.
443 .It Sy rate-unit Ar scheduler-rate-unit
444 The units of the scheduler rate constraints:
445 .Pp
446 .Bl -tag -width "bits" -compact -offset indent
447 .It Sy bits
448 bit rate in Kb/s.
449 .Pp
450 .It Sy pkts
451 packets/s.
452 .El
453 .It Sy rate-mode Ar scheduler-rate-mode
454 The mode of the scheduler rate constraints:
455 .Pp
456 .Bl -tag -width "relative" -compact -offset indent
457 .It Sy relative
458 percent of port rate.
459 .Pp
460 .It Sy absolute
461 Kb/s.
462 .El
463 .It Sy channel Ar scheduler-channel-index
464 The scheduling channel to which the scheduling class will be bound.
465 .It Sy class Ar scheduler-class-index
466 The scheduling class being programmed.
467 .It Sy min-rate Ar minimum-rate
468 The minimum guaranteed rate to which a rate-limiting scheduling class hierarchy will have access.
469 .It Sy max-rate Ar maximum-rate
470 The maximum rate for a rate-limiting scheduling class hierarchy.
471 .It Sy weight Ar round-robin-weight
472 The weight to be used for a weighted-round-robin scheduling hierarchy.
473 .It Sy pkt-size Ar average-packet-size
474 The average packet size will be used to compute scheduler constraints for a rate-limited scheduler class hierarchy.
475 .Pp
476 NOTE:  Many (most) of the parameters and constraints are adapter-specific - for instance the number of channels and classes which are available,
477 whether various modes are implemented, etc.
478 Consult the adapter documentation for specific information on any limitations.
479 .El
480 .It Cm sched-queue Ar port queue class
481 Bind the indicated port's NIC TX
482 .Ar queue
483 to the specified TX Scheduler
484 .Ar class.
485 If the TX
486 .Ar queue
487 is
488 .Cm all, *
489 or any negative value, the binding will apply to
490 all  of  the TX queues associated with the
491 .Ar interface.
492 If the class is
493 .Cm unbind, clear
494 or any negative value, the TX queue(s) will be unbound from
495 any current TX Scheduler Class binding.
496 .It Cm stdio
497 Switch to interactive mode.
498 .It Cm tcb Ar tid
499 Display contents of the hardware TCB (TCP Control Block) for the
500 connection identfied by
501 .Ar tid Ns .
502 .El
503 .Sh FILES
504 /sys/dev/cxgbe/t4_ioctl.h
505 .Sh AUTHORS
506 This manual page was written by
507 .An Navdeep Parhar Aq np@FreeBSD.org .