DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] mempool/cnxk: avoid batch op free for empty mempools
@ 2022-04-28  9:59 Ashwin Sekhar T K
  2022-05-23 18:15 ` Ashwin Sekhar Thalakalath Kottilveetil
  2022-06-08  9:12 ` Thomas Monjalon
  0 siblings, 2 replies; 3+ messages in thread
From: Ashwin Sekhar T K @ 2022-04-28  9:59 UTC (permalink / raw)
  To: dev
  Cc: jerinj, skori, skoteshwar, pbhagavatula, kirankumark, psatheesh,
	asekhar, anoobj, gakhil, ndabilpuram, hkalra

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] mempool/cnxk: avoid batch op free for empty mempools
  2022-04-28  9:59 [PATCH] mempool/cnxk: avoid batch op free for empty mempools Ashwin Sekhar T K
@ 2022-05-23 18:15 ` Ashwin Sekhar Thalakalath Kottilveetil
  2022-06-08  9:12 ` Thomas Monjalon
  1 sibling, 0 replies; 3+ messages in thread
From: Ashwin Sekhar Thalakalath Kottilveetil @ 2022-05-23 18:15 UTC (permalink / raw)
  To: Ashwin Sekhar Thalakalath Kottilveetil, dev, thomas
  Cc: Jerin Jacob Kollanukkaran, Sunil Kumar Kori,
	Satha Koteswara Rao Kottidi, Pavan Nikhilesh Bhagavatula,
	Kiran Kumar Kokkilagadda, Satheesh Paul Antonysamy, Anoob Joseph,
	Akhil Goyal, Nithin Kumar Dabilpuram, Harman Kalra

PING.

Ashwin Sekhar T K 

> -----Original Message-----
> From: Ashwin Sekhar T K <asekhar@marvell.com>
> Sent: Thursday, April 28, 2022 3:30 PM
> To: dev@dpdk.org
> Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Sunil Kumar Kori
> <skori@marvell.com>; Satha Koteswara Rao Kottidi
> <skoteshwar@marvell.com>; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com>; Kiran Kumar Kokkilagadda
> <kirankumark@marvell.com>; Satheesh Paul Antonysamy
> <psatheesh@marvell.com>; Ashwin Sekhar Thalakalath Kottilveetil
> <asekhar@marvell.com>; Anoob Joseph <anoobj@marvell.com>; Akhil
> Goyal <gakhil@marvell.com>; Nithin Kumar Dabilpuram
> <ndabilpuram@marvell.com>; Harman Kalra <hkalra@marvell.com>
> Subject: [PATCH] mempool/cnxk: avoid batch op free for empty mempools
> 
> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mempool/cnxk: avoid batch op free for empty mempools
  2022-04-28  9:59 [PATCH] mempool/cnxk: avoid batch op free for empty mempools Ashwin Sekhar T K
  2022-05-23 18:15 ` Ashwin Sekhar Thalakalath Kottilveetil
@ 2022-06-08  9:12 ` Thomas Monjalon
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2022-06-08  9:12 UTC (permalink / raw)
  To: Ashwin Sekhar T K
  Cc: dev, jerinj, skori, skoteshwar, pbhagavatula, kirankumark,
	psatheesh, asekhar, anoobj, gakhil, ndabilpuram, hkalra

28/04/2022 11:59, Ashwin Sekhar T K:
> 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>

Applied, thanks.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-08  9:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28  9:59 [PATCH] mempool/cnxk: avoid batch op free for empty mempools Ashwin Sekhar T K
2022-05-23 18:15 ` Ashwin Sekhar Thalakalath Kottilveetil
2022-06-08  9:12 ` Thomas Monjalon

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).