xref: /freebsd/usr.sbin/cxgbetool/cxgbetool.8 (revision b1879975794772ee51f0b4865753364c7d7626c3)
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 December 10, 2024
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
535.Cm hw.cxgbe.config_file="flash"
536in loader.conf to get
537.Xr cxgbe 4
538to use the on-flash configuration.
539.It Cm loadcfg Cm clear
540Erase configuration file from the card.
541.It Cm loadfw Ar fw-image.bin
542Install the firmware contained in
543.Ar fw-image.bin
544to the card.
545.It Cm memdump Ar addr len
546Display
547.Ar len
548bytes of data of the card's memory starting at
549.Ar addr Ns .
550The card's memory map is available in
551.Va dev.t4nex.%d.misc.meminfo Ns .
552.It Cm policy Ar cop.txt
553Install the Connection Offload Policy (COP) in
554.Ar cop.txt Ns .
555A COP offers fine-grained control over which connections get offloaded and with
556what parameters.
557Set
558.Cm hw.cxgbe.toe.cop_managed_offloading="1"
559in loader.conf to ensure that t4_tom will not offload any connection before a
560COP is installed.
561Note that t4_tom must be loaded and operational (IFCAP_TOE enabled) as always
562for any kind of offload based on the hardware TOE.
563.Bl -column -offset indent "COP installed" "cop_managed_offloading" "Behavior"
564.It Sy COP installed Ta Sy cop_managed_offloading Ta Sy Behavior
565.It NO Ta 0 Ta offload all [Default]
566.It NO Ta 1 Ta no offload
567.It YES Ta Don't Care Ta Rule based offload
568.El
569.Pp
570The policy file consists of empty lines, comments (lines beginning with #) and
571any number of rules.
572Rules are applied in the order they appear in the file and processing stops at
573the first match.
574There is an implicit rule that disables offload for connections that do not
575match anything in the policy.
576.Pp
577Each rule consists of a filter part, which determines what connections the
578rule applies to, and a settings part, which determines whether matching
579connections will be offloaded and, if so, with what settings.
580The general form of a rule is
581.Bl -ohang -offset indent
582.It Cm \&[ Ar socket-type Cm \&] Ar pcap-filter Cm => Ar settings
583.Pp
584.Ar socket-type
585is one of the following.
586.Bl -tag -width "X" -compact
587.It Sy A
588Active open.
589Connection is being opened by this host.
590.It Sy P
591Passive open.
592Connection was requested by a peer.
593.It Sy L
594Listen called on a socket.
595Disabling offload in such a rule will prevent a hardware listener from being started.
596.It Sy D
597Don't care.
598Matches all of the above.
599.El
600.Pp
601.Ar pcap-filter
602is an expression that follows the
603.Xr pcap-filter 7
604syntax, or it is the keyword
605.Cm all
606that matches everything.
607.Pp
608.Ar settings
609determine whether connections matching
610.Ar socket-type
611and
612.Ar pcap-filter
613are offloaded and optionally sets some per-connection properties if they are.
614A combination of the following is allowed.
615.Bl -tag -width "timestamp" -compact
616.It Cm offload
617Connection should be offloaded.
618Use
619.Cm !offload
620or
621.Cm not offload
622to disable offload instead.
623.It Cm coalesce
624Enable rx payload coalescing.
625Negate to disable.
626.It Cm timestamp
627Enable TCP timestamp option.
628Negate to disable.
629.It Cm sack
630Enable TCP Selective Acknowledgements (SACK).
631Negate to disable.
632.It Cm nagle
633Enable Nagle's algorithm.
634Negate to disable.
635.It Cm ecn
636Enable Explicit Congestion Notification (ECN).
637Negate to disable.
638.It Cm ddp
639Use Direct Data Placement (zero copy receive) and zero copy transmit on the
640connection to service AIO requests on the socket.
641Negate to disable.
642.It Cm tls
643Set ULP mode to ULP_MODE_TLS.
644.It Cm cong Ar algo
645Use the specified congestion control algorithm.
646.Ar algo
647must be one of
648.Cm reno Ns , Cm tahoe Ns , Cm newreno Ns , or Cm highspeed Ns .
649.It Cm class Ar sc
650Bind the connection to the specified tx scheduling class.
651Valid range is 0 to 14 (for T4) and 0 to 15 (T5 onwards).
652.It Cm rxq Ar qnum
653Use the specified offload rx queue.
654.Ar qnum
655should be
656.Cm random Ns , Cm roundrobin Ns ,
657or a number between 0 and nofldrxq for the ifnet.
658.It Cm txq Ar qnum
659Use the specified offload tx queue.
660.Ar qnum
661should be
662.Cm random Ns , Cm roundrobin Ns ,
663or a number between 0 and nofldtxq for the ifnet.
664.It Cm bind Ar qnum
665Shorthand for
666.Cm rxq Ar qnum Cm txq Ar qnum Ns .
667Use when nofldrxq is the same as nofldtxq.
668.It Cm mss Ar val
669Set the advertised TCP MSS in the SYN for this connection to
670.Ar val
671(in bytes).
672The hardware MTU table must already have an entry that is suitable for the MSS.
673.El
674.Pp
675.It Example of a COP.
676Note that hardware listener for port 22 will be IPv4 only because the rule
677before it will prevent any IPv6 servers other than the first two.  Also note
678that outgoing connections to 192.168/16 are the only outgoing connections that
679will get offloaded.
680.Bd -literal
681[L] port 80 => offload
682[L] port 443 => offload
683[L] ip6 => !offload
684[L] port 22 => offload
685[P] dst port 80 => offload cong highspeed !sack !ecn
686[P] dst port 443 => offload tls
687[A] dst net 192.168/16 => offload
688[A] all => !offload
689[D] port 22 => offload !nagle
690.Ed
691.El
692.It Cm policy clear
693Remove the Connection Offload Policy (COP) if one is in use.
694.It Bro Cm reg | reg64 Brc Ar addr Ns Op Ar =val
695.It Cm regdump Op Ar register-block ...
696Display contents of device registers.
697One or more
698.Ar register-block
699can be specified to limit the registers displayed.
700The default is to display registers for all blocks.
701Registers with read side effects are not read during a
702.Cm regdump
703operation.
704.Ar register-block
705can be
706.Cm sge pci dbg mc ma edc0 edc1 cim tp ulp_rx ulp_tx pmrx pmtx mps cplsw
707.Cm smb i2c mi uart pmu sf pl le ncsi xgmac Ns .
708.It Cm sched-class config Op Ar param Ar value
709Configure optional feature capabilities for the TX scheduler.
710.Bl -ohang -offset indent
711.It Sy type Ar scheduler-type
712Use packet for the packet scheduler.
713.It Sy minmax Ar value
714A non-zero value will enable "minmax" mode; a zero value will disable "minmax" mode.
715.Pp
716NOTE:  Many (most) of the parameters and constraints are adapter-specific
717- for instance the number of channels and classes which are available
718whether various modes are implemented, etc.
719Consult the adapter documentation for specific information on any limitations.
720.El
721.It Cm sched-class params Op Ar param Ar value
722Configure parameters for a scheduling class.
723.Bl -ohang -offset indent
724.It Sy type Ar scheduler-type
725Use packet for packet scheduler.
726.It Sy level Ar scheduler-hierarchy-level
727The "level" within the scheduling hierarchy which is being programed:
728.Pp
729.Bl -tag -width "cl-wrr" -compact -offset indent
730.It Sy cl-rl
731Class Rate Limiting.
732.Pp
733.It Sy cl-wrr
734Class Weighted Round Robin.
735.Pp
736.It Sy ch-rl
737Channel Rate Limiting.
738.El
739.It Sy mode Ar scheduler-mode
740The mode in which the scheduling class is going to operate:
741.Pp
742.Bl -tag -width "class" -compact -offset indent
743.It Sy class
744All of the "flows" bound to the scheduling class will be held to aggregate scheduling constraints.
745.Pp
746.It Sy flow
747Each of the "flows" bound to the scheduling class will be held to the scheduling constraints.
748.El
749.Pp
750E.g. if the scheduling class has a TX bandwidth of 10Mb/s, in
751.Cm class
752mode, all of the "flows" bound to the class would be  limited  to  an
753aggregate bandwidth of 10Mb/s; but in
754.Cm flow
755mode, each of the "flows" bound to the scheduling class would be limited to 10Mb/s.
756.It Sy rate-unit Ar scheduler-rate-unit
757The units of the scheduler rate constraints:
758.Pp
759.Bl -tag -width "bits" -compact -offset indent
760.It Sy bits
761bit rate in Kb/s.
762.Pp
763.It Sy pkts
764packets/s.
765.El
766.It Sy rate-mode Ar scheduler-rate-mode
767The mode of the scheduler rate constraints:
768.Pp
769.Bl -tag -width "relative" -compact -offset indent
770.It Sy relative
771percent of port rate.
772.Pp
773.It Sy absolute
774Kb/s.
775.El
776.It Sy channel Ar scheduler-channel-index
777The scheduling channel to which the scheduling class will be bound.
778.It Sy class Ar scheduler-class-index
779The scheduling class being programmed.
780.It Sy min-rate Ar minimum-rate
781The minimum guaranteed rate to which a rate-limiting scheduling class hierarchy will have access.
782.It Sy max-rate Ar maximum-rate
783The maximum rate for a rate-limiting scheduling class hierarchy.
784.It Sy weight Ar round-robin-weight
785The weight to be used for a weighted-round-robin scheduling hierarchy.
786.It Sy pkt-size Ar average-packet-size
787The average packet size will be used to compute scheduler constraints for a rate-limited scheduler class hierarchy.
788.Pp
789NOTE:  Many (most) of the parameters and constraints are adapter-specific - for instance the number of channels and classes which are available,
790whether various modes are implemented, etc.
791Consult the adapter documentation for specific information on any limitations.
792.El
793.It Cm sched-queue Ar port queue class
794Bind the indicated port's NIC TX
795.Ar queue
796to the specified TX Scheduler
797.Ar class.
798If the TX
799.Ar queue
800is
801.Cm all, *
802or any negative value, the binding will apply to
803all  of  the TX queues associated with the
804.Ar interface.
805If the class is
806.Cm unbind, clear
807or any negative value, the TX queue(s) will be unbound from
808any current TX Scheduler Class binding.
809.It Cm stdio
810Switch to interactive mode.
811.It Cm tcb Ar tid
812Display contents of the hardware TCB (TCP Control Block) for the
813connection identfied by
814.Ar tid Ns .
815.El
816.Sh FILES
817/sys/dev/cxgbe/t4_ioctl.h
818.Sh AUTHORS
819This manual page was written by
820.An Navdeep Parhar Aq np@FreeBSD.org .
821