patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Cc: bruce.richardson@intel.com, mb@smartsharesystems.com,
	dev@dpdk.org, ruifeng.wang@arm.com, jerinj@marvell.com,
	nd@arm.com, stable@dpdk.org, pbhagavatula@marvell.com
Subject: Re: [RFC] eal: use same atomic intrinsics for gcc and clang
Date: Mon, 13 Feb 2023 12:01:05 -0800	[thread overview]
Message-ID: <20230213200105.GA24482@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <20230211015622.408487-1-honnappa.nagarahalli@arm.com>

On Fri, Feb 10, 2023 at 07:56:22PM -0600, Honnappa Nagarahalli wrote:
> The size generic atomic intrinsics generate the same
> code as the size specific intrinsics for gcc. Use size
> generic intrinsics for both gcc and clang.
> 
> Fixes: 7bdccb93078e ("eal: fix ARM build with clang")
> Cc: stable@dpdk.org
> Cc: pbhagavatula@marvell.com
> 
> Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>

so first of all thanks for fixing this up. it was confusing me why it
was being conditionally compiled (there was no documented rationale).

i do have a slight concern that perhaps the reason this was done was
because __atomic_exchange_n on some gcc versions or for some specific
target processor was generating less than desirable code but if nobody
else has this concern i won't get in the way since it simplifies things.

thanks!

> ---
>  lib/eal/include/generic/rte_atomic.h | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/lib/eal/include/generic/rte_atomic.h b/lib/eal/include/generic/rte_atomic.h
> index f5c49a9870..234b268b91 100644
> --- a/lib/eal/include/generic/rte_atomic.h
> +++ b/lib/eal/include/generic/rte_atomic.h
> @@ -176,11 +176,7 @@ rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val);
>  static inline uint16_t
>  rte_atomic16_exchange(volatile uint16_t *dst, uint16_t val)
>  {
> -#if defined(__clang__)
>  	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
> -#else
> -	return __atomic_exchange_2(dst, val, __ATOMIC_SEQ_CST);
> -#endif
>  }
>  #endif
>  
> @@ -459,11 +455,7 @@ rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val);
>  static inline uint32_t
>  rte_atomic32_exchange(volatile uint32_t *dst, uint32_t val)
>  {
> -#if defined(__clang__)
>  	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
> -#else
> -	return __atomic_exchange_4(dst, val, __ATOMIC_SEQ_CST);
> -#endif
>  }
>  #endif
>  
> @@ -741,11 +733,7 @@ rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val);
>  static inline uint64_t
>  rte_atomic64_exchange(volatile uint64_t *dst, uint64_t val)
>  {
> -#if defined(__clang__)
>  	return __atomic_exchange_n(dst, val, __ATOMIC_SEQ_CST);
> -#else
> -	return __atomic_exchange_8(dst, val, __ATOMIC_SEQ_CST);
> -#endif
>  }
>  #endif
>  
> -- 
> 2.25.1

  parent reply	other threads:[~2023-02-13 20:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-11  1:56 Honnappa Nagarahalli
2023-02-11  8:04 ` Morten Brørup
2023-02-13 20:01 ` Tyler Retzlaff [this message]
2023-02-13 20:13   ` Honnappa Nagarahalli
2023-02-16  6:53 ` Ruifeng Wang
2023-02-18  1:58 ` [PATCH] " Honnappa Nagarahalli
2023-02-20  7:46   ` Thomas Monjalon

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=20230213200105.GA24482@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
    --to=roretzla@linux.microsoft.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=jerinj@marvell.com \
    --cc=mb@smartsharesystems.com \
    --cc=nd@arm.com \
    --cc=pbhagavatula@marvell.com \
    --cc=ruifeng.wang@arm.com \
    --cc=stable@dpdk.org \
    /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).