New upstream version 16.11.8
[deb_dpdk.git] / doc / guides / testpmd_app_ug / testpmd_funcs.rst
index aed5e47..a906974 100644 (file)
@@ -1,5 +1,5 @@
 ..  BSD LICENSE
-    Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+    Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
     All rights reserved.
 
     Redistribution and use in source and binary forms, with or without
@@ -35,7 +35,8 @@ Testpmd Runtime Functions
 
 Where the testpmd application is started in interactive mode, (``-i|--interactive``),
 it displays a prompt that can be used to start and stop forwarding,
-configure the application, display statistics, set the Flow Director and other tasks::
+configure the application, display statistics (including the extended NIC
+statistics aka xstats) , set the Flow Director and other tasks::
 
    testpmd>
 
@@ -50,10 +51,10 @@ If you type a partial command and hit ``<TAB>`` you get a list of the available
 
    testpmd> show port <TAB>
 
-       info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap|dcb_tc X
-       info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap|dcb_tc all
-       stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap|dcb_tc X
-       stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap|dcb_tc all
+       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc X
+       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc all
+       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc X
+       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc all
        ...
 
 
@@ -98,9 +99,11 @@ Start packet forwarding with current configuration::
 start tx_first
 ~~~~~~~~~~~~~~
 
-Start packet forwarding with current configuration after sending one burst of packets::
+Start packet forwarding with current configuration after sending specified number of bursts of packets::
 
-   testpmd> start tx_first
+   testpmd> start tx_first (""|burst_num)
+
+The default burst number is 1 when ``burst_num`` not presented.
 
 stop
 ~~~~
@@ -128,7 +131,7 @@ show port
 
 Display information for a given port or all ports::
 
-   testpmd> show port (info|stats|fdir|stat_qmap|dcb_tc) (port_id|all)
+   testpmd> show port (info|stats|xstats|fdir|stat_qmap|dcb_tc) (port_id|all)
 
 The available information categories are:
 
@@ -136,6 +139,8 @@ The available information categories are:
 
 * ``stats``: RX/TX statistics.
 
+* ``xstats``: RX/TX extended NIC statistics.
+
 * ``fdir``: Flow Director information and statistics.
 
 * ``stat_qmap``: Queue statistics mapping.
@@ -177,6 +182,10 @@ For example:
      ipv6-sctp
      ipv6-other
      l2_payload
+     port
+     vxlan
+     geneve
+     nvgre
 
 show port rss reta
 ~~~~~~~~~~~~~~~~~~
@@ -199,7 +208,7 @@ clear port
 
 Clear the port statistics for a given port or for all ports::
 
-   testpmd> clear port (info|stats|fdir|stat_qmap) (port_id|all)
+   testpmd> clear port (info|stats|xstats|fdir|stat_qmap) (port_id|all)
 
 For example::
 
@@ -249,8 +258,10 @@ set fwd
 
 Set the packet forwarding mode::
 
-   testpmd> set fwd (io|mac|mac_retry|macswap|flowgen| \
-                     rxonly|txonly|csum|icmpecho)
+   testpmd> set fwd (io|mac|macswap|flowgen| \
+                     rxonly|txonly|csum|icmpecho) (""|retry)
+
+``retry`` can be specified for forwarding engines except ``rx_only``.
 
 The available information categories are:
 
@@ -259,8 +270,9 @@ The available information categories are:
   This is the default mode.
 
 * ``mac``: Changes the source and the destination Ethernet addresses of packets before forwarding them.
-
-* ``mac_retry``: Same as "mac" forwarding mode, but includes retries if the destination queue is full.
+  Default application behaviour is to set source Ethernet address to that of the transmitting interface, and destination
+  address to a dummy value (set during init). The user may specify a target destination Ethernet address via the 'eth-peer' or
+  'eth-peer-configfile' command-line options. It is not currently possible to specify a specific source Ethernet address.
 
 * ``macswap``: MAC swap forwarding mode.
   Swaps the source and the destination Ethernet addresses of packets before forwarding them.
