1 .\" Copyright (c) 2015, 2018 Chelsio Inc
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions are met:
7 .\" 1. Redistributions of source code must retain the above copyright notice,
8 .\" this list of conditions and the following disclaimer.
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.
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.
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.
30 .\" * Other names and brands may be claimed as the property of others.
37 .Nd Userspace companion to
42 .Nm Ar nexus command Op Ar parameter ...
45 .Nm Ar nexus Cm clearstats Ar port_id
47 .Nm Ar nexus Cm clip Bro Cm hold | release Brc Ar ipv6-address
49 .Nm Ar nexus Cm clip Cm list
51 .Nm Ar nexus Cm context Bro Cm ingress | egress | fl | cong Brc Ar cntxt_id
53 .Nm Ar nexus Cm hashfilter mode
55 .Nm Ar nexus Cm hashfilter Ar filter-specification
57 .Nm Ar nexus Cm hashfilter Ar idx Cm delete
59 .Nm Ar nexus Cm hashfilter list
61 .Nm Ar nexus Cm filter mode
63 .Nm Ar nexus Cm filter Ar idx Ar filter-specification
65 .Nm Ar nexus Cm filter Ar idx Cm delete Op Cm prio Bro Cm 0 | 1 Brc
67 .Nm Ar nexus Cm filter list
69 .Nm Ar nexus Cm i2c Ar port_id devaddr addr Op Ar len
71 .Nm Ar nexus Cm loadcfg Ar fw-config.txt
73 .Nm Ar nexus Cm loadcfg clear
75 .Nm Ar nexus Cm loadfw Ar fw-image.bin
77 .Nm Ar nexus Cm memdump Ar addr len
79 .Nm Ar nexus Cm policy Ar cop.txt
81 .Nm Ar nexus Cm policy clear
83 .Nm Ar nexus Bro Cm reg | reg64 Brc Ar addr Ns Op Ar =val
85 .Nm Ar nexus Cm regdump Op Ar register-block ...
87 .Nm Ar nexus Cm sched-class Ar sub-command Op Ar param Ar value
89 .Nm Ar nexus Cm sched-queue Ar port Ar queue Ar class
93 .Nm Ar nexus Cm tcb Ar tid
97 provides command-line access to features and debug facilities exported by
100 The target nexus device,
102 , is always the first argument.
103 (The parent nexus for an Ethernet port
106 .Va dev.cxgbe.%d.%parent
110 The rest consists of a command and any parameters required by that command.
113 .It Cm clearstats Ar port_id
114 Clear all transmit, receive, and error statistics of all queues associated
116 The total number of ports attached to a nexus is listed in
117 .Va dev.t4nex.%d.nports
120 identifies a port within this range.
124 .Cm clip hold Ar ipv6-address
126 Install a reference on the given
128 in the CLIP (Compressed Local IPv6) table.
129 The address is added to the CLIP table if it is not present there already.
135 List the contents of the CLIP table.
139 .Cm clip release Ar ipv6-address
141 Release a reference on the given
144 A reference on the address must have been acquired previously.
148 .Cm context ingress Ar ingress_cntxt_id
150 .Cm context cong Ar ingress_cntxt_id
152 .Cm context egress Ar egress_cntxt_id
154 .Cm context fl Ar flm_cntxt_id
156 Display hardware context for an ingress queue, congestion manager, egress
157 queue, or freelist manager.
158 .Bl -tag -width ingress_cntxt_id -compact
159 .It Ar ingress_cntxt_id
160 context id of an ingress queue -- the value listed in one of
161 .Va dev.t4nex.%d.fwq.cntxt_id Ns ,
162 .Va dev.cxgbe.%d.rxq.%d.cntxt_id Ns ,
164 .Va dev.cxgbe.%d.ofld_rxq.%d.cntxt_id Ns .
165 .It Ar egress_cntxt_id
166 context id of an egress queue -- the value listed in one of
167 .Va dev.t4nex.%d.mgmtq.cntxt_id Ns ,
168 .Va dev.cxgbe.%d.txq.%d.cntxt_id Ns ,
169 .Va dev.cxgbe.%d.ctrlq.%d.cntxt_id Ns ,
170 .Va dev.cxgbe.%d.ofld_txq.%d.cntxt_id Ns ,
171 .Va dev.cxgbe.%d.rxq.%d.fl.cntxt_id Ns ,
173 .Va dev.cxgbe.%d.ofld_rxq.%d.fl.cntxt_id Ns .
174 Note that freelists are egress queues too.
176 context id of a freelist manager.
177 The FLM context id is displayed in the
178 egress context dump of a freelist as FLMcontextID.
187 Display a list of match-criteria available for use in filter rules.
188 A full list of match-criteria known to the chip is in the table below but not
189 all can be used together and the firmware sets up the available parameters based
190 on "filterMode" in the configuration file.
191 Every filter must conform to the filter mode -- multiple match criteria per
192 filter are allowed but only from among those in the current setting of the
194 The filter mode for hash filters is a subset of that for normal TCAM filters and
195 depends on the "filterMask" setting in the firmware configuration file.
196 Hash filters do not support masked matches and an exact value for every
197 parameter in the output of "hashfilter mode" (except ipv4/ipv6) must be provided
198 when creating a hash filter.
202 defaults to all 1s when not provided explicitly.
203 Hash filters do not support masked matches.
204 Also note that many of the items being matched are discrete numeric
205 values rather than bit fields and should be masked with caution.)
210 Criteria Usage Matches if ...
215 incoming packet is an IPv4 datagram.
221 incoming packet is an IPv6 datagram.
225 .Cm sip Ar addr Ns Op / Ns Ar mask
227 bitwise and of the source address in an incoming IP datagram with
232 can be an IPv4 or IPv6 address.
236 .Cm dip Ar addr Ns Op / Ns Ar mask
238 bitwise and of the destination address in an incoming IP datagram with
243 can be an IPv4 or IPv6 address.
247 .Cm sport Ar port Ns Op : Ns Ar mask
249 bitwise and of the source port in an incoming TCP or UDP datagram with
256 .Cm dport Ar port Ns Op : Ns Ar mask
258 bitwise and of the destination port in an incoming TCP or UDP datagram with
267 incoming frame is Fibre Channel over Ethernet(1) or not(0).
271 .Cm iport Ar val Ns Op : Ns Ar mask
273 bitwise and of the ingress port with
277 The ingress port is a 3 bit number that identifies the port on which a
279 Physical ports are numbered 0-3 and 4-7 are internal loopback paths
281 Note that ingress port is not a bit field so it is not always possible
282 to match an arbitrary subset of ingress ports with a single filter rule.
286 .Cm ovlan Ar tag Ns Op : Ns Ar mask
288 bitwise and of the 16-bit outer VLAN tag of an incoming frame with
295 .Cm vlan Ar tag Ns Op : Ns Ar mask
297 bitwise and of the 16-bit VLAN tag of an incoming QinQ frame with
301 The inner VLAN tag is used if the incoming frame is QinQ.
305 .Cm tos Ar val Ns Op : Ns Ar mask
307 bitwise and of the 8-bit IP Type of Service/IPv6 Traffic Class in an
315 .Cm proto Ar ipproto Ns Op : Ns Ar mask
317 bitwise and of the 8-bit IP protocol in an incoming packet with
324 .Cm ethtype Ar type Ns Op : Ns Ar mask
326 bitwise and of the 16-bit Ethernet type field of an incoming frame with
333 .Cm macidx Ar idx Ns Op : Ns Ar mask
335 bitwise and of the MAC Address Match Index of an incoming frame with
339 The MAC Address Match Index refers to an entry in the MPS TCAM or in the
342 for more information.
346 .Cm matchtype Ar type Ns Op : Ns Ar mask
348 bitwise and of the Match Type of an incoming frame with
352 Match Type is one of the following:
353 .Bl -tag -width "n" -compact
355 destination MAC in incoming frame is a unicast L2 address that is
356 programmed in the MPS TCAM.
358 can be used to match the index (and thus the MAC address) of the match
361 destination MAC in incoming frame is a unicast L2 address that "hit" a
362 hash entry in the MPS hash table.
364 can be used to match the index of the entry in the MPS hash table.
366 destination MAC in incoming frame is a multicast L2 address that is
367 programmed in the MPS TCAM.
369 can be used to match the index (and thus the MAC address) of the match
372 destination MAC in incoming frame is a multicast L2 address that "hit"
373 an entry in the MPS hash table.
375 interface on which incoming frame was received is in promiscuous mode
376 and the destination MAC in the frame is not a broadcast address, and
377 does not match in the MPS TCAM or the MPS hash either. (The frame would
378 have been discarded if the interface wasn't in promiscuous mode.)
380 interface on which incoming frame was received is in promiscuous mode
381 and the destination MAC in the frame is not a broadcast address; it
382 wasn't looked up in the MPS TCAM or the MPS hash because the chip is
383 configured to give precedence to promiscuous mode classification.
385 destination MAC in incoming frame is a broadcast address.
387 Not documented. Do not use.
394 incoming frame is part of a fragmented IP datagram(1) or not(0).
400 .Cm hashfilter Ar filter-specification
402 .Cm filter Ar idx Ar filter-specification
406 TCAM filters: The number of available filters is in
407 dev.<nexus>.<instance>.nfilters.
409 must be an unused index between 0 and nfilters - 1.
410 IPv6 filters consume 4 consecutive entries on T4/T5 and 2 on T6 and
412 must be aligned to 4 or 2 in this case.
414 Hash filters: These reside in the card's memory instead of its TCAM and are
415 enabled with a special configuration file that is selected with
416 .Cm hw.cxgbe.config_file="hashfilter"
418 There are at least half a million filters available with the sample config
419 shipped with the driver.
420 Note that the hardware selects the index for a hashfilter and this index is
421 displayed when the filter is created.
422 Hash and TCAM filters can be used together.
424 .Ar filter-specification
425 consists of one or more matches (see Usage in the table above) to try against an
426 incoming frame, an action to perform when all matches succeed, and some
427 additional operational parameters.
428 Hashfilters require an exact value for the 5-tuple (sip, dip, sport, dport,
429 proto) and for any other match-criteria listed in "hashfilter mode".
430 Possible filter actions are
435 .Bl -tag -width nat_dport -offset indent -compact
436 Operational parameters that can be used with all filters:
438 Count filter hits: 0 or 1 (default).
440 Filter has priority over active and server regions of TCAM: 0 (default) or 1.
443 .Bl -tag -width nat_dport -offset indent -compact
444 Operational parameters that can be used with filters with
447 Context id of an ingress queue to which to deliver the packet.
448 The context id is available in
449 .Va dev.cxgbe.%d.rxq.%d.cntxt_id .
450 By default, packets that hit a filter with action pass are delivered based on
451 their RSS hash as usual.
452 Use this to steer them to a particular queue.
454 Report the filter tid instead of the RSS hash in the rx descriptor.
457 Select TCB hash information in rx descriptor.
461 .Bl -tag -width nat_dport -offset indent -compact
462 Operational parameters that can be used with filters with
463 .Cm action switch Ns :
465 Egress port number on which to send the packet matching the filter.
466 0 to dev.<nexus>.<instance>.nports - 1.
468 Replace packet destination MAC address with the one provided before switching
471 Replace packet source MAC address with the one provided before switching it
474 Swap packet source and destination MAC addresses before switching it out of
477 Insert, remove, or rewrite the VLAN tag before switching the packet out of
482 replaces the existing tag with the one provided, and
484 inserts the given tag into the frame.
486 Specify the desired NAT mode. Valid NAT modes values are:
487 .Bl -tag -width dip-dp-sip -compact
489 Perform NAT on destination IP.
491 Perform NAT on destination IP, destination port.
493 Perform NAT on destination IP, destination port, source IP.
495 Perform NAT on destination IP, destination port, source port.
497 Perform NAT on source IP, source port.
499 Perform NAT on destination IP, source IP, source port.
501 Perform NAT on all 4-tuple fields.
504 Perform NAT only on segments which do not have TCP FIN or RST set.
506 Perform NAT only if incoming segment's sequence number + payload length is less
507 than this supplied value.
509 Perform NAT using this destination IP.
511 Perform NAT using this source IP.
513 Perform NAT using this destination port.
515 Perform NAT using this source port.
516 Perform NAT only if incoming segment's sequence number + payload length is less
517 than this supplied value.
522 .Cm hashfilter Ar idx Cm delete
524 .Cm filter Ar idx Cm delete
526 Delete filter that is at the given index.
527 .It Cm filter Cm list
528 List all filters programmed into the hardware.
529 .It Cm i2c Ar port_id devaddr addr Op Ar len
530 .It Cm loadcfg Ar fw-config.txt
531 Install the firmware configuration file contained in
534 Set hw.cxgbe.config_file="flash" in loader.conf to get
536 to use the on-flash configuration.
537 .It Cm loadcfg Cm clear
538 Erase configuration file from the card.
539 .It Cm loadfw Ar fw-image.bin
540 Install the firmware contained in
543 .It Cm memdump Ar addr len
546 bytes of data of the card's memory starting at
548 The card's memory map is available in
549 .Va dev.t4nex.%d.misc.meminfo Ns .
550 .It Cm policy Ar cop.txt
551 Install the Connection Offload Policy (COP) in
553 A COP offers fine-grained control over which connections get offloaded and with
556 .Cm hw.cxgbe.cop_managed_offloading="1"
557 in loader.conf to ensure that t4_tom will not offload any connection before a
559 Note that t4_tom must be loaded and operational (IFCAP_TOE enabled) as always
560 for any kind of offload based on the hardware TOE.
561 .Bl -column -offset indent "COP installed" "cop_managed_offloading" "Behavior"
562 .It Sy COP installed Ta Sy cop_managed_offloading Ta Sy Behavior
563 .It NO Ta 0 Ta offload all [Default]
564 .It NO Ta 1 Ta no offload
565 .It YES Ta Don't Care Ta Rule based offload
568 The policy file consists of empty lines, comments (lines beginning with #) and
570 Rules are applied in the order they appear in the file and processing stops at
572 There is an implicit rule that disables offload for connections that do not
573 match anything in the policy.
575 Each rule consists of a filter part, which determines what connections the
576 rule applies to, and a settings part, which determines whether matching
577 connections will be offloaded and, if so, with what settings.
578 The general form of a rule is
579 .Bl -ohang -offset indent
580 .It Cm \&[ Ar socket-type Cm \&] Ar pcap-filter Cm => Ar settings
583 is one of the following.
584 .Bl -tag -width "X" -compact
587 Connection is being opened by this host.
590 Connection was requested by a peer.
592 Listen called on a socket.
593 Disabling offload in such a rule will prevent a hardware listener from being started.
596 Matches all of the above.
600 is an expression that follows the
602 syntax, or it is the keyword
604 that matches everything.
607 determine whether connections matching
611 are offloaded and optionally sets some per-connection properties if they are.
612 A combination of the following is allowed.
613 .Bl -tag -width "timestamp" -compact
615 Connection should be offloaded.
620 to disable offload instead.
622 Enable rx payload coalescing.
625 Enable TCP timestamp option.
628 Enable TCP Selective Acknowledgements (SACK).
631 Enable Nagle's algorithm.
634 Enable Explicit Congestion Notification (ECN).
637 Use Direct Data Placement (zero copy receive) and zero copy transmit on the
638 connection to service AIO requests on the socket.
641 Set ULP mode to ULP_MODE_TLS.
643 Use the specified congestion control algorithm.
646 .Cm reno Ns , Cm tahoe Ns , Cm newreno Ns , or Cm highspeed Ns .
648 Bind the connection to the specified tx scheduling class.
649 Valid range is 0 to 14 (for T4) and 0 to 15 (T5 onwards).
651 Use the specified offload rx queue.
654 .Cm random Ns , Cm roundrobin Ns ,
655 or a number between 0 and nofldrxq for the ifnet.
657 Use the specified offload tx queue.
660 .Cm random Ns , Cm roundrobin Ns ,
661 or a number between 0 and nofldtxq for the ifnet.
664 .Cm rxq Ar qnum Cm txq Ar qnum Ns .
665 Use when nofldrxq is the same as nofldtxq.
667 Set the advertised TCP MSS in the SYN for this connection to
670 The hardware MTU table must already have an entry that is suitable for the MSS.
673 .It Example of a COP.
674 Note that hardware listener for port 22 will be IPv4 only because the rule
675 before it will prevent any IPv6 servers other than the first two. Also note
676 that outgoing connections to 192.168/16 are the only outgoing connections that
679 [L] port 80 => offload
680 [L] port 443 => 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
687 [D] port 22 => offload !nagle
691 Remove the Connection Offload Policy (COP) if one is in use.
692 .It Bro Cm reg | reg64 Brc Ar addr Ns Op Ar =val
693 .It Cm regdump Op Ar register-block ...
694 Display contents of device registers.
697 can be specified to limit the registers displayed.
698 The default is to display registers for all blocks.
699 Registers with read side effects are not read during a
704 .Cm sge pci dbg mc ma edc0 edc1 cim tp ulp_rx ulp_tx pmrx pmtx mps cplsw
705 .Cm smb i2c mi uart pmu sf pl le ncsi xgmac Ns .
706 .It Cm sched-class config Op Ar param Ar value
707 Configure optional feature capabilities for the TX scheduler.
708 .Bl -ohang -offset indent
709 .It Sy type Ar scheduler-type
710 Use packet for the packet scheduler.
711 .It Sy minmax Ar value
712 A non-zero value will enable "minmax" mode; a zero value will disable "minmax" mode.
714 NOTE: Many (most) of the parameters and constraints are adapter-specific
715 - for instance the number of channels and classes which are available
716 whether various modes are implemented, etc.
717 Consult the adapter documentation for specific information on any limitations.
719 .It Cm sched-class params Op Ar param Ar value
720 Configure parameters for a scheduling class.
721 .Bl -ohang -offset indent
722 .It Sy type Ar scheduler-type
723 Use packet for packet scheduler.
724 .It Sy level Ar scheduler-hierarchy-level
725 The "level" within the scheduling hierarchy which is being programed:
727 .Bl -tag -width "cl-wrr" -compact -offset indent
732 Class Weighted Round Robin.
735 Channel Rate Limiting.
737 .It Sy mode Ar scheduler-mode
738 The mode in which the scheduling class is going to operate:
740 .Bl -tag -width "class" -compact -offset indent
742 All of the "flows" bound to the scheduling class will be held to aggregate scheduling constraints.
745 Each of the "flows" bound to the scheduling class will be held to the scheduling constraints.
748 E.g. if the scheduling class has a TX bandwidth of 10Mb/s, in
750 mode, all of the "flows" bound to the class would be limited to an
751 aggregate bandwidth of 10Mb/s; but in
753 mode, each of the "flows" bound to the scheduling class would be limited to 10Mb/s.
754 .It Sy rate-unit Ar scheduler-rate-unit
755 The units of the scheduler rate constraints:
757 .Bl -tag -width "bits" -compact -offset indent
764 .It Sy rate-mode Ar scheduler-rate-mode
765 The mode of the scheduler rate constraints:
767 .Bl -tag -width "relative" -compact -offset indent
769 percent of port rate.
774 .It Sy channel Ar scheduler-channel-index
775 The scheduling channel to which the scheduling class will be bound.
776 .It Sy class Ar scheduler-class-index
777 The scheduling class being programmed.
778 .It Sy min-rate Ar minimum-rate
779 The minimum guaranteed rate to which a rate-limiting scheduling class hierarchy will have access.
780 .It Sy max-rate Ar maximum-rate
781 The maximum rate for a rate-limiting scheduling class hierarchy.
782 .It Sy weight Ar round-robin-weight
783 The weight to be used for a weighted-round-robin scheduling hierarchy.
784 .It Sy pkt-size Ar average-packet-size
785 The average packet size will be used to compute scheduler constraints for a rate-limited scheduler class hierarchy.
787 NOTE: Many (most) of the parameters and constraints are adapter-specific - for instance the number of channels and classes which are available,
788 whether various modes are implemented, etc.
789 Consult the adapter documentation for specific information on any limitations.
791 .It Cm sched-queue Ar port queue class
792 Bind the indicated port's NIC TX
794 to the specified TX Scheduler
800 or any negative value, the binding will apply to
801 all of the TX queues associated with the
805 or any negative value, the TX queue(s) will be unbound from
806 any current TX Scheduler Class binding.
808 Switch to interactive mode.
810 Display contents of the hardware TCB (TCP Control Block) for the
811 connection identfied by
815 /sys/dev/cxgbe/t4_ioctl.h
817 This manual page was written by
818 .An Navdeep Parhar Aq np@FreeBSD.org .