DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: David Marchand <david.marchand@redhat.com>, dev@dpdk.org
Cc: thomas@monjalon.net, stable@dpdk.org,
	Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Bernard Iremonger <bernard.iremonger@intel.com>
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: report invalid command line parameter
Date: Mon, 18 Nov 2019 10:37:09 +0000	[thread overview]
Message-ID: <b44dfff5-5af2-2d6d-b246-c0ffbce336c4@intel.com> (raw)
In-Reply-To: <20191117171013.17373-1-david.marchand@redhat.com>

On 11/17/2019 5:10 PM, David Marchand wrote:
> We currently do not check that a non option string has been passed to
> testpmd.
> 
> Example:
> $ ./master/app/testpmd --no-huge -m 512 --vdev net_null0 \
> 	--vdev net_null1 -- -i nb-cores=2 --total-num-mbuf 2048
> [...]
> testpmd> show config fwd
> io packet forwarding - ports=2 - cores=1 - streams=2 - NUMA support
> enabled, MP allocation mode: native
> Logical Core 1 (socket 0) forwards packets on 2 streams:
>   RX P=0/Q=0 (socket 0) -> TX P=1/Q=0 (socket 0) peer=02:00:00:00:00:01
>   RX P=1/Q=0 (socket 0) -> TX P=0/Q=0 (socket 0) peer=02:00:00:00:00:00
> 
> Here nb-cores=2 is just ignored, while the (probably sleepy) user did not
> notice this.
> 
> Validate that all strings passed to testpmd are part of a known option.
> 
> After this patch:
> $ ./master/app/testpmd --no-huge -m 512 --vdev net_null0 \
> 	--vdev net_null1 -- -i -nb-cores=2 --total-num-mbuf 2048
> [...]
> Invalid parameter: nb-cores=2
> EAL: Error - exiting with code: 1
>   Cause: Command line incorrect
> 
> While at it, when passing an unknown option, print the string that gets
> refused by getopt_long to help the user.
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
> This seems a bit dangerous to take this kind of change.
> Some "working fine" scripts might now report failures from testpmd because
> of garbage in the command line.
> 
> Sending the patch anyway to see what others think about it.

+1 to the patch, I think better to fail in this case.

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

  parent reply	other threads:[~2019-11-18 10:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-17 17:10 David Marchand
2019-11-17 17:12 ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-11-18 10:37 ` Ferruh Yigit [this message]
2019-11-18 15:37 ` [dpdk-dev] [PATCH v2] " David Marchand
2019-11-18 16:18   ` Ferruh Yigit
2019-11-19 19:18     ` Pallavi Kadam
2019-11-20 12:18       ` 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=b44dfff5-5af2-2d6d-b246-c0ffbce336c4@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.org \
    --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).