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 flowdir : Flow Director filter help.
75 help registers : Reading and setting port registers.
76 help filters : Filters configuration help.
77 help all : All of the above sections.
85 Start packet forwarding with current configuration:
92 Start packet forwarding with current configuration after sending one burst of packets:
99 Stop packet forwarding, and display accumulated statistics:
106 Quit to prompt in Linux or reboot on Baremetal:
113 The functions in the following sections are used to display information about the
114 testpmd configuration or the NIC status.
119 Display information for a given port or all ports:
121 show port (info|stats|fdir|stat_qmap) (port_id|all)
123 The available information categories are:
125 info : General port information such as MAC address.
127 stats : RX/TX statistics.
129 fdir : Flow Director information and statistics.
131 stat_qmap : Queue statistics mapping.
135 .. code-block:: console
137 testpmd> show port info 0
139 ********************* Infos for port 0 *********************
141 MAC address: XX:XX:XX:XX:XX:XX
143 Link speed: 10000 Mbps
144 Link duplex: full-duplex
145 Promiscuous mode: enabled
146 Allmulticast mode: disabled
147 Maximum number of MAC addresses: 127
156 Display the RSS hash functions and RSS hash key of port (port_id).
158 show port (port_id) rss-hash [key] clear port
159 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161 Clear the port statistics for a given port or for all ports:
163 clear port (info|stats|fdir|stat_qmap) (port_id|all)
167 .. code-block:: console
169 testpmd> clear port stats all
174 Displays the configuration of the application.
175 The configuration comes from the command-line, the runtime or the application defaults:
177 show config (rxtx|cores|fwd)
179 The available information categories are:
181 rxtx : RX/TX configuration items.
183 cores : List of forwarding cores.
185 fwd : Packet forwarding configuration.
189 .. code-block:: console
191 testpmd> show config rxtx
193 io packet forwarding - CRC stripping disabled - packets/burst=16
194 nb forwarding cores=2 - nb forwarding ports=1
195 RX queues=1 - RX desc=128 - RX free threshold=0
196 RX threshold registers: pthresh=8 hthresh=8 wthresh=4
197 TX queues=1 - TX desc=512 - TX free threshold=0
198 TX threshold registers: pthresh=36 hthresh=0 wthresh=0
199 TX RS bit threshold=0 - TXQ flags=0x0
204 Display an RX descriptor for a port RX queue:
206 read rxd (port_id) (queue_id) (rxd_id)
210 .. code-block:: console
212 testpmd> read rxd 0 0 4
213 0x0000000B - 0x001D0180 / 0x0000000B - 0x001D0180
218 Display a TX descriptor for a port TX queue:
220 read txd (port_id) (queue_id) (txd_id)
224 .. code-block:: console
226 testpmd> read txd 0 0 4
227 0x00000001 - 0x24C3C440 / 0x000F0000 - 0x2330003C
229 Configuration Functions
230 -----------------------
232 The testpmd application can be configured from the runtime as well as from the command-line.
234 This section details the available configuration functions that are available.
238 Configuration changes only become active when forwarding is started/restarted.
243 Reset forwarding to the default configuration:
250 Set the debug verbosity level:
254 Currently the only available levels are 0 (silent except for error) and 1 (fully verbose).
259 Set the number of ports used by the application:
263 This is equivalent to the --nb-ports command-line option.
268 Set the number of cores used by the application:
272 This is equivalent to the --nb-cores command-line option.
276 The number of cores used must not be greater than number of ports used multiplied by the number of queues per port.
281 Set the forwarding cores hexadecimal mask:
285 This is equivalent to the --coremask command-line option.
289 The master lcore is reserved for command line parsing only and cannot be masked on for packet forwarding.
294 Set the forwarding ports hexadecimal mask:
298 This is equivalent to the --portmask command-line option.
303 Set number of packets per burst:
307 This is equivalent to the --burst command-line option.
309 In mac_retry forwarding mode, the transmit delay time and number of retries can also be set.
311 set burst tx delay (micrseconds) retry (num)
316 Set the length of each segment of the TX-ONLY packets:
320 Where x[,y]* represents a CSV list of values, without white space.
325 Set the list of forwarding cores:
327 set corelist (x[,y]*)
329 For example, to change the forwarding cores:
331 .. code-block:: console
333 testpmd> set corelist 3,1
334 testpmd> show config fwd
336 io packet forwarding - ports=2 - cores=2 - streams=2 - NUMA support disabled
337 Logical Core 3 (socket 0) forwards packets on 1 streams:
338 RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
339 Logical Core 1 (socket 0) forwards packets on 1 streams:
340 RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
344 The cores are used in the same order as specified on the command line.
349 Set the list of forwarding ports:
351 set portlist (x[,y]*)
353 For example, to change the port forwarding:
355 .. code-block:: console
357 testpmd> set portlist 0,2,1,3
358 testpmd> show config fwd
360 io packet forwarding - ports=4 - cores=1 - streams=4
361 Logical Core 3 (socket 0) forwards packets on 4 streams:
362 RX P=0/Q=0 (socket 0) -> TX P=2/Q=0 (socket 0) peer=02:00:00:00:00:01
363 RX P=2/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
364 RX P=1/Q=0 (socket 0) -> TX P=3/Q=0 (socket 0) peer=02:00:00:00:00:03
365 RX P=3/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:02
370 Set the VLAN strip on a port:
372 vlan set strip (on|off) (port_id)
377 Set the VLAN strip for a queue on a port:
379 vlan set stripq (on|off) (port_id,queue_id)
384 Set the VLAN filter on a port:
386 vlan set filter (on|off) (port_id)
391 Set the VLAN QinQ (extended queue in queue) on for a port:
393 vlan set qinq (on|off) (port_id)
398 Set the outer VLAN TPID for packet filtering on a port:
400 vlan set tpid (value) (port_id)
404 TPID value must be a 16-bit number (value <= 65536).
409 Add a VLAN ID, or all identifiers, to the set of VLAN identifiers filtered by port ID:
411 rx_vlan add (vlan_id|all) (port_id)
415 VLAN filter must be set on that port. VLAN ID < 4096.
420 Remove a VLAN ID, or all identifiers, from the set of VLAN identifiers filtered by port ID:
422 rx_vlan rm (vlan_id|all) (port_id)
427 Add a VLAN ID, to the set of VLAN identifiers filtered for VF(s) for port ID:
429 rx_vlan add (vlan_id) port (port_id) vf (vf_mask)
434 Remove a VLAN ID, from the set of VLAN identifiers filtered for VF(s) for port ID:
436 rx_vlan rm (vlan_id) port (port_id) vf (vf_mask)
441 Set TX rate limitation for queue of a port ID:
443 set port (port_id) queue (queue_id) rate (rate_value)
448 Set TX rate limitation for queues in VF of a port ID:
450 set port (port_id) vf (vf_id) rate (rate_value) queue_mask (queue_mask)
455 Set the outer VLAN TPID for packet filtering on a port:
457 rx_vlan set tpid (value) (port_id)
462 Set hardware insertion of VLAN ID in packets sent on a port:
464 tx_vlan set (vlan_id) (port_id)
469 Set port based hardware insertion of VLAN ID in pacekts sent on a port:
471 tx_vlan set pvid (port_id) (vlan_id) (on|off)
476 Disable hardware insertion of a VLAN header in packets sent on a port:
478 tx_vlan reset (port_id)
483 Enable hardware insertion of checksum offload with a 4-bit mask, 0x0 - 0xF, in packets sent on a port:
485 tx_checksum set (mask) (port_id)
487 The bits in the mask are:
489 bit 0 - if set insert ip checksum offload
491 bit 1 - if set insert udp checksum offload
493 bit 2 - if set insert tcp checksum offload
495 bit 3 - if set insert sctp checksum offload
499 Check the NIC Datasheet for hardware limits.
505 Set the packet forwarding mode:
507 set fwd (io|mac|mac_retry|macswap|flowgen|rxonly|txonly|csum|icmpecho)
509 The available information categories are:
511 * io: forwards packets "as-is" in I/O mode.
512 This is the fastest possible forwarding operation as it does not access packets data.
513 This is the default mode.
515 * mac: changes the source and the destination Ethernet addresses of packets before forwarding them.
517 * mac_retry: same as "mac" forwarding mode, but includes retries if the destination queue is full.
519 * macswap: MAC swap forwarding mode.
520 Swaps the source and the destination Ethernet addresses of packets before forwarding them.
522 * flowgen: multi-flow generation mode.
523 Originates a bunch of flows (varying destination IP addresses), and terminate receive traffic.
525 * rxonly: receives packets but doesn't transmit them.
527 * txonly: generates and transmits packets without receiving any.
529 * csum: changes the checksum field with HW or SW methods depending on the offload flags on the packet.
531 * icmpecho: receives a burst of packets, lookup for IMCP echo requests and, if any, send back ICMP echo replies.
536 .. code-block:: console
538 testpmd> set fwd rxonly
540 Set rxonly packet forwarding mode
545 Add an alternative MAC address to a port:
547 mac_addr add (port_id) (XX:XX:XX:XX:XX:XX)
552 Remove a MAC address from a port:
554 mac_addr remove (port_id) (XX:XX:XX:XX:XX:XX)
559 Add an alternative MAC address for a VF to a port:
561 mac_add add port (port_id) vf (vf_id) (XX:XX:XX:XX:XX:XX)
566 Set the unicast hash filter(s) on/off for a port X:
568 set port (port_id) uta (XX:XX:XX:XX:XX:XX|all) (on|off)
573 Set the promiscuous mode on for a port or for all ports.
574 In promiscuous mode packets are not dropped if they aren't for the specified MAC address:
576 set promisc (port_id|all) (on|off)
581 Set the allmulti mode for a port or for all ports:
583 set allmulti (port_id|all) (on|off)
585 Same as the ifconfig (8) option. Controls how multicast packets are handled.
590 Set the link flow control parameter on a port:
592 set flow_ctrl rx (on|off) tx (on|off) (high_water) (low_water) \
593 (pause_time) (send_xon) (port_id)
597 high_water (integer): High threshold value to trigger XOFF.
599 low_water (integer) : Low threshold value to trigger XON.
601 pause_time (integer): Pause quota in the Pause frame.
603 send_xon (0/1) : Send XON frame.
605 mac_ctrl_frame_fwd : Enable receiving MAC control frames
610 Set the priority flow control parameter on a port:
612 set pfc_ctrl rx (on|off) tx (on|off) (high_water) (low_water) \ (pause_time) (priority) (port_id)
616 priority (0-7): VLAN User Priority.
621 Set statistics mapping (qmapping 0..15) for RX/TX queue on port:
623 set stat_qmap (tx|rx) (port_id) (queue_id) (qmapping)
625 For example, to set rx queue 2 on port 0 to mapping 5:
627 .. code-block:: console
629 testpmd>set stat_qmap rx 0 2 5
631 set port - rx/tx(for VF)
632 ~~~~~~~~~~~~~~~~~~~~~~~~
634 Set VF receive/transmit from a port:
636 set port (port_id) vf (vf_id) (rx|tx) (on|off)
638 set port - rx mode(for VF)
639 ~~~~~~~~~~~~~~~~~~~~~~~~~~
641 Set the VF receive mode of a port:
643 set port (port_id) vf (vf_id) rxmode (AUPE|ROPE|BAM|MPE) (on|off)
645 The available receive modes are:
647 * AUPE: accepts untagged VLAN.
649 * ROPE: accepts unicast hash.
651 * BAM: accepts broadcast packets
653 * MPE: accepts all multicast packets
655 set port - mirror rule
656 ~~~~~~~~~~~~~~~~~~~~~~
658 Set port or vlan type mirror rule for a port.
660 set port (port_id) mirror-rule (rule_id) (pool-mirror|vlan-mirror) (poolmask|vlanid[,vlanid]*) dst-pool (pool_id) (on|off)
662 For example to enable mirror traffic with vlan 0,1 to pool 0:
664 .. code-block:: console
666 set port 0 mirror-rule 0 vlan-mirror 0,1 dst-pool 0 on
668 reset port - mirror rule
669 ~~~~~~~~~~~~~~~~~~~~~~~~
671 Reset a mirror rule for a port.
673 reset port (port_id) mirror-rule (rule_id)
678 Flush (default) or don't flush RX streams before forwarding.
679 Mainly used with PCAP drivers to avoid the default behavior of flushing the first 512 packets on RX streams.
686 Set the bypass mode for the lowest port on bypass enabled NIC.
688 set bypass mode (normal|bypass|isolate) (port_id)
693 Set the event required to initiate specified bypass mode for the lowest port on a bypass enabled NIC where:
695 * timeout: enable bypass after watchdog timeout.
697 * os_on: enable bypass when OS/board is powered on.
699 * os_off: enable bypass when OS/board is powered off.
701 * power_on: enable bypass when power supply is turned on.
703 * power_off: enable bypass when power supply is turned off.
705 set bypass event (timeout|os_on|os_off|power_on|power_off) mode (normal|bypass|isolate) (port_id)
710 Set the bypass watchdog timeout to 'n' seconds where 0 = instant.
712 set bypass timeout (0|1.5|2|3|4|8|16|32)
717 Show the bypass configuration for a bypass enabled NIC using the lowest port on the NIC.
719 show bypass config (port_id)
724 Add a L2 Ethertype filter, which identify packets by their L2 Ethertype mainly assign them to a receive queue.
726 add_ethertype_filter (port_id) ethertype (eth_value) priority (enable|disable) (pri_value) queue (queue_id) index (idx)
728 The available information parameters are:
730 * port_id: the port which the Ethertype filter assigned on.
732 * eth_value: the EtherType value want to match,
733 for example 0x0806 for ARP packet. 0x0800 (IPv4) and 0x86DD (IPv6) are invalid.
735 * enable: user priority participates in the match.
737 * disable: user priority doesn't participate in the match.
739 * pri_value: user priority value that want to match.
741 * queue_id : The receive queue associated with this EtherType filter
743 * index: the index of this EtherType filter
747 .. code-block:: console
749 testpmd> add_ethertype_filter 0 ethertype 0x0806 priority disable 0 queue 3 index 0
750 Assign ARP packet to receive queue 3
752 remove_ethertype_filter
753 ~~~~~~~~~~~~~~~~~~~~~~~
755 Remove a L2 Ethertype filter
757 remove_ethertype_filter (port_id) index (idx)
762 Get and display a L2 Ethertype filter
764 get_ethertype_filter (port_id) index (idx)
768 .. code-block:: console
770 testpmd> get_ethertype_filter 0 index 0
780 Add a 2-tuple filter,
781 which identify packets by specific protocol and destination TCP/UDP port
782 and forwards packets into one of the receive queues.
784 add_2tuple_filter (port_id) protocol (pro_value) (pro_mask) dst_port (port_value) (port_mask)
785 flags (flg_value) priority (prio_value) queue (queue_id) index (idx)
787 The available information parameters are:
789 * port_id: the port which the 2-tuple filter assigned on.
791 * pro_value: IP L4 protocol
793 * pro_mask: protocol participates in the match or not, 1 means participate
795 * port_value: destination port in L4.
797 * port_mask: destination port participates in the match or not, 1 means participate.
799 * flg_value: TCP control bits. The non-zero value is invalid, when the pro_value is not set to 0x06 (TCP).
801 * prio_value: the priority of this filter.
803 * queue_id: The receive queue associated with this 2-tuple filter
805 * index: the index of this 2-tuple filter
809 .. code-block:: console
811 testpmd> add_2tuple_filter 0 protocol 0x06 1 dst_port 32 1 flags 0x02 priority 3 queue 3 index 0
816 Remove a 2-tuple filter
818 remove_2tuple_filter (port_id) index (idx)
823 Get and display a 2-tuple filter
825 get_2tuple_filter (port_id) index (idx)
829 .. code-block:: console
831 testpmd> get_2tuple_filter 0 index 0
834 Destination Port: 0x0020 mask: 1
835 protocol: 0x06 mask:1 tcp_flags: 0x02
841 Add a 5-tuple filter,
842 which consists of a 5-tuple (protocol, source and destination IP addresses, source and destination TCP/UDP/SCTP port)
843 and routes packets into one of the receive queues.
845 add_5tuple_filter (port_id) dst_ip (dst_address) src_ip (src_address) dst_port (dst_port_value) src_port (src_port_value)
846 protocol (protocol_value) mask (mask_value) flags (flags_value) priority (prio_value) queue (queue_id) index (idx)
848 The available information parameters are:
850 * port_id: the port which the 5-tuple filter assigned on.
852 * dst_address: destination IP address.
854 * src_address: source IP address.
856 * dst_port_value: TCP/UDP destination port.
858 * src_port_value: TCP/UDP source port.
860 * protocol_value: L4 protocol.
862 * mask_value: participates in the match or not by bit for field above, 1b means participate
864 * flags_value: TCP control bits. The non-zero value is invalid, when the protocol_value is not set to 0x06 (TCP).
866 * prio_value: the priority of this filter.
868 * queue_id: The receive queue associated with this 5-tuple filter.
870 * index: the index of this 5-tuple filter
874 .. code-block:: console
876 testpmd> add_5tuple_filter 1 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 index 0
881 Remove a 5-tuple filter
883 remove_5tuple_filter (port_id) index (idx)
888 Get and display a 5-tuple filter
890 get_5tuple_filter (port_id) index (idx)
894 .. code-block:: console
896 testpmd> get_5tuple_filter 1 index 0
899 Destination IP: 0x02020205 mask: 1
900 Source IP: 0x02020204 mask: 1
901 Destination Port: 0x0040 mask: 1
902 Source Port: 0x0020 mask: 1
903 protocol: 0x06 mask: 1
904 priority: 3 flags: 0x00 queue: 3
909 Add SYN filter, which can forward TCP packets whose *SYN* flag is set into a separate queue.
911 add_syn_filter (port_id) priority (high|low) queue (queue_id)
913 The available information parameters are:
915 * port_id: the port which the SYN filter assigned on.
917 * high: this SYN filter has higher priority than other filters.
919 * low: this SYN filter has lower priority than other filters.
921 * queue_id: The receive queue associated with this SYN filter
925 .. code-block:: console
927 testpmd> add_syn_filter 0 priority high queue 3,
934 remove_syn_filter (port_id)
939 Get and display SYN filter
941 get_syn_filter (port_id)
945 .. code-block:: console
947 testpmd> get_syn_filter 0
949 syn filter: on, priority: high, queue: 3
955 which recognizes any arbitrary pattern within the first 128 bytes of the packet
956 and routes packets into one of the receive queues.
958 add_flex_filter (port_id) len (len_value) bytes (bytes_string) mask (mask_value)
959 priority (prio_value) queue (queue_id) index (idx)
961 The available information parameters are:
963 * port_id: the port which the Flex filter assigned on.
965 * len_value: filter length in byte, no greater than 128.
967 * bytes_string: a sting in format of octal, means the value the flex filter need to match.
969 * mask_value: a sting in format of octal, bit 1 means corresponding byte in DWORD participates in the match.
971 * prio_value: the priority of this filter.
973 * queue_id: The receive queue associated with this Flex filter.
975 * index: the index of this Flex filter
979 .. code-block:: console
981 testpmd> add_flex_filter 0 len 16 bytes 0x00000000000000000000000008060000 mask 000C priority 3 queue 3 index 0
983 Assign a packet whose 13th and 14th bytes are 0x0806 to queue 3.
990 remove_flex_filter (port_id) index (idx)
995 Get and display a Flex filter
997 get_flex_filter (port_id) index (idx)
1001 .. code-block:: console
1003 testpmd> get_flex_filter 0 index 0
1009 dword[]: 0x00000000 00000000 00000000 08060000 00000000 00000000 00000000
1010 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
1011 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
1012 00000000 00000000 00000000 00000000 00000000 00000000 00000000
1015 0b0000000000001100000000000000000000000000000000000000000000000000000000
1016 0000000000000000000000000000000000000000000000000000000000
1018 priority: 3 queue: 3
1023 Set link up for a port.
1025 set link-up port (port id)
1030 Set link down for a port.
1032 set link-down port (port id)
1037 The following sections show functions for configuring ports.
1041 Port configuration changes only become active when forwarding is started/restarted.
1046 Start all ports or a specific port:
1048 port start (port_id|all)
1053 Stop all ports or a specific port:
1055 port stop (port_id|all)
1060 Close all ports or a specific port:
1062 port close (port_id|all)
1067 Set the speed and duplex mode for all ports or a specific port:
1069 port config (port_id|all) speed (10|100|1000|10000|auto) duplex (half|full|auto)
1071 port config - queues/descriptors
1072 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1074 Set number of queues/descriptors for rxq, txq, rxd and txd:
1076 port config all (rxq|txq|rxd|txd) (value)
1078 This is equivalent to the --rxq, --txq, --rxd and --txd command-line options.
1080 port config - max-pkt-len
1081 ~~~~~~~~~~~~~~~~~~~~~~~~~
1083 Set the maximum packet length:
1085 port config all max-pkt-len (value)
1087 This is equivalent to the --max-pkt-len command-line option.
1089 port config - CRC Strip
1090 ~~~~~~~~~~~~~~~~~~~~~~~
1092 Set hardware CRC stripping on or off for all ports:
1094 port config all crc-strip (on|off)
1096 CRC stripping is off by default.
1098 The on option is equivalent to the --crc-strip command-line option.
1100 port config - RX Checksum
1101 ~~~~~~~~~~~~~~~~~~~~~~~~~
1103 Set hardware RX checksum offload to on or off for all ports:
1105 port config all rx-cksum (on|off)
1107 Checksum offload is off by default.
1109 The on option is equivalent to the --enable-rx-cksum command-line option.
1114 Set hardware VLAN on or off for all ports:
1116 port config all hw-vlan (on|off)
1118 Hardware VLAN is on by default.
1120 The off option is equivalent to the --disable-hw-vlan command-line option.
1122 port config - Drop Packets
1123 ~~~~~~~~~~~~~~~~~~~~~~~~~~
1125 Set packet drop for packets with no descriptors on or off for all ports:
1127 port config all drop-en (on|off)
1129 Packet dropping for packets with no descriptors is off by default.
1131 The on option is equivalent to the --enable-drop-en command-line option.
1136 Set the RSS (Receive Side Scaling) mode on or off:
1138 port config all rss (ip|udp|none)
1140 RSS is on by default.
1142 The off option is equivalent to the --disable-rss command-line option.
1144 port config - RSS Reta
1145 ~~~~~~~~~~~~~~~~~~~~~~
1147 Set the RSS (Receive Side Scaling) redirection table:
1149 port config all rss reta (hash,queue)[,(hash,queue)]
1154 Set the DCB mode for an individual port:
1156 port config (port_id) dcb vt (on|off) (traffic_class) pfc (on|off)
1158 The traffic class should be 4 or 8.
1163 Set the number of packets per burst:
1165 port config all burst (value)
1167 This is equivalent to the --burst command-line option.
1169 port config - Threshold
1170 ~~~~~~~~~~~~~~~~~~~~~~~
1172 Set thresholds for TX/RX queues:
1174 port config all (threshold) (value)
1176 Where the threshold type can be:
1178 * txpt: Set the prefetch threshold register of the TX rings, 0 <= value <= 255.
1180 * txht: Set the host threshold register of the TX rings, 0 <= value <= 255.
1182 * txwt: Set the write-back threshold register of the TX rings, 0 <= value <= 255.
1184 * rxpt: Set the prefetch threshold register of the RX rings, 0 <= value <= 255.
1186 * rxht: Set the host threshold register of the RX rings, 0 <= value <= 255.
1188 * rxwt: Set the write-back threshold register of the RX rings, 0 <= value <= 255.
1190 * txfreet: Set the transmit free threshold of the TX rings, 0 <= value <= txd.
1192 * rxfreet: Set the transmit free threshold of the RX rings, 0 <= value <= rxd.
1194 * txrst: Set the transmit RS bit threshold of TX rings, 0 <= value <= txd.
1195 These threshold options are also available from the command-line.
1197 Flow Director Functions
1198 -----------------------
1200 The Flow Director works in receive mode to identify specific flows or sets of flows and route them to specific queues.
1202 Two types of filtering are supported which are referred to as Perfect Match and Signature filters:
1204 * Perfect match filters.
1205 The hardware checks a match between the masked fields of the received packets and the programmed filters.
1207 * Signature filters.
1208 The hardware checks a match between a hash-based signature of the masked fields of the received packet.
1210 The Flow Director filters can match the following fields in a packet:
1212 * Source IP and destination IP addresses.
1214 * Source port and destination port numbers (for UDP and TCP packets).
1216 * IPv4/IPv6 and UDP/ TCP/SCTP protocol match.
1220 * Flexible 2-byte tuple match anywhere in the first 64 bytes of the packet.
1222 The Flow Director can also mask out parts of all of these fields so that filters are only applied to certain fields
1223 or parts of the fields.
1224 For example it is possible to mask out sub-nets of IP addresses or to ignore VLAN headers.
1226 In the following sections, several common parameters are used in the Flow Director filters.
1227 These are explained below:
1229 * src: A pair of source address values. The source IP, in IPv4 or IPv6 format, and the source port:
1231 src 192.168.0.1 1024
1233 src 2001:DB8:85A3:0:0:8A2E:370:7000 1024
1235 * dst: A pair of destination address values. The destination IP, in IPv4 or IPv6 format, and the destination port.
1237 * flexbytes: A 2-byte tuple to be matched within the first 64 bytes of a packet.
1239 The offset where the match occurs is set by the --pkt-filter-flexbytes-offset command-line parameter
1240 and is counted from the first byte of the destination Ethernet MAC address.
1241 The default offset is 0xC bytes, which is the "Type" word in the MAC header.
1242 Typically, the flexbyte value is set to 0x0800 to match the IPv4 MAC type or 0x86DD to match IPv6.
1243 These values change when a VLAN tag is added.
1245 * vlan: The VLAN header to match in the packet.
1247 * queue: The index of the RX queue to route matched packets to.
1249 * soft: The 16-bit value in the MBUF flow director ID field for RX packets matching the filter.
1251 add_signature_filter
1252 ~~~~~~~~~~~~~~~~~~~~
1254 Add a signature filter:
1256 # Command is displayed on several lines for clarity.
1258 add_signature_filter (port_id) (ip|udp|tcp|sctp)
1260 src (src_ip_address) (src_port)
1262 dst (dst_ip_address) (dst_port)
1264 flexbytes (flexbytes_values)
1266 vlan (vlan_id) queue (queue_id)
1268 upd_signature_filter
1269 ~~~~~~~~~~~~~~~~~~~~
1271 Update a signature filter:
1273 # Command is displayed on several lines for clarity.
1275 upd_signature_filter (port_id) (ip|udp|tcp|sctp)
1277 src (src_ip_address) (src_port)
1279 dst (dst_ip_address) (dst_port)
1281 flexbytes (flexbytes_values)
1283 vlan (vlan_id) queue (queue_id)
1288 Remove a signature filter:
1290 # Command is displayed on several lines for clarity.
1292 rm_signature_filter (port_id) (ip|udp|tcp|sctp)
1294 src (src_ip_address) (src_port)
1296 dst (dst_ip_address) (dst_port)
1298 flexbytes (flexbytes_values)
1305 Add a perfect filter:
1307 # Command is displayed on several lines for clarity.
1309 add_perfect_filter (port_id) (ip|udp|tcp|sctp)
1311 src (src_ip_address) (src_port)
1313 dst (dst_ip_address) (dst_port)
1315 flexbytes (flexbytes_values)
1317 vlan (vlan_id) queue (queue_id) soft (soft_id)
1322 Update a perfect filter:
1324 # Command is displayed on several lines for clarity.
1326 upd_perfect_filter (port_id) (ip|udp|tcp|sctp)
1328 src (src_ip_address) (src_port)
1330 dst (dst_ip_address) (dst_port)
1332 flexbytes (flexbytes_values)
1334 vlan (vlan_id) queue (queue_id)
1339 Remove a perfect filter:
1341 rm_perfect_filter (port_id) (ip|udp|tcp|sctp)
1343 src (src_ip_address) (src_port)
1345 dst (dst_ip_address) (dst_port)
1347 flexbytes (flexbytes_values)
1349 vlan (vlan_id) soft (soft_id)
1354 Set IPv4 filter masks:
1356 # Command is displayed on several lines for clarity.
1358 set_masks_filter (port_id) only_ip_flow (0|1)
1360 src_mask (ip_src_mask) (src_port_mask)
1362 dst_mask (ip_dst_mask) (dst_port_mask)
1364 flexbytes (0|1) vlan_id (0|1) vlan_prio (0|1)
1366 set_ipv6_masks_filter
1367 ~~~~~~~~~~~~~~~~~~~~~
1369 Set IPv6 filter masks:
1371 # Command is displayed on several lines for clarity.
1373 set_ipv6_masks_filter (port_id) only_ip_flow (0|1)
1375 src_mask (ip_src_mask) (src_port_mask)
1377 dst_mask (ip_dst_mask) (dst_port_mask)
1379 flexbytes (0|1) vlan_id (0|1) vlan_prio (0|1)
1383 Link Bonding Functions
1384 ----------------------
1386 The Link Bonding functions make it possible to dynamically create and
1387 manage link bonding devices from within testpmd interactive prompt.
1389 create bonded device
1390 ~~~~~~~~~~~~~~~~~~~~
1392 Create a new bonding device:
1394 create bonded device (mode) (socket)
1396 For example, to create a bonded device in mode 1 on socket 0.
1398 .. code-block:: console
1400 testpmd> create bonded 1 0
1401 created new bonded device (port X)
1406 Adds Ethernet device to a Link Bonding device:
1408 add bonding slave (slave id) (port id)
1410 For example, to add Ethernet device (port 6) to a Link Bonding device (port 10).
1412 .. code-block:: console
1414 testpmd> add bonding slave 6 10
1417 remove bonding slave
1418 ~~~~~~~~~~~~~~~~~~~~
1420 Removes an Ethernet slave device from a Link Bonding device:
1422 remove bonding slave (slave id) (port id)
1424 For example, to remove Ethernet slave device (port 6) to a Link Bonding device (port 10).
1426 .. code-block:: console
1428 testpmd> remove bonding slave 6 10
1433 Set the Link Bonding mode of a Link Bonding device:
1435 set bonding mode (value) (port id)
1437 For example, to set the bonding mode of a Link Bonding device (port 10) to broadcast (mode 3).
1439 .. code-block:: console
1441 testpmd> set bonding mode 3 10
1446 Set an Ethernet slave device as the primary device on a Link Bonding device:
1448 set bonding primary (slave id) (port id)
1450 For example, to set the Ethernet slave device (port 6) as the primary port of a Link Bonding device (port 10).
1452 .. code-block:: console
1454 testpmd> set bonding primary 6 10
1459 Set the MAC address of a Link Bonding device:
1461 set bonding mac (port id) (mac)
1463 For example, to set the MAC address of a Link Bonding device (port 10) to 00:00:00:00:00:01
1465 .. code-block:: console
1467 testpmd> set bonding mac 10 00:00:00:00:00:01
1469 set bonding xmit_balance_policy
1470 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1472 Set the transmission policy for a Link Bonding device when it is in Balance XOR mode:
1474 set bonding xmit_balance_policy (port_id) (l2|l23|l34)
1476 For example, set a Link Bonding device (port 10) to use a balance policy of layer 3+4 (IP addresses & UDP ports )
1478 .. code-block:: console
1480 testpmd> set bonding xmit_balance_policy 10 l34
1485 Show the current configuration of a Link Bonding device:
1487 show bonding config (port id)
1490 to show the configuration a Link Bonding device (port 9) with 3 slave devices (1, 3, 4)
1491 in balance mode with a transmission policy of layer 2+3.
1493 .. code-block:: console
1495 testpmd> show bonding config 9
1497 Balance Xmit Policy: BALANCE_XMIT_POLICY_LAYER23
1499 Active Slaves (3): [1 3 4]
1505 The Register functions can be used to read from and write to registers on the network card referenced by a port number.
1506 This is mainly useful for debugging purposes.
1507 Reference should be made to the appropriate datasheet for the network card for details on the register addresses
1508 and fields that can be accessed.
1513 Display the value of a port register:
1515 read reg (port_id) (address)
1517 For example, to examine the Flow Director control register (FDIRCTL, 0x0000EE000) on an IntelĀ® 82599 10 GbE Controller:
1519 .. code-block:: console
1521 testpmd> read reg 0 0xEE00
1522 port 0 PCI register at offset 0xEE00: 0x4A060029 (1241907241)
1527 Display a port register bit field:
1529 read regfield (port_id) (address) (bit_x) (bit_y)
1531 For example, reading the lowest two bits from the register in the example above:
1533 .. code-block:: console
1535 testpmd> read regfield 0 0xEE00 0 1
1536 port 0 PCI register at offset 0xEE00: bits[0, 1]=0x1 (1)
1541 Display a single port register bit:
1543 read regbit (port_id) (address) (bit_x)
1545 For example, reading the lowest bit from the register in the example above:
1547 .. code-block:: console
1549 testpmd> read regbit 0 0xEE00 0
1550 port 0 PCI register at offset 0xEE00: bit 0=1
1555 Set the value of a port register:
1557 write reg (port_id) (address) (value)
1559 For example, to clear a register:
1561 .. code-block:: console
1563 testpmd> write reg 0 0xEE00 0x0
1564 port 0 PCI register at offset 0xEE00: 0x00000000 (0)
1569 Set bit field of a port register:
1571 write regfield (port_id) (address) (bit_x) (bit_y) (value)
1573 For example, writing to the register cleared in the example above:
1575 .. code-block:: console
1577 testpmd> write regfield 0 0xEE00 0 1 2
1578 port 0 PCI register at offset 0xEE00: 0x00000002 (2)
1583 Set single bit value of a port register:
1585 write regbit (port_id) (address) (bit_x) (value)
1587 For example, to set the high bit in the register from the example above:
1589 .. code-block:: console
1591 testpmd> write regbit 0 0xEE00 31 1
1592 port 0 PCI register at offset 0xEE00: 0x8000000A (2147483658)