mempool/cnxk: fix bug in batch alloc issue failure path

Message ID 20220210115256.2744447-1-asekhar@marvell.com (mailing list archive)
State Changes Requested, archived
Delegated to: Jerin Jacob
Headers
Series mempool/cnxk: fix bug in batch alloc issue failure path |

Checks

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

Commit Message

Ashwin Sekhar T K Feb. 10, 2022, 11:52 a.m. UTC
  Fix bug in batch alloc issue failure path.

Fixes: 91531e63f4 ("mempool/cnxk: add cn10k batch dequeue")

Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
---
 drivers/mempool/cnxk/cn10k_mempool_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jerin Jacob Feb. 11, 2022, 7:24 a.m. UTC | #1
On Thu, Feb 10, 2022 at 5:19 PM Ashwin Sekhar T K <asekhar@marvell.com> wrote:
>
> Fix bug in batch alloc issue failure path.

Please specify what is the bug and what is the fix.

>
> Fixes: 91531e63f4 ("mempool/cnxk: add cn10k batch dequeue")
>
> Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
> ---
>  drivers/mempool/cnxk/cn10k_mempool_ops.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mempool/cnxk/cn10k_mempool_ops.c b/drivers/mempool/cnxk/cn10k_mempool_ops.c
> index 4c669b878f..6ebbf91de5 100644
> --- a/drivers/mempool/cnxk/cn10k_mempool_ops.c
> +++ b/drivers/mempool/cnxk/cn10k_mempool_ops.c
> @@ -202,7 +202,7 @@ cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
>                                                     BATCH_ALLOC_SZ, 0, 1);
>                 /* If issue fails, try falling back to default alloc */
>                 if (unlikely(rc))
> -                       return cn10k_mempool_enq(mp, obj_table, n);
> +                       return cnxk_mempool_deq(mp, obj_table, n);
>                 mem->status = BATCH_ALLOC_OP_ISSUED;
>         }
>
> --
> 2.32.0
>
  

Patch

diff --git a/drivers/mempool/cnxk/cn10k_mempool_ops.c b/drivers/mempool/cnxk/cn10k_mempool_ops.c
index 4c669b878f..6ebbf91de5 100644
--- a/drivers/mempool/cnxk/cn10k_mempool_ops.c
+++ b/drivers/mempool/cnxk/cn10k_mempool_ops.c
@@ -202,7 +202,7 @@  cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)
 						    BATCH_ALLOC_SZ, 0, 1);
 		/* If issue fails, try falling back to default alloc */
 		if (unlikely(rc))
-			return cn10k_mempool_enq(mp, obj_table, n);
+			return cnxk_mempool_deq(mp, obj_table, n);
 		mem->status = BATCH_ALLOC_OP_ISSUED;
 	}