The mempool library no longer limits the cache size to
RTE_MEMPOOL_CACHE_MAX_SIZE, but the --mbcache option still rejected
values above it.
Limit the option to the range of the variable holding the value
instead. A cache size larger than the number of mbufs in the pool is
still rejected by the mempool library when the pool is created.
Update the user guide accordingly, and correct the documented default
value, which is 250.
Fixes: b815acfdfc48 ("mempool: remove cache size limit")
Signed-off-by: Kishore Padmanabha <[email protected]>
Reviewed-by: Morten Brorup <[email protected]>
---
v2:
* Documented the value 65535 instead of UINT16_MAX.
* Corrected the documented default value of --mbcache to 250.
app/test-pmd/parameters.c | 5 ++---
doc/guides/testpmd_app_ug/run_app.rst | 4 ++--
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 34a4f74e636b..9967e49881c5 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -1455,13 +1455,12 @@ launch_args_parse(int argc, char** argv)
break;
case TESTPMD_OPT_MBCACHE_NUM:
n = atoi(optarg);
- if ((n >= 0) &&
- (n <= RTE_MEMPOOL_CACHE_MAX_SIZE))
+ if ((n >= 0) && (n <= UINT16_MAX))
mb_mempool_cache = (uint16_t) n;
else
rte_exit(EXIT_FAILURE,
"mbcache must be >= 0 and <= %d\n",
- RTE_MEMPOOL_CACHE_MAX_SIZE);
+ UINT16_MAX);
break;
case TESTPMD_OPT_TXFREET_NUM:
n = atoi(optarg);
diff --git a/doc/guides/testpmd_app_ug/run_app.rst
b/doc/guides/testpmd_app_ug/run_app.rst
index e34e414ce246..7931d8082dbc 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -315,8 +315,8 @@ The command line options are:
* ``--mbcache=N``
- Set the cache of mbuf memory pools to N, where 0 <= N <= 512.
- The default value is 16.
+ Set the cache of mbuf memory pools to N, where 0 <= N <= 65535.
+ The default value is 250.
* ``--rxpt=N``
--
2.54.0