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 58A8DA0508; Tue, 29 Mar 2022 11:23:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4A07242813; Tue, 29 Mar 2022 11:22:04 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 4F4E240691; Tue, 29 Mar 2022 11:22:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648545722; x=1680081722; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YWoKKn9UKRp5LBkghJB+7KLPmFcLCUe0zAXm+uPmnWM=; b=Sco2ocyQI1kX0n1QUUjHl7MZ6KH965ppoXNyM4TDep1qy2lQ47CgT8fQ s4P8b2lUeMOnh5SPxoFGpp4ikvHGQ0l3ZIA0N7P6ZukzypPIiBz35xebl YVrMm3O2I7IqdRK9Zz2dOpcDqaQraUYb1ib/peuf0ZCdAaLcH/lkqPbMv n0zoriYL6Z2t4i3ZRmNlIyPEVamrK3q8huNKOqdIbJ/ts5tgW5lu4vVJZ 1WQOjuQCTkhBABpPYUvmp8HIVuBlEeCTF9MvErDW0UkkDHkPaBaAXAYvJ GNoRz363qW2+ATorlLwsRHUAJUCz52rS+1JN/7AkHV2w6PaTKcUODCNBV g==; X-IronPort-AV: E=McAfee;i="6200,9189,10300"; a="322390879" X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="322390879" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2022 02:22:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="564471345" Received: from dpdk-mingxialiu-01.sh.intel.com ([10.67.119.13]) by orsmga008.jf.intel.com with ESMTP; 29 Mar 2022 02:21:59 -0700 From: Mingxia Liu To: dev@dpdk.org Cc: mingxial , stable@dpdk.org Subject: [PATCH v1] app/test-pmd: change a magic number to macro Date: Tue, 29 Mar 2022 08:35:34 +0000 Message-Id: <20220329083534.1527755-1-mingxia.liu@intel.com> X-Mailer: git-send-email 2.25.1 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