From: Ashwin Sekhar T K Date: Thu, 28 Apr 2022 09:59:35 +0000 (+0530) Subject: mempool/cnxk: avoid batch op free for empty pools X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7c754f553e500557f322958647281d541899ed14;p=dpdk.git mempool/cnxk: avoid batch op free for empty pools Batch op data is initialized inside mempool alloc. But in case of empty mempools, the alloc function is not called and hence the initialization of batch op data is also not done. So ensure the validity of batch op data inside mempool free. Signed-off-by: Ashwin Sekhar T K --- diff --git a/drivers/mempool/cnxk/cn10k_mempool_ops.c b/drivers/mempool/cnxk/cn10k_mempool_ops.c index 6ebbf91de5..a02e01cea0 100644 --- a/drivers/mempool/cnxk/cn10k_mempool_ops.c +++ b/drivers/mempool/cnxk/cn10k_mempool_ops.c @@ -109,6 +109,12 @@ batch_op_fini(struct rte_mempool *mp) int i; op_data = batch_op_data_get(mp->pool_id); + if (!op_data) { + /* Batch op data can be uninitialized in case of empty + * mempools. + */ + return; + } rte_wmb(); for (i = 0; i < RTE_MAX_LCORE; i++) {