[PATCH v3 06/19] ipsec: use rte optional stdatomic API

Konstantin Ananyev konstantin.v.ananyev at yandex.ru
Fri Oct 27 14:59:35 CEST 2023


26.10.2023 01:31, Tyler Retzlaff пишет:
> Replace the use of gcc builtin __atomic_xxx intrinsics with
> corresponding rte_atomic_xxx optional stdatomic API
> 
> Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
> ---
>   lib/ipsec/ipsec_sqn.h | 2 +-
>   lib/ipsec/sa.h        | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/ipsec/ipsec_sqn.h b/lib/ipsec/ipsec_sqn.h
> index 505950e..984a9dd 100644
> --- a/lib/ipsec/ipsec_sqn.h
> +++ b/lib/ipsec/ipsec_sqn.h
> @@ -128,7 +128,7 @@
>   
>   	n = *num;
>   	if (SQN_ATOMIC(sa))
> -		sqn = __atomic_fetch_add(&sa->sqn.outb, n, __ATOMIC_RELAXED) + n;
> +		sqn = rte_atomic_fetch_add_explicit(&sa->sqn.outb, n, rte_memory_order_relaxed) + n;
>   	else {
>   		sqn = sa->sqn.outb + n;
>   		sa->sqn.outb = sqn;
> diff --git a/lib/ipsec/sa.h b/lib/ipsec/sa.h
> index ce4af8c..4b30bea 100644
> --- a/lib/ipsec/sa.h
> +++ b/lib/ipsec/sa.h
> @@ -124,7 +124,7 @@ struct rte_ipsec_sa {
>   	 * place from other frequently accessed data.
>   	 */
>   	union {
> -		uint64_t outb;
> +		RTE_ATOMIC(uint64_t) outb;
>   		struct {
>   			uint32_t rdidx; /* read index */
>   			uint32_t wridx; /* write index */

Acked-by: Konstantin Ananyev <konstantin.v.ananyev at yandex.ru>



More information about the dev mailing list