DPDK patches and discussions
 help / color / mirror / Atom feed
From: Xutao Sun <xutao.sun@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v5 4/4] app/test-pmd: test tunnel filter for IP in GRE
Date: Fri, 19 Feb 2016 15:31:37 +0800	[thread overview]
Message-ID: <1455867097-19173-5-git-send-email-xutao.sun@intel.com> (raw)
In-Reply-To: <1455867097-19173-1-git-send-email-xutao.sun@intel.com>

This patch add some options in tunnel_filter command to test IP in GRE packet classification on i40e.

Signed-off-by: Xutao Sun <xutao.sun@intel.com>
Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
---
 app/test-pmd/cmdline.c | 32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index c707318..3e7cec8 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -302,11 +302,13 @@ 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) (vxlan|nvgre) (filter_type) (tenant_id) (queue_id)\n"
+			"(inner_vlan) (vxlan|nvgre|ipingre) (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) (filter_type) (tenant_id) (queue_id)\n"
+			"(inner_vlan) (vxlan|nvgre|ipingre) (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"
 
 			"rx_vxlan_port add (udp_port) (port_id)\n"
@@ -6640,6 +6642,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));
+
 	rte_memcpy(&tunnel_filter_conf.outer_mac, &res->outer_mac,
 			ETHER_ADDR_LEN);
 	rte_memcpy(&tunnel_filter_conf.inner_mac, &res->inner_mac,
@@ -6648,12 +6652,14 @@ cmd_tunnel_filter_parsed(void *parsed_result,
 
 	if (res->ip_value.family == AF_INET) {
 		tunnel_filter_conf.ip_addr.ipv4_addr =
-			res->ip_value.addr.ipv4.s_addr;
+			rte_be_to_cpu_32(res->ip_value.addr.ipv4.s_addr);
 		tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV4;
 	} else {
-		memcpy(&(tunnel_filter_conf.ip_addr.ipv6_addr),
-			&(res->ip_value.addr.ipv6),
-			sizeof(struct in6_addr));
+		int i;
+		for (i = 0; i < 4; i++) {
+			tunnel_filter_conf.ip_addr.ipv6_addr[i] =
+			rte_be_to_cpu_32(res->ip_value.addr.ipv6.s6_addr32[i]);
+		}
 		tunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6;
 	}
 
@@ -6669,6 +6675,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;
@@ -6678,6 +6688,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;
@@ -6723,11 +6735,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,
@@ -6741,8 +6753,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.9.3

  parent reply	other threads:[~2016-02-19  7:32 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-25  7:25 [dpdk-dev] [PATCH 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun
2016-01-25  7:25 ` [dpdk-dev] [PATCH 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-01-25  7:25 ` [dpdk-dev] [PATCH 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-01-25  7:25 ` [dpdk-dev] [PATCH 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-01-25  7:25 ` [dpdk-dev] [PATCH 4/4] app/test-pmd: test " Xutao Sun
2016-01-28  7:30 ` [dpdk-dev] [PATCH v2 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun
2016-01-28  7:30   ` [dpdk-dev] [PATCH v2 1/4] lib/ether: optimize the 'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-01-28  8:21     ` Thomas Monjalon
2016-01-28  9:05       ` Sun, Xutao
2016-01-28  7:30   ` [dpdk-dev] [PATCH v2 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-01-28  7:30   ` [dpdk-dev] [PATCH v2 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-01-28  7:30   ` [dpdk-dev] [PATCH v2 4/4] app/test-pmd: test " Xutao Sun
     [not found]   ` <1453976778-27807-1-git-send-email-xutao.sun@intel.com>
2016-01-28 10:26     ` [dpdk-dev] [PATCH v3 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-01-28 10:26     ` [dpdk-dev] [PATCH v3 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-01-28 10:26     ` [dpdk-dev] [PATCH v3 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-01-28 10:26     ` [dpdk-dev] [PATCH v3 4/4] app/test-pmd: test " Xutao Sun
2016-02-12 13:46       ` De Lara Guarch, Pablo
2016-02-18  7:19         ` Sun, Xutao
2016-02-18  9:58     ` [dpdk-dev] [PATCH v4 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun
2016-02-18  9:58       ` [dpdk-dev] [PATCH v4 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-02-18  9:58       ` [dpdk-dev] [PATCH v4 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-02-18  9:58       ` [dpdk-dev] [PATCH v4 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-02-18  9:58       ` [dpdk-dev] [PATCH v4 4/4] app/test-pmd: test " Xutao Sun
2016-02-18 12:16         ` De Lara Guarch, Pablo
2016-02-19  2:40           ` Sun, Xutao
2016-02-19  7:31       ` [dpdk-dev] [PATCH v5 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun
2016-02-19  7:31         ` [dpdk-dev] [PATCH v5 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-02-25  1:22           ` Wu, Jingjing
2016-02-19  7:31         ` [dpdk-dev] [PATCH v5 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-02-19  7:31         ` [dpdk-dev] [PATCH v5 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-02-25  1:50           ` Wu, Jingjing
2016-02-19  7:31         ` Xutao Sun [this message]
2016-03-01  3:47         ` [dpdk-dev] [PATCH v6 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun
2016-03-01  3:47           ` [dpdk-dev] [PATCH v6 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-03-01  8:53             ` Panu Matilainen
2016-03-02  3:10               ` Sun, Xutao
2016-03-02  7:12                 ` Panu Matilainen
2016-03-01  3:47           ` [dpdk-dev] [PATCH v6 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-03-01  3:47           ` [dpdk-dev] [PATCH v6 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-03-01  3:47           ` [dpdk-dev] [PATCH v6 4/4] app/test-pmd: test " Xutao Sun
2016-03-01  8:41           ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Xutao Sun
2016-03-01  8:41             ` [dpdk-dev] [PATCH v7 1/4] lib/ether: optimize the'rte_eth_tunnel_filter_conf' structure Xutao Sun
2016-03-08 23:08               ` Thomas Monjalon
2016-03-08 23:20                 ` Thomas Monjalon
2016-03-01  8:41             ` [dpdk-dev] [PATCH v7 2/4] lib/ether: add IP in GRE type Xutao Sun
2016-03-01  8:41             ` [dpdk-dev] [PATCH v7 3/4] driver/i40e: implement tunnel filter for IP in GRE Xutao Sun
2016-03-01  8:41             ` [dpdk-dev] [PATCH v7 4/4] app/test-pmd: test " Xutao Sun
2016-03-02  7:04             ` [dpdk-dev] [PATCH v7 0/4] Add tunnel filter support for IP in GRE on i40e Liu, Yong
2016-03-02  7:31             ` Wu, Jingjing
2016-03-10  3:05             ` [dpdk-dev] [PATCH v8 0/4] This patch set adds " Jingjing Wu
2016-03-10  3:05               ` [dpdk-dev] [PATCH v8 1/4] lib/ether: optimize struct rte_eth_tunnel_filter_conf Jingjing Wu
2016-03-13 12:01                 ` Thomas Monjalon
2016-03-10  3:06               ` [dpdk-dev] [PATCH v8 2/4] lib/ether: add IP in GRE type Jingjing Wu
2016-03-10  3:06               ` [dpdk-dev] [PATCH v8 3/4] driver/i40e: implement tunnel filter for IP in GRE Jingjing Wu
2016-03-10  3:06               ` [dpdk-dev] [PATCH v8 4/4] app/test-pmd: test " Jingjing Wu
2016-03-13 14:18               ` [dpdk-dev] [PATCH v8 0/4] This patch set adds tunnel filter support for IP in GRE on i40e Thomas Monjalon

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=1455867097-19173-5-git-send-email-xutao.sun@intel.com \
    --to=xutao.sun@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).