From: Jerin Jacob <jerinjacobk@gmail.com>
To: Ashwin Sekhar T K <asekhar@marvell.com>
Cc: dpdk-dev <dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>,
Sunil Kumar Kori <skori@marvell.com>,
Satha Koteswara Rao Kottidi <skoteshwar@marvell.com>,
Pavan Nikhilesh <pbhagavatula@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Satheesh Paul <psatheesh@marvell.com>,
Anoob Joseph <anoobj@marvell.com>,
Akhil Goyal <gakhil@marvell.com>,
Harman Kalra <hkalra@marvell.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>
Subject: Re: [PATCH] drivers: wait optionally when counting allocated pointers
Date: Thu, 16 Jun 2022 01:06:11 +0530 [thread overview]
Message-ID: <CALBAE1MgS4qn8B3FeLFbLqfJmhODJTZsfwE1_eWC03ToQUXOCw@mail.gmail.com> (raw)
In-Reply-To: <20220610160714.1827115-1-asekhar@marvell.com>
On Fri, Jun 10, 2022 at 9:37 PM Ashwin Sekhar T K <asekhar@marvell.com> wrote:
>
> When counting the batch allocated pointers in cnxk mempool driver,
> currently it always waits for in-flight batch operations to finish.
> Add a provision to make this waiting optional.
>
> Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Applied to dpdk-next-net-mrvl/for-next-net. Thanks
> ---
> drivers/common/cnxk/roc_npa.h | 7 +++++--
> drivers/mempool/cnxk/cn10k_mempool_ops.c | 4 ++--
> 2 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/common/cnxk/roc_npa.h b/drivers/common/cnxk/roc_npa.h
> index 0339876bff..59d13d88a1 100644
> --- a/drivers/common/cnxk/roc_npa.h
> +++ b/drivers/common/cnxk/roc_npa.h
> @@ -264,7 +264,8 @@ roc_npa_batch_alloc_wait(uint64_t *cache_line)
> }
>
> static inline unsigned int
> -roc_npa_aura_batch_alloc_count(uint64_t *aligned_buf, unsigned int num)
> +roc_npa_aura_batch_alloc_count(uint64_t *aligned_buf, unsigned int num,
> + unsigned int do_wait)
> {
> unsigned int count, i;
>
> @@ -278,7 +279,9 @@ roc_npa_aura_batch_alloc_count(uint64_t *aligned_buf, unsigned int num)
>
> status = (struct npa_batch_alloc_status_s *)&aligned_buf[i];
>
> - roc_npa_batch_alloc_wait(&aligned_buf[i]);
> + if (do_wait)
> + roc_npa_batch_alloc_wait(&aligned_buf[i]);
> +
> count += status->count;
> }
>
> diff --git a/drivers/mempool/cnxk/cn10k_mempool_ops.c b/drivers/mempool/cnxk/cn10k_mempool_ops.c
> index a02e01cea0..ba826f0f01 100644
> --- a/drivers/mempool/cnxk/cn10k_mempool_ops.c
> +++ b/drivers/mempool/cnxk/cn10k_mempool_ops.c
> @@ -177,8 +177,8 @@ cn10k_mempool_get_count(const struct rte_mempool *mp)
> struct batch_op_mem *mem = &op_data->mem[i];
>
> if (mem->status == BATCH_ALLOC_OP_ISSUED)
> - count += roc_npa_aura_batch_alloc_count(mem->objs,
> - BATCH_ALLOC_SZ);
> + count += roc_npa_aura_batch_alloc_count(
> + mem->objs, BATCH_ALLOC_SZ, 1);
>
> if (mem->status == BATCH_ALLOC_OP_DONE)
> count += mem->sz;
> --
> 2.25.1
>
prev parent reply other threads:[~2022-06-15 19:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-10 16:07 Ashwin Sekhar T K
2022-06-15 19:36 ` Jerin Jacob [this message]
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=CALBAE1MgS4qn8B3FeLFbLqfJmhODJTZsfwE1_eWC03ToQUXOCw@mail.gmail.com \
--to=jerinjacobk@gmail.com \
--cc=anoobj@marvell.com \
--cc=asekhar@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).