From: Ashwin Sekhar T K <asekhar@marvell.com>
To: <dev@dpdk.org>
Cc: <jerinj@marvell.com>, <skori@marvell.com>,
<skoteshwar@marvell.com>, <pbhagavatula@marvell.com>,
<kirankumark@marvell.com>, <psatheesh@marvell.com>,
<asekhar@marvell.com>, <anoobj@marvell.com>, <gakhil@marvell.com>,
<ndabilpuram@marvell.com>, <hkalra@marvell.com>
Subject: [PATCH] mempool/cnxk: avoid batch op free for empty mempools
Date: Thu, 28 Apr 2022 15:29:35 +0530 [thread overview]
Message-ID: <20220428095935.3612387-1-asekhar@marvell.com> (raw)
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 | 6 ++++++
1 file changed, 6 insertions(+)
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++) {
--
2.32.0
next reply other threads:[~2022-04-28 9:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-28 9:59 Ashwin Sekhar T K [this message]
2022-05-23 18:15 ` Ashwin Sekhar Thalakalath Kottilveetil
2022-06-08 9:12 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220428095935.3612387-1-asekhar@marvell.com \
--to=asekhar@marvell.com \
--cc=anoobj@marvell.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=hkalra@marvell.com \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=pbhagavatula@marvell.com \
--cc=psatheesh@marvell.com \
--cc=skori@marvell.com \
--cc=skoteshwar@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).