DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qi Zhang <qi.z.zhang@intel.com>
To: thomas@monjalon.net
Cc: dev@dpdk.org, beilei.xing@intel.com, jingjing.wu@intel.com,
	wenzhuo.lu@intel.com, Qi Zhang <qi.z.zhang@intel.com>
Subject: [dpdk-dev] [PATCH v2 2/4] app/testpmd: add parameters for deferred queue setup
Date: Fri,  2 Mar 2018 12:13:04 +0800	[thread overview]
Message-ID: <20180302041306.90324-3-qi.z.zhang@intel.com> (raw)
In-Reply-To: <20180302041306.90324-1-qi.z.zhang@intel.com>

Add two parameters:
rxq-setup: set the number of RX queues be setup before device started
txq-setup: set the number of TX queues be setup before device started.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 app/test-pmd/parameters.c             | 29 +++++++++++++++++++++++++++++
 app/test-pmd/testpmd.c                |  8 ++++++--
 app/test-pmd/testpmd.h                |  2 ++
 doc/guides/testpmd_app_ug/run_app.rst | 12 ++++++++++++
 4 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 97d22b860..497259ee7 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -146,8 +146,12 @@ usage(char* progname)
 	printf("  --rss-ip: set RSS functions to IPv4/IPv6 only .\n");
 	printf("  --rss-udp: set RSS functions to IPv4/IPv6 + UDP.\n");
 	printf("  --rxq=N: set the number of RX queues per port to N.\n");
+	printf("  --rxq-setup=N: set the number of RX queues be setup before"
+	       "device start to N.\n");
 	printf("  --rxd=N: set the number of descriptors in RX rings to N.\n");
 	printf("  --txq=N: set the number of TX queues per port to N.\n");
+	printf("  --txq-setup=N: set the number of TX queues be setup before"
+	       "device start to N.\n");
 	printf("  --txd=N: set the number of descriptors in TX rings to N.\n");
 	printf("  --burst=N: set the number of packets per burst to N.\n");
 	printf("  --mbcache=N: set the cache of mbuf memory pool to N.\n");
@@ -596,7 +600,9 @@ launch_args_parse(int argc, char** argv)
 		{ "rss-ip",			0, 0, 0 },
 		{ "rss-udp",			0, 0, 0 },
 		{ "rxq",			1, 0, 0 },
+		{ "rxq-setup",			1, 0, 0 },
 		{ "txq",			1, 0, 0 },
+		{ "txq-setup",			1, 0, 0 },
 		{ "rxd",			1, 0, 0 },
 		{ "txd",			1, 0, 0 },
 		{ "burst",			1, 0, 0 },
@@ -933,6 +939,15 @@ launch_args_parse(int argc, char** argv)
 						  " >= 0 && <= %u\n", n,
 						  get_allowed_max_nb_rxq(&pid));
 			}
+			if (!strcmp(lgopts[opt_idx].name, "rxq-setup")) {
+				n = atoi(optarg);
+				if (n >= 0 && check_nb_rxq((queueid_t)n) == 0)
+					nb_rxq_setup = (queueid_t) n;
+				else
+					rte_exit(EXIT_FAILURE, "rxq-setup %d invalid - must be"
+						  " >= 0 && <= %u\n", n,
+						  get_allowed_max_nb_rxq(&pid));
+			}
 			if (!strcmp(lgopts[opt_idx].name, "txq")) {
 				n = atoi(optarg);
 				if (n >= 0 && check_nb_txq((queueid_t)n) == 0)
@@ -942,6 +957,15 @@ launch_args_parse(int argc, char** argv)
 						  " >= 0 && <= %u\n", n,
 						  get_allowed_max_nb_txq(&pid));
 			}
