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 27C79A0505 for ; Mon, 4 Apr 2022 12:31:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1689A4068C; Mon, 4 Apr 2022 12:31:31 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id C5BED40691; Tue, 29 Mar 2022 10:37:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648543061; x=1680079061; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YWoKKn9UKRp5LBkghJB+7KLPmFcLCUe0zAXm+uPmnWM=; b=LYg2bVds/SUw3682c7YocVHjLmVWaZaYpQaUM/tvon7neQQdEZ7owjXy u/aYxvCN9BZ/6CIJNViO5ccQ3E25e1RaSXd9kH9bjK3C/t+y6gJMtDF6r xE3iv7gkwvVs9nG/w/3NoWRv6PXk6fpXdVsDzyG1GZ61lW893Dib9ChRS 9gPWxDh7ngbFsRMvLmVMQDN0NadfdZhIhoODro8cl+ZLi4lEQRpvVICnt sgRqsLjx6cQ/rYl8YvM8J6KdqfXkkHLGbh+oolUxhBGxUYTSLjcYBw3hl /nD/S6Dr+ufCf10lu+Gn4XujPKQNwsvnXrwAlqVCg5aXQAh7i/U0uu50/ g==; X-IronPort-AV: E=McAfee;i="6200,9189,10300"; a="256773673" X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="256773673" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2022 01:37:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="546294900" Received: from dpdk-mingxialiu-01.sh.intel.com ([10.67.119.13]) by orsmga007.jf.intel.com with ESMTP; 29 Mar 2022 01:37:19 -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 v1] app/test-pmd: change a magic number to macro Date: Tue, 29 Mar 2022 07:50:47 +0000 Message-Id: <20220329075047.1526063-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: Mon, 04 Apr 2022 12:31:29 +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