@@ -392,14 +404,14 @@ Set number of packets per burst::
 
 This is equivalent to the ``--burst command-line`` option.
 
-In ``mac_retry`` forwarding mode, the transmit delay time and number of retries can also be set::
+When retry is enabled, the transmit delay time and number of retries can also be set::
 
-   testpmd> set burst tx delay (micrseconds) retry (num)
+   testpmd> set burst tx delay (microseconds) retry (num)
 
 set txpkts
 ~~~~~~~~~~
 
-Set the length of each segment of the TX-ONLY packets::
+Set the length of each segment of the TX-ONLY packets or length of packet for FLOWGEN mode::
 
    testpmd> set txpkts (x[,y]*)
 
@@ -467,6 +479,34 @@ For example, to change the port forwarding:
    RX P=1/Q=0 (socket 0) -> TX P=3/Q=0 (socket 0) peer=02:00:00:00:00:03
    RX P=3/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:02
 
+set tx loopback
+~~~~~~~~~~~~~~~
+
+Enable/disable tx loopback::
+
+   testpmd> set tx loopback (port_id) (on|off)
+
+set drop enable
+~~~~~~~~~~~~~~~
+
+set drop enable bit for all queues::
+
+   testpmd> set all queues drop (port_id) (on|off)
+
+set split drop enable (for VF)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+set split drop enable bit for VF from PF::
+
+   testpmd> set vf split drop (port_id) (vf_id) (on|off)
+
+set mac antispoof (for VF)
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set mac antispoof for a VF from the PF::
+
+   testpmd> set vf mac antispoof  (port_id) (vf_id) (on|off)
+
 vlan set strip
 ~~~~~~~~~~~~~~
 
@@ -481,6 +521,27 @@ Set the VLAN strip for a queue on a port::
 
    testpmd> vlan set stripq (on|off) (port_id,queue_id)
 
+vlan set stripq (for VF)
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set VLAN strip for all queues in a pool for a VF from the PF::
+
+   testpmd> set vf vlan stripq (port_id) (vf_id) (on|off)
+
+vlan set insert (for VF)
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set VLAN insert for a VF from the PF::
+
+   testpmd> set vf vlan insert (port_id) (vf_id) (vlan_id)
+
+vlan set antispoof (for VF)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set VLAN antispoof for a VF from the PF::
+
+   testpmd> set vf vlan antispoof (port_id) (vf_id) (on|off)
+
 vlan set filter
 ~~~~~~~~~~~~~~~
 
@@ -721,13 +782,20 @@ Remove a MAC address from a port::
 
    testpmd> mac_addr remove (port_id) (XX:XX:XX:XX:XX:XX)
 
-mac_addr add(for VF)
-~~~~~~~~~~~~~~~~~~~~
+mac_addr add (for VF)
+~~~~~~~~~~~~~~~~~~~~~
 
 Add an alternative MAC address for a VF to a port::
 
    testpmd> mac_add add port (port_id) vf (vf_id) (XX:XX:XX:XX:XX:XX)
 
+mac_addr set (for VF)
+~~~~~~~~~~~~~~~~~~~~~
+
+Set the MAC address for a VF from the PF::
+
+   testpmd> set vf mac addr (port_id) (vf_id) (XX:XX:XX:XX:XX:XX)
+
 set port-uta
 ~~~~~~~~~~~~
 
@@ -980,7 +1048,9 @@ The following sections show functions for configuring ports.
 port attach
 ~~~~~~~~~~~
 
-Attach a port specified by pci address or virtual device args.
+Attach a port specified by pci address or virtual device args::
+
+   testpmd> port attach (identifier)
 
 To attach a new pci device, the device should be recognized by kernel first.
 Then it should be moved under DPDK management.
@@ -991,7 +1061,7 @@ For example, to move a pci device using ixgbe under DPDK management:
 .. code-block:: console
 
    # Check the status of the available devices.
