]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/cxgbetool/cxgbetool.8
Merge lld trunk r338150, and resolve conflicts.
[FreeBSD/FreeBSD.git] / usr.sbin / cxgbetool / cxgbetool.8
1 .\" Copyright (c) 2015, 2018 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 May 14, 2018
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 hashfilter mode
52 .It
53 .Nm Ar nexus Cm hashfilter Ar filter-specification
54 .It
55 .Nm Ar nexus Cm hashfilter Ar idx Cm delete
56 .It
57 .Nm Ar nexus Cm hashfilter list
58 .It
59 .Nm Ar nexus Cm filter mode
60 .It
61 .Nm Ar nexus Cm filter Ar idx Ar filter-specification
62 .It
63 .Nm Ar nexus Cm filter Ar idx Cm delete
64 .It
65 .Nm Ar nexus Cm filter list
66 .It
67 .Nm Ar nexus Cm i2c Ar port_id devaddr addr Op Ar len
68 .It
69 .Nm Ar nexus Cm loadcfg Ar fw-config.txt
70 .It
71 .Nm Ar nexus Cm loadcfg clear
72 .It
73 .Nm Ar nexus Cm loadfw Ar fw-image.bin
74 .It
75 .Nm Ar nexus Cm memdump Ar addr len
76 .It
77 .Nm Ar nexus Cm policy Ar cop.txt
78 .It
79 .Nm Ar nexus Cm policy clear
80 .It
81 .Nm Ar nexus Bro Cm reg | reg64 Brc Ar addr Ns Op Ar =val
82 .It
83 .Nm Ar nexus Cm regdump Op Ar register-block ...
84 .It
85 .Nm Ar nexus Cm sched-class Ar sub-command Op Ar param Ar value
86 .It
87 .Nm Ar nexus Cm sched-queue Ar port Ar queue Ar class
88 .It
89 .Nm Ar nexus Cm stdio
90 .It
91 .Nm Ar nexus Cm tcb Ar tid
92 .El
93 .Sh DESCRIPTION
94 .Nm
95 provides command-line access to features and debug facilities exported by
96 .Xr cxgbe 4
97 via private ioctls.
98 The target nexus device,
99 .Va t4nex%d
100 , is always the first argument.
101 (The parent nexus for an Ethernet port
102 .Va cxgbe%d
103 is listed in
104 .Va dev.cxgbe.%d.%parent
105 in the
106 .Xr sysctl 8
107 MIB).
108 The rest consists of a command and any parameters required by that command.
109 .Ss Commands
110 .Bl -ohang
111 .It Cm clearstats Ar port_id
112 Clear all transmit, receive, and error statistics of all queues associated
113 with a port.
114 The total number of ports attached to a nexus is listed in
115 .Va dev.t4nex.%d.nports
116 and the 0 based
117 .Ar port_id
118 identifies a port within this range.
119 .Pp
120 .Bl -item -compact
121 .It
122 .Cm context ingress Ar ingress_cntxt_id
123 .It
124 .Cm context cong Ar ingress_cntxt_id
125 .It
126 .Cm context egress Ar egress_cntxt_id
127 .It
128 .Cm context fl Ar flm_cntxt_id
129 .El
130 Display hardware context for an ingress queue, congestion manager, egress
131 queue, or freelist manager.
132 .Bl -tag -width ingress_cntxt_id -compact
133 .It Ar ingress_cntxt_id
134 context id of an ingress queue -- the value listed in one of
135 .Va dev.t4nex.%d.fwq.cntxt_id Ns ,
136 .Va dev.cxgbe.%d.rxq.%d.cntxt_id Ns ,
137 or
138 .Va dev.cxgbe.%d.ofld_rxq.%d.cntxt_id Ns .
139 .It Ar egress_cntxt_id
140 context id of an egress queue -- the value listed in one of
141 .Va dev.t4nex.%d.mgmtq.cntxt_id Ns ,
142 .Va dev.cxgbe.%d.txq.%d.cntxt_id Ns ,
143 .Va dev.cxgbe.%d.ctrlq.%d.cntxt_id Ns ,
144 .Va dev.cxgbe.%d.ofld_txq.%d.cntxt_id Ns ,
145 .Va dev.cxgbe.%d.rxq.%d.fl.cntxt_id Ns ,
146 or
147 .Va dev.cxgbe.%d.ofld_rxq.%d.fl.cntxt_id Ns .
148 Note that freelists are egress queues too.
149 .It Ar flm_cntxt_id
150 context id of a freelist manager.
151 The FLM context id is displayed in the
152 egress context dump of a freelist as FLMcontextID.
153 .El
154 .Pp
155 .Bl -item -compact
156 .It
157 .Cm hashfilter mode
158 .It
159 .Cm filter mode
160 .El
161 Display a list of match-criteria available for use in filter rules.
162 A full list of match-criteria known to the chip is in the table below but not
163 all can be used together and the firmware sets up the available parameters based
164 on "filterMode" in the configuration file.
165 Every filter must conform to the filter mode -- multiple match criteria per
166 filter are allowed but only from among those in the current setting of the
167 filter mode.
168 The filter mode for hash filters is a subset of that for normal TCAM filters and
169 depends on the "filterMask" setting in the firmware configuration file.
170 Hash filters do not support masked matches and an exact value for every
171 parameter in the output of "hashfilter mode" (except ipv4/ipv6) must be provided
172 when creating a hash filter.
173 .Pp
174 (Note that
175 .Ar mask
176 defaults to all 1s when not provided explicitly.
177 Hash filters do not support masked matches.
178 Also note that many of the items being matched are discrete numeric
179 values rather than bit fields and should be masked with caution.)
180 .TS
181 center expand;
182 cb cb cbw(40m)
183 cb l l.
184 Criteria        Usage   Matches if ...
185 _
186 ipv4    T{
187 .Cm type ipv4
188 T}      T{
189 incoming packet is an IPv4 datagram.
190 T}
191 _
192 ipv6    T{
193 .Cm type ipv6
194 T}      T{
195 incoming packet is an IPv6 datagram.
196 T}
197 _
198 sip     T{
199 .Cm sip Ar addr Ns Op / Ns Ar mask
200 T}      T{
201 bitwise and of the source address in an incoming IP datagram with
202 .Ar mask
203 equals
204 .Ar addr Ns .
205 .Ar addr
206 can be an IPv4 or IPv6 address.
207 T}
208 _
209 dip     T{
210 .Cm dip Ar addr Ns Op / Ns Ar mask
211 T}      T{
212 bitwise and of the destination address in an incoming IP datagram with
213 .Ar mask
214 equals
215 .Ar addr Ns .
216 .Ar addr
217 can be an IPv4 or IPv6 address.
218 T}
219 _
220 sport   T{
221 .Cm sport Ar port Ns Op : Ns Ar mask
222 T}      T{
223 bitwise and of the source port in an incoming TCP or UDP datagram with
224 .Ar mask
225 equals
226 .Ar port Ns .
227 T}
228 _
229 dport   T{
230 .Cm dport Ar port Ns Op : Ns Ar mask
231 T}      T{
232 bitwise and of the destination port in an incoming TCP or UDP datagram with
233 .Ar mask
234 equals
235 .Ar port Ns .
236 T}
237 _
238 fcoe    T{
239 .Cm fcoe Brq 0 | 1
240 T}      T{
241 incoming frame is Fibre Channel over Ethernet(1) or not(0).
242 T}
243 _
244 iport   T{
245 .Cm iport Ar val Ns Op : Ns Ar mask
246 T}      T{
247 bitwise and of the ingress port with
248 .Ar mask
249 equals
250 .Ar val Ns .
251 The ingress port is a 3 bit number that identifies the port on which a
252 frame arrived.
253 Physical ports are numbered 0-3 and 4-7 are internal loopback paths
254 within the chip.
255 Note that ingress port is not a bit field so it is not always possible
256 to match an arbitrary subset of ingress ports with a single filter rule.
257 T}
258 _
259 ovlan   T{
260 .Cm ovlan Ar tag Ns Op : Ns Ar mask
261 T}      T{
262 bitwise and of the 16-bit outer VLAN tag of an incoming frame with
263 .Ar mask
264 equals
265 .Ar tag Ns .
266 T}
267 _
268 vlan    T{
269 .Cm vlan Ar tag Ns Op : Ns Ar mask
270 T}      T{
271 bitwise and of the 16-bit VLAN tag of an incoming QinQ frame with
272 .Ar mask
273 equals
274 .Ar tag Ns .
275 The inner VLAN tag is used if the incoming frame is QinQ.
276 T}
277 _
278 tos     T{
279 .Cm tos Ar val Ns Op : Ns Ar mask
280 T}      T{
281 bitwise and of the 8-bit IP Type of Service/IPv6 Traffic Class in an
282 incoming packet with
283 .Ar mask
284 equals
285 .Ar val Ns .
286 T}
287 _
288 proto   T{
289 .Cm proto Ar ipproto Ns Op : Ns Ar mask
290 T}      T{
291 bitwise and of the 8-bit IP protocol in an incoming packet with
292 .Ar mask
293 equals
294 .Ar ipproto Ns .
295 T}
296 _
297 ethtype T{
298 .Cm ethtype Ar type Ns Op : Ns Ar mask
299 T}      T{
300 bitwise and of the 16-bit Ethernet type field of an incoming frame with
301 .Ar mask
302 equals
303 .Ar type Ns .
304 T}
305 _
306 macidx  T{
307 .Cm macidx Ar idx Ns Op : Ns Ar mask
308 T}      T{
309 bitwise and of the MAC Address Match Index of an incoming frame with
310 .Ar mask
311 equals
312 .Ar idx Ns .
313 The MAC Address Match Index refers to an entry in the MPS TCAM or in the
314 MPS hash.  See
315 .Cm matchtype
316 for more information.
317 T}
318 _
319 matchtype       T{
320 .Cm matchtype Ar type Ns Op : Ns Ar mask
321 T}      T{
322 bitwise and of the Match Type of an incoming frame with
323 .Ar mask
324 equals
325 .Ar idx Ns .
326 Match Type is one of the following:
327 .Bl -tag -width "n" -compact
328 .It 0
329 destination MAC in incoming frame is a unicast L2 address that is
330 programmed in the MPS TCAM.
331 .Cm macidx
332 can be used to match the index (and thus the MAC address) of the match
333 in the TCAM.
334 .It 1
335 destination MAC in incoming frame is a unicast L2 address that "hit" a
336 hash entry in the MPS hash table.
337 .Cm macidx
338 can be used to match the index of the entry in the MPS hash table.
339 .It 2
340 destination MAC in incoming frame is a multicast L2 address that is
341 programmed in the MPS TCAM.
342 .Cm macidx
343 can be used to match the index (and thus the MAC address) of the match
344 in the TCAM.
345 .It 3
346 destination MAC in incoming frame is a multicast L2 address that "hit"
347 an entry in the MPS hash table.
348 .It 4
349 interface on which incoming frame was received is in promiscuous mode
350 and the destination MAC in the frame is not a broadcast address, and
351 does not match in the MPS TCAM or the MPS hash either.  (The frame would
352 have been discarded if the interface wasn't in promiscuous mode.)
353 .It 5
354 interface on which incoming frame was received is in promiscuous mode
355 and the destination MAC in the frame is not a broadcast address; it
356 wasn't looked up in the MPS TCAM or the MPS hash because the chip is
357 configured to give precedence to promiscuous mode classification.
358 .It 6
359 destination MAC in incoming frame is a broadcast address.
360 .It 7
361 Not documented.  Do not use.
362 .El
363 T}
364 _
365 frag    T{
366 .Cm frag Brq 0 | 1
367 T}      T{
368 incoming frame is part of a fragmented IP datagram(1) or not(0).
369 T}
370 .TE
371 .Pp
372 .Bl -item -compact
373 .It
374 .Cm hashfilter Ar filter-specification
375 .It
376 .Cm filter Ar idx Ar filter-specification
377 .El
378 Program a filter.
379 .Pp
380 TCAM filters: The number of available filters is in
381 dev.<nexus>.<instance>.nfilters.
382 .Ar idx
383 must be an unused index between 0 and nfilters - 1.
384 IPv6 filters consume 4 consecutive entries on T4/T5 and and 2 on T6 and
385 .Ar idx
386 must be aligned to 4 or 2 in this case.
387 .Pp
388 Hash filters:  These reside in the card's memory instead of its TCAM and are
389 enabled with a special configuration file that is selected with
390 .Cm hw.cxgbe.config_file="hashfilter"
391 in loader.conf.
392 There are at least half a million filters available with the sample config
393 shipped with the driver.
394 Note that the hardware selects the index for a hashfilter and this index is
395 displayed when the filter is created.
396 Hash and TCAM filters can be used together.
397 .Pp
398 .Ar filter-specification
399 consists of one or more matches (see Usage in the table above) to try against an
400 incoming frame, an action to perform when all matches succeed, and some
401 additional operational parameters.
402 Hashfilters require an exact value for the 5-tuple (sip, dip, sport, dport,
403 proto) and for any other match-criteria listed in "hashfilter mode".
404 Possible filter actions are
405 .Cm drop Ns ,
406 .Cm pass Ns , or
407 .Cm switch Ns .
408 .Pp
409 .Bl -tag -width nat_dport -offset indent -compact
410 Operational parameters that can be used with all filters:
411 .It Cm hitcnts
412 Count filter hits: 0 or 1 (default).
413 .It Cm prio
414 Filter has priority over active and server regions of TCAM: 0 (default) or 1.
415 .El
416 .Pp
417 .Bl -tag -width nat_dport -offset indent -compact
418 Operational parameters that can be used with filters with
419 .Cm action pass Ns :
420 .It Cm queue
421 Rx queue index to which to deliver the packet.  By default, packets that hit a
422 filter with action pass are delivered based on their RSS hash as usual.  Use
423 this to steer them to a particular queue.
424 .It Cm rpttid
425 Report the filter tid instead of the RSS hash in the rx descriptor.
426 0 (default) or 1.
427 .It Cm tcbhash
428 Select TCB hash information in rx descriptor.
429 0 (default) or 1
430 .El
431 .Pp
432 .Bl -tag -width nat_dport -offset indent -compact
433 Operational parameters that can be used with filters with
434 .Cm action switch Ns :
435 .It Cm eport
436 Egress port number on which to send the packet matching the filter.
437 0 to dev.<nexus>.<instance>.nports - 1.
438 .It Cm dmac
439 Replace packet destination MAC address with the one provided before switching
440 it out of eport.
441 .It Cm smac
442 Replace packet source MAC address with the one provided before switching it
443 out of eport.
444 .It Cm swapmac
445 Swap packet source and destination MAC addresses before switching it out of
446 eport.
447 .It Cm vlan
448 Insert, remove, or rewrite the VLAN tag before switching the packet out of
449 eport.
450 .Cm vlan=none
451 removes the tag,
452 .Cm vlan= Ns Ar tag
453 replaces the existing tag with the one provided, and
454 .Cm vlan=+ Ns Ar tag
455 inserts the given tag into the frame.
456 .It Cm nat
457 Specify the desired NAT mode. Valid NAT modes values are:
458 .Bl -tag -width dip-dp-sip -compact
459 .It Cm dip
460 Perform NAT on destination IP.
461 .It Cm dip-dp
462 Perform NAT on destination IP, destination port.
463 .It Cm dip-dp-sip
464 Perform NAT on destination IP, destination port, source IP.
465 .It Cm dip-dp-sp
466 Perform NAT on destination IP, destination port, source port.
467 .It Cm sip-sp
468 Perform NAT on source IP, source port.
469 .It Cm dip-sip-sp
470 Perform NAT on destination IP, source IP, source port.
471 .It Cm all
472 Perform NAT on all 4-tuple fields.
473 .El
474 .It Cm natflag
475 Perform NAT only on segments which do not have TCP FIN or RST set.
476 .It Cm natseq
477 Perform NAT only if incoming segment's sequence number + payload length is less
478 than this supplied value.
479 .It Cm nat_dip
480 Perform NAT using this destination IP.
481 .It Cm nat_sip
482 Perform NAT using this source IP.
483 .It Cm nat_dport
484 Perform NAT using this destination port.
485 .It Cm nat_sport
486 Perform NAT using this source port.
487 Perform NAT only if incoming segment's sequence number + payload length is less
488 than this supplied value.
489 .El
490 .Pp
491 .Bl -item -compact
492 .It
493 .Cm hashfilter Ar idx Cm delete
494 .It
495 .Cm filter Ar idx Cm delete
496 .El
497 Delete filter that is at the given index.
498 .It Cm filter Cm list
499 List all filters programmed into the hardware.
500 .It Cm i2c Ar port_id devaddr addr Op Ar len
501 .It Cm loadcfg Ar fw-config.txt
502 Install the firmware configuration file contained in
503 .Ar fw-config.txt
504 to the card.
505 Set hw.cxgbe.config_file="flash" in loader.conf to get
506 .Xr cxgbe 4
507 to use the on-flash configuration.
508 .It Cm loadcfg Cm clear
509 Erase configuration file from the card.
510 .It Cm loadfw Ar fw-image.bin
511 Install the firmware contained in
512 .Ar fw-image.bin
513 to the card.
514 .It Cm memdump Ar addr len
515 Display
516 .Ar len
517 bytes of data of the card's memory starting at
518 .Ar addr Ns .
519 The card's memory map is available in
520 .Va dev.t4nex.%d.misc.meminfo Ns .
521 .It Cm policy Ar cop.txt
522 Install the Connection Offload Policy (COP) in
523 .Ar cop.txt Ns .
524 A COP offers fine-grained control over which connections get offloaded and with
525 what parameters.
526 Set
527 .Cm hw.cxgbe.cop_managed_offloading="1"
528 in loader.conf to ensure that t4_tom will not offload any connection before a
529 COP is installed.
530 Note that t4_tom must be loaded and operational (IFCAP_TOE enabled) as always
531 for any kind of offload based on the hardware TOE.
532 .Bl -column -offset indent "COP installed" "cop_managed_offloading" "Behavior"
533 .It Sy COP installed Ta Sy cop_managed_offloading Ta Sy Behavior
534 .It NO Ta 0 Ta offload all [Default]
535 .It NO Ta 1 Ta no offload
536 .It YES Ta Don't Care Ta Rule based offload
537 .El
538 .Pp
539 The policy file consists of empty lines, comments (lines begining with #) and
540 any number of rules.
541 Rules are applied in the order they appear in the file and processing stops at
542 the first match.
543 There is an implicit rule that disables offload for connections that do not
544 match anything in the policy.
545 .Pp
546 Each rule consists of a filter part, which determines what connections the
547 rule applies to, and a settings part, which determines whether whether matching
548 connections will be offloaded and, if so, with what settings.
549 The general form of a rule is
550 .Bl -ohang -offset indent
551 .It Cm \&[ Ar socket-type Cm \&] Ar pcap-filter Cm => Ar settings
552 .Pp
553 .Ar socket-type
554 is one of the following.
555 .Bl -tag -width "X" -compact
556 .It Sy A
557 Active open.
558 Connection is being opened by this host.
559 .It Sy P
560 Passive open.
561 Connection was requested by a peer.
562 .It Sy L
563 Listen called on a socket.
564 Disabling offload in such a rule will prevent a hardware listener from being started.
565 .It Sy D
566 Don't care.
567 Matches all of the above.
568 .El
569 .Pp
570 .Ar pcap-filter
571 is an expression that follows the
572 .Xr pcap-filter 7
573 syntax, or it is the keyword
574 .Cm all
575 that matches everything.
576 .Pp
577 .Ar settings
578 determine whether connections matching
579 .Ar socket-type
580 and
581 .Ar pcap-filter
582 are offloaded and optionally sets some per-connection properties if they are.
583 A combination of the following is allowed.
584 .Bl -tag -width "timestamp" -compact
585 .It Cm offload
586 Connection should be offloaded.
587 Use
588 .Cm !offload
589 or
590 .Cm not offload
591 to disable offload instead.
592 .It Cm coalesce
593 Enable rx payload coalescing.
594 Negate to disable.
595 .It Cm timestamp
596 Enable TCP timestamp option.
597 Negate to disable.
598 .It Cm sack
599 Enable TCP Selective Acknowledgements (SACK).
600 Negate to disable.
601 .It Cm nagle
602 Enable Nagle's algorithm.
603 Negate to disable.
604 .It Cm ecn
605 Enable Explicit Congestion Notification (ECN).
606 Negate to disable.
607 .It Cm ddp
608 Use Direct Data Placement (zero copy receive) and zero copy transmit on the
609 connection to service AIO requests on the socket.
610 Negate to disable.
611 .It Cm tls
612 Set ULP mode to ULP_MODE_TLS.
613 .It Cm cong Ar algo
614 Use the specified congestion control algorithm.
615 .Ar algo
616 must be one of
617 .Cm reno Ns , Cm tahoe Ns , Cm newreno Ns , or Cm highspeed Ns .
618 .It Cm class Ar sc
619 Bind the connection to the specified tx scheduling class.
620 Valid range is 0 to 14 (for T4) and 0 to 15 (T5 onwards).
621 .It Cm rxq Ar qid
622 Use the specified offload rx queue.
623 .Ar qid
624 should be between 0 and nofldrxq for the ifnet.
625 .It Cm txq Ar qnum
626 Use the specified offload tx queue.
627 .Ar qid
628 should be between 0 and nofldtxq for the ifnet.
629 .It Cm bind Ar qnum
630 Shorthand for
631 .Cm rxq Ar qnum Cm txq Ar qnum Ns .
632 Use only when nofldrxq is the same as nofldtxq.
633 .It Cm mss Ar val
634 Set the advertised TCP MSS in the SYN for this connection to
635 .Ar val
636 (in bytes).
637 The hardware MTU table must already have an entry that is suitable for the MSS.
638 .El
639 .Pp
640 .It Example of a COP.
641 Note that hardware listener for port 22 will be IPv4 only because the rule
642 before it will prevent any IPv6 servers other than the first two.  Also note
643 that outgoing connections to 192.168/16 are the only outgoing connections that
644 will get offloaded.
645 .Bd -literal
646 [L] port 80 => offload
647 [L] port 443 => offload
648 [L] ip6 => !offload
649 [L] port 22 => offload
650 [P] dst port 80 => offload cong highspeed !sack !ecn
651 [P] dst port 443 => offload tls
652 [A] dst net 192.168/16 => offload
653 [A] all => !offload
654 [D] port 22 => offload !nagle
655 .Ed
656 .El
657 .It Cm policy clear
658 Remove the Connection Offload Policy (COP) if one is in use.
659 .It Bro Cm reg | reg64 Brc Ar addr Ns Op Ar =val
660 .It Cm regdump Op Ar register-block ...
661 Display contents of device registers.
662 One or more
663 .Ar register-block
664 can be specified to limit the registers displayed.
665 The default is to display registers for all blocks.
666 Registers with read side effects are not read during a
667 .Cm regdump
668 operation.
669 .Ar register-block
670 can be
671 .Cm sge pci dbg mc ma edc0 edc1 cim tp ulp_rx ulp_tx pmrx pmtx mps cplsw
672 .Cm smb i2c mi uart pmu sf pl le ncsi xgmac Ns .
673 .It Cm sched-class config Op Ar param Ar value
674 Configure optional feature capabilities for the TX scheduler.
675 .Bl -ohang -offset indent
676 .It Sy type Ar scheduler-type
677 Use packet for the packet scheduler.
678 .It Sy minmax Ar value
679 A non-zero value will enable "minmax" mode; a zero value will disable "minmax" mode.
680 .Pp
681 NOTE:  Many (most) of the parameters and constraints are adapter-specific
682 - for instance the number of channels and classes which are available
683 whether various modes are implemented, etc.
684 Consult the adapter documentation for specific information on any limitations.
685 .El
686 .It Cm sched-class params Op Ar param Ar value
687 Configure parameters for a scheduling class.
688 .Bl -ohang -offset indent
689 .It Sy type Ar scheduler-type
690 Use packet for packet scheduler.
691 .It Sy level Ar scheduler-hierarchy-level
692 The "level" within the scheduling hierarchy which is being programed:
693 .Pp
694 .Bl -tag -width "cl-wrr" -compact -offset indent
695 .It Sy cl-rl
696 Class Rate Limiting.
697 .Pp
698 .It Sy cl-wrr
699 Class Weighted Round Robin.
700 .Pp
701 .It Sy ch-rl
702 Channel Rate Limiting.
703 .El
704 .It Sy mode Ar scheduler-mode
705 The mode in which the scheduling class is going to operate:
706 .Pp
707 .Bl -tag -width "class" -compact -offset indent
708 .It Sy class
709 All of the "flows" bound to the scheduling class will be held to aggregate scheduling constraints.
710 .Pp
711 .It Sy flow
712 Each of the "flows" bound to the scheduling class will be held to the scheduling constraints.
713 .El
714 .Pp
715 E.g. if the scheduling class has a TX bandwidth of 10Mb/s, in
716 .Cm class
717 mode, all of the "flows" bound to the class would be  limited  to  an
718 aggregate bandwidth of 10Mb/s; but in
719 .Cm flow
720 mode, each of the "flows" bound to the scheduling class would be limited to 10Mb/s.
721 .It Sy rate-unit Ar scheduler-rate-unit
722 The units of the scheduler rate constraints:
723 .Pp
724 .Bl -tag -width "bits" -compact -offset indent
725 .It Sy bits
726 bit rate in Kb/s.
727 .Pp
728 .It Sy pkts
729 packets/s.
730 .El
731 .It Sy rate-mode Ar scheduler-rate-mode
732 The mode of the scheduler rate constraints:
733 .Pp
734 .Bl -tag -width "relative" -compact -offset indent
735 .It Sy relative
736 percent of port rate.
737 .Pp
738 .It Sy absolute
739 Kb/s.
740 .El
741 .It Sy channel Ar scheduler-channel-index
742 The scheduling channel to which the scheduling class will be bound.
743 .It Sy class Ar scheduler-class-index
744 The scheduling class being programmed.
745 .It Sy min-rate Ar minimum-rate
746 The minimum guaranteed rate to which a rate-limiting scheduling class hierarchy will have access.
747 .It Sy max-rate Ar maximum-rate
748 The maximum rate for a rate-limiting scheduling class hierarchy.
749 .It Sy weight Ar round-robin-weight
750 The weight to be used for a weighted-round-robin scheduling hierarchy.
751 .It Sy pkt-size Ar average-packet-size
752 The average packet size will be used to compute scheduler constraints for a rate-limited scheduler class hierarchy.
753 .Pp
754 NOTE:  Many (most) of the parameters and constraints are adapter-specific - for instance the number of channels and classes which are available,
755 whether various modes are implemented, etc.
756 Consult the adapter documentation for specific information on any limitations.
757 .El
758 .It Cm sched-queue Ar port queue class
759 Bind the indicated port's NIC TX
760 .Ar queue
761 to the specified TX Scheduler
762 .Ar class.
763 If the TX
764 .Ar queue
765 is
766 .Cm all, *
767 or any negative value, the binding will apply to
768 all  of  the TX queues associated with the
769 .Ar interface.
770 If the class is
771 .Cm unbind, clear
772 or any negative value, the TX queue(s) will be unbound from
773 any current TX Scheduler Class binding.
774 .It Cm stdio
775 Switch to interactive mode.
776 .It Cm tcb Ar tid
777 Display contents of the hardware TCB (TCP Control Block) for the
778 connection identfied by
779 .Ar tid Ns .
780 .El
781 .Sh FILES
782 /sys/dev/cxgbe/t4_ioctl.h
783 .Sh AUTHORS
784 This manual page was written by
785 .An Navdeep Parhar Aq np@FreeBSD.org .