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