dpdk-fm10k/lib/librte_mempool
Zhike Wang 9dbe628a7b mempool: fix allocation in memzone during retry
If allocation is successful on the first attempt, typically
there is no problem since we allocated everything required and
we'll terminate the loop (if memory chunk is really sufficient
to populate required number of mempool elements).

If the first attempt fails, we try to allocate half
of mem_size and it succeed, we'll have one more iteration of
the for-loop to allocate memory for remaining elements and
should not try the next time with quarter of the mem_size.

It is wrong that max_alloc_size is divided by 2 in the
case of successful allocation as well, or invalid memory
can be allocated, and leads to population failure, then errno
other than ENOMEM may be returned.

Fixes: 3a3d0c75b4 ("mempool: fix slow allocation of large pools")
Cc: stable@dpdk.org

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Signed-off-by: Zhike Wang <wangzhike@jd.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
2020-07-22 01:27:10 +02:00
..
Makefile mempool: add tracepoints 2020-04-23 15:40:11 +02:00
mempool_trace_points.c trace: simplify trace point registration 2020-07-05 21:34:21 +02:00
meson.build mempool: return 0 if area is too small on populate 2020-05-05 00:27:05 +02:00
rte_mempool.c mempool: fix allocation in memzone during retry 2020-07-22 01:27:10 +02:00
rte_mempool.h eal: register non-EAL threads as lcores 2020-07-08 14:41:05 +02:00
rte_mempool_ops.c mempool: add tracepoints 2020-04-23 15:40:11 +02:00
rte_mempool_ops_default.c mempool: use specific macro for object alignment 2019-11-06 11:34:19 +01:00
rte_mempool_trace.h trace: add size_t field emitter 2020-06-15 19:27:00 +02:00
rte_mempool_trace_fp.h mempool: add tracepoints 2020-04-23 15:40:11 +02:00
rte_mempool_version.map mempool: return 0 if area is too small on populate 2020-05-05 00:27:05 +02:00