[PATCH 15/46] net/sfc: use rte stdatomic API
Tyler Retzlaff
roretzla at linux.microsoft.com
Thu Mar 21 19:15:26 CET 2024
On Thu, Mar 21, 2024 at 02:11:00PM -0400, Aaron Conole wrote:
> Tyler Retzlaff <roretzla at linux.microsoft.com> writes:
>
> > Replace the use of gcc builtin __atomic_xxx intrinsics with
> > corresponding rte_atomic_xxx optional rte stdatomic API.
> >
> > Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
> > ---
> > drivers/net/sfc/meson.build | 5 ++---
> > drivers/net/sfc/sfc_mae_counter.c | 30 +++++++++++++++---------------
> > drivers/net/sfc/sfc_repr_proxy.c | 8 ++++----
> > drivers/net/sfc/sfc_stats.h | 8 ++++----
> > 4 files changed, 25 insertions(+), 26 deletions(-)
> >
> > diff --git a/drivers/net/sfc/meson.build b/drivers/net/sfc/meson.build
> > index 5adde68..d3603a0 100644
> > --- a/drivers/net/sfc/meson.build
> > +++ b/drivers/net/sfc/meson.build
> > @@ -47,9 +47,8 @@ int main(void)
> > __int128 a = 0;
> > __int128 b;
> >
> > - b = __atomic_load_n(&a, __ATOMIC_RELAXED);
> > - __atomic_store(&b, &a, __ATOMIC_RELAXED);
> > - __atomic_store_n(&b, a, __ATOMIC_RELAXED);
> > + b = rte_atomic_load_explicit(&a, rte_memory_order_relaxed);
> > + rte_atomic_store_explicit(&b, a, rte_memory_order_relaxed);
> > return 0;
> > }
> > '''
>
> I think this is a case where simple find/replace is a problem. For
> example, this is a sample file that the meson build uses to determine if
> libatomic is properly installed. However, it is very bare-bones.
>
> Your change is likely causing a compile error when cc.links happens in
> the meson file. That leads to the ABI error.
>
> If the goal is to remove all the intrinsics, then maybe a better change
> would be dropping this libatomic check from here completely.
>
> WDYT?
yeah, actually it wasn't a search replace mistake it was an
unintentionally included file where i was experimenting with keeping the
test (thought i had reverted it).
i shouldn't have added the change to the series thanks for pointing the
mistake out and sorry for the noise.
appreciate it!
More information about the dev
mailing list