From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"lijuan.tu@intel.com" <lijuan.tu@intel.com>,
"juraj.linkes@pantheon.tech" <juraj.linkes@pantheon.tech>,
"ohilyard@iol.unh.edu" <ohilyard@iol.unh.edu>,
"david.marchand@redhat.com" <david.marchand@redhat.com>,
"thomas@monjalon.net" <thomas@monjalon.net>,
"jerinj@marvell.com" <jerinj@marvell.com>,
"bruce.richardson@intel.com" <bruce.richardson@intel.com>,
Kathleen Capella <Kathleen.Capella@arm.com>, nd <nd@arm.com>,
Ruifeng Wang <Ruifeng.Wang@arm.com>, nd <nd@arm.com>
Subject: RE: [PATCH v2 2/2] examples/l3fwd: make RX and TX queue size configurable
Date: Fri, 11 Feb 2022 03:38:33 +0000 [thread overview]
Message-ID: <DBAPR08MB581487CC3F4C960A3F3611B898309@DBAPR08MB5814.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20220210170147.08c43652@hermes.local>
<snip>
>
> On Fri, 11 Feb 2022 00:26:07 +0000
> Honnappa Nagarahalli <honnappa.nagarahalli@arm.com> wrote:
>
> > +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_txd = tx_queue_size;
>
> These are duplications of the same function, just different result.
Agreed, make sense to combine
> Also programs should test for invalid queue size which is currently limited to 16
> bits by rte_eth_dev_configure
>
> static void
> parse_queue_size(const char *size_arg, uint32_t *size_ret) {
> unsigned long result;
> char *end;
>
> result = strtoul(size_arg, &end, 0);
> if (size_arg[0] == '\0' || *end != '\0' || result > UINT16_MAX)
> rte_exit(EXIT_FAILURE, "Invalid queue size '%s'\n", size_arg);
> *size_ret = result;
> }
next prev parent reply other threads:[~2022-02-11 3:38 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 ` [PATCH 2/2] examples/l3fwd: make RX and TX queue size configurable Honnappa Nagarahalli
2022-02-08 7:41 ` 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 [this message]
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=DBAPR08MB581487CC3F4C960A3F3611B898309@DBAPR08MB5814.eurprd08.prod.outlook.com \
--to=honnappa.nagarahalli@arm.com \
--cc=Kathleen.Capella@arm.com \
--cc=Ruifeng.Wang@arm.com \
--cc=bruce.richardson@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=juraj.linkes@pantheon.tech \
--cc=lijuan.tu@intel.com \
--cc=nd@arm.com \
--cc=ohilyard@iol.unh.edu \
--cc=stephen@networkplumber.org \
--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).