DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jingjing Wu <jingjing.wu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 09/12] testpmd: extend commands for fdir's tunnel id input set
Date: Tue, 26 Jan 2016 14:20:21 +0800	[thread overview]
Message-ID: <1453789224-5716-10-git-send-email-jingjing.wu@intel.com> (raw)
In-Reply-To: <1453789224-5716-1-git-send-email-jingjing.wu@intel.com>

This patch extended commands for filter's input set changing.
It added GRE/Vxlan Tunnel as filter's input fields.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 app/test-pmd/cmdline.c                      | 27 +++++++++++++++++++++------
 doc/guides/testpmd_app_ug/testpmd_funcs.rst | 22 ++++++++++++++++------
 2 files changed, 37 insertions(+), 12 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index da1d3f2..ecc822a 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -641,7 +641,8 @@ static void cmd_help_long_parsed(void *parsed_result,
 			" flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)"
 			" src (src_ip_address) dst (dst_ip_address)"
 			" tos (tos_value) proto (proto_value) ttl (ttl_value)"
-			" vlan (vlan_value) flexbytes (flexbytes_value)"
+			" vlan (vlan_value) (NVGRE|VxLAN|GRE|Notunnel)"
+			" (tunnel_id_value) flexbytes (flexbytes_value)"
 			" (drop|fwd) pf|vf(vf_id) queue (queue_id)"
 			" fd_id (fd_id_value)\n"
 			"    Add/Del an IP type flow director filter.\n\n"
@@ -651,7 +652,8 @@ static void cmd_help_long_parsed(void *parsed_result,
 			" src (src_ip_address) (src_port)"
 			" dst (dst_ip_address) (dst_port)"
 			" tos (tos_value) ttl (ttl_value)"
-			" vlan (vlan_value) flexbytes (flexbytes_value)"
+			" vlan (vlan_value) (NVGRE|VxLAN|GRE|Notunnel)"
+			" (tunnel_id_value) flexbytes (flexbytes_value)"
 			" (drop|fwd) pf|vf(vf_id) queue (queue_id)"
 			" fd_id (fd_id_value)\n"
 			"    Add/Del an UDP/TCP type flow director filter.\n\n"
@@ -663,6 +665,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 			" tag (verification_tag) "
 			" tos (tos_value) ttl (ttl_value)"
 			" vlan (vlan_value)"
+			" (NVGRE|VxLAN|GRE|Notunnel) (tunnel_id_value)"
 			" flexbytes (flexbytes_value) (drop|fwd)"
 			" pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\n"
 			"    Add/Del a SCTP type flow director filter.\n\n"
@@ -749,7 +752,8 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"dst-ipv6|ipv4-tos|ipv4-proto|ipv4-ttl|ipv6-tc|"
 			"ipv6-next-header|ipv6-hop-limits|udp-src-port|"
 			"udp-dst-port|tcp-src-port|tcp-dst-port|"
-			"sctp-src-port|sctp-dst-port|sctp-veri-tag|none)"
+			"sctp-src-port|sctp-dst-port|sctp-veri-tag|"
+			"udp-key|gre-key|none)"
 			" (select|add)\n"
 			"    Set the input set for FDir.\n\n"
 		);
@@ -8092,6 +8096,7 @@ str2fdir_tunneltype(char *string)
 	} tunneltype_str[] = {
 		{"NVGRE", RTE_FDIR_TUNNEL_TYPE_NVGRE},
 		{"VxLAN", RTE_FDIR_TUNNEL_TYPE_VXLAN},
+		{"GRE",   RTE_FDIR_TUNNEL_TYPE_GRE},
 	};
 
 	for (i = 0; i < RTE_DIM(tunneltype_str); i++) {
@@ -8263,6 +8268,10 @@ cmd_flow_director_filter_parsed(void *parsed_result,
 		   RTE_ETH_FDIR_MAX_FLEXLEN);
 
 	entry.input.flow_ext.vlan_tci = rte_cpu_to_be_16(res->vlan_value);
+	entry.input.flow.tunnel_flow.tunnel_type =
+		str2fdir_tunneltype(res->tunnel_type);
+	entry.input.flow.tunnel_flow.tunnel_id =
+			rte_cpu_to_be_32(res->tunnel_id_value);
 
 	entry.action.flex_off = 0;  /*use 0 by default */
 	if (!strcmp(res->drop, "drop"))
@@ -8426,7 +8435,7 @@ cmdline_parse_token_string_t cmd_flow_director_tunnel =
 				 tunnel, "tunnel");
 cmdline_parse_token_string_t cmd_flow_director_tunnel_type =
 	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-				 tunnel_type, "NVGRE#VxLAN");
+				 tunnel_type, "NVGRE#VxLAN#GRE#Notunnel");
 cmdline_parse_token_string_t cmd_flow_director_tunnel_id =
 	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
 				 tunnel_id, "tunnel-id");
