From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 3BAE491CB for ; Mon, 25 Jan 2016 08:25:40 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP; 24 Jan 2016 23:25:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,343,1449561600"; d="scan'208";a="35591573" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga004.fm.intel.com with ESMTP; 24 Jan 2016 23:25:39 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u0P7PaK1009010; Mon, 25 Jan 2016 15:25:36 +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 u0P7PWVK029489; Mon, 25 Jan 2016 15:25:34 +0800 Received: (from xutaosun@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u0P7PWUP029485; Mon, 25 Jan 2016 15:25:32 +0800 From: Xutao Sun To: dev@dpdk.org Date: Mon, 25 Jan 2016 15:25:22 +0800 Message-Id: <1453706722-29427-5-git-send-email-xutao.sun@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1453706722-29427-1-git-send-email-xutao.sun@intel.com> References: <1453706722-29427-1-git-send-email-xutao.sun@intel.com> Subject: [dpdk-dev] [PATCH 4/4] app/test-pmd: test tunnel filter for IP in GRE 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: Mon, 25 Jan 2016 07:25:40 -0000 This patch add some options in tunnel_filter command to test IP in GRE packet classification on i40e. Signed-off-by: Xutao, Sun Signed-off-by: Jijiang Liu --- app/test-pmd/cmdline.c | 26 ++++++++++++++++++-------- 1 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 792da7d..f871095 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -299,12 +299,14 @@ static void cmd_help_long_parsed(void *parsed_result, " Set the outer VLAN TPID for Packet Filtering on" " a port\n\n" - "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n" + "tunnel_filter add (port_id) (outer_ip) (inner_ip) (outer_mac)" + "(inner_mac) (ip_addr) (inner_vlan) (vxlan|nvgre|iningre) (filter_type)" + "(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) (filter_type) (tenant_id) (queue_id)\n" + "tunnel_filter rm (port_id) (outer_ip) (inner_ip) (outer_mac)" + "(inner_mac) (ip_addr) (inner_vlan) (vxlan|nvgre|ipingre) (filter_type)" + "(tenant_id) (queue_id)\n" " remove a tunnel filter of a port.\n\n" "rx_vxlan_port add (udp_port) (port_id)\n" @@ -6638,6 +6640,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, struct rte_eth_tunnel_filter_conf tunnel_filter_conf; int ret = 0; + memset(&tunnel_filter_conf, 0, sizeof(tunnel_filter_conf)); + (void)rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac, ETHER_ADDR_LEN); (void)rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac, @@ -6666,6 +6670,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, else if (!strcmp(res->filter_type, "omac-imac-tenid")) tunnel_filter_conf.filter_type = RTE_TUNNEL_FILTER_OMAC_TENID_IMAC; + else if (!strcmp(res->filter_type, "oip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_OIP; + else if (!strcmp(res->filter_type, "iip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_IIP; else { printf("The filter type is not supported"); return; @@ -6675,6 +6683,8 @@ cmd_tunnel_filter_parsed(void *parsed_result, tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN; else if (!strcmp(res->tunnel_type, "nvgre")) tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_NVGRE; + else if (!strcmp(res->tunnel_type, "ipingre")) + tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_IP_IN_GRE; else { printf("The tunnel type %s not supported.\n", res->tunnel_type); return; @@ -6720,11 +6730,11 @@ 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"); + tunnel_type, "vxlan#nvgre#ipingre"); cmdline_parse_token_string_t cmd_tunnel_filter_filter_type = TOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result, - filter_type, "imac-ivlan#imac-ivlan-tenid#imac-tenid#" + filter_type, "oip#iip#imac-ivlan#imac-ivlan-tenid#imac-tenid#" "imac#omac-imac-tenid"); cmdline_parse_token_num_t cmd_tunnel_filter_tenant_id = TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, @@ -6738,8 +6748,8 @@ cmdline_parse_inst_t cmd_tunnel_filter = { .data = (void *)0, .help_str = "add/rm tunnel filter of a port: " "tunnel_filter add port_id outer_mac inner_mac ip " - "inner_vlan tunnel_type(vxlan|nvgre) filter_type " - "(imac-ivlan|imac-ivlan-tenid|imac-tenid|" + "inner_vlan tunnel_type(vxlan|nvgre|ipingre) filter_type " + "(oip|iip|imac-ivlan|imac-ivlan-tenid|imac-tenid|" "imac|omac-imac-tenid) " "tenant_id queue_num", .tokens = { -- 1.7.7.6