DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] app/test-pmd: change a magic number to macro
@ 2022-03-29  7:14 Mingxia Liu
  2022-03-31  2:33 ` [PATCH v2] app/testpmd: " Mingxia Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Mingxia Liu @ 2022-03-29  7:14 UTC (permalink / raw)
  To: dev; +Cc: mingxial, stable

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] app/testpmd: change a magic number to macro
  2022-03-29  7:14 [PATCH v1] app/test-pmd: change a magic number to macro Mingxia Liu
@ 2022-03-31  2:33 ` Mingxia Liu
  2022-04-01  8:50   ` Zhang, Yuying
  0 siblings, 1 reply; 4+ messages in thread
From: Mingxia Liu @ 2022-03-31  2:33 UTC (permalink / raw)
  To: dev; +Cc: xiaoyun.li, aman.deep.singh, yuying.zhang, mingxial, stable

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v2] app/testpmd: change a magic number to macro
  2022-03-31  2:33 ` [PATCH v2] app/testpmd: " Mingxia Liu
@ 2022-04-01  8:50   ` Zhang, Yuying
  2022-05-20 22:09     ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Zhang, Yuying @ 2022-04-01  8:50 UTC (permalink / raw)
  To: Liu, Mingxia, dev; +Cc: Li, Xiaoyun, Singh, Aman Deep, stable

Hi Mingxia,

LGTM.

> -----Original Message-----
> From: Liu, Mingxia <mingxia.liu@intel.com>
> Sent: Thursday, March 31, 2022 10:34 AM
> To: dev@dpdk.org
> Cc: Li, Xiaoyun <xiaoyun.li@intel.com>; Singh, Aman Deep
> <aman.deep.singh@intel.com>; Zhang, Yuying <yuying.zhang@intel.com>;
> Liu, Mingxia <mingxia.liu@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] app/testpmd: change a magic number to macro
> 
> 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>

Acked-by: Yuying Zhang <yuying.zhang@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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] app/testpmd: change a magic number to macro
  2022-04-01  8:50   ` Zhang, Yuying
@ 2022-05-20 22:09     ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2022-05-20 22:09 UTC (permalink / raw)
  To: Zhang, Yuying, Liu, Mingxia, dev; +Cc: Li, Xiaoyun, Singh, Aman Deep, stable

On 4/1/2022 9:50 AM, Zhang, Yuying wrote:
> Hi Mingxia,
> 
> LGTM.
> 
>> -----Original Message-----
>> From: Liu, Mingxia <mingxia.liu@intel.com>
>> Sent: Thursday, March 31, 2022 10:34 AM
>> To: dev@dpdk.org
>> Cc: Li, Xiaoyun <xiaoyun.li@intel.com>; Singh, Aman Deep
>> <aman.deep.singh@intel.com>; Zhang, Yuying <yuying.zhang@intel.com>;
>> Liu, Mingxia <mingxia.liu@intel.com>; stable@dpdk.org
>> Subject: [PATCH v2] app/testpmd: change a magic number to macro
>>
>> 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>
> 
> Acked-by: Yuying Zhang <yuying.zhang@intel.com>
> 

Updated sign off as:
Signed-off-by: Mingxia Liu <mingxia.liu@intel.com>

Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>

Applied to dpdk-next-net/main, thanks.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-20 22:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29  7:14 [PATCH v1] app/test-pmd: change a magic number to macro Mingxia Liu
2022-03-31  2:33 ` [PATCH v2] app/testpmd: " Mingxia Liu
2022-04-01  8:50   ` Zhang, Yuying
2022-05-20 22:09     ` Ferruh Yigit

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).