+			if (!strcmp(lgopts[opt_idx].name, "txq-setup")) {
+				n = atoi(optarg);
+				if (n >= 0 && check_nb_txq((queueid_t)n) == 0)
+					nb_txq_setup = (queueid_t) n;
+				else
+					rte_exit(EXIT_FAILURE, "txq-setup %d invalid - must be"
+						  " >= 0 && <= %u\n", n,
+						  get_allowed_max_nb_txq(&pid));
+			}
 			if (!nb_rxq && !nb_txq) {
 				rte_exit(EXIT_FAILURE, "Either rx or tx queues should "
 						"be non-zero\n");
@@ -1119,4 +1143,9 @@ launch_args_parse(int argc, char** argv)
 	/* Set offload configuration from command line parameters. */
 	rx_mode.offloads = rx_offloads;
 	tx_mode.offloads = tx_offloads;
+
+	if (nb_rxq_setup > nb_rxq)
+		nb_rxq_setup = nb_rxq;
+	if (nb_txq_setup > nb_txq)
+		nb_txq_setup = nb_txq;
 }
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 46dc22c94..790e7359c 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -207,6 +207,10 @@ uint8_t dcb_test = 0;
  */
 queueid_t nb_rxq = 1; /**< Number of RX queues per port. */
 queueid_t nb_txq = 1; /**< Number of TX queues per port. */
+queueid_t nb_rxq_setup = MAX_QUEUE_ID;
+/**< Number of RX queues per port start when dev_start. */
+queueid_t nb_txq_setup = MAX_QUEUE_ID;
+/**< Number of TX queues per port start when dev_start  */
 
 /*
  * Configurable number of RX/TX ring descriptors.
@@ -1594,7 +1598,7 @@ start_port(portid_t pid)
 			/* Apply Tx offloads configuration */
 			port->tx_conf.offloads = port->dev_conf.txmode.offloads;
 			/* setup tx queues */
