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 42FD0A0506 for ; Tue, 29 Mar 2022 10:21:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E044A428C7; Tue, 29 Mar 2022 10:21:44 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 8275940691; Tue, 29 Mar 2022 10:01:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648540880; x=1680076880; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YWoKKn9UKRp5LBkghJB+7KLPmFcLCUe0zAXm+uPmnWM=; b=CEprl9xOca0fN9CKRK2h4PvfqnNK0aa04dnclXUMvG8jSZfQ0puCpyHC E/6PiB6q2BNPGngJwJQRkTdNUNcT59CCg1zxzA3NGnpEgBYRfxRF3tT0e 0wFSTTbYCU115UQB2dwQB4BWr3TCDfiOfoICR7Q049pIQQo+trvBJ+cId 08E25bmcsiPw/FoEg1mrGMIplyasBNtJlZ2HBd9dhhBcMe2ZW7syX0Cbv e7dJOeAoU2NtfMHW/bxjPZZuBWmHBCT6OlfcpUawaXwaLbYjP47qT4xqO QKh+McLw2JMf1k06sfDEWL0R0gSWuN2oWdBSh980bCR4yt2NueUchHhLI A==; X-IronPort-AV: E=McAfee;i="6200,9189,10300"; a="256766779" X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="256766779" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2022 01:01:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="521342700" Received: from dpdk-mingxialiu-01.sh.intel.com ([10.67.119.13]) by orsmga006.jf.intel.com with ESMTP; 29 Mar 2022 01:01:16 -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 07:14:52 +0000 Message-Id: <20220329071452.1524865-1-mingxia.liu@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Tue, 29 Mar 2022 10:21:44 +0200 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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