-   ./tools/dpdk_nic_bind.py --status
+   ./tools/dpdk-devbind.py --status
 
    Network devices using DPDK-compatible driver
    ============================================
@@ -1003,19 +1073,17 @@ For example, to move a pci device using ixgbe under DPDK management:
 
 
    # Bind the device to igb_uio.
-   sudo ./tools/dpdk_nic_bind.py -b igb_uio 0000:0a:00.0
+   sudo ./tools/dpdk-devbind.py -b igb_uio 0000:0a:00.0
 
 
    # Recheck the status of the devices.
-   ./tools/dpdk_nic_bind.py --status
+   ./tools/dpdk-devbind.py --status
    Network devices using DPDK-compatible driver
    ============================================
    0000:0a:00.0 '82599ES 10-Gigabit' drv=igb_uio unused=
 
 To attach a port created by virtual device, above steps are not needed.
 
-port attach (identifier)
-
 For example, to attach a port whose pci address is 0000:0a:00.0.
 
 .. code-block:: console
@@ -1035,14 +1103,14 @@ For example, to attach a port created by pcap PMD.
 
 .. code-block:: console
 
-   testpmd> port attach eth_pcap0
+   testpmd> port attach net_pcap0
    Attaching a new port...
-   PMD: Initializing pmd_pcap for eth_pcap0
+   PMD: Initializing pmd_pcap for net_pcap0
    PMD: Creating pcap-backed ethdev on numa socket 0
    Port 0 is attached. Now total ports is 1
    Done
 
-In this case, identifier is ``eth_pcap0``.
+In this case, identifier is ``net_pcap0``.
 This identifier format is the same as ``--vdev`` format of DPDK applications.
 
 For example, to re-attach a bonded port which has been previously detached,
@@ -1050,10 +1118,10 @@ the mode and slave parameters must be given.
 
 .. code-block:: console
 
-   testpmd> port attach eth_bond_0,mode=0,slave=1
+   testpmd> port attach net_bond_0,mode=0,slave=1
    Attaching a new port...
-   EAL: Initializing pmd_bond for eth_bond_0
-   EAL: Create bonded device eth_bond_0 on port 0 in mode 0 on socket 0.
+   EAL: Initializing pmd_bond for net_bond_0
+   EAL: Create bonded device net_bond_0 on port 0 in mode 0 on socket 0.
    Port 0 is attached. Now total ports is 1
    Done
 
@@ -1061,16 +1129,19 @@ the mode and slave parameters must be given.
 port detach
 ~~~~~~~~~~~
 
-Detach a specific port.
-
-Before detaching a port, the port should be closed::
+Detach a specific port::
 
    testpmd> port detach (port_id)
 
+Before detaching a port, the port should be stopped and closed.
+
 For example, to detach a pci device port 0.
 
 .. code-block:: console
 
+   testpmd> port stop 0
+   Stopping ports...
+   Done
    testpmd> port close 0
    Closing ports...
    Done
@@ -1088,6 +1159,9 @@ For example, to detach a virtual device port 0.
 
 .. code-block:: console
 
+   testpmd> port stop 0
+   Stopping ports...
+   Done
    testpmd> port close 0
    Closing ports...
    Done
@@ -1095,7 +1169,7 @@ For example, to detach a virtual device port 0.
    testpmd> port detach 0
    Detaching a port...
    PMD: Closing pcap ethdev on numa socket 0
-   Port 'eth_pcap0' is detached. Now total ports is 0
+   Port 'net_pcap0' is detached. Now total ports is 0
    Done
 
 To remove a pci device completely from the system, first detach the port from testpmd.
@@ -1106,9 +1180,9 @@ For example, to move a pci device under kernel management:
 
 .. code-block:: console
 
-   sudo ./tools/dpdk_nic_bind.py -b ixgbe 0000:0a:00.0
+   sudo ./tools/dpdk-devbind.py -b ixgbe 0000:0a:00.0
 
