[dpdk-dev] [PATCH] eal/arm64: remove internal macros

Jerin Jacob jerinjacobk at gmail.com
Mon Mar 9 17:17:05 CET 2020


On Mon, Mar 9, 2020 at 3:09 PM David Marchand <david.marchand at redhat.com> wrote:
>
> No need to export dsb and dmb.
> EAL memory barriers are the public API.
>
> %s/\<\(d.b\)\>(\([^()]*\))$/asm volatile("\1 \2" : : : "memory")/
>
> Signed-off-by: David Marchand <david.marchand at redhat.com>

Acked-by: Jerin Jacob <jerinj at marvell.com>


> ---
>  .../common/include/arch/arm/rte_atomic_64.h   | 19 ++++++++-----------
>  1 file changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h b/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h
> index 859ae129d8..7b7099cdc1 100644
> --- a/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h
> +++ b/lib/librte_eal/common/include/arch/arm/rte_atomic_64.h
> @@ -19,20 +19,17 @@ extern "C" {
>  #include <rte_compat.h>
>  #include <rte_debug.h>
>
> -#define dsb(opt) asm volatile("dsb " #opt : : : "memory")
> -#define dmb(opt) asm volatile("dmb " #opt : : : "memory")
> +#define rte_mb() asm volatile("dsb sy" : : : "memory")
>
> -#define rte_mb() dsb(sy)
> +#define rte_wmb() asm volatile("dsb st" : : : "memory")
>
> -#define rte_wmb() dsb(st)
> +#define rte_rmb() asm volatile("dsb ld" : : : "memory")
>
> -#define rte_rmb() dsb(ld)
> +#define rte_smp_mb() asm volatile("dmb ish" : : : "memory")
>
> -#define rte_smp_mb() dmb(ish)
> +#define rte_smp_wmb() asm volatile("dmb ishst" : : : "memory")
>
> -#define rte_smp_wmb() dmb(ishst)
> -
> -#define rte_smp_rmb() dmb(ishld)
> +#define rte_smp_rmb() asm volatile("dmb ishld" : : : "memory")
>
>  #define rte_io_mb() rte_mb()
>
> @@ -40,9 +37,9 @@ extern "C" {
>
>  #define rte_io_rmb() rte_rmb()
>
> -#define rte_cio_wmb() dmb(oshst)
> +#define rte_cio_wmb() asm volatile("dmb oshst" : : : "memory")
>
> -#define rte_cio_rmb() dmb(oshld)
> +#define rte_cio_rmb() asm volatile("dmb oshld" : : : "memory")
>
>  /*------------------------ 128 bit atomic operations -------------------------*/
>
> --
> 2.23.0
>


More information about the dev mailing list