From mboxrd@z Thu Jan 1 00:00:00 1970 From: Li Han Subject: [PATCH] app/testpmd:fix invalid port id parameters Date: Mon, 21 Aug 2017 16:11:17 +0800 Message-ID: <1503303077-13122-1-git-send-email-han.li1@zte.com.cn> Cc: dev@dpdk.org, Li Han To: jingjing.wu@intel.com Return-path: Received: from out1.zte.com.cn (out1.zte.com.cn [202.103.147.172]) by dpdk.org (Postfix) with ESMTP id DD24B910F for ; Mon, 21 Aug 2017 10:12:47 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- app/test-pmd/parameters.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 app/test-pmd/parameters.c diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c old mode 100644 new mode 100755 index 2f7f70f..99a5340 --- 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) { 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) { printf("Valid port range is [0"); RTE_ETH_FOREACH_DEV(pid) printf(", %d", pid); -- 1.8.3.1