From 1aec68d134c4c36f14a5703b824c5c015da86296 Mon Sep 17 00:00:00 2001 From: Qiming Yang Date: Fri, 5 Apr 2019 17:05:34 +0800 Subject: [PATCH] app/testpmd: add VXLAN-GPE This patch added new item "vxlan-gpe" to tunnel_type to support new VXLAN-GPE packet type, and its classification. Signed-off-by: Qiming Yang Reviewed-by: Ferruh Yigit --- app/test-pmd/cmdline.c | 19 ++++++++++++------- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 11 +++++++---- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index ee50e45663..2ab03c1113 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -376,12 +376,12 @@ static void cmd_help_long_parsed(void *parsed_result, "filtered for VF(s) from port_id.\n\n" "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|" + "(inner_vlan) (vxlan|nvgre|ipingre|vxlan-gpe) (imac-ivlan|imac-ivlan-tenid|" "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n" " add a tunnel filter of a port.\n\n" "tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|" + "(inner_vlan) (vxlan|nvgre|ipingre|vxlan-gpe) (imac-ivlan|imac-ivlan-tenid|" "imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id)\n" " remove a tunnel filter of a port.\n\n" @@ -863,7 +863,7 @@ static void cmd_help_long_parsed(void *parsed_result, " for ports.\n\n" "port config all rss (all|default|ip|tcp|udp|sctp|" - "ether|port|vxlan|geneve|nvgre|none|)\n" + "ether|port|vxlan|geneve|nvgre|vxlan-gpe|none|)\n" " Set the RSS mode.\n\n" "port config port-id rss reta (hash,queue)[,(hash,queue)]\n" @@ -2190,7 +2190,7 @@ cmdline_parse_inst_t cmd_config_rss = { .f = cmd_config_rss_parsed, .data = NULL, .help_str = "port config all rss " - "all|default|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none|", + "all|default|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|vxlan-gpe|none|", .tokens = { (void *)&cmd_config_rss_port, (void *)&cmd_config_rss_keyword, @@ -8758,6 +8758,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, if (!strcmp(res->tunnel_type, "vxlan")) tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN; + else if (!strcmp(res->tunnel_type, "vxlan-gpe")) + tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN_GPE; else if (!strcmp(res->tunnel_type, "nvgre")) tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_NVGRE; else if (!strcmp(res->tunnel_type, "ipingre")) @@ -8807,7 +8809,7 @@ cmdline_parse_token_ipaddr_t cmd_tunnel_filter_ip_value = ip_value); cmdline_parse_token_string_t cmd_tunnel_filter_tunnel_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - tunnel_type, "vxlan#nvgre#ipingre"); + tunnel_type, "vxlan#nvgre#ipingre#vxlan-gpe"); cmdline_parse_token_string_t cmd_tunnel_filter_filter_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, @@ -8931,6 +8933,8 @@ cmd_cfg_tunnel_udp_port_parsed(void *parsed_result, tunnel_udp.prot_type = RTE_TUNNEL_TYPE_VXLAN; } else if (!strcmp(res->tunnel_type, "geneve")) { tunnel_udp.prot_type = RTE_TUNNEL_TYPE_GENEVE; + } else if (!strcmp(res->tunnel_type, "vxlan-gpe")) { + tunnel_udp.prot_type = RTE_TUNNEL_TYPE_VXLAN_GPE; } else { printf("Invalid tunnel type\n"); return; @@ -8965,7 +8969,7 @@ cmdline_parse_token_string_t cmd_config_tunnel_udp_port_action = "add#rm"); cmdline_parse_token_string_t cmd_config_tunnel_udp_port_tunnel_type = TOKEN_STRING_INITIALIZER(struct cmd_config_tunnel_udp_port, tunnel_type, - "vxlan#geneve"); + "vxlan#geneve#vxlan-gpe"); cmdline_parse_token_num_t cmd_config_tunnel_udp_port_value = TOKEN_NUM_INITIALIZER(struct cmd_config_tunnel_udp_port, udp_port, UINT16); @@ -8973,7 +8977,7 @@ cmdline_parse_token_num_t cmd_config_tunnel_udp_port_value = cmdline_parse_inst_t cmd_cfg_tunnel_udp_port = { .f = cmd_cfg_tunnel_udp_port_parsed, .data = NULL, - .help_str = "port config udp_tunnel_port add|rm vxlan|geneve ", + .help_str = "port config udp_tunnel_port add|rm vxlan|geneve|vxlan-gpe ", .tokens = { (void *)&cmd_config_tunnel_udp_port_port, (void *)&cmd_config_tunnel_udp_port_config, @@ -11987,6 +11991,7 @@ flowtype_to_str(uint16_t ftype) {"vxlan", RTE_ETH_FLOW_VXLAN}, {"geneve", RTE_ETH_FLOW_GENEVE}, {"nvgre", RTE_ETH_FLOW_NVGRE}, + {"vxlan-gpe", RTE_ETH_FLOW_VXLAN_GPE}, }; for (i = 0; i < RTE_DIM(ftype_table); i++) { diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index bcf1449a2c..5d4dc6f0cc 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -218,6 +218,7 @@ For example: vxlan geneve nvgre + vxlan-gpe show port rss reta ~~~~~~~~~~~~~~~~~~ @@ -830,7 +831,7 @@ tunnel_filter add Add a tunnel filter on a port:: testpmd> tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) \ - (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ + (inner_vlan) (vxlan|nvgre|ipingre|vxlan-gpe) (imac-ivlan|imac-ivlan-tenid|\ imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id) The available information categories are: @@ -841,6 +842,8 @@ The available information categories are: * ``ipingre``: Set tunnel type as IP-in-GRE. +* ``vxlan-gpe``: Set tunnel type as VXLAN-GPE + * ``imac-ivlan``: Set filter type as Inner MAC and VLAN. * ``imac-ivlan-tenid``: Set filter type as Inner MAC, VLAN and tenant ID. @@ -868,7 +871,7 @@ tunnel_filter remove Remove a tunnel filter on a port:: testpmd> tunnel_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) \ - (inner_vlan) (vxlan|nvgre|ipingre) (imac-ivlan|imac-ivlan-tenid|\ + (inner_vlan) (vxlan|nvgre|ipingre|vxlan-gpe) (imac-ivlan|imac-ivlan-tenid|\ imac-tenid|imac|omac-imac-tenid|oip|iip) (tenant_id) (queue_id) rx_vxlan_port add @@ -2059,7 +2062,7 @@ port config - RSS Set the RSS (Receive Side Scaling) mode on or off:: - testpmd> port config all rss (all|default|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|none) + testpmd> port config all rss (all|default|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|vxlan-gpe|none) RSS is on by default. @@ -2170,7 +2173,7 @@ port config udp_tunnel_port ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Add/remove UDP tunnel port for VXLAN/GENEVE tunneling protocols:: - testpmd> port config (port_id) udp_tunnel_port add|rm vxlan|geneve (udp_port) + testpmd> port config (port_id) udp_tunnel_port add|rm vxlan|geneve|vxlan-gpe (udp_port) port config tx_metadata ~~~~~~~~~~~~~~~~~~~~~~~ -- 2.20.1