DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: Ashwin Sekhar T K <asekhar@marvell.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	 Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dpdk-dev <dev@dpdk.org>,
	Nithin Dabilpuram <ndabilpuram@marvell.com>,
	 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>
Subject: Re: [PATCH] common/cnxk: use cas with release semantics for batch alloc
Date: Thu, 6 Jan 2022 17:57:11 +0530	[thread overview]
Message-ID: <CALBAE1NqT7bhD-TjfWkSOUx9KdnNAugenuycMiTXO6xqC9uZqg@mail.gmail.com> (raw)
In-Reply-To: <20211130054527.2696881-1-asekhar@marvell.com>

On Tue, Nov 30, 2021 at 11:17 AM Ashwin Sekhar T K <asekhar@marvell.com> wrote:
>
> Before issuing the batch alloc, we clear the first word of
> cache lines so that NPA can update the status. Make sure that
> this line clear is flushed before the batch alloc is issued.
>
> Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>

Changed cas -> CAS in git commit

Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-net-mrvl/for-next-net. Thanks


> ---
>  drivers/common/cnxk/roc_io.h         | 12 ++++++++++++
>  drivers/common/cnxk/roc_io_generic.h |  9 +++++++++
>  drivers/common/cnxk/roc_npa.h        |  2 +-
>  3 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/common/cnxk/roc_io.h b/drivers/common/cnxk/roc_io.h
> index fe5f7f46d0..4f15503c29 100644
> --- a/drivers/common/cnxk/roc_io.h
> +++ b/drivers/common/cnxk/roc_io.h
> @@ -78,6 +78,18 @@ roc_atomic64_cas(uint64_t compare, uint64_t swap, int64_t *ptr)
>         return compare;
>  }
>
> +static __plt_always_inline uint64_t
> +roc_atomic64_casl(uint64_t compare, uint64_t swap, int64_t *ptr)
> +{
> +       asm volatile(PLT_CPU_FEATURE_PREAMBLE
> +                    "casl %[compare], %[swap], [%[ptr]]\n"
> +                    : [compare] "+r"(compare)
> +                    : [swap] "r"(swap), [ptr] "r"(ptr)
> +                    : "memory");
> +
> +       return compare;
> +}
> +
>  static __plt_always_inline uint64_t
>  roc_atomic64_add_nosync(int64_t incr, int64_t *ptr)
>  {
> diff --git a/drivers/common/cnxk/roc_io_generic.h b/drivers/common/cnxk/roc_io_generic.h
> index ceaa3a38d8..5f90835c09 100644
> --- a/drivers/common/cnxk/roc_io_generic.h
> +++ b/drivers/common/cnxk/roc_io_generic.h
> @@ -41,6 +41,15 @@ roc_atomic64_cas(uint64_t compare, uint64_t swap, int64_t *ptr)
>         return compare;
>  }
>
> +static __plt_always_inline uint64_t
> +roc_atomic64_casl(uint64_t compare, uint64_t swap, int64_t *ptr)
> +{
> +       PLT_SET_USED(swap);
> +       PLT_SET_USED(ptr);
> +
> +       return compare;
> +}
> +
>  static inline uint64_t
>  roc_atomic64_add_nosync(int64_t incr, int64_t *ptr)
>  {
> diff --git a/drivers/common/cnxk/roc_npa.h b/drivers/common/cnxk/roc_npa.h
> index 46350fdb48..19b9a9352c 100644
> --- a/drivers/common/cnxk/roc_npa.h
> +++ b/drivers/common/cnxk/roc_npa.h
> @@ -218,7 +218,7 @@ roc_npa_aura_batch_alloc_issue(uint64_t aura_handle, uint64_t *buf,
>         cmp.compare_s.dis_wait = dis_wait;
>         cmp.compare_s.count = num;
>
> -       res = roc_atomic64_cas(cmp.u, (uint64_t)buf, addr);
> +       res = roc_atomic64_casl(cmp.u, (uint64_t)buf, addr);
>         if (res != ALLOC_RESULT_ACCEPTED && res != ALLOC_RESULT_NOCORE)
>                 return -1;
>
> --
> 2.32.0
>

  reply	other threads:[~2022-01-06 12:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30  5:45 Ashwin Sekhar T K
2022-01-06 12:27 ` Jerin Jacob [this message]
2022-01-11 12:08 ` Ferruh Yigit
2022-01-11 12:12   ` Ferruh Yigit
2022-01-11 12:26     ` [EXT] " Ashwin Sekhar Thalakalath Kottilveetil
2022-01-11 13:46       ` Ferruh Yigit
2022-01-12  3:01         ` Ruifeng Wang
2022-01-12  6:18           ` Ruifeng Wang
2022-01-12  9:20             ` Ferruh Yigit
2022-01-12  9:21           ` Ferruh Yigit

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=CALBAE1NqT7bhD-TjfWkSOUx9KdnNAugenuycMiTXO6xqC9uZqg@mail.gmail.com \
    --to=jerinjacobk@gmail.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=anoobj@marvell.com \
    --cc=asekhar@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=gakhil@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).