From aa49f36628df975dd266f0ab0ab355a2e17f5a2b Mon Sep 17 00:00:00 2001 From: Pablo de Lara Date: Mon, 1 Dec 2014 11:40:47 +0000 Subject: [PATCH] doc: reorder testpmd commands Moved commands in testpmd UG to set queue rates to match order in testpmd command help. Created new section "Filters" to match that same section in testpmd UG, and moved all commands related to it there. Signed-off-by: Pablo de Lara Acked-by: Bernard Iremonger --- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 1041 ++++++++++--------- 1 file changed, 523 insertions(+), 518 deletions(-) diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 975929ee4a..65d316850c 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -444,20 +444,6 @@ Remove a VLAN ID, from the set of VLAN identifiers filtered for VF(s) for port I rx_vlan rm (vlan_id) port (port_id) vf (vf_mask) -tx_rate (for Queue) -~~~~~~~~~~~~~~~~~~~ - -Set TX rate limitation for queue of a port ID: - -set port (port_id) queue (queue_id) rate (rate_value) - -tx_rate (for VF) -~~~~~~~~~~~~~~~~ - -Set TX rate limitation for queues in VF of a port ID: - -set port (port_id) vf (vf_id) rate (rate_value) queue_mask (queue_mask) - rx_vlan set tpid ~~~~~~~~~~~~~~~~ @@ -717,6 +703,20 @@ The available receive modes are: * MPE: accepts all multicast packets +set port - tx_rate (for Queue) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Set TX rate limitation for queue of a port ID: + +set port (port_id) queue (queue_id) rate (rate_value) + +set port - tx_rate (for VF) +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Set TX rate limitation for queues in VF of a port ID: + +set port (port_id) vf (vf_id) rate (rate_value) queue_mask (queue_mask) + set port - mirror rule ~~~~~~~~~~~~~~~~~~~~~~ @@ -783,903 +783,908 @@ Show the bypass configuration for a bypass enabled NIC using the lowest port on show bypass config (port_id) -add_ethertype_filter -~~~~~~~~~~~~~~~~~~~~ +set link up +~~~~~~~~~~~ -Add a L2 Ethertype filter, which identify packets by their L2 Ethertype mainly assign them to a receive queue. +Set link up for a port. -add_ethertype_filter (port_id) ethertype (eth_value) priority (enable|disable) (pri_value) queue (queue_id) index (idx) +set link-up port (port id) -The available information parameters are: +set link down +~~~~~~~~~~~~~ -* port_id: the port which the Ethertype filter assigned on. +Set link down for a port. -* eth_value: the EtherType value want to match, - for example 0x0806 for ARP packet. 0x0800 (IPv4) and 0x86DD (IPv6) are invalid. +set link-down port (port id) -* enable: user priority participates in the match. +Port Functions +-------------- -* disable: user priority doesn't participate in the match. +The following sections show functions for configuring ports. -* pri_value: user priority value that want to match. +.. note:: -* queue_id : The receive queue associated with this EtherType filter + Port configuration changes only become active when forwarding is started/restarted. -* index: the index of this EtherType filter +port start +~~~~~~~~~~ -Example: +Start all ports or a specific port: -.. code-block:: console +port start (port_id|all) - testpmd> add_ethertype_filter 0 ethertype 0x0806 priority disable 0 queue 3 index 0 - Assign ARP packet to receive queue 3 +port stop +~~~~~~~~~ -remove_ethertype_filter -~~~~~~~~~~~~~~~~~~~~~~~ +Stop all ports or a specific port: -Remove a L2 Ethertype filter +port stop (port_id|all) -remove_ethertype_filter (port_id) index (idx) +port close +~~~~~~~~~~ -get_ethertype_filter -~~~~~~~~~~~~~~~~~~~~ +Close all ports or a specific port: -Get and display a L2 Ethertype filter +port close (port_id|all) -get_ethertype_filter (port_id) index (idx) +port start/stop queue +~~~~~~~~~~~~~~~~~~~~~ -Example: +Start/stop a rx/tx queue on a specific port: -.. code-block:: console +port (port_id) (rxq|txq) (queue_id) (start|stop) - testpmd> get_ethertype_filter 0 index 0 +Only take effect when port is started. - filter[0]: - ethertype: 0x0806 - priority: disable, 0 - queue: 3 +port config - speed +~~~~~~~~~~~~~~~~~~~ -add_2tuple_filter -~~~~~~~~~~~~~~~~~ +Set the speed and duplex mode for all ports or a specific port: -Add a 2-tuple filter, -which identify packets by specific protocol and destination TCP/UDP port -and forwards packets into one of the receive queues. +port config (port_id|all) speed (10|100|1000|10000|auto) duplex (half|full|auto) -add_2tuple_filter (port_id) protocol (pro_value) (pro_mask) dst_port (port_value) (port_mask) -flags (flg_value) priority (prio_value) queue (queue_id) index (idx) +port config - queues/descriptors +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The available information parameters are: +Set number of queues/descriptors for rxq, txq, rxd and txd: -* port_id: the port which the 2-tuple filter assigned on. +port config all (rxq|txq|rxd|txd) (value) -* pro_value: IP L4 protocol +This is equivalent to the --rxq, --txq, --rxd and --txd command-line options. -* pro_mask: protocol participates in the match or not, 1 means participate +port config - max-pkt-len +~~~~~~~~~~~~~~~~~~~~~~~~~ -* port_value: destination port in L4. +Set the maximum packet length: -* port_mask: destination port participates in the match or not, 1 means participate. +port config all max-pkt-len (value) -* flg_value: TCP control bits. The non-zero value is invalid, when the pro_value is not set to 0x06 (TCP). +This is equivalent to the --max-pkt-len command-line option. -* prio_value: the priority of this filter. +port config - CRC Strip +~~~~~~~~~~~~~~~~~~~~~~~ -* queue_id: The receive queue associated with this 2-tuple filter +Set hardware CRC stripping on or off for all ports: -* index: the index of this 2-tuple filter +port config all crc-strip (on|off) -Example: +CRC stripping is off by default. -.. code-block:: console +The on option is equivalent to the --crc-strip command-line option. - testpmd> add_2tuple_filter 0 protocol 0x06 1 dst_port 32 1 flags 0x02 priority 3 queue 3 index 0 +port config - RX Checksum +~~~~~~~~~~~~~~~~~~~~~~~~~ -remove_2tuple_filter -~~~~~~~~~~~~~~~~~~~~ +Set hardware RX checksum offload to on or off for all ports: -Remove a 2-tuple filter +port config all rx-cksum (on|off) -remove_2tuple_filter (port_id) index (idx) +Checksum offload is off by default. -get_2tuple_filter -~~~~~~~~~~~~~~~~~ +The on option is equivalent to the --enable-rx-cksum command-line option. -Get and display a 2-tuple filter +port config - VLAN +~~~~~~~~~~~~~~~~~~ -get_2tuple_filter (port_id) index (idx) +Set hardware VLAN on or off for all ports: -Example: +port config all hw-vlan (on|off) -.. code-block:: console +Hardware VLAN is on by default. - testpmd> get_2tuple_filter 0 index 0 +The off option is equivalent to the --disable-hw-vlan command-line option. - filter[0]: - Destination Port: 0x0020 mask: 1 - protocol: 0x06 mask:1 tcp_flags: 0x02 - priority: 3 queue: 3 +port config - Drop Packets +~~~~~~~~~~~~~~~~~~~~~~~~~~ -add_5tuple_filter -~~~~~~~~~~~~~~~~~ +Set packet drop for packets with no descriptors on or off for all ports: -Add a 5-tuple filter, -which consists of a 5-tuple (protocol, source and destination IP addresses, source and destination TCP/UDP/SCTP port) -and routes packets into one of the receive queues. +port config all drop-en (on|off) -add_5tuple_filter (port_id) dst_ip (dst_address) src_ip (src_address) dst_port (dst_port_value) src_port (src_port_value) -protocol (protocol_value) mask (mask_value) flags (flags_value) priority (prio_value) queue (queue_id) index (idx) +Packet dropping for packets with no descriptors is off by default. -The available information parameters are: +The on option is equivalent to the --enable-drop-en command-line option. -* port_id: the port which the 5-tuple filter assigned on. +port config - RSS +~~~~~~~~~~~~~~~~~ -* dst_address: destination IP address. +Set the RSS (Receive Side Scaling) mode on or off: -* src_address: source IP address. +port config all rss (ip|udp|none) -* dst_port_value: TCP/UDP destination port. +RSS is on by default. -* src_port_value: TCP/UDP source port. +The off option is equivalent to the --disable-rss command-line option. -* protocol_value: L4 protocol. +port config - RSS Reta +~~~~~~~~~~~~~~~~~~~~~~ -* mask_value: participates in the match or not by bit for field above, 1b means participate +Set the RSS (Receive Side Scaling) redirection table: -* flags_value: TCP control bits. The non-zero value is invalid, when the protocol_value is not set to 0x06 (TCP). +port config all rss reta (hash,queue)[,(hash,queue)] -* prio_value: the priority of this filter. +port config - DCB +~~~~~~~~~~~~~~~~~ -* queue_id: The receive queue associated with this 5-tuple filter. +Set the DCB mode for an individual port: -* index: the index of this 5-tuple filter +port config (port_id) dcb vt (on|off) (traffic_class) pfc (on|off) -Example: +The traffic class should be 4 or 8. -.. code-block:: console +port config - Burst +~~~~~~~~~~~~~~~~~~~ - 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 +Set the number of packets per burst: -remove_5tuple_filter -~~~~~~~~~~~~~~~~~~~~ +port config all burst (value) -Remove a 5-tuple filter +This is equivalent to the --burst command-line option. -remove_5tuple_filter (port_id) index (idx) +port config - Threshold +~~~~~~~~~~~~~~~~~~~~~~~ -get_5tuple_filter -~~~~~~~~~~~~~~~~~ +Set thresholds for TX/RX queues: -Get and display a 5-tuple filter +port config all (threshold) (value) -get_5tuple_filter (port_id) index (idx) +Where the threshold type can be: -Example: +* txpt: Set the prefetch threshold register of the TX rings, 0 <= value <= 255. -.. code-block:: console +* txht: Set the host threshold register of the TX rings, 0 <= value <= 255. - testpmd> get_5tuple_filter 1 index 0 +* txwt: Set the write-back threshold register of the TX rings, 0 <= value <= 255. - filter[0]: - Destination IP: 0x02020205 mask: 1 - Source IP: 0x02020204 mask: 1 - Destination Port: 0x0040 mask: 1 - Source Port: 0x0020 mask: 1 - protocol: 0x06 mask: 1 - priority: 3 flags: 0x00 queue: 3 +* rxpt: Set the prefetch threshold register of the RX rings, 0 <= value <= 255. -add_syn_filter -~~~~~~~~~~~~~~ +* rxht: Set the host threshold register of the RX rings, 0 <= value <= 255. -Add SYN filter, which can forward TCP packets whose *SYN* flag is set into a separate queue. +* rxwt: Set the write-back threshold register of the RX rings, 0 <= value <= 255. -add_syn_filter (port_id) priority (high|low) queue (queue_id) +* txfreet: Set the transmit free threshold of the TX rings, 0 <= value <= txd. -The available information parameters are: +* rxfreet: Set the transmit free threshold of the RX rings, 0 <= value <= rxd. -* port_id: the port which the SYN filter assigned on. +* txrst: Set the transmit RS bit threshold of TX rings, 0 <= value <= txd. + These threshold options are also available from the command-line. -* high: this SYN filter has higher priority than other filters. +Flow Director Functions +----------------------- -* low: this SYN filter has lower priority than other filters. +The Flow Director works in receive mode to identify specific flows or sets of flows and route them to specific queues. -* queue_id: The receive queue associated with this SYN filter +Two types of filtering are supported which are referred to as Perfect Match and Signature filters: -Example: +* Perfect match filters. + The hardware checks a match between the masked fields of the received packets and the programmed filters. -.. code-block:: console +* Signature filters. + The hardware checks a match between a hash-based signature of the masked fields of the received packet. - testpmd> add_syn_filter 0 priority high queue 3, +The Flow Director filters can match the following fields in a packet: -remove_syn_filter -~~~~~~~~~~~~~~~~~ +* Source IP and destination IP addresses. -Remove SYN filter +* Source port and destination port numbers (for UDP and TCP packets). -remove_syn_filter (port_id) +* IPv4/IPv6 and UDP/ TCP/SCTP protocol match. -get_syn_filter -~~~~~~~~~~~~~~ +* VLAN header. -Get and display SYN filter +* Flexible 2-byte tuple match anywhere in the first 64 bytes of the packet. -get_syn_filter (port_id) +The Flow Director can also mask out parts of all of these fields so that filters are only applied to certain fields +or parts of the fields. +For example it is possible to mask out sub-nets of IP addresses or to ignore VLAN headers. -Example: +In the following sections, several common parameters are used in the Flow Director filters. +These are explained below: -.. code-block:: console +* src: A pair of source address values. The source IP, in IPv4 or IPv6 format, and the source port: - testpmd> get_syn_filter 0 + src 192.168.0.1 1024 - syn filter: on, priority: high, queue: 3 + src 2001:DB8:85A3:0:0:8A2E:370:7000 1024 -add_flex_filter -~~~~~~~~~~~~~~~ +* dst: A pair of destination address values. The destination IP, in IPv4 or IPv6 format, and the destination port. -Add a Flex filter, -which recognizes any arbitrary pattern within the first 128 bytes of the packet -and routes packets into one of the receive queues. +* flexbytes: A 2-byte tuple to be matched within the first 64 bytes of a packet. -add_flex_filter (port_id) len (len_value) bytes (bytes_string) mask (mask_value) -priority (prio_value) queue (queue_id) index (idx) +The offset where the match occurs is set by the --pkt-filter-flexbytes-offset command-line parameter +and is counted from the first byte of the destination Ethernet MAC address. +The default offset is 0xC bytes, which is the "Type" word in the MAC header. +Typically, the flexbyte value is set to 0x0800 to match the IPv4 MAC type or 0x86DD to match IPv6. +These values change when a VLAN tag is added. -The available information parameters are: +* vlan: The VLAN header to match in the packet. -* port_id: the port which the Flex filter assigned on. +* queue: The index of the RX queue to route matched packets to. -* len_value: filter length in byte, no greater than 128. +* soft: The 16-bit value in the MBUF flow director ID field for RX packets matching the filter. -* bytes_string: a sting in format of octal, means the value the flex filter need to match. +add_signature_filter +~~~~~~~~~~~~~~~~~~~~ -* mask_value: a sting in format of octal, bit 1 means corresponding byte in DWORD participates in the match. +Add a signature filter: -* prio_value: the priority of this filter. +# Command is displayed on several lines for clarity. -* queue_id: The receive queue associated with this Flex filter. +add_signature_filter (port_id) (ip|udp|tcp|sctp) -* index: the index of this Flex filter + src (src_ip_address) (src_port) -Example: + dst (dst_ip_address) (dst_port) -.. code-block:: console + flexbytes (flexbytes_values) - testpmd> add_flex_filter 0 len 16 bytes 0x00000000000000000000000008060000 mask 000C priority 3 queue 3 index 0 + vlan (vlan_id) queue (queue_id) -Assign a packet whose 13th and 14th bytes are 0x0806 to queue 3. +upd_signature_filter +~~~~~~~~~~~~~~~~~~~~ -remove_flex_filter -~~~~~~~~~~~~~~~~~~ +Update a signature filter: -Remove a Flex filter +# Command is displayed on several lines for clarity. -remove_flex_filter (port_id) index (idx) +upd_signature_filter (port_id) (ip|udp|tcp|sctp) -get_flex_filter -~~~~~~~~~~~~~~~ + src (src_ip_address) (src_port) -Get and display a Flex filter + dst (dst_ip_address) (dst_port) -get_flex_filter (port_id) index (idx) + flexbytes (flexbytes_values) -Example: + vlan (vlan_id) queue (queue_id) -.. code-block:: console +rm_signature_filter +~~~~~~~~~~~~~~~~~~~ - testpmd> get_flex_filter 0 index 0 +Remove a signature filter: - filter[0]: +# Command is displayed on several lines for clarity. - length: 16 +rm_signature_filter (port_id) (ip|udp|tcp|sctp) - dword[]: 0x00000000 00000000 00000000 08060000 00000000 00000000 00000000 - 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 - 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 - 00000000 00000000 00000000 00000000 00000000 00000000 00000000 + src (src_ip_address) (src_port) - mask[]: - 0b0000000000001100000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000 + dst (dst_ip_address) (dst_port) - priority: 3 queue: 3 + flexbytes (flexbytes_values) -set link up -~~~~~~~~~~~ + vlan (vlan_id) -Set link up for a port. +add_perfect_filter +~~~~~~~~~~~~~~~~~~ -set link-up port (port id) +Add a perfect filter: -set link down -~~~~~~~~~~~~~ +# Command is displayed on several lines for clarity. -Set link down for a port. +add_perfect_filter (port_id) (ip|udp|tcp|sctp) -set link-down port (port id) + src (src_ip_address) (src_port) -Port Functions --------------- + dst (dst_ip_address) (dst_port) -The following sections show functions for configuring ports. + flexbytes (flexbytes_values) -.. note:: + vlan (vlan_id) queue (queue_id) soft (soft_id) - Port configuration changes only become active when forwarding is started/restarted. +upd_perfect_filter +~~~~~~~~~~~~~~~~~~ -port start -~~~~~~~~~~ +Update a perfect filter: -Start all ports or a specific port: +# Command is displayed on several lines for clarity. -port start (port_id|all) +upd_perfect_filter (port_id) (ip|udp|tcp|sctp) -port stop -~~~~~~~~~ + src (src_ip_address) (src_port) -Stop all ports or a specific port: + dst (dst_ip_address) (dst_port) -port stop (port_id|all) + flexbytes (flexbytes_values) -port close -~~~~~~~~~~ + vlan (vlan_id) queue (queue_id) -Close all ports or a specific port: +rm_perfect_filter +~~~~~~~~~~~~~~~~~ -port close (port_id|all) +Remove a perfect filter: -port start/stop queue -~~~~~~~~~~~~~~~~~~~~~ +rm_perfect_filter (port_id) (ip|udp|tcp|sctp) -Start/stop a rx/tx queue on a specific port: + src (src_ip_address) (src_port) -port (port_id) (rxq|txq) (queue_id) (start|stop) + dst (dst_ip_address) (dst_port) -Only take effect when port is started. + flexbytes (flexbytes_values) -port config - speed -~~~~~~~~~~~~~~~~~~~ + vlan (vlan_id) soft (soft_id) -Set the speed and duplex mode for all ports or a specific port: +set_masks_filter +~~~~~~~~~~~~~~~~ -port config (port_id|all) speed (10|100|1000|10000|auto) duplex (half|full|auto) +Set IPv4 filter masks: -port config - queues/descriptors -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Command is displayed on several lines for clarity. -Set number of queues/descriptors for rxq, txq, rxd and txd: +set_masks_filter (port_id) only_ip_flow (0|1) -port config all (rxq|txq|rxd|txd) (value) + src_mask (ip_src_mask) (src_port_mask) -This is equivalent to the --rxq, --txq, --rxd and --txd command-line options. + dst_mask (ip_dst_mask) (dst_port_mask) -port config - max-pkt-len -~~~~~~~~~~~~~~~~~~~~~~~~~ + flexbytes (0|1) vlan_id (0|1) vlan_prio (0|1) -Set the maximum packet length: +set_ipv6_masks_filter +~~~~~~~~~~~~~~~~~~~~~ -port config all max-pkt-len (value) +Set IPv6 filter masks: -This is equivalent to the --max-pkt-len command-line option. +# Command is displayed on several lines for clarity. -port config - CRC Strip -~~~~~~~~~~~~~~~~~~~~~~~ +set_ipv6_masks_filter (port_id) only_ip_flow (0|1) -Set hardware CRC stripping on or off for all ports: + src_mask (ip_src_mask) (src_port_mask) -port config all crc-strip (on|off) + dst_mask (ip_dst_mask) (dst_port_mask) -CRC stripping is off by default. + flexbytes (0|1) vlan_id (0|1) vlan_prio (0|1) -The on option is equivalent to the --crc-strip command-line option. + compare_dst (0|1) -port config - RX Checksum -~~~~~~~~~~~~~~~~~~~~~~~~~ +Link Bonding Functions +---------------------- -Set hardware RX checksum offload to on or off for all ports: +The Link Bonding functions make it possible to dynamically create and +manage link bonding devices from within testpmd interactive prompt. -port config all rx-cksum (on|off) +create bonded device +~~~~~~~~~~~~~~~~~~~~ -Checksum offload is off by default. +Create a new bonding device: -The on option is equivalent to the --enable-rx-cksum command-line option. +create bonded device (mode) (socket) -port config - VLAN -~~~~~~~~~~~~~~~~~~ +For example, to create a bonded device in mode 1 on socket 0. -Set hardware VLAN on or off for all ports: +.. code-block:: console -port config all hw-vlan (on|off) + testpmd> create bonded 1 0 + created new bonded device (port X) -Hardware VLAN is on by default. +add bonding slave +~~~~~~~~~~~~~~~~~ -The off option is equivalent to the --disable-hw-vlan command-line option. +Adds Ethernet device to a Link Bonding device: -port config - Drop Packets -~~~~~~~~~~~~~~~~~~~~~~~~~~ +add bonding slave (slave id) (port id) -Set packet drop for packets with no descriptors on or off for all ports: +For example, to add Ethernet device (port 6) to a Link Bonding device (port 10). -port config all drop-en (on|off) +.. code-block:: console -Packet dropping for packets with no descriptors is off by default. + testpmd> add bonding slave 6 10 -The on option is equivalent to the --enable-drop-en command-line option. -port config - RSS -~~~~~~~~~~~~~~~~~ +remove bonding slave +~~~~~~~~~~~~~~~~~~~~ -Set the RSS (Receive Side Scaling) mode on or off: +Removes an Ethernet slave device from a Link Bonding device: -port config all rss (ip|udp|none) +remove bonding slave (slave id) (port id) -RSS is on by default. +For example, to remove Ethernet slave device (port 6) to a Link Bonding device (port 10). -The off option is equivalent to the --disable-rss command-line option. +.. code-block:: console -port config - RSS Reta -~~~~~~~~~~~~~~~~~~~~~~ + testpmd> remove bonding slave 6 10 -Set the RSS (Receive Side Scaling) redirection table: +set bonding mode +~~~~~~~~~~~~~~~~ -port config all rss reta (hash,queue)[,(hash,queue)] +Set the Link Bonding mode of a Link Bonding device: -port config - DCB -~~~~~~~~~~~~~~~~~ +set bonding mode (value) (port id) -Set the DCB mode for an individual port: +For example, to set the bonding mode of a Link Bonding device (port 10) to broadcast (mode 3). -port config (port_id) dcb vt (on|off) (traffic_class) pfc (on|off) +.. code-block:: console -The traffic class should be 4 or 8. + testpmd> set bonding mode 3 10 -port config - Burst +set bonding primary ~~~~~~~~~~~~~~~~~~~ -Set the number of packets per burst: - -port config all burst (value) - -This is equivalent to the --burst command-line option. +Set an Ethernet slave device as the primary device on a Link Bonding device: -port config - Threshold -~~~~~~~~~~~~~~~~~~~~~~~ +set bonding primary (slave id) (port id) -Set thresholds for TX/RX queues: +For example, to set the Ethernet slave device (port 6) as the primary port of a Link Bonding device (port 10). -port config all (threshold) (value) +.. code-block:: console -Where the threshold type can be: + testpmd> set bonding primary 6 10 -* txpt: Set the prefetch threshold register of the TX rings, 0 <= value <= 255. +set bonding mac +~~~~~~~~~~~~~~~ -* txht: Set the host threshold register of the TX rings, 0 <= value <= 255. +Set the MAC address of a Link Bonding device: -* txwt: Set the write-back threshold register of the TX rings, 0 <= value <= 255. +set bonding mac (port id) (mac) -* rxpt: Set the prefetch threshold register of the RX rings, 0 <= value <= 255. +For example, to set the MAC address of a Link Bonding device (port 10) to 00:00:00:00:00:01 -* rxht: Set the host threshold register of the RX rings, 0 <= value <= 255. +.. code-block:: console -* rxwt: Set the write-back threshold register of the RX rings, 0 <= value <= 255. + testpmd> set bonding mac 10 00:00:00:00:00:01 -* txfreet: Set the transmit free threshold of the TX rings, 0 <= value <= txd. +set bonding xmit_balance_policy +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -* rxfreet: Set the transmit free threshold of the RX rings, 0 <= value <= rxd. +Set the transmission policy for a Link Bonding device when it is in Balance XOR mode: -* txrst: Set the transmit RS bit threshold of TX rings, 0 <= value <= txd. - These threshold options are also available from the command-line. +set bonding xmit_balance_policy (port_id) (l2|l23|l34) -Flow Director Functions ------------------------ +For example, set a Link Bonding device (port 10) to use a balance policy of layer 3+4 (IP addresses & UDP ports ) -The Flow Director works in receive mode to identify specific flows or sets of flows and route them to specific queues. +.. code-block:: console -Two types of filtering are supported which are referred to as Perfect Match and Signature filters: + testpmd> set bonding xmit_balance_policy 10 l34 -* Perfect match filters. - The hardware checks a match between the masked fields of the received packets and the programmed filters. -* Signature filters. - The hardware checks a match between a hash-based signature of the masked fields of the received packet. +set bonding mon_period +~~~~~~~~~~~~~~~~~~~~~~ -The Flow Director filters can match the following fields in a packet: +Set the link status monitoring polling period in milliseconds for a bonding devicie. -* Source IP and destination IP addresses. +This adds support for PMD slave devices which do not support link status interrupts. +When the mon_period is set to a value greater than 0 then all PMD's which do not support +link status ISR will be queried every polling interval to check if their link status has changed. -* Source port and destination port numbers (for UDP and TCP packets). +set bonding mon_period (port_id) (value) -* IPv4/IPv6 and UDP/ TCP/SCTP protocol match. +For example, to set the link status monitoring polling period of bonded device (port 5) to 150ms -* VLAN header. +.. code-block:: console -* Flexible 2-byte tuple match anywhere in the first 64 bytes of the packet. + testpmd> set bonding mon_period 5 150 -The Flow Director can also mask out parts of all of these fields so that filters are only applied to certain fields -or parts of the fields. -For example it is possible to mask out sub-nets of IP addresses or to ignore VLAN headers. -In the following sections, several common parameters are used in the Flow Director filters. -These are explained below: +show bonding config +~~~~~~~~~~~~~~~~~~~ -* src: A pair of source address values. The source IP, in IPv4 or IPv6 format, and the source port: +Show the current configuration of a Link Bonding device: - src 192.168.0.1 1024 +show bonding config (port id) - src 2001:DB8:85A3:0:0:8A2E:370:7000 1024 +For example, +to show the configuration a Link Bonding device (port 9) with 3 slave devices (1, 3, 4) +in balance mode with a transmission policy of layer 2+3. -* dst: A pair of destination address values. The destination IP, in IPv4 or IPv6 format, and the destination port. +.. code-block:: console -* flexbytes: A 2-byte tuple to be matched within the first 64 bytes of a packet. + testpmd> show bonding config 9 + Bonding mode: 2 + Balance Xmit Policy: BALANCE_XMIT_POLICY_LAYER23 + Slaves (3): [1 3 4] + Active Slaves (3): [1 3 4] + Primary: [3] -The offset where the match occurs is set by the --pkt-filter-flexbytes-offset command-line parameter -and is counted from the first byte of the destination Ethernet MAC address. -The default offset is 0xC bytes, which is the "Type" word in the MAC header. -Typically, the flexbyte value is set to 0x0800 to match the IPv4 MAC type or 0x86DD to match IPv6. -These values change when a VLAN tag is added. +Register Functions +------------------ -* vlan: The VLAN header to match in the packet. +The Register functions can be used to read from and write to registers on the network card referenced by a port number. +This is mainly useful for debugging purposes. +Reference should be made to the appropriate datasheet for the network card for details on the register addresses +and fields that can be accessed. -* queue: The index of the RX queue to route matched packets to. +read reg +~~~~~~~~ -* soft: The 16-bit value in the MBUF flow director ID field for RX packets matching the filter. +Display the value of a port register: -add_signature_filter -~~~~~~~~~~~~~~~~~~~~ +read reg (port_id) (address) -Add a signature filter: +For example, to examine the Flow Director control register (FDIRCTL, 0x0000EE000) on an Intel® 82599 10 GbE Controller: -# Command is displayed on several lines for clarity. +.. code-block:: console -add_signature_filter (port_id) (ip|udp|tcp|sctp) + testpmd> read reg 0 0xEE00 + port 0 PCI register at offset 0xEE00: 0x4A060029 (1241907241) - src (src_ip_address) (src_port) +read regfield +~~~~~~~~~~~~~ - dst (dst_ip_address) (dst_port) +Display a port register bit field: - flexbytes (flexbytes_values) +read regfield (port_id) (address) (bit_x) (bit_y) - vlan (vlan_id) queue (queue_id) +For example, reading the lowest two bits from the register in the example above: -upd_signature_filter -~~~~~~~~~~~~~~~~~~~~ +.. code-block:: console -Update a signature filter: + testpmd> read regfield 0 0xEE00 0 1 + port 0 PCI register at offset 0xEE00: bits[0, 1]=0x1 (1) -# Command is displayed on several lines for clarity. +read regbit +~~~~~~~~~~~ -upd_signature_filter (port_id) (ip|udp|tcp|sctp) +Display a single port register bit: - src (src_ip_address) (src_port) +read regbit (port_id) (address) (bit_x) - dst (dst_ip_address) (dst_port) +For example, reading the lowest bit from the register in the example above: - flexbytes (flexbytes_values) +.. code-block:: console - vlan (vlan_id) queue (queue_id) + testpmd> read regbit 0 0xEE00 0 + port 0 PCI register at offset 0xEE00: bit 0=1 -rm_signature_filter -~~~~~~~~~~~~~~~~~~~ +write reg +~~~~~~~~~ -Remove a signature filter: +Set the value of a port register: -# Command is displayed on several lines for clarity. +write reg (port_id) (address) (value) -rm_signature_filter (port_id) (ip|udp|tcp|sctp) +For example, to clear a register: - src (src_ip_address) (src_port) +.. code-block:: console - dst (dst_ip_address) (dst_port) + testpmd> write reg 0 0xEE00 0x0 + port 0 PCI register at offset 0xEE00: 0x00000000 (0) - flexbytes (flexbytes_values) +write regfield +~~~~~~~~~~~~~~ - vlan (vlan_id) +Set bit field of a port register: -add_perfect_filter -~~~~~~~~~~~~~~~~~~ +write regfield (port_id) (address) (bit_x) (bit_y) (value) -Add a perfect filter: +For example, writing to the register cleared in the example above: -# Command is displayed on several lines for clarity. +.. code-block:: console -add_perfect_filter (port_id) (ip|udp|tcp|sctp) + testpmd> write regfield 0 0xEE00 0 1 2 + port 0 PCI register at offset 0xEE00: 0x00000002 (2) - src (src_ip_address) (src_port) +write regbit +~~~~~~~~~~~~ - dst (dst_ip_address) (dst_port) +Set single bit value of a port register: - flexbytes (flexbytes_values) +write regbit (port_id) (address) (bit_x) (value) - vlan (vlan_id) queue (queue_id) soft (soft_id) +For example, to set the high bit in the register from the example above: -upd_perfect_filter -~~~~~~~~~~~~~~~~~~ +.. code-block:: console -Update a perfect filter: + testpmd> write regbit 0 0xEE00 31 1 + port 0 PCI register at offset 0xEE00: 0x8000000A (2147483658) -# Command is displayed on several lines for clarity. +Filter Functions +---------------- -upd_perfect_filter (port_id) (ip|udp|tcp|sctp) +This section details the available filter functions that are available. - src (src_ip_address) (src_port) +add_ethertype_filter +~~~~~~~~~~~~~~~~~~~~ - dst (dst_ip_address) (dst_port) +Add a L2 Ethertype filter, which identify packets by their L2 Ethertype mainly assign them to a receive queue. - flexbytes (flexbytes_values) +add_ethertype_filter (port_id) ethertype (eth_value) priority (enable|disable) (pri_value) queue (queue_id) index (idx) - vlan (vlan_id) queue (queue_id) +The available information parameters are: -rm_perfect_filter -~~~~~~~~~~~~~~~~~ +* port_id: the port which the Ethertype filter assigned on. -Remove a perfect filter: +* eth_value: the EtherType value want to match, + for example 0x0806 for ARP packet. 0x0800 (IPv4) and 0x86DD (IPv6) are invalid. -rm_perfect_filter (port_id) (ip|udp|tcp|sctp) +* enable: user priority participates in the match. - src (src_ip_address) (src_port) +* disable: user priority doesn't participate in the match. - dst (dst_ip_address) (dst_port) +* pri_value: user priority value that want to match. - flexbytes (flexbytes_values) +* queue_id : The receive queue associated with this EtherType filter - vlan (vlan_id) soft (soft_id) +* index: the index of this EtherType filter -set_masks_filter -~~~~~~~~~~~~~~~~ +Example: -Set IPv4 filter masks: +.. code-block:: console -# Command is displayed on several lines for clarity. + testpmd> add_ethertype_filter 0 ethertype 0x0806 priority disable 0 queue 3 index 0 + Assign ARP packet to receive queue 3 -set_masks_filter (port_id) only_ip_flow (0|1) +remove_ethertype_filter +~~~~~~~~~~~~~~~~~~~~~~~ - src_mask (ip_src_mask) (src_port_mask) +Remove a L2 Ethertype filter - dst_mask (ip_dst_mask) (dst_port_mask) +remove_ethertype_filter (port_id) index (idx) - flexbytes (0|1) vlan_id (0|1) vlan_prio (0|1) +get_ethertype_filter +~~~~~~~~~~~~~~~~~~~~ -set_ipv6_masks_filter -~~~~~~~~~~~~~~~~~~~~~ +Get and display a L2 Ethertype filter -Set IPv6 filter masks: +get_ethertype_filter (port_id) index (idx) -# Command is displayed on several lines for clarity. +Example: -set_ipv6_masks_filter (port_id) only_ip_flow (0|1) +.. code-block:: console - src_mask (ip_src_mask) (src_port_mask) + testpmd> get_ethertype_filter 0 index 0 - dst_mask (ip_dst_mask) (dst_port_mask) + filter[0]: + ethertype: 0x0806 + priority: disable, 0 + queue: 3 - flexbytes (0|1) vlan_id (0|1) vlan_prio (0|1) +add_2tuple_filter +~~~~~~~~~~~~~~~~~ - compare_dst (0|1) +Add a 2-tuple filter, +which identify packets by specific protocol and destination TCP/UDP port +and forwards packets into one of the receive queues. -Link Bonding Functions ----------------------- +add_2tuple_filter (port_id) protocol (pro_value) (pro_mask) dst_port (port_value) (port_mask) +flags (flg_value) priority (prio_value) queue (queue_id) index (idx) -The Link Bonding functions make it possible to dynamically create and -manage link bonding devices from within testpmd interactive prompt. +The available information parameters are: -create bonded device -~~~~~~~~~~~~~~~~~~~~ +* port_id: the port which the 2-tuple filter assigned on. -Create a new bonding device: +* pro_value: IP L4 protocol -create bonded device (mode) (socket) +* pro_mask: protocol participates in the match or not, 1 means participate -For example, to create a bonded device in mode 1 on socket 0. +* port_value: destination port in L4. -.. code-block:: console +* port_mask: destination port participates in the match or not, 1 means participate. - testpmd> create bonded 1 0 - created new bonded device (port X) +* flg_value: TCP control bits. The non-zero value is invalid, when the pro_value is not set to 0x06 (TCP). -add bonding slave -~~~~~~~~~~~~~~~~~ +* prio_value: the priority of this filter. -Adds Ethernet device to a Link Bonding device: +* queue_id: The receive queue associated with this 2-tuple filter -add bonding slave (slave id) (port id) +* index: the index of this 2-tuple filter -For example, to add Ethernet device (port 6) to a Link Bonding device (port 10). +Example: .. code-block:: console - testpmd> add bonding slave 6 10 - + testpmd> add_2tuple_filter 0 protocol 0x06 1 dst_port 32 1 flags 0x02 priority 3 queue 3 index 0 -remove bonding slave +remove_2tuple_filter ~~~~~~~~~~~~~~~~~~~~ -Removes an Ethernet slave device from a Link Bonding device: +Remove a 2-tuple filter -remove bonding slave (slave id) (port id) +remove_2tuple_filter (port_id) index (idx) -For example, to remove Ethernet slave device (port 6) to a Link Bonding device (port 10). +get_2tuple_filter +~~~~~~~~~~~~~~~~~ + +Get and display a 2-tuple filter + +get_2tuple_filter (port_id) index (idx) + +Example: .. code-block:: console - testpmd> remove bonding slave 6 10 + testpmd> get_2tuple_filter 0 index 0 -set bonding mode -~~~~~~~~~~~~~~~~ + filter[0]: + Destination Port: 0x0020 mask: 1 + protocol: 0x06 mask:1 tcp_flags: 0x02 + priority: 3 queue: 3 -Set the Link Bonding mode of a Link Bonding device: +add_5tuple_filter +~~~~~~~~~~~~~~~~~ -set bonding mode (value) (port id) +Add a 5-tuple filter, +which consists of a 5-tuple (protocol, source and destination IP addresses, source and destination TCP/UDP/SCTP port) +and routes packets into one of the receive queues. -For example, to set the bonding mode of a Link Bonding device (port 10) to broadcast (mode 3). +add_5tuple_filter (port_id) dst_ip (dst_address) src_ip (src_address) dst_port (dst_port_value) src_port (src_port_value) +protocol (protocol_value) mask (mask_value) flags (flags_value) priority (prio_value) queue (queue_id) index (idx) -.. code-block:: console +The available information parameters are: - testpmd> set bonding mode 3 10 +* port_id: the port which the 5-tuple filter assigned on. -set bonding primary -~~~~~~~~~~~~~~~~~~~ +* dst_address: destination IP address. -Set an Ethernet slave device as the primary device on a Link Bonding device: +* src_address: source IP address. -set bonding primary (slave id) (port id) +* dst_port_value: TCP/UDP destination port. -For example, to set the Ethernet slave device (port 6) as the primary port of a Link Bonding device (port 10). +* src_port_value: TCP/UDP source port. -.. code-block:: console +* protocol_value: L4 protocol. - testpmd> set bonding primary 6 10 +* mask_value: participates in the match or not by bit for field above, 1b means participate -set bonding mac -~~~~~~~~~~~~~~~ +* flags_value: TCP control bits. The non-zero value is invalid, when the protocol_value is not set to 0x06 (TCP). -Set the MAC address of a Link Bonding device: +* prio_value: the priority of this filter. -set bonding mac (port id) (mac) +* queue_id: The receive queue associated with this 5-tuple filter. -For example, to set the MAC address of a Link Bonding device (port 10) to 00:00:00:00:00:01 +* index: the index of this 5-tuple filter + +Example: .. code-block:: console - testpmd> set bonding mac 10 00:00:00:00:00:01 + 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 -set bonding xmit_balance_policy -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +remove_5tuple_filter +~~~~~~~~~~~~~~~~~~~~ -Set the transmission policy for a Link Bonding device when it is in Balance XOR mode: +Remove a 5-tuple filter -set bonding xmit_balance_policy (port_id) (l2|l23|l34) +remove_5tuple_filter (port_id) index (idx) -For example, set a Link Bonding device (port 10) to use a balance policy of layer 3+4 (IP addresses & UDP ports ) +get_5tuple_filter +~~~~~~~~~~~~~~~~~ -.. code-block:: console +Get and display a 5-tuple filter - testpmd> set bonding xmit_balance_policy 10 l34 +get_5tuple_filter (port_id) index (idx) +Example: -set bonding mon_period -~~~~~~~~~~~~~~~~~~~~~~ +.. code-block:: console -Set the link status monitoring polling period in milliseconds for a bonding devicie. + testpmd> get_5tuple_filter 1 index 0 -This adds support for PMD slave devices which do not support link status interrupts. -When the mon_period is set to a value greater than 0 then all PMD's which do not support -link status ISR will be queried every polling interval to check if their link status has changed. + filter[0]: + Destination IP: 0x02020205 mask: 1 + Source IP: 0x02020204 mask: 1 + Destination Port: 0x0040 mask: 1 + Source Port: 0x0020 mask: 1 + protocol: 0x06 mask: 1 + priority: 3 flags: 0x00 queue: 3 -set bonding mon_period (port_id) (value) +add_syn_filter +~~~~~~~~~~~~~~ -For example, to set the link status monitoring polling period of bonded device (port 5) to 150ms +Add SYN filter, which can forward TCP packets whose *SYN* flag is set into a separate queue. -.. code-block:: console +add_syn_filter (port_id) priority (high|low) queue (queue_id) - testpmd> set bonding mon_period 5 150 +The available information parameters are: +* port_id: the port which the SYN filter assigned on. -show bonding config -~~~~~~~~~~~~~~~~~~~ +* high: this SYN filter has higher priority than other filters. -Show the current configuration of a Link Bonding device: +* low: this SYN filter has lower priority than other filters. -show bonding config (port id) +* queue_id: The receive queue associated with this SYN filter -For example, -to show the configuration a Link Bonding device (port 9) with 3 slave devices (1, 3, 4) -in balance mode with a transmission policy of layer 2+3. +Example: .. code-block:: console - testpmd> show bonding config 9 - Bonding mode: 2 - Balance Xmit Policy: BALANCE_XMIT_POLICY_LAYER23 - Slaves (3): [1 3 4] - Active Slaves (3): [1 3 4] - Primary: [3] + testpmd> add_syn_filter 0 priority high queue 3, -Register Functions ------------------- +remove_syn_filter +~~~~~~~~~~~~~~~~~ -The Register functions can be used to read from and write to registers on the network card referenced by a port number. -This is mainly useful for debugging purposes. -Reference should be made to the appropriate datasheet for the network card for details on the register addresses -and fields that can be accessed. +Remove SYN filter -read reg -~~~~~~~~ +remove_syn_filter (port_id) -Display the value of a port register: +get_syn_filter +~~~~~~~~~~~~~~ -read reg (port_id) (address) +Get and display SYN filter -For example, to examine the Flow Director control register (FDIRCTL, 0x0000EE000) on an Intel® 82599 10 GbE Controller: +get_syn_filter (port_id) + +Example: .. code-block:: console - testpmd> read reg 0 0xEE00 - port 0 PCI register at offset 0xEE00: 0x4A060029 (1241907241) + testpmd> get_syn_filter 0 -read regfield -~~~~~~~~~~~~~ + syn filter: on, priority: high, queue: 3 -Display a port register bit field: +add_flex_filter +~~~~~~~~~~~~~~~ -read regfield (port_id) (address) (bit_x) (bit_y) +Add a Flex filter, +which recognizes any arbitrary pattern within the first 128 bytes of the packet +and routes packets into one of the receive queues. -For example, reading the lowest two bits from the register in the example above: +add_flex_filter (port_id) len (len_value) bytes (bytes_string) mask (mask_value) +priority (prio_value) queue (queue_id) index (idx) -.. code-block:: console +The available information parameters are: - testpmd> read regfield 0 0xEE00 0 1 - port 0 PCI register at offset 0xEE00: bits[0, 1]=0x1 (1) +* port_id: the port which the Flex filter assigned on. -read regbit -~~~~~~~~~~~ +* len_value: filter length in byte, no greater than 128. -Display a single port register bit: +* bytes_string: a sting in format of octal, means the value the flex filter need to match. -read regbit (port_id) (address) (bit_x) +* mask_value: a sting in format of octal, bit 1 means corresponding byte in DWORD participates in the match. -For example, reading the lowest bit from the register in the example above: +* prio_value: the priority of this filter. -.. code-block:: console +* queue_id: The receive queue associated with this Flex filter. - testpmd> read regbit 0 0xEE00 0 - port 0 PCI register at offset 0xEE00: bit 0=1 +* index: the index of this Flex filter -write reg -~~~~~~~~~ +Example: -Set the value of a port register: +.. code-block:: console -write reg (port_id) (address) (value) + testpmd> add_flex_filter 0 len 16 bytes 0x00000000000000000000000008060000 mask 000C priority 3 queue 3 index 0 -For example, to clear a register: +Assign a packet whose 13th and 14th bytes are 0x0806 to queue 3. -.. code-block:: console +remove_flex_filter +~~~~~~~~~~~~~~~~~~ - testpmd> write reg 0 0xEE00 0x0 - port 0 PCI register at offset 0xEE00: 0x00000000 (0) +Remove a Flex filter -write regfield -~~~~~~~~~~~~~~ +remove_flex_filter (port_id) index (idx) -Set bit field of a port register: +get_flex_filter +~~~~~~~~~~~~~~~ -write regfield (port_id) (address) (bit_x) (bit_y) (value) +Get and display a Flex filter -For example, writing to the register cleared in the example above: +get_flex_filter (port_id) index (idx) -.. code-block:: console +Example: - testpmd> write regfield 0 0xEE00 0 1 2 - port 0 PCI register at offset 0xEE00: 0x00000002 (2) +.. code-block:: console -write regbit -~~~~~~~~~~~~ + testpmd> get_flex_filter 0 index 0 -Set single bit value of a port register: + filter[0]: -write regbit (port_id) (address) (bit_x) (value) + length: 16 -For example, to set the high bit in the register from the example above: + dword[]: 0x00000000 00000000 00000000 08060000 00000000 00000000 00000000 + 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 + 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 + 00000000 00000000 00000000 00000000 00000000 00000000 00000000 -.. code-block:: console + mask[]: + 0b0000000000001100000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000 - testpmd> write regbit 0 0xEE00 31 1 - port 0 PCI register at offset 0xEE00: 0x8000000A (2147483658) + priority: 3 queue: 3 -- 2.20.1