-   ./tools/dpdk_nic_bind.py --status
+   ./tools/dpdk-devbind.py --status
 
    Network devices using DPDK-compatible driver
    ============================================
@@ -1155,7 +1229,7 @@ port config - speed
 
 Set the speed and duplex mode for all ports or a specific port::
 
-   testpmd> port config (port_id|all) speed (10|100|1000|10000|40000|100000|auto) \
+   testpmd> port config (port_id|all) speed (10|100|1000|10000|25000|40000|50000|100000|auto) \
             duplex (half|full|auto)
 
 port config - queues/descriptors
@@ -1183,9 +1257,29 @@ Set hardware CRC stripping on or off for all ports::
 
    testpmd> port config all crc-strip (on|off)
 
-CRC stripping is off by default.
+CRC stripping is on by default.
+
+The ``off`` option is equivalent to the ``--disable-crc-strip`` command-line option.
+
+port config - scatter
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Set RX scatter mode on or off for all ports::
+
+   testpmd> port config all scatter (on|off)
+
+RX scatter mode is off by default.
+
+The ``on`` option is equivalent to the ``--enable-scatter`` command-line option.
+
+port config - TX queue flags
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set a hexadecimal bitmap of TX queue flags for all ports::
+
+   testpmd> port config all txqflags value
 
-The ``on`` option is equivalent to the ``--crc-strip`` command-line option.
+This command is equivalent to the ``--txqflags`` command-line option.
 
 port config - RX Checksum
 ~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1258,7 +1352,7 @@ port config - RSS
 
 Set the RSS (Receive Side Scaling) mode on or off::
 
-   testpmd> port config all rss (all|ip|tcp|udp|sctp|ether|none)
+   testpmd> port config all rss (all|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none)
 
 RSS is on by default.
 
@@ -1345,7 +1439,7 @@ Create a new bonding device::
 
 For example, to create a bonded device in mode 1 on socket 0::
 
-   testpmd> create bonded 1 0
+   testpmd> create bonded device 1 0
    created new bonded device (port X)
 
 add bonding slave
@@ -1782,13 +1876,13 @@ Different NICs may have different capabilities, command show port fdir (port_id)
 
 For example, to add an ipv4-udp flow type filter::
 
-   testpmd> flow_director_filter 0 add flow ipv4-udp src 2.2.2.3 32 \
+   testpmd> flow_director_filter 0 mode IP add flow ipv4-udp src 2.2.2.3 32 \
             dst 2.2.2.5 33 tos 2 ttl 40 vlan 0x1 flexbytes (0x88,0x48) \
             fwd pf queue 1 fd_id 1
 
 For example, add an ipv4-other flow type filter::
 
-   testpmd> flow_director_filter 0 add flow ipv4-other src 2.2.2.3 \
+   testpmd> flow_director_filter 0 mode IP add flow ipv4-other src 2.2.2.3 \
              dst 2.2.2.5 tos 2 proto 20 ttl 40 vlan 0x1 \
              flexbytes (0x88,0x48) fwd pf queue 1 fd_id 1
 
@@ -1812,8 +1906,7 @@ Set flow director's input masks::
                       src_mask (ipv4_src) (ipv6_src) (src_port) \
                       dst_mask (ipv4_dst) (ipv6_dst) (dst_port)
 
-   flow_director_mask (port_id) mode MAC-VLAN vlan (vlan_value) \
-                      mac (mac_value)
+   flow_director_mask (port_id) mode MAC-VLAN vlan (vlan_value)
 
    flow_director_mask (port_id) mode Tunnel vlan (vlan_value) \
                       mac (mac_value) tunnel-type (tunnel_type_value) \
@@ -1821,7 +1914,7 @@ Set flow director's input masks::
 
 Example, to set flow director mask on port 0::
 
-   testpmd> flow_director_mask 0 vlan 0xefff \
+   testpmd> flow_director_mask 0 mode IP vlan 0xefff \
             src_mask 255.255.255.255 \
                 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 0xFFFF \
             dst_mask 255.255.255.255 \