-			for (qi = 0; qi < nb_txq; qi++) {
+			for (qi = 0; qi < nb_txq_setup; qi++) {
 				if ((numa_support) &&
 					(txring_numa[pi] != NUMA_NO_CONFIG))
 					diag = rte_eth_tx_queue_setup(pi, qi,
@@ -1622,7 +1626,7 @@ start_port(portid_t pid)
 			/* Apply Rx offloads configuration */
 			port->rx_conf.offloads = port->dev_conf.rxmode.offloads;
 			/* setup rx queues */
-			for (qi = 0; qi < nb_rxq; qi++) {
+			for (qi = 0; qi < nb_rxq_setup; qi++) {
 				if ((numa_support) &&
 					(rxring_numa[pi] != NUMA_NO_CONFIG)) {
 					struct rte_mempool * mp =
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 153abea05..1a423eb8c 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -373,6 +373,8 @@ extern uint64_t rss_hf;
 
 extern queueid_t nb_rxq;
 extern queueid_t nb_txq;
+extern queueid_t nb_rxq_setup;
+extern queueid_t nb_txq_setup;
 
 extern uint16_t nb_rxd;
 extern uint16_t nb_txd;
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 1fd53958a..63dbec407 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -354,6 +354,12 @@ The commandline options are:
     Set the number of RX queues per port to N, where 1 <= N <= 65535.
     The default value is 1.
 
+*   ``--rxq-setup=N``
+
+    Set the number of RX queues will be setup before device started,
+    where 0 <= N <= 65535. The default value is rxq, if the number is
+    larger than rxq, it will be set to rxq automatically.
+
 *   ``--rxd=N``
 
     Set the number of descriptors in the RX rings to N, where N > 0.
@@ -364,6 +370,12 @@ The commandline options are:
     Set the number of TX queues per port to N, where 1 <= N <= 65535.
     The default value is 1.
 
+*   ``--txq-setup=N``
+
+    Set the number of TX queues will be setup before device started,
+    where 0 <= N <= 65535. The default value is rxq, if the number is
+    larger than txq, it will be set to txq automatically.
+
 *   ``--txd=N``
 
     Set the number of descriptors in the TX rings to N, where N > 0.
-- 
2.13.6

  parent reply	other threads:[~2018-03-02  4:13 UTC|newest]

Thread overview: 95+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12  4:53 [dpdk-dev] [PATCH 0/4] " Qi Zhang
2018-02-12  4:53 ` [dpdk-dev] [PATCH 1/4] ether: support " Qi Zhang
2018-02-12 13:55   ` Thomas Monjalon
2018-02-12  4:53 ` [dpdk-dev] [PATCH 2/4] app/testpmd: add parameters for " Qi Zhang
2018-02-12  4:53 ` [dpdk-dev] [PATCH 3/4] app/testpmd: add command for " Qi Zhang
2018-02-12  4:53 ` [dpdk-dev] [PATCH 4/4] net/i40e: enable deferred " Qi Zhang
2018-03-02  4:13 ` [dpdk-dev] [PATCH v2 0/4] " Qi Zhang
2018-03-02  4:13   ` [dpdk-dev] [PATCH v2 1/4] ether: support " Qi Zhang
2018-03-14 12:31     ` Ananyev, Konstantin
2018-03-15  3:13       ` Zhang, Qi Z
2018-03-15 13:16         ` Ananyev, Konstantin
2018-03-15 15:08           ` Zhang, Qi Z
2018-03-15 15:38             ` Ananyev, Konstantin
2018-03-16  0:42               ` Zhang, Qi Z
2018-03-02  4:13   ` Qi Zhang [this message]
2018-03-14 17:38     ` [dpdk-dev] [PATCH v2 2/4] app/testpmd: add parameters for " Ananyev, Konstantin
2018-03-15  3:58       ` Zhang, Qi Z
2018-03-15 13:42         ` Ananyev, Konstantin
2018-03-15 14:31           ` Zhang, Qi Z
2018-03-02  4:13   ` [dpdk-dev] [PATCH v2 3/4] app/testpmd: add command for " Qi Zhang
2018-03-14 17:36     ` Ananyev, Konstantin
2018-03-14 17:41     ` Ananyev, Konstantin
2018-03-15  3:59       ` Zhang, Qi Z
2018-03-02  4:13   ` [dpdk-dev] [PATCH v2 4/4] net/i40e: enable deferred " Qi Zhang
2018-03-14 12:35     ` Ananyev, Konstantin
2018-03-15  3:22       ` Zhang, Qi Z
2018-03-15  3:50         ` Zhang, Qi Z
2018-03-15 13:22         ` Ananyev, Konstantin
2018-03-15 14:30           ` Zhang, Qi Z
2018-03-15 15:22             ` Ananyev, Konstantin
2018-03-16  0:52               ` Zhang, Qi Z
2018-03-16  9:54                 ` Ananyev, Konstantin
2018-03-16 11:00                   ` Bruce Richardson
2018-03-16 13:18                   ` Zhang, Qi Z
2018-03-16 14:15                   ` Zhang, Qi Z
2018-03-16 18:47                     ` Ananyev, Konstantin
2018-03-18  7:55                       ` Zhang, Qi Z
2018-03-20 13:18                         ` Ananyev, Konstantin
2018-03-21  1:53                           ` Zhang, Qi Z
2018-03-21  7:28 ` [dpdk-dev] [PATCH v3 0/3] runtime " Qi Zhang
2018-03-21  7:28   ` [dpdk-dev] [PATCH v3 1/3] ether: support " Qi Zhang
2018-03-25 19:47     ` Ananyev, Konstantin
2018-03-21  7:28   ` [dpdk-dev] [PATCH v3 2/3] app/testpmd: add command for " Qi Zhang
2018-03-21  7:28   ` [dpdk-dev] [PATCH v3 3/3] net/i40e: enable runtime " Qi Zhang
2018-03-25 19:46     ` Ananyev, Konstantin
2018-03-26  8:49       ` Zhang, Qi Z
2018-03-26  8:59 ` [dpdk-dev] [PATCH v4 0/3] " Qi Zhang
2018-03-26  8:59   ` [dpdk-dev] [PATCH v4 1/3] ether: support " Qi Zhang
2018-03-26  8:59   ` [dpdk-dev] [PATCH v4 2/3] app/testpmd: add command for " Qi Zhang
2018-04-01 12:21     ` Ananyev, Konstantin
2018-03-26  8:59   ` [dpdk-dev] [PATCH v4 3/3] net/i40e: enable runtime " Qi Zhang
2018-04-01 12:18     ` Ananyev, Konstantin
2018-04-02  2:20       ` Zhang, Qi Z
2018-04-02  2:59 ` [dpdk-dev] [PATCH v5 0/3] " Qi Zhang
2018-04-02  2:59   ` [dpdk-dev] [PATCH v5 1/3] ether: support " Qi Zhang
2018-04-06 19:42     ` Rosen, Rami
2018-04-08  2:20       ` Zhang, Qi Z
2018-04-02  2:59   ` [dpdk-dev] [PATCH v5 2/3] app/testpmd: add command for " Qi Zhang
2018-04-07 15:49     ` Rosen, Rami
2018-04-08  2:22       ` Zhang, Qi Z
2018-04-02  2:59   ` [dpdk-dev] [PATCH v5 3/3] net/i40e: enable runtime " Qi Zhang
2018-04-02 23:36   ` [dpdk-dev] [PATCH v5 0/3] " Ananyev, Konstantin
2018-04-08  2:42 ` Qi Zhang
2018-04-08  2:42   ` [dpdk-dev] [PATCH v6 1/3] ether: support " Qi Zhang
2018-04-10 13:59     ` Thomas Monjalon
2018-04-20 11:14       ` Ferruh Yigit
2018-04-24 19:36       ` Thomas Monjalon
2018-04-25  5:33         ` Zhang, Qi Z
2018-04-25  7:54           ` Thomas Monjalon
2018-04-20 11:16     ` Ferruh Yigit
2018-04-08  2:42   ` [dpdk-dev] [PATCH v6 2/3] app/testpmd: add command for " Qi Zhang
2018-04-20 11:29     ` Ferruh Yigit
2018-04-22 11:57       ` Zhang, Qi Z
2018-04-08  2:42   ` [dpdk-dev] [PATCH v6 3/3] net/i40e: enable runtime " Qi Zhang
2018-04-20 11:17     ` Ferruh Yigit
2018-04-22 11:58 ` [dpdk-dev] [PATCH v7 0/5] " Qi Zhang
2018-04-22 11:58   ` [dpdk-dev] [PATCH v7 1/5] ethdev: support " Qi Zhang
2018-04-23 17:45     ` Ferruh Yigit
2018-04-22 11:58   ` [dpdk-dev] [PATCH v7 2/5] app/testpmd: add command for " Qi Zhang
2018-04-22 11:58   ` [dpdk-dev] [PATCH v7 3/5] app/testpmd: enable per queue configure Qi Zhang
2018-04-23 17:45     ` Ferruh Yigit
2018-04-22 11:58   ` [dpdk-dev] [PATCH v7 4/5] app/testpmd: enable queue ring size configure Qi Zhang
2018-04-23 17:45     ` Ferruh Yigit
2018-04-24  3:16       ` Zhang, Qi Z
2018-04-24 11:05         ` Ferruh Yigit
2018-04-22 11:58   ` [dpdk-dev] [PATCH v7 5/5] net/i40e: enable runtime queue setup Qi Zhang
2018-04-23 17:45   ` [dpdk-dev] [PATCH v7 0/5] " Ferruh Yigit
2018-04-24 12:44 ` [dpdk-dev] [PATCH v8 " Qi Zhang
2018-04-24 12:44   ` [dpdk-dev] [PATCH v8 1/5] ethdev: support " Qi Zhang
2018-04-24 14:01     ` Thomas Monjalon
2018-04-24 12:44   ` [dpdk-dev] [PATCH v8 2/5] app/testpmd: add command for " Qi Zhang
2018-04-24 12:44   ` [dpdk-dev] [PATCH v8 3/5] app/testpmd: enable per queue configure Qi Zhang
2018-04-24 12:44   ` [dpdk-dev] [PATCH v8 4/5] app/testpmd: enable queue ring size configure Qi Zhang
2018-04-24 12:44   ` [dpdk-dev] [PATCH v8 5/5] net/i40e: enable runtime queue setup Qi Zhang
2018-04-24 14:50   ` [dpdk-dev] [PATCH v8 0/5] " Ferruh Yigit

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=20180302041306.90324-3-qi.z.zhang@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=thomas@monjalon.net \
    --cc=wenzhuo.lu@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).