@@ -8458,6 +8467,8 @@ cmdline_parse_inst_t cmd_add_del_ip_flow_director = {
 		(void *)&cmd_flow_director_ttl_value,
 		(void *)&cmd_flow_director_vlan,
 		(void *)&cmd_flow_director_vlan_value,
+		(void *)&cmd_flow_director_tunnel_type,
+		(void *)&cmd_flow_director_tunnel_id_value,
 		(void *)&cmd_flow_director_flexbytes,
 		(void *)&cmd_flow_director_flexbytes_value,
 		(void *)&cmd_flow_director_drop,
@@ -8494,6 +8505,8 @@ cmdline_parse_inst_t cmd_add_del_udp_flow_director = {
 		(void *)&cmd_flow_director_ttl_value,
 		(void *)&cmd_flow_director_vlan,
 		(void *)&cmd_flow_director_vlan_value,
+		(void *)&cmd_flow_director_tunnel_type,
+		(void *)&cmd_flow_director_tunnel_id_value,
 		(void *)&cmd_flow_director_flexbytes,
 		(void *)&cmd_flow_director_flexbytes_value,
 		(void *)&cmd_flow_director_drop,
@@ -8532,6 +8545,8 @@ cmdline_parse_inst_t cmd_add_del_sctp_flow_director = {
 		(void *)&cmd_flow_director_ttl_value,
 		(void *)&cmd_flow_director_vlan,
 		(void *)&cmd_flow_director_vlan_value,
+		(void *)&cmd_flow_director_tunnel_type,
+		(void *)&cmd_flow_director_tunnel_id_value,
 		(void *)&cmd_flow_director_flexbytes,
 		(void *)&cmd_flow_director_flexbytes_value,
 		(void *)&cmd_flow_director_drop,
@@ -9611,7 +9626,7 @@ cmdline_parse_token_string_t cmd_set_fdir_input_set_field =
 	"ipv4-tos#ipv4-proto#ipv4-ttl#ipv6-tc#ipv6-next-header#"
 	"ipv6-hop-limits#udp-src-port#udp-dst-port#"
 	"tcp-src-port#tcp-dst-port#sctp-src-port#sctp-dst-port#"
-	"sctp-veri-tag#none");
+	"sctp-veri-tag#udp-key#gre-key#none");
 cmdline_parse_token_string_t cmd_set_fdir_input_set_select =
 	TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result,
 	select, "select#add");
@@ -9626,7 +9641,7 @@ cmdline_parse_inst_t cmd_set_fdir_input_set = {
 	"ipv4-tos|ipv4-proto|ipv4-ttl|ipv6-tc|ipv6-next-header|"
 	"ipv6-hop-limits|udp-src-port|udp-dst-port|"
 	"tcp-src-port|tcp-dst-port|sctp-src-port|sctp-dst-port|"
-	"sctp-veri-tag|none select|add",
+	"sctp-veri-tag|udp-key|gre-key|none select|add",
 	.tokens = {
 		(void *)&cmd_set_fdir_input_set_cmd,
 		(void *)&cmd_set_fdir_input_set_port_id,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f59e63e..417ddde 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1681,7 +1681,8 @@ Different NICs may have different capabilities, command show port fdir (port_id)
                         flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag) \
                         src (src_ip_address) dst (dst_ip_address) \
                         tos (tos_value) proto (proto_value) ttl (ttl_value) \
-                        vlan (vlan_value) flexbytes (flexbytes_value) \
+                        vlan (vlan_value) (NVGRE|VxLAN|GRE|Notunnel) \
+                        (tunnel_id_value) flexbytes (flexbytes_value) \
                         (drop|fwd) pf|vf(vf_id) queue (queue_id) \
                         fd_id (fd_id_value)
 
@@ -1690,7 +1691,8 @@ Different NICs may have different capabilities, command show port fdir (port_id)
                         src (src_ip_address) (src_port) \
                         dst (dst_ip_address) (dst_port) \
                         tos (tos_value) ttl (ttl_value) \
-                        vlan (vlan_value) flexbytes (flexbytes_value) \
+                        vlan (vlan_value) (NVGRE|VxLAN|GRE|Notunnel) \
+                        (tunnel_id_value) flexbytes (flexbytes_value) \
                         (drop|fwd) queue pf|vf(vf_id) (queue_id) \
                         fd_id (fd_id_value)
 
@@ -1700,6 +1702,7 @@ Different NICs may have different capabilities, command show port fdir (port_id)
                         dst (dst_ip_address) (dst_port) \
                         tos (tos_value) ttl (ttl_value) \
                         tag (verification_tag) vlan (vlan_value) \
+                        (NVGRE|VxLAN|GRE|Notunnel) (tunnel_id_value) \
                         flexbytes (flexbytes_value) (drop|fwd) \
                         pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)
 
