From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id A28F45A96 for ; Mon, 26 Jan 2015 04:43:38 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 25 Jan 2015 19:43:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,466,1418112000"; d="scan'208";a="675811283" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 25 Jan 2015 19:43:37 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t0Q3hZFr026372 for ; Mon, 26 Jan 2015 11:43:35 +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 t0Q3hX3m010962 for ; Mon, 26 Jan 2015 11:43:35 +0800 Received: (from jijiangl@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t0Q3hXeP010958 for dev@dpdk.org; Mon, 26 Jan 2015 11:43:33 +0800 From: Jijiang Liu To: dev@dpdk.org Date: Mon, 26 Jan 2015 11:43:22 +0800 Message-Id: <1422243805-10906-4-git-send-email-jijiang.liu@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1422243805-10906-1-git-send-email-jijiang.liu@intel.com> References: <1422243805-10906-1-git-send-email-jijiang.liu@intel.com> Subject: [dpdk-dev] [PATCH 3/6] app/testpmd:test RX tunnel filter for NVGRE packet 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, 26 Jan 2015 03:43:39 -0000 Extend the "tunnel_filter" command in testpmd to test the RX tunnel filter API for NVGRE packet. Signed-off-by Jijiang Liu --- app/test-pmd/cmdline.c | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 882a5a2..ab25e24 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -292,11 +292,11 @@ static void cmd_help_long_parsed(void *parsed_result, " a port\n\n" "tunnel_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) " - "(inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id)\n" + "(inner_vlan) (vxlan|nvgre) (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) (tunnel_type) (filter_type) (tenant_id) (queue_id)\n" + "(inner_vlan) (vxlan|nvgre) (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" @@ -6756,6 +6756,8 @@ 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, "iip")) + tunnel_filter_conf.filter_type = ETH_TUNNEL_FILTER_IIP; else { printf("The filter type is not supported"); return; @@ -6763,8 +6765,10 @@ cmd_tunnel_filter_parsed(void *parsed_result, if (!strcmp(res->tunnel_type, "vxlan")) tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN; + if (!strcmp(res->tunnel_type, "nvgre")) + tunnel_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_NVGRE; else { - printf("Only VXLAN is supported now.\n"); + printf("The tunnel type is supported now.\n"); return; } @@ -6808,12 +6812,12 @@ 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"); + tunnel_type, "vxlan#nvgre"); 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#" - "imac#omac-imac-tenid"); + "imac#omac-imac-tenid#iip"); cmdline_parse_token_num_t cmd_tunnel_filter_tenant_id = TOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result, tenant_id, UINT32); @@ -6826,9 +6830,9 @@ 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) filter_type " + "inner_vlan tunnel_type(vxlan|nvgre) filter_type " "(imac-ivlan|imac-ivlan-tenid|imac-tenid|" - "imac|omac-imac-tenid) " + "imac|omac-imac-tenid|iip) " "tenant_id queue_num", .tokens = { (void *)&cmd_tunnel_filter_cmd, -- 1.7.7.6