From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: jingjing.wu@dpdk.org
Cc: dev@dpdk.org, Pablo de Lara <pablo.de.lara.guarch@intel.com>
Subject: [dpdk-dev] [PATCH v3] app/testpmd: add parameter to start forwarding TX first
Date: Thu, 15 Jun 2017 05:04:03 +0100 [thread overview]
Message-ID: <20170615040403.78712-1-pablo.de.lara.guarch@intel.com> (raw)
In-Reply-To: <20170609023044.75127-1-pablo.de.lara.guarch@intel.com>
Add parameter to start forwarding sending first
a burst of packets, which is useful when testing
a loopback connection.
This was already implemented as an internal command,
but adding it as a parameter is interesting, as it
allows the user to test a loopback connection without
entering in the internal command line.
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
Changes in v3:
-Added tx-first in long parameter list
-Reworded informational message when tx-first is enabled
Changes in v2:
- Added check to prevent user from using --tx-first in interactive mode,
to avoid confusion
- Added extra information in testpmd help about the new parameter
app/test-pmd/parameters.c | 9 +++++++++
app/test-pmd/testpmd.c | 6 +++++-
app/test-pmd/testpmd.h | 1 +
doc/guides/testpmd_app_ug/run_app.rst | 8 ++++++++
4 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index fbe6284..0a88844 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -89,6 +89,7 @@ usage(char* progname)
"[--cmdline-file=FILENAME] "
#endif
"[--help|-h] | [--auto-start|-a] | ["
+ "--tx-first | "
"--coremask=COREMASK --portmask=PORTMASK --numa "
"--mbuf-size= | --total-num-mbufs= | "
"--nb-cores= | --nb-ports= | "
@@ -109,6 +110,8 @@ usage(char* progname)
printf(" --auto-start: start forwarding on init "
"[always when non-interactive].\n");
printf(" --help: display this message and quit.\n");
+ printf(" --tx-first: start forwarding sending a burst first "
+ "(only if interactive is disabled).\n");
printf(" --nb-cores=N: set the number of forwarding cores "
"(1 <= N <= %d).\n", nb_lcores);
printf(" --nb-ports=N: set the number of forwarding ports "
@@ -566,6 +569,7 @@ launch_args_parse(int argc, char** argv)
{ "eth-peers-configfile", 1, 0, 0 },
{ "eth-peer", 1, 0, 0 },
#endif
+ { "tx-first", 0, 0, 0 },
{ "ports", 1, 0, 0 },
{ "nb-cores", 1, 0, 0 },
{ "nb-ports", 1, 0, 0 },
@@ -674,6 +678,11 @@ launch_args_parse(int argc, char** argv)
printf("Auto-start selected\n");
auto_start = 1;
}
+ if (!strcmp(lgopts[opt_idx].name, "tx-first")) {
+ printf("Ports to start sending a burst of "
+ "packets first\n");
+ tx_first = 1;
+ }
if (!strcmp(lgopts[opt_idx].name,
"eth-peers-configfile")) {
if (init_peer_eth_addrs(optarg) != 0)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index d32cbb9..6001283 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -98,6 +98,7 @@ uint16_t verbose_level = 0; /**< Silent by default. */
/* use master core for command line ? */
uint8_t interactive = 0;
uint8_t auto_start = 0;
+uint8_t tx_first;
char cmdline_filename[PATH_MAX] = {0};
/*
@@ -2294,6 +2295,9 @@ main(int argc, char** argv)
if (argc > 1)
launch_args_parse(argc, argv);
+ if (tx_first && interactive)
+ rte_exit(EXIT_FAILURE, "--tx-first cannot be used on "
+ "interactive mode.\n");
if (!nb_rxq && !nb_txq)
printf("Warning: Either rx or tx queues should be non-zero\n");
@@ -2353,7 +2357,7 @@ main(int argc, char** argv)
int rc;
printf("No commandline core given, start packet forwarding\n");
- start_packet_forwarding(0);
+ start_packet_forwarding(tx_first);
printf("Press enter to exit\n");
rc = read(0, &c, 1);
pmd_test_exit();
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 364502d..5cabeef 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -299,6 +299,7 @@ extern uint16_t nb_rx_queue_stats_mappings;
extern uint16_t verbose_level; /**< Drives messages being displayed, if any. */
extern uint8_t interactive;
extern uint8_t auto_start;
+extern uint8_t tx_first;
extern char cmdline_filename[PATH_MAX]; /**< offline commands file */
extern uint8_t numa_support; /**< set by "--numa" parameter */
extern uint16_t port_topology; /**< set by "--port-topology" parameter */
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 2a43214..3159398 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -188,6 +188,14 @@ The commandline options are:
Start forwarding on initialization.
+* ``--tx-first``
+
+ Start forwarding, after sending a burst of packets first.
+
+.. Note::
+
+ This flag should be only used in non-interactive mode.
+
* ``--nb-cores=N``
Set the number of forwarding cores,
--
2.9.4
next prev parent reply other threads:[~2017-06-15 12:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-28 21:36 [dpdk-dev] [PATCH] app/testpmd: add parameter to start forwarding sending Pablo de Lara
2017-06-07 9:17 ` Wu, Jingjing
2017-06-07 13:20 ` De Lara Guarch, Pablo
2017-06-07 13:23 ` Bruce Richardson
2017-06-09 2:30 ` [dpdk-dev] [PATCH v2] " Pablo de Lara
2017-06-15 4:04 ` Pablo de Lara [this message]
2017-06-15 12:05 ` [dpdk-dev] [PATCH v3] app/testpmd: add parameter to start forwarding TX first De Lara Guarch, Pablo
2017-06-19 1:05 ` Wu, Jingjing
2017-07-05 23:48 ` Thomas Monjalon
2017-06-19 21:12 ` Thomas Monjalon
2017-06-20 8:03 ` De Lara Guarch, Pablo
2017-06-20 9:22 ` Bruce Richardson
2017-06-20 9:58 ` Thomas Monjalon
2017-06-20 10:19 ` Gaëtan Rivet
2017-06-20 10:27 ` Van Haaren, Harry
2017-06-20 11:20 ` Bruce Richardson
2017-06-20 12:30 ` Gaëtan Rivet
2017-06-19 0:53 ` [dpdk-dev] [PATCH v2] app/testpmd: add parameter to start forwarding sending Wu, Jingjing
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=20170615040403.78712-1-pablo.de.lara.guarch@intel.com \
--to=pablo.de.lara.guarch@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@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).