DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: Ashwin Sekhar T K <asekhar@marvell.com>
Cc: dev@dpdk.org, Pavan Nikhilesh <pbhagavatula@marvell.com>,
	jerinj@marvell.com,  skori@marvell.com, skoteshwar@marvell.com,
	kirankumark@marvell.com,  psatheesh@marvell.com,
	anoobj@marvell.com, gakhil@marvell.com,  hkalra@marvell.com,
	ndabilpuram@marvell.com
Subject: Re: [PATCH 2/2] mempool/cnxk: fix alloc from non-EAL pthreads
Date: Fri, 18 Aug 2023 14:51:42 +0530	[thread overview]
Message-ID: <CALBAE1NWbMm=Zx6jQX5cQ9X9JXKkdJQ0gY=Z4jj+ADdSatcZdw@mail.gmail.com> (raw)
In-Reply-To: <20230731055514.1708500-2-asekhar@marvell.com>

On Mon, Jul 31, 2023 at 11:25 AM Ashwin Sekhar T K <asekhar@marvell.com> wrote:
>
> For non-EAL pthreads, rte_lcore_id() will not be valid.
> So, batch allocation cannot be used as we won't have a
> dedicated alloc buffer for the thread. So, fallback to
> bulk alloc in such cases.
>
> Fixes: 91531e63f43b ("mempool/cnxk: add cn10k batch dequeue")
>
> 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 41b755b52b..9594370ecd 100644
> --- a/drivers/mempool/cnxk/cn10k_mempool_ops.c
> +++ b/drivers/mempool/cnxk/cn10k_mempool_ops.c
> @@ -326,6 +326,12 @@ cn10k_mempool_deq(struct rte_mempool *mp, void **obj_table, unsigned int n)



Looks like same problem on enq() as well, if so, please fix the same.


>         struct batch_op_data *op_data;
>         unsigned int count = 0;
>
> +       /* For non-EAL threads, rte_lcore_id() will not be valid. Hence
> +        * fallback to bulk alloc
> +        */
> +       if (unlikely(rte_lcore_id() == LCORE_ID_ANY))
> +               return cnxk_mempool_deq(mp, obj_table, n);
> +
>         op_data = batch_op_data_get(mp->pool_id);
>         if (op_data->max_async_batch)
>                 count = mempool_deq_batch_async(mp, obj_table, n);
> --
> 2.25.1
>

  reply	other threads:[~2023-08-18  9:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31  5:55 [PATCH 1/2] mempool/cnxk: limit usage of async allocs Ashwin Sekhar T K
2023-07-31  5:55 ` [PATCH 2/2] mempool/cnxk: fix alloc from non-EAL pthreads Ashwin Sekhar T K
2023-08-18  9:21   ` Jerin Jacob [this message]
2023-08-22 17:01 ` [PATCH 1/3] mempool/cnxk: limit usage of async allocs Ashwin Sekhar T K
2023-08-22 17:01   ` [PATCH 2/3] mempool/cnxk: fix free from non-EAL pthreads Ashwin Sekhar T K
2023-08-22 17:01   ` [PATCH 3/3] mempool/cnxk: fix alloc " Ashwin Sekhar T K
2023-08-24  4:57   ` [PATCH 1/3] mempool/cnxk: limit usage of async allocs Jerin Jacob

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='CALBAE1NWbMm=Zx6jQX5cQ9X9JXKkdJQ0gY=Z4jj+ADdSatcZdw@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).