DPDK patches and discussions
 help / color / mirror / Atom feed
From: <maciej.czekaj@caviumnetworks.com>
To: <pablo.de.lara.guarch@intel.com>
Cc: <dev@dpdk.org>, Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
Subject: [dpdk-dev] [PATCH 3/3] app/testpmd: support setting up txq_flags value in command line
Date: Fri, 22 Apr 2016 11:58:18 +0200	[thread overview]
Message-ID: <1461319098-22632-4-git-send-email-maciej.czekaj@caviumnetworks.com> (raw)
In-Reply-To: <1461319098-22632-1-git-send-email-maciej.czekaj@caviumnetworks.com>

From: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>

	"port config all txqflags <value>" allows for
	specifying txq_flags value in command line.

Signed-off-by: Maciej Czekaj <maciej.czekaj@caviumnetworks.com>
---
 app/test-pmd/cmdline.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 929d19a..680164f 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2730,6 +2730,69 @@ cmdline_parse_inst_t cmd_set_txsplit = {
 	},
 };
 
+/* *** CONFIG TX QUEUE FLAGS *** */
+
+struct cmd_config_txqflags_result {
+	cmdline_fixed_string_t port;
+	cmdline_fixed_string_t config;
+	cmdline_fixed_string_t all;
+	cmdline_fixed_string_t what;
+	int32_t hexvalue;
+};
+
+static void cmd_config_txqflags_parsed(void *parsed_result,
+				__attribute__((unused)) struct cmdline *cl,
+				__attribute__((unused)) void *data)
+{
+	struct cmd_config_txqflags_result *res = parsed_result;
+
+	if (!all_ports_stopped()) {
+		printf("Please stop all ports first\n");
+		return;
+	}
+
+	if (!strcmp(res->what, "txqflags")) {
+		txq_flags = res->hexvalue;
+	} else {
+		printf("Unknown parameter\n");
+		return;
+	}
+
+	init_port_config();
+
+	cmd_reconfig_device_queue(RTE_PORT_ALL, 1, 1);
+}
+
+cmdline_parse_token_string_t cmd_config_txqflags_port =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_txqflags_result, port,
+				 "port");
+cmdline_parse_token_string_t cmd_config_txqflags_config =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_txqflags_result, config,
+				 "config");
+cmdline_parse_token_string_t cmd_config_txqflags_all =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_txqflags_result, all,
+				 "all");
+cmdline_parse_token_string_t cmd_config_txqflags_what =
+	TOKEN_STRING_INITIALIZER(struct cmd_config_txqflags_result, what,
+				 "txqflags");
+cmdline_parse_token_num_t cmd_config_txqflags_value =
+	TOKEN_NUM_INITIALIZER(struct cmd_config_txqflags_result,
+				hexvalue, INT32);
+
+cmdline_parse_inst_t cmd_config_txqflags = {
+	.f = cmd_config_txqflags_parsed,
+	.data = NULL,
+	.help_str = "port config all txqflags value",
+	.tokens = {
+		(void *)&cmd_config_txqflags_port,
+		(void *)&cmd_config_txqflags_config,
+		(void *)&cmd_config_txqflags_all,
+		(void *)&cmd_config_txqflags_what,
+		(void *)&cmd_config_txqflags_value,
+		NULL,
+	},
+};
+
 /* *** ADD/REMOVE ALL VLAN IDENTIFIERS TO/FROM A PORT VLAN RX FILTER *** */
 struct cmd_rx_vlan_filter_all_result {
 	cmdline_fixed_string_t rx_vlan;
@@ -10487,6 +10550,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_config_rx_mode_flag,
 	(cmdline_parse_inst_t *)&cmd_config_rss,
 	(cmdline_parse_inst_t *)&cmd_config_rxtx_queue,
+	(cmdline_parse_inst_t *)&cmd_config_txqflags,
 	(cmdline_parse_inst_t *)&cmd_config_rss_reta,
 	(cmdline_parse_inst_t *)&cmd_showport_reta,
 	(cmdline_parse_inst_t *)&cmd_config_burst,
-- 
1.9.1

  parent reply	other threads:[~2016-04-22  9:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22  9:58 [dpdk-dev] [PATCH 0/3] testpmd: extend commands for better scatter-gather tests maciej.czekaj
2016-04-22  9:58 ` [dpdk-dev] [PATCH 1/3] app/testpmd: add "enable-scatter" parameter maciej.czekaj
2016-04-22  9:58 ` [dpdk-dev] [PATCH 2/3] app/testpmd: extend port config with scatter parameter maciej.czekaj
2016-04-22  9:58 ` maciej.czekaj [this message]
2016-04-22 10:19 ` [dpdk-dev] [PATCH 0/3] testpmd: extend commands for better scatter-gather tests Mcnamara, John
2016-04-22 10:38   ` [dpdk-dev] Odp.: " Czekaj, Maciej
2016-04-22 14:51 ` [dpdk-dev] [PATCH v2 " maciej.czekaj
2016-04-28  8:52   ` De Lara Guarch, Pablo
2016-04-28 12:09     ` Maciej Czekaj
2016-04-28 13:13       ` De Lara Guarch, Pablo
2016-04-28 13:19         ` Maciej Czekaj
2016-06-08 10:38     ` Thomas Monjalon
2016-04-22 14:51 ` [dpdk-dev] [PATCH v2 1/3] app/testpmd: add "enable-scatter" parameter maciej.czekaj
2016-04-22 14:51 ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: extend port config with scatter parameter maciej.czekaj
2016-04-22 14:51 ` [dpdk-dev] [PATCH v2 3/3] app/testpmd: support setting up txq_flags value in command line maciej.czekaj

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=1461319098-22632-4-git-send-email-maciej.czekaj@caviumnetworks.com \
    --to=maciej.czekaj@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@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).