DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yong Liu <yong.liu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check
Date: Wed, 11 Mar 2015 15:23:10 +0800	[thread overview]
Message-ID: <1426058590-15180-1-git-send-email-yong.liu@intel.com> (raw)

testpmd parameter "nb-port" mean the number of forwarding port.
It's incorrect to use function port_id_is_invalid to check number of ports.

Signed-off-by: Marvin Liu <yong.liu@intel.com>

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 11d9af0..f1daa6e 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -628,8 +628,7 @@ launch_args_parse(int argc, char** argv)
 #endif
 			if (!strcmp(lgopts[opt_idx].name, "nb-ports")) {
 				n = atoi(optarg);
-				if (n > 0 &&
-				    !port_id_is_invalid(n, DISABLED_WARN))
+				if (n > 0 && n <= nb_ports)
 					nb_fwd_ports = (uint8_t) n;
 				else
 					rte_exit(EXIT_FAILURE,
-- 
1.9.3

             reply	other threads:[~2015-03-11  7:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11  7:23 Yong Liu [this message]
2015-03-11 15:03 ` Thomas Monjalon
2015-03-19  3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu
2015-03-19  3:16 ` [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check Yong Liu
2015-03-19  8:40   ` 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=1426058590-15180-1-git-send-email-yong.liu@intel.com \
    --to=yong.liu@intel.com \
    --cc=dev@dpdk.org \
    /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).