From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by dpdk.org (Postfix) with ESMTP id 286CF5677 for ; Thu, 19 Mar 2015 09:41:07 +0100 (CET) Received: by wibdy8 with SMTP id dy8so111289721wib.0 for ; Thu, 19 Mar 2015 01:41:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=5VIKnOqxmtz2Wg7L302uBi/W/GS65NebAiZRoCpPoNw=; b=ZsCRVo+zBhEk4O0hQC8ZrfQu9fbg9jHtElGVT5jzotxztef9sCxvLUIdgNRapwYP/F SC9HKvooqE7g2tWwFjxZMs3eeeB5EX91RkimAjB9jSj+7QkdfbBb/6HxwyW5xpipNvck 3OwSwvLovsOGZOXq4xRXaMz1M2R6oK+hpB7Qwh/DRFmmTa2OoxuRwkIl9uFcZKUA7bBJ ZHTNLklQJDBMkrb0NxHRNTjkscbQt4k3x7oFPO68JGWyAZr0vBHRItTKBcJfB9X8U3xq PQw5DMemdyveoXupWlYWJre+acRIDJtebbb87G7rTnI4iwi9EIqZWJBU3s53rKE4YcPZ c7Wg== X-Gm-Message-State: ALoCoQlziLa8gu4WC4HwawcHEKSZgDBmECKB+IkMtNhFx2yfDWm8/hNuFJQ3BpnPLNyMnPlVu6yz X-Received: by 10.180.218.200 with SMTP id pi8mr14216051wic.71.1426754466964; Thu, 19 Mar 2015 01:41:06 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id b4sm6546773wic.2.2015.03.19.01.41.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Mar 2015 01:41:06 -0700 (PDT) From: Thomas Monjalon To: Yong Liu Date: Thu, 19 Mar 2015 09:40:28 +0100 Message-ID: <6456552.u7TssYRrzX@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: <1426735018-19411-2-git-send-email-yong.liu@intel.com> References: <1426735018-19411-1-git-send-email-yong.liu@intel.com> <1426735018-19411-2-git-send-email-yong.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2015 08:41:07 -0000 This patch was already applied: http://dpdk.org/browse/dpdk/commit/?id=0a530f0d58b030 2015-03-19 11:16, Yong Liu: > 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 > > 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, >