@@ -1722,15 +1725,21 @@ 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 \
-            dst 2.2.2.5 33 tos 2 ttl 40 vlan 0x1 flexbytes (0x88,0x48) \
-            fwd pf queue 1 fd_id 1
+            dst 2.2.2.5 33  tos 2 ttl 40 vlan 0x1 Notunnel 0 \
+            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 \
-             dst 2.2.2.5 tos 2 proto 20 ttl 40 vlan 0x1 \
+             dst 2.2.2.5  tos 2 proto 20 ttl 40 vlan 0x1 Notunnel 0 \
              flexbytes (0x88,0x48) fwd pf queue 1 fd_id 1
 
+For example, add a ipv4-other flow type filter with GRE key 0x0a0b0c0d:
+
+   testpmd> flow_director_filter 0 add flow ipv4-other src 2.2.2.3 \
+            dst 2.2.2.5 tos 2 proto 20 ttl 40 vlan 0x1 GRE 0x0a0b0c0d \
+            flexbytes (0x88,0x48) fwd pf queue 1 fd_id 1
+
 flush_flow_director
 ~~~~~~~~~~~~~~~~~~~
 
@@ -1861,6 +1870,7 @@ For example, to add source IP to hash input set for flow type of ipv4-udp on por
 set_fdir_input_set
 ~~~~~~~~~~~~~~~~~~
 
+
 The Flow Director filters can match the different fields for different type of packet, i.e. specific input set
 on per flow type and the flexible payload. This command can be used to change input set for each flow type.
 
@@ -1871,7 +1881,7 @@ Set the input set for flow director::
    l2_payload) (ethertype|src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|ipv4-tos| \
    ipv4-proto|ipv4-ttl|ipv6-tc|ipv6-next-header|ipv6-hop-limits| \
    tudp-src-port|udp-dst-port|cp-src-port|tcp-dst-port|sctp-src-port| \
-   sctp-dst-port|sctp-veri-tag|none) (select|add)
+   sctp-dst-port|sctp-veri-tag|udp-key|gre-key|none) (select|add)
 
 For example to add source IP to FD input set for flow type of ipv4-udp on port 0::
 
-- 
2.4.0

  parent reply	other threads:[~2016-01-26  6:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26  6:20 [dpdk-dev] [PATCH 00/12] extend flow director's fields in i40e driver Jingjing Wu
2016-01-26  6:20 ` [dpdk-dev] [PATCH 01/12] ethdev: extend flow director to support input set selection Jingjing Wu
2016-01-26  6:20 ` [dpdk-dev] [PATCH 02/12] i40e: split function for input set change of hash and fdir Jingjing Wu
2016-01-26  6:20 ` [dpdk-dev] [PATCH 03/12] i40e: remove flex payload from INPUT_SET_SELECT operation Jingjing Wu
2016-01-26  6:20 ` [dpdk-dev] [PATCH 04/12] i40e: restore default setting on input set of filters Jingjing Wu
2016-01-26  6:20 ` [dpdk-dev] [PATCH 05/12] i40e: extend flow director to filter by more IP Header fields Jingjing Wu
2016-01-26  6:20 ` [dpdk-dev] [PATCH 06/12] testpmd: extend commands for filter's input set changing Jingjing Wu
2016-01-26  6:20 ` [dpdk-dev] [PATCH 07/12] librte_ether: extend rte_eth_fdir_flow to support tunnel format Jingjing Wu
2016-01-26  6:20 ` [dpdk-dev] [PATCH 08/12] i40e: extend flow director to filter by tunnel ID Jingjing Wu
2016-01-26  6:20 ` Jingjing Wu [this message]
2016-01-26  6:20 ` [dpdk-dev] [PATCH 10/12] i40e: fix VLAN bitmasks for hash/fdir input sets for tunnels Jingjing Wu
2016-01-26  6:20 ` [dpdk-dev] [PATCH 11/12] i40e: extend flow director to filter by vlan id Jingjing Wu
2016-01-26  6:20 ` [dpdk-dev] [PATCH 12/12] testpmd: extend commands for fdir's vlan input set Jingjing Wu
  -- strict thread matches above, loose matches on Subject: below --
2015-12-25  8:29 [dpdk-dev] [PATCH 0/4] extend flow director's IP fields in i40e driver Jingjing Wu
2016-01-26  6:26 ` [dpdk-dev] [PATCH 00/12] extend flow director's " Jingjing Wu
2016-01-26  6:26   ` [dpdk-dev] [PATCH 09/12] testpmd: extend commands for fdir's tunnel id input set Jingjing Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1453789224-5716-10-git-send-email-jingjing.wu@intel.com \
    --to=jingjing.wu@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).