]> git.droids-corp.org - dpdk.git/commitdiff
mempool/cnxk: avoid batch op free for empty pools
authorAshwin Sekhar T K <asekhar@marvell.com>
Thu, 28 Apr 2022 09:59:35 +0000 (15:29 +0530)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 8 Jun 2022 09:11:32 +0000 (11:11 +0200)
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 <asekhar@marvell.com>
drivers/mempool/cnxk/cn10k_mempool_ops.c

index 6ebbf91de5682b8926fd8f24b1f4c1c332627f67..a02e01cea0a2723e63f538d399a25504fb7cfc55 100644 (file)
@@ -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++) {