xref: /freebsd/usr.sbin/cxgbetool/cxgbetool.8 (revision f39bffc62c1395bde25d152c7f68fdf7cbaab414)
1.\" Copyright (c) 2015, 2018 Chelsio Inc
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions are met:
6.\"
7.\" 1. Redistributions of source code must retain the above copyright notice,
8.\"    this list of conditions and the following disclaimer.
9.\"
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" 3. Neither the name of the Chelsio Inc nor the names of its
15.\"    contributors may be used to endorse or promote products derived from
16.\"    this software without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.\" * Other names and brands may be claimed as the property of others.
31.\"
32.\" $FreeBSD$
33.\"
34.Dd May 14, 2018
35.Dt CXGBETOOL 8
36.Os
37.Sh NAME
38.Nm cxgbetool
39.Nd Userspace companion to
40.Xr cxgbe 4
41.Sh SYNOPSIS
42.Bl -item -compact
43.It
44.Nm Ar nexus command Op Ar parameter ...
45.Pp
46.It
47.Nm Ar nexus Cm clearstats Ar port_id
48.It
49.Nm Ar nexus Cm context Bro Cm ingress | egress | fl | cong Brc Ar cntxt_id
50.It
51.Nm Ar nexus Cm hashfilter mode
52.It
53.Nm Ar nexus Cm hashfilter Ar filter-specification
54.It
55.Nm Ar nexus Cm hashfilter Ar idx Cm delete
56.It
57.Nm Ar nexus Cm hashfilter list
58.It
59.Nm Ar nexus Cm filter mode
60.It
61.Nm Ar nexus Cm filter Ar idx Ar filter-specification
62.It
63.Nm Ar nexus Cm filter Ar idx Cm delete
64.It
65.Nm Ar nexus Cm filter list
66.It
67.Nm Ar nexus Cm i2c Ar port_id devaddr addr Op Ar len
68.It
69.Nm Ar nexus Cm loadcfg Ar fw-config.txt
70.It
71.Nm Ar nexus Cm loadcfg clear
72.It
73.Nm Ar nexus Cm loadfw Ar fw-image.bin
74.It
75.Nm Ar nexus Cm memdump Ar addr len
76.It
77.Nm Ar nexus Cm policy Ar cop.txt
78.It
79.Nm Ar nexus Cm policy clear
80.It
81.Nm Ar nexus Bro Cm reg | reg64 Brc Ar addr Ns Op Ar =val
82.It
83.Nm Ar nexus Cm regdump Op Ar register-block ...
84.It
85.Nm Ar nexus Cm sched-class Ar sub-command Op Ar param Ar value
86.It
87.Nm Ar nexus Cm sched-queue Ar port Ar queue Ar class
88.It
89.Nm Ar nexus Cm stdio
90.It
91.Nm Ar nexus Cm tcb Ar tid
92.El
93.Sh DESCRIPTION
94.Nm
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 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
421Rx queue index to which to deliver the packet.  By default, packets that hit a
422filter with action pass are delivered based on their RSS hash as usual.  Use
423this to steer them to a particular queue.
424.It Cm rpttid
425Report the filter tid instead of the RSS hash in the rx descriptor.
4260 (default) or 1.
427.It Cm tcbhash
428Select TCB hash information in rx descriptor.
4290 (default) or 1
430.El
431.Pp
432.Bl -tag -width nat_dport -offset indent -compact
433Operational parameters that can be used with filters with
434.Cm action switch Ns :
435.It Cm eport
436Egress port number on which to send the packet matching the filter.
4370 to dev.<nexus>.<instance>.nports - 1.
438.It Cm dmac
439Replace packet destination MAC address with the one provided before switching
440it out of eport.
441.It Cm smac
442Replace packet source MAC address with the one provided before switching it
443out of eport.
444.It Cm swapmac
445Swap packet source and destination MAC addresses before switching it out of
446eport.
447.It Cm vlan
448Insert, remove, or rewrite the VLAN tag before switching the packet out of
449eport.
450.Cm vlan=none
451removes the tag,
452.Cm vlan= Ns Ar tag
453replaces the existing tag with the one provided, and
454.Cm vlan=+ Ns Ar tag
455inserts the given tag into the frame.
456.It Cm nat
457Specify the desired NAT mode. Valid NAT modes values are:
458.Bl -tag -width dip-dp-sip -compact
459.It Cm dip
460Perform NAT on destination IP.
461.It Cm dip-dp
462Perform NAT on destination IP, destination port.
463.It Cm dip-dp-sip
464Perform NAT on destination IP, destination port, source IP.
465.It Cm dip-dp-sp
466Perform NAT on destination IP, destination port, source port.
467.It Cm sip-sp
468Perform NAT on source IP, source port.
469.It Cm dip-sip-sp
470Perform NAT on destination IP, source IP, source port.
471.It Cm all
472Perform NAT on all 4-tuple fields.
473.El
474.It Cm natflag
475Perform NAT only on segments which do not have TCP FIN or RST set.
476.It Cm natseq
477Perform NAT only if incoming segment's sequence number + payload length is less
478than this supplied value.
479.It Cm nat_dip
480Perform NAT using this destination IP.
481.It Cm nat_sip
482Perform NAT using this source IP.
483.It Cm nat_dport
484Perform NAT using this destination port.
485.It Cm nat_sport
486Perform NAT using this source port.
487Perform NAT only if incoming segment's sequence number + payload length is less
488than this supplied value.
489.El
490.Pp
491.Bl -item -compact
492.It
493.Cm hashfilter Ar idx Cm delete
494.It
495.Cm filter Ar idx Cm delete
496.El
497Delete filter that is at the given index.
498.It Cm filter Cm list
499List all filters programmed into the hardware.
500.It Cm i2c Ar port_id devaddr addr Op Ar len
501.It Cm loadcfg Ar fw-config.txt
502Install the firmware configuration file contained in
503.Ar fw-config.txt
504to the card.
505Set hw.cxgbe.config_file="flash" in loader.conf to get
506.Xr cxgbe 4
507to use the on-flash configuration.
508.It Cm loadcfg Cm clear
509Erase configuration file from the card.
510.It Cm loadfw Ar fw-image.bin
511Install the firmware contained in
512.Ar fw-image.bin
513to the card.
514.It Cm memdump Ar addr len
515Display
516.Ar len
517bytes of data of the card's memory starting at
518.Ar addr Ns .
519The card's memory map is available in
520.Va dev.t4nex.%d.misc.meminfo Ns .
521.It Cm policy Ar cop.txt
522Install the Connection Offload Policy (COP) in
523.Ar cop.txt Ns .
524A COP offers fine-grained control over which connections get offloaded and with
525what parameters.
526Set
527.Cm hw.cxgbe.cop_managed_offloading="1"
528in loader.conf to ensure that t4_tom will not offload any connection before a
529COP is installed.
530Note that t4_tom must be loaded and operational (IFCAP_TOE enabled) as always
531for any kind of offload based on the hardware TOE.
532.Bl -column -offset indent "COP installed" "cop_managed_offloading" "Behavior"
533.It Sy COP installed Ta Sy cop_managed_offloading Ta Sy Behavior
534.It NO Ta 0 Ta offload all [Default]
535.It NO Ta 1 Ta no offload
536.It YES Ta Don't Care Ta Rule based offload
537.El
538.Pp
539The policy file consists of empty lines, comments (lines begining with #) and
540any number of rules.
541Rules are applied in the order they appear in the file and processing stops at
542the first match.
543There is an implicit rule that disables offload for connections that do not
544match anything in the policy.
545.Pp
546Each rule consists of a filter part, which determines what connections the
547rule applies to, and a settings part, which determines whether whether matching
548connections will be offloaded and, if so, with what settings.
549The general form of a rule is
550.Bl -ohang -offset indent
551.It Cm \&[ Ar socket-type Cm \&] Ar pcap-filter Cm => Ar settings
552.Pp
553.Ar socket-type
554is one of the following.
555.Bl -tag -width "X" -compact
556.It Sy A
557Active open.
558Connection is being opened by this host.
559.It Sy P
560Passive open.
561Connection was requested by a peer.
562.It Sy L
563Listen called on a socket.
564Disabling offload in such a rule will prevent a hardware listener from being started.
565.It Sy D
566Don't care.
567Matches all of the above.
568.El
569.Pp
570.Ar pcap-filter
571is an expression that follows the
572.Xr pcap-filter 7
573syntax, or it is the keyword
574.Cm all
575that matches everything.
576.Pp
577.Ar settings
578determine whether connections matching
579.Ar socket-type
580and
581.Ar pcap-filter
582are offloaded and optionally sets some per-connection properties if they are.
583A combination of the following is allowed.
584.Bl -tag -width "timestamp" -compact
585.It Cm offload
586Connection should be offloaded.
587Use
588.Cm !offload
589or
590.Cm not offload
591to disable offload instead.
592.It Cm coalesce
593Enable rx payload coalescing.
594Negate to disable.
595.It Cm timestamp
596Enable TCP timestamp option.
597Negate to disable.
598.It Cm sack
599Enable TCP Selective Acknowledgements (SACK).
600Negate to disable.
601.It Cm nagle
602Enable Nagle's algorithm.
603Negate to disable.
604.It Cm ecn
605Enable Explicit Congestion Notification (ECN).
606Negate to disable.
607.It Cm ddp
608Use Direct Data Placement (zero copy receive) and zero copy transmit on the
609connection to service AIO requests on the socket.
610Negate to disable.
611.It Cm tls
612Set ULP mode to ULP_MODE_TLS.
613.It Cm cong Ar algo
614Use the specified congestion control algorithm.
615.Ar algo
616must be one of
617.Cm reno Ns , Cm tahoe Ns , Cm newreno Ns , or Cm highspeed Ns .
618.It Cm class Ar sc
619Bind the connection to the specified tx scheduling class.
620Valid range is 0 to 14 (for T4) and 0 to 15 (T5 onwards).
621.It Cm rxq Ar qid
622Use the specified offload rx queue.
623.Ar qid
624should be between 0 and nofldrxq for the ifnet.
625.It Cm txq Ar qnum
626Use the specified offload tx queue.
627.Ar qid
628should be between 0 and nofldtxq for the ifnet.
629.It Cm bind Ar qnum
630Shorthand for
631.Cm rxq Ar qnum Cm txq Ar qnum Ns .
632Use only when nofldrxq is the same as nofldtxq.
633.It Cm mss Ar val
634Set the advertised TCP MSS in the SYN for this connection to
635.Ar val
636(in bytes).
637The hardware MTU table must already have an entry that is suitable for the MSS.
638.El
639.Pp
640.It Example of a COP.
641Note that hardware listener for port 22 will be IPv4 only because the rule
642before it will prevent any IPv6 servers other than the first two.  Also note
643that outgoing connections to 192.168/16 are the only outgoing connections that
644will get offloaded.
645.Bd -literal
646[L] port 80 => offload
647[L] port 443 => offload
648[L] ip6 => !offload
649[L] port 22 => offload
650[P] dst port 80 => offload cong highspeed !sack !ecn
651[P] dst port 443 => offload tls
652[A] dst net 192.168/16 => offload
653[A] all => !offload
654[D] port 22 => offload !nagle
655.Ed
656.El
657.It Cm policy clear
658Remove the Connection Offload Policy (COP) if one is in use.
659.It Bro Cm reg | reg64 Brc Ar addr Ns Op Ar =val
660.It Cm regdump Op Ar register-block ...
661Display contents of device registers.
662One or more
663.Ar register-block
664can be specified to limit the registers displayed.
665The default is to display registers for all blocks.
666Registers with read side effects are not read during a
667.Cm regdump
668operation.
669.Ar register-block
670can be
671.Cm sge pci dbg mc ma edc0 edc1 cim tp ulp_rx ulp_tx pmrx pmtx mps cplsw
672.Cm smb i2c mi uart pmu sf pl le ncsi xgmac Ns .
673.It Cm sched-class config Op Ar param Ar value
674Configure optional feature capabilities for the TX scheduler.
675.Bl -ohang -offset indent
676.It Sy type Ar scheduler-type
677Use packet for the packet scheduler.
678.It Sy minmax Ar value
679A non-zero value will enable "minmax" mode; a zero value will disable "minmax" mode.
680.Pp
681NOTE:  Many (most) of the parameters and constraints are adapter-specific
682- for instance the number of channels and classes which are available
683whether various modes are implemented, etc.
684Consult the adapter documentation for specific information on any limitations.
685.El
686.It Cm sched-class params Op Ar param Ar value
687Configure parameters for a scheduling class.
688.Bl -ohang -offset indent
689.It Sy type Ar scheduler-type
690Use packet for packet scheduler.
691.It Sy level Ar scheduler-hierarchy-level
692The "level" within the scheduling hierarchy which is being programed:
693.Pp
694.Bl -tag -width "cl-wrr" -compact -offset indent
695.It Sy cl-rl
696Class Rate Limiting.
697.Pp
698.It Sy cl-wrr
699Class Weighted Round Robin.
700.Pp
701.It Sy ch-rl
702Channel Rate Limiting.
703.El
704.It Sy mode Ar scheduler-mode
705The mode in which the scheduling class is going to operate:
706.Pp
707.Bl -tag -width "class" -compact -offset indent
708.It Sy class
709All of the "flows" bound to the scheduling class will be held to aggregate scheduling constraints.
710.Pp
711.It Sy flow
712Each of the "flows" bound to the scheduling class will be held to the scheduling constraints.
713.El
714.Pp
715E.g. if the scheduling class has a TX bandwidth of 10Mb/s, in
716.Cm class
717mode, all of the "flows" bound to the class would be  limited  to  an
718aggregate bandwidth of 10Mb/s; but in
719.Cm flow
720mode, each of the "flows" bound to the scheduling class would be limited to 10Mb/s.
721.It Sy rate-unit Ar scheduler-rate-unit
722The units of the scheduler rate constraints:
723.Pp
724.Bl -tag -width "bits" -compact -offset indent
725.It Sy bits
726bit rate in Kb/s.
727.Pp
728.It Sy pkts
729packets/s.
730.El
731.It Sy rate-mode Ar scheduler-rate-mode
732The mode of the scheduler rate constraints:
733.Pp
734.Bl -tag -width "relative" -compact -offset indent
735.It Sy relative
736percent of port rate.
737.Pp
738.It Sy absolute
739Kb/s.
740.El
741.It Sy channel Ar scheduler-channel-index
742The scheduling channel to which the scheduling class will be bound.
743.It Sy class Ar scheduler-class-index
744The scheduling class being programmed.
745.It Sy min-rate Ar minimum-rate
746The minimum guaranteed rate to which a rate-limiting scheduling class hierarchy will have access.
747.It Sy max-rate Ar maximum-rate
748The maximum rate for a rate-limiting scheduling class hierarchy.
749.It Sy weight Ar round-robin-weight
750The weight to be used for a weighted-round-robin scheduling hierarchy.
751.It Sy pkt-size Ar average-packet-size
752The average packet size will be used to compute scheduler constraints for a rate-limited scheduler class hierarchy.
753.Pp
754NOTE:  Many (most) of the parameters and constraints are adapter-specific - for instance the number of channels and classes which are available,
755whether various modes are implemented, etc.
756Consult the adapter documentation for specific information on any limitations.
757.El
758.It Cm sched-queue Ar port queue class
759Bind the indicated port's NIC TX
760.Ar queue
761to the specified TX Scheduler
762.Ar class.
763If the TX
764.Ar queue
765is
766.Cm all, *
767or any negative value, the binding will apply to
768all  of  the TX queues associated with the
769.Ar interface.
770If the class is
771.Cm unbind, clear
772or any negative value, the TX queue(s) will be unbound from
773any current TX Scheduler Class binding.
774.It Cm stdio
775Switch to interactive mode.
776.It Cm tcb Ar tid
777Display contents of the hardware TCB (TCP Control Block) for the
778connection identfied by
779.Ar tid Ns .
780.El
781.Sh FILES
782/sys/dev/cxgbe/t4_ioctl.h
783.Sh AUTHORS
784This manual page was written by
785.An Navdeep Parhar Aq np@FreeBSD.org .
786