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