From: "Rybalchenko, Kirill" <kirill.rybalchenko@intel.com>
To: Li Han <han.li1@zte.com.cn>, "Wu, Jingjing" <jingjing.wu@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] app/testpmd:fix invalid port id parameters
Date: Mon, 4 Sep 2017 14:11:57 +0000 [thread overview]
Message-ID: <696B43C21188DF4F9C9091AAE4789B824E295BC4@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <1503378222-23306-1-git-send-email-han.li1@zte.com.cn>
Hi Han,
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Li Han
> Sent: Tuesday 22 August 2017 06:04
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Li Han <han.li1@zte.com.cn>
> Subject: [dpdk-dev] [PATCH] app/testpmd:fix invalid port id parameters
>
> in parse_ringnuma_config/parse_portnuma_config functions,port_id should
> less than RTE_MAX_ETHPORTS,but port_id_is_invalid check assumes that
> port_id may be 255.
>
> Signed-off-by: Li Han <han.li1@zte.com.cn>
> ---
> app/test-pmd/parameters.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index
> 2f7f70f..0c97ba4 100644
> --- a/app/test-pmd/parameters.c
> +++ b/app/test-pmd/parameters.c
> @@ -424,7 +424,8 @@
> return -1;
> }
> port_id = (uint8_t)int_fld[FLD_PORT];
> - if (port_id_is_invalid(port_id, ENABLED_WARN)) {
> + if (port_id_is_invalid(port_id, ENABLED_WARN) ||
> + port_id == (portid_t)RTE_PORT_ALL) {
In this case the message "printf("Invalid port %d\n", port_id)" will be omitted and there will be no way
To figure out which port id caused the problem
> printf("Valid port range is [0");
> RTE_ETH_FOREACH_DEV(pid)
> printf(", %d", pid);
> @@ -483,7 +484,8 @@
> return -1;
> }
> port_id = (uint8_t)int_fld[FLD_PORT];
> - if (port_id_is_invalid(port_id, ENABLED_WARN)) {
> + if (port_id_is_invalid(port_id, ENABLED_WARN) ||
> + port_id == (portid_t)RTE_PORT_ALL) {
The same here
> printf("Valid port range is [0");
> RTE_ETH_FOREACH_DEV(pid)
> printf(", %d", pid);
> --
> 1.8.3.1
>
Thanks,
Kirill
next parent reply other threads:[~2017-09-04 14:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1503378222-23306-1-git-send-email-han.li1@zte.com.cn>
2017-09-04 14:11 ` Rybalchenko, Kirill [this message]
2017-09-07 8:44 ` Wu, Jingjing
2017-10-09 4:16 ` Ferruh Yigit
2017-10-09 4:57 ` Ferruh Yigit
2017-08-22 2:31 Li Han
-- strict thread matches above, loose matches on Subject: below --
2017-08-21 8:11 Li Han
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=696B43C21188DF4F9C9091AAE4789B824E295BC4@IRSMSX108.ger.corp.intel.com \
--to=kirill.rybalchenko@intel.com \
--cc=dev@dpdk.org \
--cc=han.li1@zte.com.cn \
--cc=jingjing.wu@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).