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 EAF6FA0506; Tue, 29 Mar 2022 10:21:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C04794289D; Tue, 29 Mar 2022 10:21:07 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 5F45F40691; Tue, 29 Mar 2022 09:39:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648539585; x=1680075585; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YWoKKn9UKRp5LBkghJB+7KLPmFcLCUe0zAXm+uPmnWM=; b=nuKnfd9ilhYq44V26LiWARQZieRvrLOJmXo0S5Gx/bVwwjnb68OgzzyU AAehfar2MBAS1PTiifS0qmKurZhtOEFPCRqypt5zIXzxlXWGj1KTVto6J rz6rEm7qivIPOV6inLI9T7YKg6OdFl21lVcmV68jliCCy12KtIHruql14 in1KjlgcfGnUtDYxwExpGkHZEq/wUsnb122N5hi1lblb2XvQYg8BKDLpb gK44p9GXt1Nw7nB8+x2Gmhazi6XKqqIvWohIsNI6PxEGc+KKb4aI9SAPM 6/CPV9+51zVJpdf0lFLpGbnkaLJKhgXfzK0ZFkJQIhd99qT6JmkV7g5xT g==; X-IronPort-AV: E=McAfee;i="6200,9189,10300"; a="246675619" X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="246675619" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2022 00:39:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,219,1643702400"; d="scan'208";a="564402871" Received: from dpdk-mingxialiu-01.sh.intel.com ([10.67.119.13]) by orsmga008.jf.intel.com with ESMTP; 29 Mar 2022 00:39:41 -0700 From: Mingxia Liu To: dev@dpdk.org Cc: mingxial@intel.com, mingxial , stable@dpdk.org Subject: [PATCH v1] app/test-pmd: change a magic number to macro Date: Tue, 29 Mar 2022 06:53:13 +0000 Message-Id: <20220329065313.1523721-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:04 +0200 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