From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5253AA0501; Thu, 31 Mar 2022 05:20:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7BDB42842; Thu, 31 Mar 2022 05:20:15 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 772DC410FF; Thu, 31 Mar 2022 05:20:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648696814; x=1680232814; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YWoKKn9UKRp5LBkghJB+7KLPmFcLCUe0zAXm+uPmnWM=; b=QA4QiFgI/WfifqHq2xqYWVfZZv/uxmzK79M/TKOjnybXdEibeymyXvMW mW3RE8iaiqXoiX7DZaWkLMnNYG4PKyqYBX9oq/lMRiR+4kz1Sp+BkhpKu dx9rBQLnsRw6OnamUft5eLk/3cznllFTFQL0DvWKrdj9h8GP2qXsO8v05 ILhUxtVZk7R5pGgzq1oHosQfn4iV8WsEhp5G45klZcRSUqOS3TlvXFDOw 1QC1CQX1KbGRGsaMXpNNq4gU6oGmwD9XNDExvTrEJiFGRaJSrHnNnEzo1 NYosxAoop6ooCyKrwReAKHDstLUA60pdl23IymEBTjYJ5qRpbm5kNaKMF A==; X-IronPort-AV: E=McAfee;i="6200,9189,10302"; a="258540908" X-IronPort-AV: E=Sophos;i="5.90,224,1643702400"; d="scan'208";a="258540908" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 20:20:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,224,1643702400"; d="scan'208";a="720275082" Received: from dpdk-mingxialiu-01.sh.intel.com ([10.67.119.13]) by orsmga005.jf.intel.com with ESMTP; 30 Mar 2022 20:20:11 -0700 From: Mingxia Liu To: dev@dpdk.org Cc: xiaoyun.li@intel.com, aman.deep.singh@intel.com, yuying.zhang@intel.com, mingxial , stable@dpdk.org Subject: [PATCH v2] app/testpmd: change a magic number to macro Date: Thu, 31 Mar 2022 02:33:33 +0000 Message-Id: <20220331023333.1632745-1-mingxia.liu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220329071452.1524865-1-mingxia.liu@intel.com> References: <20220329071452.1524865-1-mingxia.liu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: mingxial Add macro MIN_TOTAL_NUM_MBUFS (1024) to indicate what the value of total-num-mbufs should bigger than. Fixes: c87988187fdb ("app/testpmd: add --total-num-mbufs option") Cc: stable@dpdk.org Signed-off-by: mingxial --- app/test-pmd/parameters.c | 5 +++-- app/test-pmd/testpmd.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index daf6a31b2b..641c9c767e 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -940,11 +940,12 @@ launch_args_parse(int argc, char** argv) } if (!strcmp(lgopts[opt_idx].name, "total-num-mbufs")) { n = atoi(optarg); - if (n > 1024) + if (n > MIN_TOTAL_NUM_MBUFS) param_total_num_mbufs = (unsigned)n; else rte_exit(EXIT_FAILURE, - "total-num-mbufs should be > 1024\n"); + "total-num-mbufs should be > %d\n", + MIN_TOTAL_NUM_MBUFS); } if (!strcmp(lgopts[opt_idx].name, "max-pkt-len")) { n = atoi(optarg); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 31f766c965..a633f81b50 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -72,6 +72,8 @@ #define NUMA_NO_CONFIG 0xFF #define UMA_NO_CONFIG 0xFF +#define MIN_TOTAL_NUM_MBUFS 1024 + typedef uint8_t lcoreid_t; typedef uint16_t portid_t; typedef uint16_t queueid_t; -- 2.25.1