Skip to content

Commit

Permalink
app/testpmd: replace hardcoded min mbuf number with macro
Browse files Browse the repository at this point in the history
[ upstream commit 57d91f5b8dc589226a307560bd36181ac7a6b7df ]

Add macro MIN_TOTAL_NUM_MBUFS (1024) to indicate
what the value of total-num-mbufs should bigger than.

Fixes: c879881 ("app/testpmd: add --total-num-mbufs option")

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>
  • Loading branch information
mingxial authored and cpaelzer committed Jul 7, 2022
1 parent 5894d7a commit 0d9db81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/test-pmd/parameters.c
Expand Up @@ -873,11 +873,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);
Expand Down
2 changes: 2 additions & 0 deletions app/test-pmd/testpmd.h
Expand Up @@ -53,6 +53,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;
Expand Down

0 comments on commit 0d9db81

Please sign in to comment.