All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Cc: dev@dpdk.org, lijuan.tu@intel.com, juraj.linkes@pantheon.tech,
	ohilyard@iol.unh.edu, david.marchand@redhat.com,
	thomas@monjalon.net, jerinj@marvell.com,
	bruce.richardson@intel.com, kathleen.capella@arm.com, nd@arm.com,
	Ruifeng Wang <ruifeng.wang@arm.com>
Subject: Re: [PATCH v2 2/2] examples/l3fwd: make RX and TX queue size configurable
Date: Thu, 10 Feb 2022 17:01:47 -0800	[thread overview]
Message-ID: <20220210170147.08c43652@hermes.local> (raw)
In-Reply-To: <20220211002607.80058-2-honnappa.nagarahalli@arm.com>

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.
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;
}

  parent reply	other threads:[~2022-02-11  1:01 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 [this message]
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=20220210170147.08c43652@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=honnappa.nagarahalli@arm.com \
    --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=ruifeng.wang@arm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.