]> git.droids-corp.org - dpdk.git/commitdiff
app/testpmd: replace hardcoded min mbuf number with macro
authorMingxia Liu <mingxia.liu@intel.com>
Thu, 31 Mar 2022 02:33:33 +0000 (02:33 +0000)
committerFerruh Yigit <ferruh.yigit@xilinx.com>
Fri, 20 May 2022 21:59:35 +0000 (23:59 +0200)
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: Mingxia Liu <mingxia.liu@intel.com>
Acked-by: Yuying Zhang <yuying.zhang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
app/test-pmd/parameters.c
app/test-pmd/testpmd.h

index daf6a31b2b1e6afa4b64355b011fa2d5dc83852f..641c9c767ef4d5ee5cf9f4f20d155a52709e98e2 100644 (file)
@@ -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);
index 67f253b30ec074611c35e262a8752b22fbec341f..f04a9a11b4e3286f531880cca61888085b9af587 100644 (file)
@@ -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;