From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 26E5C5A93 for ; Thu, 29 Jan 2015 06:30:14 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 28 Jan 2015 21:25:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,484,1418112000"; d="scan'208";a="519450746" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 28 Jan 2015 21:22:52 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t0T5U1RR023021; Thu, 29 Jan 2015 13:30:01 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t0T5TxBP013736; Thu, 29 Jan 2015 13:30:01 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t0T5Tx9A013732; Thu, 29 Jan 2015 13:29:59 +0800 From: Jingjing Wu To: dev@dpdk.org Date: Thu, 29 Jan 2015 13:29:25 +0800 Message-Id: <1422509365-13596-16-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1422509365-13596-1-git-send-email-jingjing.wu@intel.com> References: <1422509365-13596-1-git-send-email-jingjing.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] =?utf-8?q?=5BPATCH_15/15=5D_doc=3A_commands_changed_in?= =?utf-8?q?_testpmd=5Ffuncs=2Erst_for_flow_director?= X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jan 2015 05:30:16 -0000 Following commands of flow director filter are removed: - add_signature_filter - upd_signature_filter - rm_signature_filter - add_perfect_filter - upd_perfect_filter - rm_perfect_filter - set_masks_filter - set_ipv6_masks_filter New command is added to set flow director's mask: - flow_director_mask Update arguments of commands: - flow_director_filter - flow_director_flex_mask - flow_director_flex_payload Signed-off-by: Jingjing Wu --- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 287 ++++++++++------------------ 1 file changed, 100 insertions(+), 187 deletions(-) diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 218835a..70fe9ea 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -71,7 +71,6 @@ These are divided into sections and can be accessed using help, help section or help display : Displaying port, stats and config information. help config : Configuration information. help ports : Configuring ports. - help flowdir : Flow Director filter help. help registers : Reading and setting port registers. help filters : Filters configuration help. help all : All of the above sections. @@ -971,192 +970,6 @@ Where the threshold type can be: * txrst: Set the transmit RS bit threshold of TX rings, 0 <= value <= txd. These threshold options are also available from the command-line. -Flow Director Functions ------------------------ - -The Flow Director works in receive mode to identify specific flows or sets of flows and route them to specific queues. - -Two types of filtering are supported which are referred to as Perfect Match and Signature filters: - -* 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. - -The Flow Director filters can match the following fields in a packet: - -* Source IP and destination IP addresses. - -* Source port and destination port numbers (for UDP and TCP packets). - -* IPv4/IPv6 and UDP/ TCP/SCTP protocol match. - -* VLAN header. - -* Flexible 2-byte tuple match anywhere in the first 64 bytes of the packet. - -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: - -* src: A pair of source address values. The source IP, in IPv4 or IPv6 format, and the source port: - - src 192.168.0.1 1024 - - src 2001:DB8:85A3:0:0:8A2E:370:7000 1024 - -* dst: A pair of destination address values. The destination IP, in IPv4 or IPv6 format, and the destination port. - -* flexbytes: A 2-byte tuple to be matched within the first 64 bytes of a packet. - -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. - -* vlan: The VLAN header to match in the packet. - -* queue: The index of the RX queue to route matched packets to. - -* soft: The 16-bit value in the MBUF flow director ID field for RX packets matching the filter. - -add_signature_filter -~~~~~~~~~~~~~~~~~~~~ - -Add a signature filter: - -# Command is displayed on several lines for clarity. - -add_signature_filter (port_id) (ip|udp|tcp|sctp) - - src (src_ip_address) (src_port) - - dst (dst_ip_address) (dst_port) - - flexbytes (flexbytes_values) - - vlan (vlan_id) queue (queue_id) - -upd_signature_filter -~~~~~~~~~~~~~~~~~~~~ - -Update a signature filter: - -# Command is displayed on several lines for clarity. - -upd_signature_filter (port_id) (ip|udp|tcp|sctp) - - src (src_ip_address) (src_port) - - dst (dst_ip_address) (dst_port) - - flexbytes (flexbytes_values) - - vlan (vlan_id) queue (queue_id) - -rm_signature_filter -~~~~~~~~~~~~~~~~~~~ - -Remove a signature filter: - -# Command is displayed on several lines for clarity. - -rm_signature_filter (port_id) (ip|udp|tcp|sctp) - - src (src_ip_address) (src_port) - - dst (dst_ip_address) (dst_port) - - flexbytes (flexbytes_values) - - vlan (vlan_id) - -add_perfect_filter -~~~~~~~~~~~~~~~~~~ - -Add a perfect filter: - -# Command is displayed on several lines for clarity. - -add_perfect_filter (port_id) (ip|udp|tcp|sctp) - - src (src_ip_address) (src_port) - - dst (dst_ip_address) (dst_port) - - flexbytes (flexbytes_values) - - vlan (vlan_id) queue (queue_id) soft (soft_id) - -upd_perfect_filter -~~~~~~~~~~~~~~~~~~ - -Update a perfect filter: - -# Command is displayed on several lines for clarity. - -upd_perfect_filter (port_id) (ip|udp|tcp|sctp) - - src (src_ip_address) (src_port) - - dst (dst_ip_address) (dst_port) - - flexbytes (flexbytes_values) - - vlan (vlan_id) queue (queue_id) - -rm_perfect_filter -~~~~~~~~~~~~~~~~~ - -Remove a perfect filter: - -rm_perfect_filter (port_id) (ip|udp|tcp|sctp) - - src (src_ip_address) (src_port) - - dst (dst_ip_address) (dst_port) - - flexbytes (flexbytes_values) - - vlan (vlan_id) soft (soft_id) - -set_masks_filter -~~~~~~~~~~~~~~~~ - -Set IPv4 filter masks: - -# Command is displayed on several lines for clarity. - -set_masks_filter (port_id) only_ip_flow (0|1) - - src_mask (ip_src_mask) (src_port_mask) - - dst_mask (ip_dst_mask) (dst_port_mask) - - flexbytes (0|1) vlan_id (0|1) vlan_prio (0|1) - -set_ipv6_masks_filter -~~~~~~~~~~~~~~~~~~~~~ - -Set IPv6 filter masks: - -# Command is displayed on several lines for clarity. - -set_ipv6_masks_filter (port_id) only_ip_flow (0|1) - - src_mask (ip_src_mask) (src_port_mask) - - dst_mask (ip_dst_mask) (dst_port_mask) - - flexbytes (0|1) vlan_id (0|1) vlan_prio (0|1) - - compare_dst (0|1) - Link Bonding Functions ---------------------- @@ -1663,3 +1476,103 @@ Example: 0000000000000000000000000000000000000000000000000000000000 priority: 3 queue: 3 + +flow_director_filter +~~~~~~~~~~~~~~~~~~~~ + +The Flow Director works in receive mode to identify specific flows or sets of flows and route them to specific queues. + +Two types of filtering are supported which are referred to as Perfect Match and Signature filters, the match mode +is set by the --pkt-filter-mode command-line parameter: + +* 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. + +The Flow Director filters can match the different fields for different type of packet: flow type, specific input set +per flow type and the flexible payload. 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. + +Different NICs may have different capabilities, command show port fdir (port_id) can be used to acquire the information. + +# Commands to add flow director filters of different flow types. + +flow_director_filter (port_id) (add|del|update) flow (ip4|ip4-frag|ip6|ip6-frag) +src (src_ip_address) dst (dst_ip_address) vlan (vlan_value) flexbytes (flexbytes_value) +(drop|fwd) queue (queue_id) fd_id (fd_id_value) + +flow_director_filter (port_id) (add|del|update) flow (udp4|tcp4|udp6|tcp6) +src (src_ip_address) (src_port) dst (dst_ip_address) (dst_port) vlan (vlan_value) +flexbytes (flexbytes_value) (drop|fwd) queue (queue_id) fd_id (fd_id_value) + +flow_director_filter (port_id) (add|del|update) flow (sctp4|sctp6) +src (src_ip_address) (src_port) dst (dst_ip_address) (dst_port) tag (verification_tag) +vlan (vlan_value) flexbytes (flexbytes_value) (drop|fwd) queue (queue_id) fd_id (fd_id_value) + +For example, to add an udp flow type filter: + +.. code-block:: console + + testpmd> flow_director_filter 0 add flow udp4 src 2.2.2.3 32 dst 2.2.2.5 33 vlan 0x1 flexbytes (0x88,0x48) fwd queue 1 fd_id 1 + +For example, add an ip4 flow type filter: + +.. code-block:: console + + testpmd> flow_director_filter 0 add flow ip4 src 2.2.2.3 dst 2.2.2.5 vlan 0x1 flexbytes (0x88,0x48) fwd queue 1 fd_id 1 + +flush_flow_director +~~~~~~~~~~~~~~~~~~~ + +flush all flow director filters on a device: + +flush_flow_director (port_id) + +Example, to flush all flow director filter on port 0: + +.. code-block:: console + + testpmd> flush_flow_director 0 + +flow_director_mask +~~~~~~~~~~~~~~~~~~ + +set flow director's masks on match input set + +flow_director_mask (port_id) vlan (vlan_value) src_mask (ipv4_src) (ipv6_src) (src_port) dst_mask (ipv4_dst) (ipv6_dst) (dst_port) + +Example, to set flow director mask on port 0: + +.. code-block:: console + + testpmd> flow_director_mask 0 vlan 0xefff src_mask 255.255.255.255 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 0xFFFF dst_mask 255.255.255.255 FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF 0xFFFF + + +flow_director_flex_mask +~~~~~~~~~~~~~~~~~~~~~~~ + +set masks of flow director's flexible payload based on certain flow type: + +flow_director_flex_mask (port_id) flow (raw|ip4|ip4-frag|tcp4|udp4|sctp4|ip6|ip6-frag|tcp6|udp6|sctp6|all) (mask) + +Example, to set flow director's udpv4 flex mask on port 0: + +.. code-block:: console + + testpmd> flow_director_flex_mask 0 flow all (0xff,0xff,0,0,0,0,0,0,0,0,0,0,0,0,0,0) + + +flow_director_flex_payload +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Configure flexible payload selection. + +flow_director_flex_payload (port_id) (raw|l2|l3|l4) (config) + +For example, to select the first 16 bytes from the offset 4 (bytes) of packet’s payload as flexible payload. + +.. code-block:: console + + testpmd> flow_director_flex_payload 0 l4 (4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19) -- 1.9.3