home | help
CXGBETOOL(8)		     System Manager's Manual		    CXGBETOOL(8)

NAME
     cxgbetool -- Userspace companion to cxgbe(4)

SYNOPSIS
     cxgbetool nexus command [parameter ...]

     cxgbetool nexus clearstats port_id
     cxgbetool nexus context {ingress | egress | fl | cong} cntxt_id
     cxgbetool nexus filter mode [match-criteria ...]
     cxgbetool nexus filter idx {filter-specification | delete}
     cxgbetool nexus filter list
     cxgbetool nexus i2c port_id devaddr addr [len]
     cxgbetool nexus loadcfg fw-config.txt
     cxgbetool nexus loadcfg clear
     cxgbetool nexus loadfw fw-image.bin
     cxgbetool nexus memdump addr len
     cxgbetool nexus {reg | reg64} addr[=val]
     cxgbetool nexus regdump [register-block ...]
     cxgbetool nexus sched-class sub-command [param value]
     cxgbetool nexus sched-queue port queue class
     cxgbetool nexus stdio
     cxgbetool nexus tcb tid

DESCRIPTION
     cxgbetool provides command-line access to features and debug facilities ex-
     ported  by cxgbe(4) via private ioctls.  The target nexus device, t4nex%d ,
     is always the first argument.  (The  parent  nexus  for  an  Ethernet  port
     cxgbe%d  is listed in dev.cxgbe.%d.%parent in the sysctl(8) MIB).	The rest
     consists of a command and any parameters required by that command.

   Commands
     clearstats port_id
     Clear all transmit, receive, and error statistics of all queues  associated
     with  a  port.   The total number of ports attached to a nexus is listed in
     dev.t4nex.%d.nports and the 0 based port_id identifies a port  within  this
     range.

     context ingress ingress_cntxt_id
     context cong ingress_cntxt_id
     context egress egress_cntxt_id
     context fl flm_cntxt_id
     Display  hardware	context for an ingress queue, congestion manager, egress
     queue, or freelist manager.
     ingress_cntxt_id  context id of an ingress queue -- the value listed in one
		       of			      dev.t4nex.%d.fwq.cntxt_id,
		       dev.cxgbe.%d.rxq.%d.cntxt_id,			      or
		       dev.cxgbe.%d.ofld_rxq.%d.cntxt_id.
     egress_cntxt_id   context id of an egress queue -- the value listed in  one
		       of			    dev.t4nex.%d.mgmtq.cntxt_id,
		       dev.cxgbe.%d.txq.%d.cntxt_id,
		       dev.cxgbe.%d.ctrlq.%d.cntxt_id,
		       dev.cxgbe.%d.ofld_txq.%d.cntxt_id,
		       dev.cxgbe.%d.rxq.%d.fl.cntxt_id, 		      or
		       dev.cxgbe.%d.ofld_rxq.%d.fl.cntxt_id.   Note  that freel-
		       ists are egress queues too.
     flm_cntxt_id      context id of a freelist manager.  The FLM context id  is
		       displayed  in  the  egress  context dump of a freelist as
		       FLMcontextID.

     filter mode [match-criteria ...]
     Display or set the nexus's filter mode.   match-criteria  is  a  whitespace
     separated	list of criteria from the table below.	Each criteria has an as-
     sociated budget which is also listed in the table.  The  total  budget  al-
     lowed is 36 and attempts to set a filter mode that exceeds this will be re-
     jected.   Every  filter  must  conform to the filter mode -- multiple match
     criteria per filter are allowed but only from among those	in  the  current
     setting of the filter mode.  The filter mode can only be changed when there
     are  no  existing	filters.   Its	default value is ipv4 ipv6 sip dip sport
     dport matchtype proto vlan iport fcoe

     (Note that mask defaults to all 1s when not provided explicitly.  Also note
     that many of the items being matched are  discrete  numeric  values  rather
     than bit fields and should be masked with caution.)
     Criteria  Budget	   Usage		    Matches if ...
     ---------------------------------------------------------------------------
       ipv4	 0    type ipv4        incoming packet is an IPv4 datagram.
     ---------------------------------------------------------------------------
       ipv6	 0    type ipv6        incoming packet is an IPv6 datagram.
     ---------------------------------------------------------------------------
	sip	 0    sip addr[/mask]  bitwise	and of the source address in an
				       incoming IP datagram  with  mask  equals
				       addr.   addr  can be an IPv4 or IPv6 ad-
				       dress.
     ---------------------------------------------------------------------------
	dip	 0    dip addr[/mask]  bitwise and of the  destination	address
				       in  an  incoming  IP  datagram with mask
				       equals addr.  addr can  be  an  IPv4  or
				       IPv6 address.
     ---------------------------------------------------------------------------
       sport	 0    sport	       bitwise and of the source port in an in-
		      port[:mask]      coming  TCP  or	UDP  datagram with mask
				       equals port.
     ---------------------------------------------------------------------------
       dport	 0    dport	       bitwise and of the destination  port  in
		      port[:mask]      an  incoming  TCP  or  UDP datagram with
				       mask equals port.
     ---------------------------------------------------------------------------
       fcoe	 1    fcoe {0 | 1}     incoming frame  is  Fibre  Channel  over
				       Ethernet(1) or not(0).
     ---------------------------------------------------------------------------
       iport	 3    iport val[:mask] bitwise	and  of  the  ingress port with
				       mask equals val.  The ingress port is  a
				       3 bit number that identifies the port on
				       which  a  frame arrived.  Physical ports
				       are numbered 0-3 and  4-7  are  internal
				       loopback  paths	within	the chip.  Note
				       that ingress port is not a bit field  so
				       it  is  not  always possible to match an
				       arbitrary subset of ingress ports with a
				       single filter rule.
     ---------------------------------------------------------------------------
       ovlan	 17   ovlan tag[:mask] bitwise and of the 16-bit outer VLAN tag
				       of an incoming frame  with  mask  equals
				       tag.
     ---------------------------------------------------------------------------
       vlan	 17   vlan tag[:mask]  bitwise and of the 16-bit VLAN tag of an
				       incoming  QinQ  frame  with  mask equals
				       tag.  The inner VLAN tag is used if  the
				       incoming frame is QinQ.
     ---------------------------------------------------------------------------
	tos	 8    tos val[:mask]   bitwise and of the 8-bit IP Type of Ser-
				       vice/IPv6  Traffic  Class in an incoming
				       packet with mask equals val.
     ---------------------------------------------------------------------------
       proto	 8    proto	       bitwise and of the 8-bit IP protocol  in
		      ipproto[:mask]   an  incoming  packet  with  mask  equals
				       ipproto.
     ---------------------------------------------------------------------------
      ethtype	 16   ethtype	       bitwise and of the 16-bit Ethernet  type
		      type[:mask]      field  of  an  incoming	frame with mask
				       equals type.
     ---------------------------------------------------------------------------
      macidx	 9    macidx	       bitwise and of the MAC Address Match In-
		      idx[:mask]       dex  of	an  incoming  frame  with  mask
				       equals idx.  The MAC Address Match Index
				       refers to an entry in the MPS TCAM or in
				       the  MPS  hash.	 See matchtype for more
				       information.
     ---------------------------------------------------------------------------
     matchtype	 3    matchtype        bitwise and of the Match Type of an  in-
		      type[:mask]      coming	frame  with  mask  equals  idx.
				       Match Type is one of the following:
				       0  destination MAC in incoming frame  is
					  a  unicast  L2  address  that is pro-
					  grammed in the MPS TCAM.  macidx  can
					  be  used to match the index (and thus
					  the MAC address) of the match in  the
					  TCAM.
				       1  destination  MAC in incoming frame is
					  a unicast L2	address  that  "hit"  a
					  hash	entry  in  the	MPS hash table.
					  macidx can be used to match the index
					  of the entry in the MPS hash table.
				       2  destination MAC in incoming frame  is
					  a  multicast	L2 address that is pro-
					  grammed in the MPS TCAM.  macidx  can
					  be  used to match the index (and thus
					  the MAC address) of the match in  the
					  TCAM.
				       3  destination  MAC in incoming frame is
					  a multicast L2 address that "hit"  an
					  entry in the MPS hash table.
				       4  interface on which incoming frame was
					  received  is	in promiscuous mode and
					  the destination MAC in the  frame  is
					  not a broadcast address, and does not
					  match in the MPS TCAM or the MPS hash
					  either.   (The  frame would have been
					  discarded if the interface wasn't  in
					  promiscuous mode.)
				       5  interface on which incoming frame was
					  received  is	in promiscuous mode and
					  the destination MAC in the  frame  is
					  not  a  broadcast  address; it wasn't
					  looked up in the MPS TCAM or the  MPS
					  hash	because  the chip is configured
					  to  give  precedence	to  promiscuous
					  mode classification.
				       6  destination  MAC in incoming frame is
					  a broadcast address.
				       7  Not documented.  Do not use.
     ---------------------------------------------------------------------------
       frag	 1    frag {0 | 1}     incoming frame is part of  a  fragmented
				       IP datagram(1) or not(0).

     filter idx filter-specification
     Program  a filter at the index specified by idx.  filter-specification con-
     sists of one or more matches to try against an incoming frame and an action
     to perform when all matches succeed.

     filter idx delete
     Delete filter that is at the given index.

     filter list
     List all filters programmed into the hardware.

     i2c port_id devaddr addr [len]

     loadcfg fw-config.txt
     Install the firmware configuration file contained in fw-config.txt  to  the
     card.   Set  hw.cxgbe.config_file="flash" in loader.conf to get cxgbe(4) to
     use the on-flash configuration.

     loadcfg clear
     Erase configuration file from the card.

     loadfw fw-image.bin
     Install the firmware contained in fw-image.bin to the card.

     memdump addr len
     Display len bytes of data of the  card's  memory  starting  at  addr.   The
     card's memory map is available in dev.t4nex.%d.misc.meminfo.

     {reg | reg64} addr[=val]

     regdump [register-block ...]
     Display  contents	of  device registers.  One or more register-block can be
     specified to limit the registers displayed.  The default is to display reg-
     isters for all blocks.  Registers with read side effects are not read  dur-
     ing a regdump operation.  register-block can be sge pci dbg mc ma edc0 edc1
     cim  tp ulp_rx ulp_tx pmrx pmtx mps cplsw smb i2c mi uart pmu sf pl le ncsi
     xgmac.

     sched-class config [param value]
     Configure optional feature capabilities for the TX scheduler.

	   type scheduler-type
	   Use packet for the packet scheduler.

	   minmax value
	   A non-zero value will enable "minmax" mode; a zero value will disable
	   "minmax" mode.

	   NOTE:  Many (most) of the parameters and constraints are adapter-spe-
	   cific - for instance the number of channels	and  classes  which  are
	   available  whether  various	modes are implemented, etc.  Consult the
	   adapter documentation for specific information on any limitations.

     sched-class params [param value]
     Configure parameters for a scheduling class.

	   type scheduler-type
	   Use packet for packet scheduler.

	   level scheduler-hierarchy-level
	   The "level" within the scheduling hierarchy which is being programed:

		 cl-rl	 Class Rate Limiting.

		 cl-wrr  Class Weighted Round Robin.

		 cl-wrr  Channel Rate Limiting.

	   mode scheduler-mode
	   The mode in which the scheduling class is going to operate:

		 class	All of the "flows" bound to the scheduling class will be
			held to aggregate scheduling constraints.

		 flow	Each of the "flows" bound to the scheduling  class  will
			be held to the scheduling constraints.

	   E.g.  if  the scheduling class has a TX bandwidth of 10Mb/s, in class
	   mode, all of the "flows" bound to the class would be  limited  to  an
	   aggregate bandwidth of 10Mb/s; but in flow mode, each of the  "flows"
	   bound to the scheduling class would be limited to 10Mb/s.

	   rate-unit scheduler-rate-unit
	   The units of the scheduler rate constraints:

		 bits  bit rate in Kb/s.

		 pkts  packets/s.

	   rate-mode scheduler-rate-mode
	   The mode of the scheduler rate constraints:

		 relative  percent of port rate.

		 absolute  Kb/s.

	   channel scheduler-channel-index
	   The scheduling channel to which the scheduling class will be bound.

	   class scheduler-class-index
	   The scheduling class being programmed.

	   min-rate minimum-rate
	   The minimum guaranteed rate to which a rate-limiting scheduling class
	   hierarchy will have access.

	   max-rate maximum-rate
	   The maximum rate for a rate-limiting scheduling class hierarchy.

	   weight round-robin-weight
	   The	weight	to be used for a weighted-round-robin scheduling hierar-
	   chy.

	   pkt-size average-packet-size
	   The average packet size will be used to compute scheduler constraints
	   for a rate-limited scheduler class hierarchy.

	   NOTE:  Many (most) of the parameters and constraints are adapter-spe-
	   cific - for instance the number of channels	and  classes  which  are
	   available,  whether	various modes are implemented, etc.  Consult the
	   adapter documentation for specific information on any limitations.

     sched-queue port queue class
     Bind the indicated port's NIC TX queue to the specified TX Scheduler class.
     If the TX queue is all, * or any negative value, the binding will apply  to
     all   of	the  TX  queues  associated  with the interface. If the class is
     unbind, clear or any negative value, the TX queue(s) will be  unbound  from
     any current TX Scheduler Class binding.

     stdio
     Switch to interactive mode.

     tcb tid
     Display contents of the hardware TCB (TCP Control Block) for the connection
     identfied by tid.

FILES
     /sys/dev/cxgbe/t4_ioctl.h

AUTHORS
     This manual page was written by Navdeep Parhar <np@FreeBSD.org>.

FreeBSD 11.1			  March 6, 2017 		    CXGBETOOL(8)

home | help