DPDK patches and discussions
 help / color / mirror / Atom feed
From: Helin Zhang <helin.zhang@intel.com>
To: dev@dpdk.org
Cc: yulong.pei@intel.com
Subject: [dpdk-dev] [PATCH v3 2/3] app/testpmd: add test commands for selecting different GRE key sizes
Date: Thu, 29 Oct 2015 14:18:38 +0800	[thread overview]
Message-ID: <1446099519-7903-3-git-send-email-helin.zhang@intel.com> (raw)
In-Reply-To: <1446099519-7903-1-git-send-email-helin.zhang@intel.com>

Test commands are added to support selecting differnt length of GRE key.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Signed-off-by: Andrey Chilikin <andrey.chilikin@intel.com>
---
 app/test-pmd/cmdline.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 1a2cb7d..cd49637 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6645,6 +6645,57 @@ cmdline_parse_inst_t cmd_tunnel_udp_config = {
 	},
 };
 
+/* *** GLOBAL CONFIG *** */
+struct cmd_global_config_result {
+	cmdline_fixed_string_t cmd;
+	uint8_t port_id;
+	cmdline_fixed_string_t cfg_type;
+	uint8_t len;
+};
+
+static void
+cmd_global_config_parsed(void *parsed_result,
+			 __attribute__((unused)) struct cmdline *cl,
+			 __attribute__((unused)) void *data)
+{
+	struct cmd_global_config_result *res = parsed_result;
+	struct rte_eth_global_cfg conf;
+	int ret;
+
+	memset(&conf, 0, sizeof(conf));
+	conf.cfg_type = RTE_ETH_GLOBAL_CFG_TYPE_GRE_KEY_LEN;
+	conf.cfg.gre_key_len = res->len;
+	ret = rte_eth_dev_filter_ctrl(res->port_id, RTE_ETH_FILTER_NONE,
+				      RTE_ETH_FILTER_SET, &conf);
+	if (ret != 0)
+		printf("Global config error\n");
+}
+
+cmdline_parse_token_string_t cmd_global_config_cmd =
+	TOKEN_STRING_INITIALIZER(struct cmd_global_config_result, cmd,
+		"global_config");
+cmdline_parse_token_num_t cmd_global_config_port_id =
+	TOKEN_NUM_INITIALIZER(struct cmd_global_config_result, port_id, UINT8);
+cmdline_parse_token_string_t cmd_global_config_type =
+	TOKEN_STRING_INITIALIZER(struct cmd_global_config_result,
+		cfg_type, "gre-key-len");
+cmdline_parse_token_num_t cmd_global_config_gre_key_len =
+	TOKEN_NUM_INITIALIZER(struct cmd_global_config_result,
+		len, UINT8);
+
+cmdline_parse_inst_t cmd_global_config = {
+	.f = cmd_global_config_parsed,
+	.data = (void *)NULL,
+	.help_str = "global_config <port_id> gre-key-len <number>",
+	.tokens = {
+		(void *)&cmd_global_config_cmd,
+		(void *)&cmd_global_config_port_id,
+		(void *)&cmd_global_config_type,
+		(void *)&cmd_global_config_gre_key_len,
+		NULL,
+	},
+};
+
 /* *** CONFIGURE VM MIRROR VLAN/POOL RULE *** */
 struct cmd_set_mirror_mask_result {
 	cmdline_fixed_string_t set;
@@ -9484,6 +9535,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_vf_rate_limit,
 	(cmdline_parse_inst_t *)&cmd_tunnel_filter,
 	(cmdline_parse_inst_t *)&cmd_tunnel_udp_config,
+	(cmdline_parse_inst_t *)&cmd_global_config,
 	(cmdline_parse_inst_t *)&cmd_set_mirror_mask,
 	(cmdline_parse_inst_t *)&cmd_set_mirror_link,
 	(cmdline_parse_inst_t *)&cmd_reset_mirror_rule,
-- 
1.9.3

  parent reply	other threads:[~2015-10-29  6:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24  7:16 [dpdk-dev] [PATCH 0/2] add selecting different GRE key length Helin Zhang
2015-09-24  7:16 ` [dpdk-dev] [PATCH 1/2] i40e: add selecting " Helin Zhang
2015-09-24  7:16 ` [dpdk-dev] [PATCH 2/2] app/testpmd: add test commands for selecting different GRE key sizes Helin Zhang
2015-10-20  6:18 ` [dpdk-dev] [PATCH v2 0/2] add selecting different GRE key length Helin Zhang
2015-10-20  6:18   ` [dpdk-dev] [PATCH v2 1/2] i40e: add selecting " Helin Zhang
2015-10-20  6:18   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: add test commands for selecting different GRE key sizes Helin Zhang
2015-10-29  6:18   ` [dpdk-dev] [PATCH v3 0/3] add selecting different GRE key length Helin Zhang
2015-10-29  6:18     ` [dpdk-dev] [PATCH v3 1/3] i40e: add selecting " Helin Zhang
2015-10-29  6:18     ` Helin Zhang [this message]
2015-10-29  6:18     ` [dpdk-dev] [PATCH v3 3/3] doc: update release notes and testpmd guide Helin Zhang
2015-10-29  7:48       ` Thomas Monjalon
2015-10-29  8:43         ` Zhang, Helin
2015-10-30  4:54     ` [dpdk-dev] [PATCH v4 0/2] add selecting different GRE key length Helin Zhang
2015-10-30  4:54       ` [dpdk-dev] [PATCH v4 1/2] i40e: add selecting " Helin Zhang
2015-10-30  4:54       ` [dpdk-dev] [PATCH v4 2/2] app/testpmd: add test commands for selecting different GRE key sizes Helin Zhang
2015-10-30  5:37       ` [dpdk-dev] [PATCH v4 0/2] add selecting different GRE key length Tao, Zhe
2015-11-02 15:07       ` [dpdk-dev] [PATCH v5 " Helin Zhang
2015-11-02 15:07         ` [dpdk-dev] [PATCH v5 1/2] i40e: add selecting " Helin Zhang
2015-11-02 15:07         ` [dpdk-dev] [PATCH v5 2/2] app/testpmd: add test commands for selecting different GRE key sizes Helin Zhang
2015-11-03 16:28         ` [dpdk-dev] [PATCH v6 0/2] add selecting different GRE key length Helin Zhang
2015-11-03 16:28           ` [dpdk-dev] [PATCH v6 1/2] i40e: add selecting " Helin Zhang
2015-11-03 16:28           ` [dpdk-dev] [PATCH v6 2/2] app/testpmd: add test commands for selecting different GRE key sizes Helin Zhang
2015-11-03 23:38           ` [dpdk-dev] [PATCH v6 0/2] add selecting different GRE key length 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=1446099519-7903-3-git-send-email-helin.zhang@intel.com \
    --to=helin.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=yulong.pei@intel.com \
    /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).