2 Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in
13 the documentation and/or other materials provided with the
15 * Neither the name of Intel Corporation nor the names of its
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 Testpmd Runtime Functions
32 =========================
34 Where the testpmd application is started in interactive mode, (-i|--interactive),
35 it displays a prompt that can be used to start and stop forwarding,
36 configure the application, display statistics, set the Flow Director and other tasks.
38 .. code-block:: console
42 The testpmd prompt has some, limited, readline support.
43 Common bash command- line functions such as Ctrl+a and Ctrl+e to go to the start and end of the prompt line are supported
44 as well as access to the command history via the up-arrow.
46 There is also support for tab completion.
47 If you type a partial command and hit <TAB> you get a list of the available completions:
49 .. code-block:: console
51 testpmd> show port <TAB>
53 info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap X
54 info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap all
55 stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap X
56 stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap all
62 The testpmd has on-line help for the functions that are available at runtime.
63 These are divided into sections and can be accessed using help, help section or help all:
65 .. code-block:: console
69 Help is available for the following sections:
70 help control : Start and stop forwarding.
71 help display : Displaying port, stats and config information.
72 help config : Configuration information.
73 help ports : Configuring ports.
74 help registers : Reading and setting port registers.
75 help filters : Filters configuration help.
76 help all : All of the above sections.
84 Start packet forwarding with current configuration:
91 Start packet forwarding with current configuration after sending one burst of packets:
98 Stop packet forwarding, and display accumulated statistics:
112 The functions in the following sections are used to display information about the
113 testpmd configuration or the NIC status.
118 Display information for a given port or all ports:
120 show port (info|stats|fdir|stat_qmap) (port_id|all)
122 The available information categories are:
124 info : General port information such as MAC address.
126 stats : RX/TX statistics.
128 fdir : Flow Director information and statistics.
130 stat_qmap : Queue statistics mapping.
134 .. code-block:: console
136 testpmd> show port info 0
138 ********************* Infos for port 0 *********************
140 MAC address: XX:XX:XX:XX:XX:XX
142 Link speed: 10000 Mbps
143 Link duplex: full-duplex
144 Promiscuous mode: enabled
145 Allmulticast mode: disabled
146 Maximum number of MAC addresses: 127
155 Display the rss redirection table entry indicated by masks on port X:
157 show port (port_id) rss reta (size) (mask0, mask1...)
159 size is used to indicate the hardware supported reta size
164 Display the RSS hash functions and RSS hash key of a port:
166 show port (port_id) rss-hash [key]
171 Clear the port statistics for a given port or for all ports:
173 clear port (info|stats|fdir|stat_qmap) (port_id|all)
177 .. code-block:: console
179 testpmd> clear port stats all
184 Displays the configuration of the application.
185 The configuration comes from the command-line, the runtime or the application defaults:
187 show config (rxtx|cores|fwd)
189 The available information categories are:
191 rxtx : RX/TX configuration items.
193 cores : List of forwarding cores.
195 fwd : Packet forwarding configuration.
199 .. code-block:: console
201 testpmd> show config rxtx
203 io packet forwarding - CRC stripping disabled - packets/burst=16
204 nb forwarding cores=2 - nb forwarding ports=1
205 RX queues=1 - RX desc=128 - RX free threshold=0
206 RX threshold registers: pthresh=8 hthresh=8 wthresh=4
207 TX queues=1 - TX desc=512 - TX free threshold=0
208 TX threshold registers: pthresh=36 hthresh=0 wthresh=0
209 TX RS bit threshold=0 - TXQ flags=0x0
214 Display an RX descriptor for a port RX queue:
216 read rxd (port_id) (queue_id) (rxd_id)
220 .. code-block:: console
222 testpmd> read rxd 0 0 4
223 0x0000000B - 0x001D0180 / 0x0000000B - 0x001D0180
228 Display a TX descriptor for a port TX queue:
230 read txd (port_id) (queue_id) (txd_id)
234 .. code-block:: console
236 testpmd> read txd 0 0 4
237 0x00000001 - 0x24C3C440 / 0x000F0000 - 0x2330003C
239 Configuration Functions
240 -----------------------
242 The testpmd application can be configured from the runtime as well as from the command-line.
244 This section details the available configuration functions that are available.
248 Configuration changes only become active when forwarding is started/restarted.
253 Reset forwarding to the default configuration:
260 Set the debug verbosity level:
264 Currently the only available levels are 0 (silent except for error) and 1 (fully verbose).
269 Set the number of ports used by the application:
273 This is equivalent to the --nb-ports command-line option.
278 Set the number of cores used by the application:
282 This is equivalent to the --nb-cores command-line option.
286 The number of cores used must not be greater than number of ports used multiplied by the number of queues per port.
291 Set the forwarding cores hexadecimal mask:
295 This is equivalent to the --coremask command-line option.
299 The master lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
304 Set the forwarding ports hexadecimal mask:
308 This is equivalent to the --portmask command-line option.
313 Set number of packets per burst:
317 This is equivalent to the --burst command-line option.
319 In mac_retry forwarding mode, the transmit delay time and number of retries can also be set.
321 set burst tx delay (micrseconds) retry (num)
326 Set the length of each segment of the TX-ONLY packets:
330 Where x[,y]* represents a CSV list of values, without white space.
335 Set the list of forwarding cores:
337 set corelist (x[,y]*)
339 For example, to change the forwarding cores:
341 .. code-block:: console
343 testpmd> set corelist 3,1
344 testpmd> show config fwd
346 io packet forwarding - ports=2 - cores=2 - streams=2 - NUMA support disabled
347 Logical Core 3 (socket 0) forwards packets on 1 streams:
348 RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
349 Logical Core 1 (socket 0) forwards packets on 1 streams:
350 RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
354 The cores are used in the same order as specified on the command line.
359 Set the list of forwarding ports:
361 set portlist (x[,y]*)
363 For example, to change the port forwarding:
365 .. code-block:: console
367 testpmd> set portlist 0,2,1,3
368 testpmd> show config fwd
370 io packet forwarding - ports=4 - cores=1 - streams=4
371 Logical Core 3 (socket 0) forwards packets on 4 streams:
372 RX P=0/Q=0 (socket 0) -> TX P=2/Q=0 (socket 0) peer=02:00:00:00:00:01
373 RX P=2/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
374 RX P=1/Q=0 (socket 0) -> TX P=3/Q=0 (socket 0) peer=02:00:00:00:00:03
375 RX P=3/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:02
380 Set the VLAN strip on a port:
382 vlan set strip (on|off) (port_id)
387 Set the VLAN strip for a queue on a port:
389 vlan set stripq (on|off) (port_id,queue_id)
394 Set the VLAN filter on a port:
396 vlan set filter (on|off) (port_id)
401 Set the VLAN QinQ (extended queue in queue) on for a port:
403 vlan set qinq (on|off) (port_id)
408 Set the outer VLAN TPID for packet filtering on a port:
410 vlan set tpid (value) (port_id)
414 TPID value must be a 16-bit number (value <= 65536).
419 Add a VLAN ID, or all identifiers, to the set of VLAN identifiers filtered by port ID:
421 rx_vlan add (vlan_id|all) (port_id)
425 VLAN filter must be set on that port. VLAN ID < 4096.
430 Remove a VLAN ID, or all identifiers, from the set of VLAN identifiers filtered by port ID:
432 rx_vlan rm (vlan_id|all) (port_id)
437 Add a VLAN ID, to the set of VLAN identifiers filtered for VF(s) for port ID:
439 rx_vlan add (vlan_id) port (port_id) vf (vf_mask)
444 Remove a VLAN ID, from the set of VLAN identifiers filtered for VF(s) for port ID:
446 rx_vlan rm (vlan_id) port (port_id) vf (vf_mask)
451 Set the outer VLAN TPID for packet filtering on a port:
453 rx_vlan set tpid (value) (port_id)
458 Add a tunnel filter on a port:
460 tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) (inner_vlan)
461 (tunnel_type) (filter_type) (tenant_id) (queue_id)
466 Remove a tunnel filter on a port:
468 tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) (inner_vlan)
469 (tunnel_type) (filter_type) (tenant_id) (queue_id)
474 Add an UDP port for VXLAN packet filter on a port:
476 rx_vxlan_port add (udp_port) (port_id)
481 Remove an UDP port for VXLAN packet filter on a port:
483 rx_vxlan_port rm (udp_port) (port_id)
488 Set hardware insertion of VLAN ID in packets sent on a port:
490 tx_vlan set (vlan_id) (port_id)
495 Set port based hardware insertion of VLAN ID in pacekts sent on a port:
497 tx_vlan set pvid (port_id) (vlan_id) (on|off)
502 Disable hardware insertion of a VLAN header in packets sent on a port:
504 tx_vlan reset (port_id)
509 Select hardware or software calculation of the checksum when
510 transmitting a packet using the csum forward engine:
512 tx_cksum set (ip|udp|tcp|sctp|vxlan)
514 ip|udp|tcp|sctp always concern the inner layer.
515 vxlan concerns the outer IP and UDP layer (in case the packet
516 is recognized as a vxlan packet by the forward engine)
520 Check the NIC Datasheet for hardware limits.
525 Display tx checksum offload configuration:
527 tx_checksum show (port_id)
532 Enable TCP Segmentation Offload in csum forward engine:
534 tso set (segsize) (port_id)
537 Please check the NIC datasheet for HW limits
542 Display the status of TCP Segmentation Offload:
549 Set the packet forwarding mode:
551 set fwd (io|mac|mac_retry|macswap|flowgen|rxonly|txonly|csum|icmpecho)
553 The available information categories are:
555 * io: forwards packets "as-is" in I/O mode.
556 This is the fastest possible forwarding operation as it does not access packets data.
557 This is the default mode.
559 * mac: changes the source and the destination Ethernet addresses of packets before forwarding them.
561 * mac_retry: same as "mac" forwarding mode, but includes retries if the destination queue is full.
563 * macswap: MAC swap forwarding mode.
564 Swaps the source and the destination Ethernet addresses of packets before forwarding them.
566 * flowgen: multi-flow generation mode.
567 Originates a bunch of flows (varying destination IP addresses), and terminate receive traffic.
569 * rxonly: receives packets but doesn't transmit them.
571 * txonly: generates and transmits packets without receiving any.
573 * csum: changes the checksum field with HW or SW methods depending on the offload flags on the packet.
575 * icmpecho: receives a burst of packets, lookup for IMCP echo requests and, if any, send back ICMP echo replies.
580 .. code-block:: console
582 testpmd> set fwd rxonly
584 Set rxonly packet forwarding mode
589 Add an alternative MAC address to a port:
591 mac_addr add (port_id) (XX:XX:XX:XX:XX:XX)
596 Remove a MAC address from a port:
598 mac_addr remove (port_id) (XX:XX:XX:XX:XX:XX)
603 Add an alternative MAC address for a VF to a port:
605 mac_add add port (port_id) vf (vf_id) (XX:XX:XX:XX:XX:XX)
610 Set the unicast hash filter(s) on/off for a port X:
612 set port (port_id) uta (XX:XX:XX:XX:XX:XX|all) (on|off)
617 Set the promiscuous mode on for a port or for all ports.
618 In promiscuous mode packets are not dropped if they aren't for the specified MAC address:
620 set promisc (port_id|all) (on|off)
625 Set the allmulti mode for a port or for all ports:
627 set allmulti (port_id|all) (on|off)
629 Same as the ifconfig (8) option. Controls how multicast packets are handled.
634 Set the link flow control parameter on a port:
636 set flow_ctrl rx (on|off) tx (on|off) (high_water) (low_water) \
637 (pause_time) (send_xon) (port_id)
641 high_water (integer): High threshold value to trigger XOFF.
643 low_water (integer) : Low threshold value to trigger XON.
645 pause_time (integer): Pause quota in the Pause frame.
647 send_xon (0/1) : Send XON frame.
649 mac_ctrl_frame_fwd : Enable receiving MAC control frames
654 Set the priority flow control parameter on a port:
656 set pfc_ctrl rx (on|off) tx (on|off) (high_water) (low_water) \ (pause_time) (priority) (port_id)
660 priority (0-7): VLAN User Priority.
665 Set statistics mapping (qmapping 0..15) for RX/TX queue on port:
667 set stat_qmap (tx|rx) (port_id) (queue_id) (qmapping)
669 For example, to set rx queue 2 on port 0 to mapping 5:
671 .. code-block:: console
673 testpmd>set stat_qmap rx 0 2 5
675 set port - rx/tx(for VF)
676 ~~~~~~~~~~~~~~~~~~~~~~~~
678 Set VF receive/transmit from a port:
680 set port (port_id) vf (vf_id) (rx|tx) (on|off)
682 set port - mac address filter (for VF)
683 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
685 Add/Remove unicast or multicast MAC addr filter for a VF:
687 set port (port_id) vf (vf_id) (mac_addr)
688 (exact-mac|exact-mac-vlan|hashmac|hashmac-vlan) (on|off)
690 set port - rx mode(for VF)
691 ~~~~~~~~~~~~~~~~~~~~~~~~~~
693 Set the VF receive mode of a port:
695 set port (port_id) vf (vf_id) rxmode (AUPE|ROPE|BAM|MPE) (on|off)
697 The available receive modes are:
699 * AUPE: accepts untagged VLAN.
701 * ROPE: accepts unicast hash.
703 * BAM: accepts broadcast packets
705 * MPE: accepts all multicast packets
707 set port - tx_rate (for Queue)
708 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
710 Set TX rate limitation for queue of a port ID:
712 set port (port_id) queue (queue_id) rate (rate_value)
714 set port - tx_rate (for VF)
715 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
717 Set TX rate limitation for queues in VF of a port ID:
719 set port (port_id) vf (vf_id) rate (rate_value) queue_mask (queue_mask)
721 set port - mirror rule
722 ~~~~~~~~~~~~~~~~~~~~~~
724 Set port or vlan type mirror rule for a port.
726 set port (port_id) mirror-rule (rule_id) (pool-mirror|vlan-mirror) (poolmask|vlanid[,vlanid]*) dst-pool (pool_id) (on|off)
728 For example to enable mirror traffic with vlan 0,1 to pool 0:
730 .. code-block:: console
732 set port 0 mirror-rule 0 vlan-mirror 0,1 dst-pool 0 on
734 reset port - mirror rule
735 ~~~~~~~~~~~~~~~~~~~~~~~~
737 Reset a mirror rule for a port.
739 reset port (port_id) mirror-rule (rule_id)
744 Flush (default) or don't flush RX streams before forwarding.
745 Mainly used with PCAP drivers to avoid the default behavior of flushing the first 512 packets on RX streams.
752 Set the bypass mode for the lowest port on bypass enabled NIC.
754 set bypass mode (normal|bypass|isolate) (port_id)
759 Set the event required to initiate specified bypass mode for the lowest port on a bypass enabled NIC where:
761 * timeout: enable bypass after watchdog timeout.
763 * os_on: enable bypass when OS/board is powered on.
765 * os_off: enable bypass when OS/board is powered off.
767 * power_on: enable bypass when power supply is turned on.
769 * power_off: enable bypass when power supply is turned off.
771 set bypass event (timeout|os_on|os_off|power_on|power_off) mode (normal|bypass|isolate) (port_id)
776 Set the bypass watchdog timeout to 'n' seconds where 0 = instant.
778 set bypass timeout (0|1.5|2|3|4|8|16|32)
783 Show the bypass configuration for a bypass enabled NIC using the lowest port on the NIC.
785 show bypass config (port_id)
790 Set link up for a port.
792 set link-up port (port id)
797 Set link down for a port.
799 set link-down port (port id)
804 The following sections show functions for configuring ports.
808 Port configuration changes only become active when forwarding is started/restarted.
813 Attach a port specified by pci address or virtual device args.
815 To attach a new pci device, the device should be recognized by kernel first.
816 Then it should be moved under DPDK management.
817 Finally the port can be attached to testpmd.
818 On the other hand, to attach a port created by virtual device, above steps are not needed.
820 port attach (identifier)
822 For example, to attach a port whose pci address is 0000:02:00.0.
824 .. code-block:: console
826 testpmd> port attach 0000:02:00.0
827 Attaching a new port...
829 Port 0 is attached. Now total ports is 1
832 For example, to attach a port created by pcap PMD.
834 .. code-block:: console
836 testpmd> port attach eth_pcap0,iface=eth0
837 Attaching a new port...
839 Port 0 is attached. Now total ports is 1
842 In this case, identifier is "eth_pcap0,iface=eth0".
843 This identifier format is the same as "--vdev" format of DPDK applications.
848 Detach a specific port.
850 Before detaching a port, the port should be closed.
851 Also to remove a pci device completely from the system, first detach the port from testpmd.
852 Then the device should be moved under kernel management.
853 Finally the device can be removed using kernel pci hotplug functionality.
854 On the other hand, to remove a port created by a virtual device, above steps are not needed.
856 port detach (port_id)
858 For example, to detach a port 0.
860 .. code-block:: console
862 testpmd> port detach 0
870 Start all ports or a specific port:
872 port start (port_id|all)
877 Stop all ports or a specific port:
879 port stop (port_id|all)
884 Close all ports or a specific port:
886 port close (port_id|all)
888 port start/stop queue
889 ~~~~~~~~~~~~~~~~~~~~~
891 Start/stop a rx/tx queue on a specific port:
893 port (port_id) (rxq|txq) (queue_id) (start|stop)
895 Only take effect when port is started.
900 Set the speed and duplex mode for all ports or a specific port:
902 port config (port_id|all) speed (10|100|1000|10000|auto) duplex (half|full|auto)
904 port config - queues/descriptors
905 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
907 Set number of queues/descriptors for rxq, txq, rxd and txd:
909 port config all (rxq|txq|rxd|txd) (value)
911 This is equivalent to the --rxq, --txq, --rxd and --txd command-line options.
913 port config - max-pkt-len
914 ~~~~~~~~~~~~~~~~~~~~~~~~~
916 Set the maximum packet length:
918 port config all max-pkt-len (value)
920 This is equivalent to the --max-pkt-len command-line option.
922 port config - CRC Strip
923 ~~~~~~~~~~~~~~~~~~~~~~~
925 Set hardware CRC stripping on or off for all ports:
927 port config all crc-strip (on|off)
929 CRC stripping is off by default.
931 The on option is equivalent to the --crc-strip command-line option.
933 port config - RX Checksum
934 ~~~~~~~~~~~~~~~~~~~~~~~~~
936 Set hardware RX checksum offload to on or off for all ports:
938 port config all rx-cksum (on|off)
940 Checksum offload is off by default.
942 The on option is equivalent to the --enable-rx-cksum command-line option.
947 Set hardware VLAN on or off for all ports:
949 port config all hw-vlan (on|off)
951 Hardware VLAN is on by default.
953 The off option is equivalent to the --disable-hw-vlan command-line option.
955 port config - Drop Packets
956 ~~~~~~~~~~~~~~~~~~~~~~~~~~
958 Set packet drop for packets with no descriptors on or off for all ports:
960 port config all drop-en (on|off)
962 Packet dropping for packets with no descriptors is off by default.
964 The on option is equivalent to the --enable-drop-en command-line option.
969 Set the RSS (Receive Side Scaling) mode on or off:
971 port config all rss (ip|udp|none)
973 RSS is on by default.
975 The off option is equivalent to the --disable-rss command-line option.
977 port config - RSS Reta
978 ~~~~~~~~~~~~~~~~~~~~~~
980 Set the RSS (Receive Side Scaling) redirection table:
982 port config all rss reta (hash,queue)[,(hash,queue)]
987 Set the DCB mode for an individual port:
989 port config (port_id) dcb vt (on|off) (traffic_class) pfc (on|off)
991 The traffic class should be 4 or 8.
996 Set the number of packets per burst:
998 port config all burst (value)
1000 This is equivalent to the --burst command-line option.
1002 port config - Threshold
1003 ~~~~~~~~~~~~~~~~~~~~~~~
1005 Set thresholds for TX/RX queues:
1007 port config all (threshold) (value)
1009 Where the threshold type can be:
1011 * txpt: Set the prefetch threshold register of the TX rings, 0 <= value <= 255.
1013 * txht: Set the host threshold register of the TX rings, 0 <= value <= 255.
1015 * txwt: Set the write-back threshold register of the TX rings, 0 <= value <= 255.
1017 * rxpt: Set the prefetch threshold register of the RX rings, 0 <= value <= 255.
1019 * rxht: Set the host threshold register of the RX rings, 0 <= value <= 255.
1021 * rxwt: Set the write-back threshold register of the RX rings, 0 <= value <= 255.
1023 * txfreet: Set the transmit free threshold of the TX rings, 0 <= value <= txd.
1025 * rxfreet: Set the transmit free threshold of the RX rings, 0 <= value <= rxd.
1027 * txrst: Set the transmit RS bit threshold of TX rings, 0 <= value <= txd.
1028 These threshold options are also available from the command-line.
1030 Link Bonding Functions
1031 ----------------------
1033 The Link Bonding functions make it possible to dynamically create and
1034 manage link bonding devices from within testpmd interactive prompt.
1036 create bonded device
1037 ~~~~~~~~~~~~~~~~~~~~
1039 Create a new bonding device:
1041 create bonded device (mode) (socket)
1043 For example, to create a bonded device in mode 1 on socket 0.
1045 .. code-block:: console
1047 testpmd> create bonded 1 0
1048 created new bonded device (port X)
1053 Adds Ethernet device to a Link Bonding device:
1055 add bonding slave (slave id) (port id)
1057 For example, to add Ethernet device (port 6) to a Link Bonding device (port 10).
1059 .. code-block:: console
1061 testpmd> add bonding slave 6 10
1064 remove bonding slave
1065 ~~~~~~~~~~~~~~~~~~~~
1067 Removes an Ethernet slave device from a Link Bonding device:
1069 remove bonding slave (slave id) (port id)
1071 For example, to remove Ethernet slave device (port 6) to a Link Bonding device (port 10).
1073 .. code-block:: console
1075 testpmd> remove bonding slave 6 10
1080 Set the Link Bonding mode of a Link Bonding device:
1082 set bonding mode (value) (port id)
1084 For example, to set the bonding mode of a Link Bonding device (port 10) to broadcast (mode 3).
1086 .. code-block:: console
1088 testpmd> set bonding mode 3 10
1093 Set an Ethernet slave device as the primary device on a Link Bonding device:
1095 set bonding primary (slave id) (port id)
1097 For example, to set the Ethernet slave device (port 6) as the primary port of a Link Bonding device (port 10).
1099 .. code-block:: console
1101 testpmd> set bonding primary 6 10
1106 Set the MAC address of a Link Bonding device:
1108 set bonding mac (port id) (mac)
1110 For example, to set the MAC address of a Link Bonding device (port 10) to 00:00:00:00:00:01
1112 .. code-block:: console
1114 testpmd> set bonding mac 10 00:00:00:00:00:01
1116 set bonding xmit_balance_policy
1117 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1119 Set the transmission policy for a Link Bonding device when it is in Balance XOR mode:
1121 set bonding xmit_balance_policy (port_id) (l2|l23|l34)
1123 For example, set a Link Bonding device (port 10) to use a balance policy of layer 3+4 (IP addresses & UDP ports )
1125 .. code-block:: console
1127 testpmd> set bonding xmit_balance_policy 10 l34
1130 set bonding mon_period
1131 ~~~~~~~~~~~~~~~~~~~~~~
1133 Set the link status monitoring polling period in milliseconds for a bonding devicie.
1135 This adds support for PMD slave devices which do not support link status interrupts.
1136 When the mon_period is set to a value greater than 0 then all PMD's which do not support
1137 link status ISR will be queried every polling interval to check if their link status has changed.
1139 set bonding mon_period (port_id) (value)
1141 For example, to set the link status monitoring polling period of bonded device (port 5) to 150ms
1143 .. code-block:: console
1145 testpmd> set bonding mon_period 5 150
1151 Show the current configuration of a Link Bonding device:
1153 show bonding config (port id)
1156 to show the configuration a Link Bonding device (port 9) with 3 slave devices (1, 3, 4)
1157 in balance mode with a transmission policy of layer 2+3.
1159 .. code-block:: console
1161 testpmd> show bonding config 9
1163 Balance Xmit Policy: BALANCE_XMIT_POLICY_LAYER23
1165 Active Slaves (3): [1 3 4]
1171 The Register functions can be used to read from and write to registers on the network card referenced by a port number.
1172 This is mainly useful for debugging purposes.
1173 Reference should be made to the appropriate datasheet for the network card for details on the register addresses
1174 and fields that can be accessed.
1179 Display the value of a port register:
1181 read reg (port_id) (address)
1183 For example, to examine the Flow Director control register (FDIRCTL, 0x0000EE000) on an Intel® 82599 10 GbE Controller:
1185 .. code-block:: console
1187 testpmd> read reg 0 0xEE00
1188 port 0 PCI register at offset 0xEE00: 0x4A060029 (1241907241)
1193 Display a port register bit field:
1195 read regfield (port_id) (address) (bit_x) (bit_y)
1197 For example, reading the lowest two bits from the register in the example above:
1199 .. code-block:: console
1201 testpmd> read regfield 0 0xEE00 0 1
1202 port 0 PCI register at offset 0xEE00: bits[0, 1]=0x1 (1)
1207 Display a single port register bit:
1209 read regbit (port_id) (address) (bit_x)
1211 For example, reading the lowest bit from the register in the example above:
1213 .. code-block:: console
1215 testpmd> read regbit 0 0xEE00 0
1216 port 0 PCI register at offset 0xEE00: bit 0=1
1221 Set the value of a port register:
1223 write reg (port_id) (address) (value)
1225 For example, to clear a register:
1227 .. code-block:: console
1229 testpmd> write reg 0 0xEE00 0x0
1230 port 0 PCI register at offset 0xEE00: 0x00000000 (0)
1235 Set bit field of a port register:
1237 write regfield (port_id) (address) (bit_x) (bit_y) (value)
1239 For example, writing to the register cleared in the example above:
1241 .. code-block:: console
1243 testpmd> write regfield 0 0xEE00 0 1 2
1244 port 0 PCI register at offset 0xEE00: 0x00000002 (2)
1249 Set single bit value of a port register:
1251 write regbit (port_id) (address) (bit_x) (value)
1253 For example, to set the high bit in the register from the example above:
1255 .. code-block:: console
1257 testpmd> write regbit 0 0xEE00 31 1
1258 port 0 PCI register at offset 0xEE00: 0x8000000A (2147483658)
1263 This section details the available filter functions that are available.
1266 ~~~~~~~~~~~~~~~~~~~~
1268 Add or delete a L2 Ethertype filter, which identify packets by their L2 Ethertype mainly assign them to a receive queue.
1270 ethertype_filter (port_id) (add|del) (mac_addr|mac_ignr) (mac_address) ethertype (ether_type) (drop|fwd) queue (queue_id)
1272 The available information parameters are:
1274 * port_id: the port which the Ethertype filter assigned on.
1276 * mac_addr: compare destination mac address.
1278 * mac_ignr: ignore destination mac address match.
1280 * mac_address: destination mac address to match.
1282 * ether_type: the EtherType value want to match,
1283 for example 0x0806 for ARP packet. 0x0800 (IPv4) and 0x86DD (IPv6) are invalid.
1285 * queue_id : The receive queue associated with this EtherType filter. It is meaningless when deleting or dropping.
1287 Example, to add/remove an ethertype filter rule:
1289 .. code-block:: console
1291 testpmd> ethertype_filter 0 add mac_ignr ethertype 0x0806 fwd queue 3
1292 testpmd> ethertype_filter 0 del mac_ignr ethertype 0x0806 fwd queue 3
1297 Add or delete a 2-tuple filter,
1298 which identify packets by specific protocol and destination TCP/UDP port
1299 and forwards packets into one of the receive queues.
1301 2tuple_filter (port_id) (add|del) dst_port (dst_port_value) protocol (protocol_value)
1302 mask (mask_value) tcp_flags (tcp_flags_value) priority (prio_value) queue (queue_id)
1304 The available information parameters are:
1306 * port_id: the port which the 2-tuple filter assigned on.
1308 * dst_port_value: destination port in L4.
1310 * protocol_value: IP L4 protocol.
1312 * mask_value: participates in the match or not by bit for field above, 1b means participate.
1314 * tcp_flags_value: TCP control bits. The non-zero value is invalid, when the pro_value is not set to 0x06 (TCP).
1316 * prio_value: priority of this filter.
1318 * queue_id: The receive queue associated with this 2-tuple filter.
1320 Example, to add/remove an 2tuple filter rule:
1322 .. code-block:: console
1324 testpmd> 2tuple_filter 0 add dst_port 32 protocol 0x06 mask 0x03 tcp_flags 0x02 priority 3 queue 3
1325 testpmd> 2tuple_filter 0 del dst_port 32 protocol 0x06 mask 0x03 tcp_flags 0x02 priority 3 queue 3
1330 Add or delete a 5-tuple filter,
1331 which consists of a 5-tuple (protocol, source and destination IP addresses, source and destination TCP/UDP/SCTP port)
1332 and routes packets into one of the receive queues.
1334 5tuple_filter (port_id) (add|del) dst_ip (dst_address) src_ip (src_address) dst_port (dst_port_value) src_port (src_port_value)
1335 protocol (protocol_value) mask (mask_value) tcp_flags (tcp_flags_value) priority (prio_value) queue (queue_id)
1337 The available information parameters are:
1339 * port_id: the port which the 5-tuple filter assigned on.
1341 * dst_address: destination IP address.
1343 * src_address: source IP address.
1345 * dst_port_value: TCP/UDP destination port.
1347 * src_port_value: TCP/UDP source port.
1349 * protocol_value: L4 protocol.
1351 * mask_value: participates in the match or not by bit for field above, 1b means participate
1353 * tcp_flags_value: TCP control bits. The non-zero value is invalid, when the protocol_value is not set to 0x06 (TCP).
1355 * prio_value: the priority of this filter.
1357 * queue_id: The receive queue associated with this 5-tuple filter.
1359 Example, to add/remove an 5tuple filter rule:
1361 .. code-block:: console
1363 testpmd> 5tuple_filter 0 add dst_ip 2.2.2.5 src_ip 2.2.2.4 dst_port 64 src_port 32 protocol 0x06 mask 0x1F flags 0x0 priority 3 queue 3
1364 testpmd> 5tuple_filter 0 del dst_ip 2.2.2.5 src_ip 2.2.2.4 dst_port 64 src_port 32 protocol 0x06 mask 0x1F flags 0x0 priority 3 queue 3
1369 By SYN filter, TCP packets whose *SYN* flag is set can be forwarded to a separate queue.
1371 syn_filter (port_id) (add|del) priority (high|low) queue (queue_id)
1373 The available information parameters are:
1375 * port_id: the port which the SYN filter assigned on.
1377 * high: this SYN filter has higher priority than other filters.
1379 * low: this SYN filter has lower priority than other filters.
1381 * queue_id: The receive queue associated with this SYN filter
1385 .. code-block:: console
1387 testpmd> syn_filter 0 add priority high queue 3
1392 With flex filter, packets can be recognized by any arbitrary pattern within the first 128 bytes of the packet
1393 and routes packets into one of the receive queues.
1395 flex_filter (port_id) (add|del) len (len_value) bytes (bytes_value)
1396 mask (mask_value) priority (prio_value) queue (queue_id)
1398 The available information parameters are:
1400 * port_id: the port which the Flex filter is assigned on.
1402 * len_value: filter length in bytes, no greater than 128.
1404 * bytes_value: a string in hexadecimal, means the value the flex filter needs to match.
1406 * mask_value: a string in hexadecimal, bit 1 means corresponding byte participates in the match.
1408 * prio_value: the priority of this filter.
1410 * queue_id: the receive queue associated with this Flex filter.
1414 .. code-block:: console
1416 testpmd> flex_filter 0 add len 16 bytes 0x00000000000000000000000008060000
1417 mask 000C priority 3 queue 3
1419 testpmd> flex_filter 0 del len 16 bytes 0x00000000000000000000000008060000
1420 mask 000C priority 3 queue 3
1422 flow_director_filter
1423 ~~~~~~~~~~~~~~~~~~~~
1425 The Flow Director works in receive mode to identify specific flows or sets of flows and route them to specific queues.
1427 Two types of filtering are supported which are referred to as Perfect Match and Signature filters, the match mode
1428 is set by the --pkt-filter-mode command-line parameter:
1430 * Perfect match filters.
1431 The hardware checks a match between the masked fields of the received packets and the programmed filters.
1433 * Signature filters.
1434 The hardware checks a match between a hash-based signature of the masked fields of the received packet.
1436 The Flow Director filters can match the different fields for different type of packet: flow type, specific input set
1437 per flow type and the flexible payload. The Flow Director can also mask out parts of all of these fields so that filters
1438 are only applied to certain fields or parts of the fields.
1440 Different NICs may have different capabilities, command show port fdir (port_id) can be used to acquire the information.
1442 # Commands to add flow director filters of different flow types.
1444 flow_director_filter (port_id) (add|del|update) flow (ip4|ip4-frag|ip6|ip6-frag)
1445 src (src_ip_address) dst (dst_ip_address) vlan (vlan_value) flexbytes (flexbytes_value)
1446 (drop|fwd) queue (queue_id) fd_id (fd_id_value)
1448 flow_director_filter (port_id) (add|del|update) flow (udp4|tcp4|udp6|tcp6)
1449 src (src_ip_address) (src_port) dst (dst_ip_address) (dst_port) vlan (vlan_value)
1450 flexbytes (flexbytes_value) (drop|fwd) queue (queue_id) fd_id (fd_id_value)
1452 flow_director_filter (port_id) (add|del|update) flow (sctp4|sctp6)
1453 src (src_ip_address) (src_port) dst (dst_ip_address) (dst_port) tag (verification_tag)
1454 vlan (vlan_value) flexbytes (flexbytes_value) (drop|fwd) queue (queue_id) fd_id (fd_id_value)
1456 For example, to add an udp flow type filter:
1458 .. code-block:: console
1460 testpmd> flow_director_filter 0 add flow udp4 src 2.2.2.3 32 dst 2.2.2.5 33 vlan 0x1 flexbytes (0x88,0x48) fwd queue 1 fd_id 1
1462 For example, add an ip4 flow type filter:
1464 .. code-block:: console
1466 testpmd> flow_director_filter 0 add flow ip4 src 2.2.2.3 dst 2.2.2.5 vlan 0x1 flexbytes (0x88,0x48) fwd queue 1 fd_id 1
1471 flush all flow director filters on a device:
1473 flush_flow_director (port_id)
1475 Example, to flush all flow director filter on port 0:
1477 .. code-block:: console
1479 testpmd> flush_flow_director 0
1484 set flow director's masks on match input set
1486 flow_director_mask (port_id) vlan (vlan_value) src_mask (ipv4_src) (ipv6_src) (src_port) dst_mask (ipv4_dst) (ipv6_dst) (dst_port)
1488 Example, to set flow director mask on port 0:
1490 .. code-block:: console
1492 testpmd> flow_director_mask 0 vlan 0xefff src_mask 255.255.255.255 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 0xFFFF dst_mask 255.255.255.255 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 0xFFFF
1495 flow_director_flex_mask
1496 ~~~~~~~~~~~~~~~~~~~~~~~
1498 set masks of flow director's flexible payload based on certain flow type:
1500 flow_director_flex_mask (port_id) flow (raw|ip4|ip4-frag|tcp4|udp4|sctp4|ip6|ip6-frag|tcp6|udp6|sctp6|all) (mask)
1502 Example, to set flow director's udpv4 flex mask on port 0:
1504 .. code-block:: console
1506 testpmd> flow_director_flex_mask 0 flow all (0xff,0xff,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
1509 flow_director_flex_payload
1510 ~~~~~~~~~~~~~~~~~~~~~~~~~~
1512 Configure flexible payload selection.
1514 flow_director_flex_payload (port_id) (raw|l2|l3|l4) (config)
1516 For example, to select the first 16 bytes from the offset 4 (bytes) of packet’s payload as flexible payload.
1518 .. code-block:: console
1520 testpmd> flow_director_flex_payload 0 l4 (4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19)