From: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
To: dev@dpdk.org, honnappa.nagarahalli@arm.com, lijuan.tu@intel.com,
juraj.linkes@pantheon.tech, ohilyard@iol.unh.edu,
david.marchand@redhat.com, thomas@monjalon.net,
jerinj@marvell.com
Cc: kathleen.capella@arm.com, nd@arm.com
Subject: [PATCH 2/2] examples/l3fwd: make RX and TX queue size configurable
Date: Wed, 2 Feb 2022 06:04:03 +0000 [thread overview]
Message-ID: <20220202060403.118301-2-honnappa.nagarahalli@arm.com> (raw)
In-Reply-To: <20220202060403.118301-1-honnappa.nagarahalli@arm.com>
Make RX and TX queue sizes configurable from the command line.
This helps DTS write better test cases.
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
examples/l3fwd/main.c | 56 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 55 insertions(+), 1 deletion(-)
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index acd186ab7d..c9ed0d4c3d 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -341,6 +341,8 @@ print_usage(const char *prgname)
" [-P]"
" [--lookup]"
" --config (port,queue,lcore)[,(port,queue,lcore)]"
+ " [--rx-queue-size]"
+ " [--tx-queue-size]"
" [--eth-dest=X,MM:MM:MM:MM:MM:MM]"
" [--max-pkt-len PKTLEN]"
" [--no-numa]"
@@ -360,6 +362,10 @@ print_usage(const char *prgname)
" Default: lpm\n"
" Accepted: em (Exact Match), lpm (Longest Prefix Match), fib (Forwarding Information Base)\n"
" --config (port,queue,lcore): Rx queue configuration\n"
+ " --rx-queue-size: Rx queue size\n"
+ " Default: %d\n"
+ " --tx-queue-size: Tx queue size\n"
+ " Default: %d\n"
" --eth-dest=X,MM:MM:MM:MM:MM:MM: Ethernet destination for port X\n"
" --max-pkt-len PKTLEN: maximum packet length in decimal (64-9600)\n"
" --no-numa: Disable numa awareness\n"
@@ -381,7 +387,7 @@ print_usage(const char *prgname)
" --event-vector-tmo: Max timeout to form vector in nanoseconds if event vectorization is enabled\n"
" -E : Enable exact match, legacy flag please use --lookup=em instead\n"
" -L : Enable longest prefix match, legacy flag please use --lookup=lpm instead\n\n",
- prgname);
+ prgname, RTE_TEST_RX_DESC_DEFAULT, RTE_TEST_TX_DESC_DEFAULT);
}
static int
@@ -524,6 +530,40 @@ parse_mode(const char *optarg)
evt_rsrc->enabled = true;
}
+static void
+parse_rx_queue_size(const char *rx_queue_size_arg)
+{
+ char *end = NULL;
+ uint32_t rx_queue_size;
+
+ /* parse decimal string */
+ rx_queue_size = strtoul(rx_queue_size_arg, &end, 10);
+ if ((rx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0'))
+ return;
+
+ if (rx_queue_size == 0)
+ return;
+
+ nb_rxd = rx_queue_size;
+}
+
+static void
+parse_tx_queue_size(const char *tx_queue_size_arg)
+{
+ char *end = NULL;
+ uint32_t tx_queue_size;
+
+ /* parse decimal string */
+ tx_queue_size = strtoul(tx_queue_size_arg, &end, 10);
+ if ((tx_queue_size_arg[0] == '\0') || (end == NULL) || (*end != '\0'))
+ return;
+
+ if (tx_queue_size == 0)
+ return;
+
+ nb_rxd = tx_queue_size;
+}
+
static void
parse_eventq_sched(const char *optarg)
{
@@ -581,6 +621,8 @@ static const char short_options[] =
;
#define CMD_LINE_OPT_CONFIG "config"
+#define CMD_LINE_OPT_RX_QUEUE_SIZE "rx-queue-size"
+#define CMD_LINE_OPT_TX_QUEUE_SIZE "tx-queue-size"
#define CMD_LINE_OPT_ETH_DEST "eth-dest"
#define CMD_LINE_OPT_NO_NUMA "no-numa"
#define CMD_LINE_OPT_IPV6 "ipv6"
@@ -603,6 +645,8 @@ enum {
* conflict with short options */
CMD_LINE_OPT_MIN_NUM = 256,
CMD_LINE_OPT_CONFIG_NUM,
+ CMD_LINE_OPT_RX_QUEUE_SIZE_NUM,
+ CMD_LINE_OPT_TX_QUEUE_SIZE_NUM,
CMD_LINE_OPT_ETH_DEST_NUM,
CMD_LINE_OPT_NO_NUMA_NUM,
CMD_LINE_OPT_IPV6_NUM,
@@ -621,6 +665,8 @@ enum {
static const struct option lgopts[] = {
{CMD_LINE_OPT_CONFIG, 1, 0, CMD_LINE_OPT_CONFIG_NUM},
+ {CMD_LINE_OPT_RX_QUEUE_SIZE, 1, 0, CMD_LINE_OPT_RX_QUEUE_SIZE_NUM},
+ {CMD_LINE_OPT_TX_QUEUE_SIZE, 1, 0, CMD_LINE_OPT_TX_QUEUE_SIZE_NUM},
{CMD_LINE_OPT_ETH_DEST, 1, 0, CMD_LINE_OPT_ETH_DEST_NUM},
{CMD_LINE_OPT_NO_NUMA, 0, 0, CMD_LINE_OPT_NO_NUMA_NUM},
{CMD_LINE_OPT_IPV6, 0, 0, CMD_LINE_OPT_IPV6_NUM},
@@ -714,6 +760,14 @@ parse_args(int argc, char **argv)
lcore_params = 1;
break;
+ case CMD_LINE_OPT_RX_QUEUE_SIZE_NUM:
+ parse_rx_queue_size(optarg);
+ break;
+
+ case CMD_LINE_OPT_TX_QUEUE_SIZE_NUM:
+ parse_tx_queue_size(optarg);
+ break;
+
case CMD_LINE_OPT_ETH_DEST_NUM:
parse_eth_dest(optarg);
break;
--
2.25.1
next prev parent reply other threads:[~2022-02-02 6:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-02 6:04 [PATCH 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
2022-02-02 6:04 ` Honnappa Nagarahalli [this message]
2022-02-08 7:41 ` [PATCH 2/2] examples/l3fwd: make RX and TX queue size configurable Ruifeng Wang
2022-02-02 8:49 ` [PATCH 1/2] examples/l3fwd: use single set of variables throughout the code Bruce Richardson
2022-02-11 0:26 ` [PATCH v2 " Honnappa Nagarahalli
2022-02-11 0:26 ` [PATCH v2 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
2022-02-11 0:53 ` Stephen Hemminger
2022-02-11 3:43 ` Honnappa Nagarahalli
2022-02-11 1:01 ` Stephen Hemminger
2022-02-11 3:38 ` Honnappa Nagarahalli
2022-02-23 6:09 ` [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
2022-02-23 6:09 ` [PATCH v3 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
2022-02-23 6:13 ` [PATCH v3 1/2] examples/l3fwd: use single set of variables throughout the code Honnappa Nagarahalli
2022-02-23 9:22 ` Kevin Traynor
2022-03-01 1:56 ` Han, YingyaX
2022-03-08 9:22 ` 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=20220202060403.118301-2-honnappa.nagarahalli@arm.com \
--to=honnappa.nagarahalli@arm.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=juraj.linkes@pantheon.tech \
--cc=kathleen.capella@arm.com \
--cc=lijuan.tu@intel.com \
--cc=nd@arm.com \
--cc=ohilyard@iol.unh.edu \
--cc=thomas@monjalon.net \
/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).