[PATCH] common/cnxk: use cas with release semantics for batch alloc

Ferruh Yigit ferruh.yigit at intel.com
Tue Jan 11 13:08:46 CET 2022


On 11/30/2021 5:45 AM, Ashwin Sekhar T K 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 at marvell.com>
> ---
>   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");
> +

out of curiosity, what is the "cas with release semantics"?
briefly, what is the difference between 'cas' and 'casl'?


More information about the dev mailing list