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