From: Matias Elo <matias....@nokia.com>

One can remove max 'cache_num' objects from the local cache.

Signed-off-by: Matias Elo <matias....@nokia.com>
---
/** Email created from pull request 78 (matiaselo:dev/dpdk_ext_mempool_v2)
 ** https://github.com/Linaro/odp/pull/78
 ** Patch: https://github.com/Linaro/odp/pull/78.patch
 ** Base sha: 490f4bf22129638899ce71c99a8847e8ba849692
 ** Merge commit sha: 1c79cd17efc7b9547426620c0f001d12a7ebca76
 **/
 platform/linux-generic/odp_pool.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/platform/linux-generic/odp_pool.c 
b/platform/linux-generic/odp_pool.c
index e08c8985..bbd56b06 100644
--- a/platform/linux-generic/odp_pool.c
+++ b/platform/linux-generic/odp_pool.c
@@ -703,6 +703,8 @@ static inline void buffer_free_to_pool(pool_t *pool,
 
                if (odp_unlikely(num > CACHE_BURST))
                        burst = num;
+               if (odp_unlikely((uint32_t)num > cache_num))
+                       burst = cache_num;
 
                {
                        /* Temporary copy needed since odp_buffer_t is

Reply via email to