patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Mingxia Liu <mingxia.liu@intel.com>
To: dev@dpdk.org
Cc: xiaoyun.li@intel.com, aman.deep.singh@intel.com,
	yuying.zhang@intel.com, mingxial <mingxia.liu@intel.com>,
	stable@dpdk.org
Subject: [PATCH v2] app/testpmd: change a magic number to macro
Date: Thu, 31 Mar 2022 02:33:33 +0000	[thread overview]
Message-ID: <20220331023333.1632745-1-mingxia.liu@intel.com> (raw)
In-Reply-To: <20220329071452.1524865-1-mingxia.liu@intel.com>

From: mingxial <mingxia.liu@intel.com>

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 <mingxia.liu@intel.com>
---
 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


  reply	other threads:[~2022-03-31  3:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29  7:14 [PATCH v1] app/test-pmd: " Mingxia Liu
2022-03-31  2:33 ` Mingxia Liu [this message]
2022-04-01  8:50   ` [PATCH v2] app/testpmd: " Zhang, Yuying
2022-05-20 22:09     ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220331023333.1632745-1-mingxia.liu@intel.com \
    --to=mingxia.liu@intel.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=xiaoyun.li@intel.com \
    --cc=yuying.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).