event/cnxk: fix missing mempool cookie marking

Message ID 20221103161631.3851-1-pbhagavatula@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series event/cnxk: fix missing mempool cookie marking |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS

Commit Message

Pavan Nikhilesh Bhagavatula Nov. 3, 2022, 4:16 p.m. UTC
  From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Mark chunks mempool objects as "put" as they are freed to NPA
automatically when they are parsed by TIM HW.

Fixes: 300b796262a1 ("event/cnxk: add timer arm routine")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 drivers/event/cnxk/cnxk_tim_worker.h | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Jerin Jacob Nov. 7, 2022, 5:26 p.m. UTC | #1
On Thu, Nov 3, 2022 at 9:46 PM <pbhagavatula@marvell.com> wrote:
>
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Mark chunks mempool objects as "put" as they are freed to NPA
> automatically when they are parsed by TIM HW.
>
> Fixes: 300b796262a1 ("event/cnxk: add timer arm routine")
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

Applied to dpdk-next-net-eventdev/for-main. Thanks


> ---
>  drivers/event/cnxk/cnxk_tim_worker.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/event/cnxk/cnxk_tim_worker.h b/drivers/event/cnxk/cnxk_tim_worker.h
> index 8d8ed1d3a1..eda84c6f31 100644
> --- a/drivers/event/cnxk/cnxk_tim_worker.h
> +++ b/drivers/event/cnxk/cnxk_tim_worker.h
> @@ -217,6 +217,7 @@ cnxk_tim_insert_chunk(struct cnxk_tim_bkt *const bkt,
>         if (unlikely(rte_mempool_get(tim_ring->chunk_pool, (void **)&chunk)))
>                 return NULL;
>
> +       RTE_MEMPOOL_CHECK_COOKIES(tim_ring->chunk_pool, (void **)&chunk, 1, 0);
>         *(uint64_t *)(chunk + tim_ring->nb_chunk_slots) = 0;
>         if (bkt->nb_entry) {
>                 *(uint64_t *)(((struct cnxk_tim_ent *)(uintptr_t)
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/event/cnxk/cnxk_tim_worker.h b/drivers/event/cnxk/cnxk_tim_worker.h
index 8d8ed1d3a1..eda84c6f31 100644
--- a/drivers/event/cnxk/cnxk_tim_worker.h
+++ b/drivers/event/cnxk/cnxk_tim_worker.h
@@ -217,6 +217,7 @@  cnxk_tim_insert_chunk(struct cnxk_tim_bkt *const bkt,
 	if (unlikely(rte_mempool_get(tim_ring->chunk_pool, (void **)&chunk)))
 		return NULL;
 
+	RTE_MEMPOOL_CHECK_COOKIES(tim_ring->chunk_pool, (void **)&chunk, 1, 0);
 	*(uint64_t *)(chunk + tim_ring->nb_chunk_slots) = 0;
 	if (bkt->nb_entry) {
 		*(uint64_t *)(((struct cnxk_tim_ent *)(uintptr_t)