Message ID | 1690866234-28365-1-git-send-email-roretzla@linux.microsoft.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A857642FAE; Tue, 1 Aug 2023 07:04:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3AC4843258; Tue, 1 Aug 2023 07:04:00 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id C6DE7400D5 for <dev@dpdk.org>; Tue, 1 Aug 2023 07:03:56 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id B3CBA238AEB8; Mon, 31 Jul 2023 22:03:55 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B3CBA238AEB8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1690866235; bh=3N79tdPAgF3Z2MQE0gzmLp/GFyycg4lhf99t7VH5rz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VZT3OjX/SsNUw7wd950gPONDpLtcL4dmxJtocG7Eh58TP4XAHAcSC8ZKvr9Bb+7ui YEGGLZHyzlf3I0qke7PTnvqZ45SwjoqqOXyIBTbB2CJ0gJaot1tpkYXvpyqhaJ6/9c IhZ7I4nMWIth0g31/mre402Qxa3fHTcfMOiw0sTk= From: Tyler Retzlaff <roretzla@linux.microsoft.com> To: dev@dpdk.org Cc: Gaetan Rivet <grive@u256.net>, Bruce Richardson <bruce.richardson@intel.com>, Thomas Monjalon <thomas@monjalon.net>, Nicolas Chautru <nicolas.chautru@intel.com>, Yipeng Wang <yipeng1.wang@intel.com>, Sameh Gobriel <sameh.gobriel@intel.com>, Vladimir Medvedkin <vladimir.medvedkin@intel.com>, Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>, Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>, Anatoly Burakov <anatoly.burakov@intel.com>, Olivier Matz <olivier.matz@6wind.com>, Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>, Joyce Kong <joyce.kong@arm.com>, Erik Gabriel Carrillo <erik.g.carrillo@intel.com>, Liang Ma <liangma@liangbit.com>, Peter Mccarthy <peter.mccarthy@intel.com>, Jerin Jacob <jerinj@marvell.com>, Maciej Czekaj <mczekaj@marvell.com>, David Hunt <david.hunt@intel.com>, Ruifeng Wang <ruifeng.wang@arm.com>, Min Zhou <zhoumin@loongson.cn>, David Christensen <drc@linux.vnet.ibm.com>, Stanislaw Kardach <kda@semihalf.com>, david.marchand@redhat.com, stephen@networkplumber.org, mb@smartsharesystems.com, Tyler Retzlaff <roretzla@linux.microsoft.com> Subject: [PATCH v2 0/4] eal: update public API to use stdatomic atomics Date: Mon, 31 Jul 2023 22:03:50 -0700 Message-Id: <1690866234-28365-1-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1690837661-27573-1-git-send-email-roretzla@linux.microsoft.com> References: <1690837661-27573-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
eal: update public API to use stdatomic atomics
|
|
Message
Tyler Retzlaff
Aug. 1, 2023, 5:03 a.m. UTC
Update EAL public API to use standard C11 atomics. In accordance with technical board discussion February 2023. http://mails.dpdk.org/archives/dev/2023-February/263516.html This initial series makes no attempt to adapt every use of builtin atomics from GCC it intends only to adapt the public API of the EAL presented as a compatibility surface to applications. Further series will be submitted to adapt the rest of DPDK to use standard atomics that are 'internal' and not do not straddle the EAL API. The choice has been made to break these two changes apart to allow more precise analysis of any potential performance impact this change or subsequent changes may introduce. Additionally, it is not possible to break the commits up per driver/lib as both the provider and consumer of the APIs need to be changed in the same commit to maintain non-broken build and function. Finally, the first patch in this series is a duplication of Bruce Richardson series https://patchwork.dpdk.org/project/dpdk/list/?series=29048 and is only being provided to enable the CI run on this series. It is expected that Bruce's series when committed will allow the build: require minimum c11 compiler here to be dropped from this series. v2: * remove volatile qualification from variables, structure fields and parameters that have been qualified _Atomic * restore removal of #include <rte_atomic.h> in rte_ring_core.h the ring library still uses other rte_atomic APIs and types that are not replaced by the standard or compiler intrinsics * add missing adaption to stdatomic in ring/rte_ring_c11_pvt.h Tyler Retzlaff (4): build: require minimum c11 compiler devtools: forbid use of GCC atomic builtins eal: adapt rte pause APIs to use C11 atomics eal: adapt rte spinlock and rwlock APIs to use C11 atomics app/test-bbdev/test_bbdev_perf.c | 123 ++++++++++++++++++++----------- app/test/test_func_reentrancy.c | 8 +- app/test/test_mcslock.c | 12 +-- app/test/test_mempool_perf.c | 8 +- app/test/test_pflock.c | 12 +-- app/test/test_pmd_perf.c | 10 +-- app/test/test_ring_perf.c | 8 +- app/test/test_rwlock.c | 8 +- app/test/test_spinlock.c | 8 +- app/test/test_stack_perf.c | 12 +-- app/test/test_ticketlock.c | 8 +- app/test/test_timer.c | 16 ++-- devtools/checkpatches.sh | 8 ++ drivers/event/opdl/opdl_ring.c | 47 ++++++------ drivers/net/failsafe/meson.build | 1 - drivers/net/thunderx/nicvf_rxtx.c | 5 +- drivers/net/thunderx/nicvf_struct.h | 2 +- lib/bpf/bpf_pkt.c | 4 +- lib/distributor/distributor_private.h | 2 +- lib/distributor/rte_distributor_single.c | 44 +++++------ lib/eal/arm/include/rte_pause_64.h | 28 +++---- lib/eal/common/eal_common_errno.c | 1 + lib/eal/common/eal_memcfg.h | 2 +- lib/eal/include/generic/rte_pause.h | 52 ++++++------- lib/eal/include/generic/rte_rwlock.h | 46 ++++++------ lib/eal/include/generic/rte_spinlock.h | 21 +++--- lib/eal/include/rte_mcslock.h | 12 +-- lib/eal/include/rte_pflock.h | 22 +++--- lib/eal/include/rte_ticketlock.h | 8 +- lib/eal/loongarch/include/rte_pause.h | 2 - lib/eal/ppc/include/rte_pause.h | 2 - lib/eal/riscv/include/rte_pause.h | 2 - lib/eal/x86/include/rte_spinlock.h | 2 +- lib/ring/rte_ring_c11_pvt.h | 28 +++---- lib/ring/rte_ring_core.h | 4 +- lib/ring/rte_ring_generic_pvt.h | 19 +++-- lib/ring/rte_ring_peek_elem_pvt.h | 2 +- meson.build | 1 + 38 files changed, 326 insertions(+), 274 deletions(-)
Comments
> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] > Sent: Tuesday, 1 August 2023 07.04 > > Update EAL public API to use standard C11 atomics. In accordance with > technical board discussion February 2023. > http://mails.dpdk.org/archives/dev/2023-February/263516.html > > This initial series makes no attempt to adapt every use of builtin atomics > from GCC it intends only to adapt the public API of the EAL presented as > a compatibility surface to applications. > > Further series will be submitted to adapt the rest of DPDK to use standard > atomics that are 'internal' and not do not straddle the EAL API. > > The choice has been made to break these two changes apart to allow more > precise analysis of any potential performance impact this change or > subsequent changes may introduce. > > Additionally, it is not possible to break the commits up per driver/lib as > both the provider and consumer of the APIs need to be changed in the same > commit to maintain non-broken build and function. > > Finally, the first patch in this series is a duplication of Bruce Richardson > series https://patchwork.dpdk.org/project/dpdk/list/?series=29048 and is > only being provided to enable the CI run on this series. It is expected that > Bruce's series when committed will allow the build: require minimum c11 > compiler > here to be dropped from this series. > > v2: > * remove volatile qualification from variables, structure fields and > parameters that have been qualified _Atomic > * restore removal of #include <rte_atomic.h> in rte_ring_core.h the ring > library still uses other rte_atomic APIs and types that are not replaced > by the standard or compiler intrinsics > * add missing adaption to stdatomic in ring/rte_ring_c11_pvt.h Series-acked-by: Morten Brørup <mb@smartsharesystems.com>
top post just a heads up on this series, please defer review until v3 is submitted. clang is stricter in atomic type enforcement than gcc so a new revision is needed that removes the direct use of intrinsics replacing them with the standard atomics for all _Atomic types. thanks On Mon, Jul 31, 2023 at 10:03:50PM -0700, Tyler Retzlaff wrote: > Update EAL public API to use standard C11 atomics. In accordance with > technical board discussion February 2023. > http://mails.dpdk.org/archives/dev/2023-February/263516.html > > This initial series makes no attempt to adapt every use of builtin atomics > from GCC it intends only to adapt the public API of the EAL presented as > a compatibility surface to applications. > > Further series will be submitted to adapt the rest of DPDK to use standard > atomics that are 'internal' and not do not straddle the EAL API. > > The choice has been made to break these two changes apart to allow more > precise analysis of any potential performance impact this change or > subsequent changes may introduce. > > Additionally, it is not possible to break the commits up per driver/lib as > both the provider and consumer of the APIs need to be changed in the same > commit to maintain non-broken build and function. > > Finally, the first patch in this series is a duplication of Bruce Richardson > series https://patchwork.dpdk.org/project/dpdk/list/?series=29048 and is > only being provided to enable the CI run on this series. It is expected that > Bruce's series when committed will allow the build: require minimum c11 compiler > here to be dropped from this series. > > v2: > * remove volatile qualification from variables, structure fields and > parameters that have been qualified _Atomic > * restore removal of #include <rte_atomic.h> in rte_ring_core.h the ring > library still uses other rte_atomic APIs and types that are not replaced > by the standard or compiler intrinsics > * add missing adaption to stdatomic in ring/rte_ring_c11_pvt.h > > Tyler Retzlaff (4): > build: require minimum c11 compiler > devtools: forbid use of GCC atomic builtins > eal: adapt rte pause APIs to use C11 atomics > eal: adapt rte spinlock and rwlock APIs to use C11 atomics > > app/test-bbdev/test_bbdev_perf.c | 123 ++++++++++++++++++++----------- > app/test/test_func_reentrancy.c | 8 +- > app/test/test_mcslock.c | 12 +-- > app/test/test_mempool_perf.c | 8 +- > app/test/test_pflock.c | 12 +-- > app/test/test_pmd_perf.c | 10 +-- > app/test/test_ring_perf.c | 8 +- > app/test/test_rwlock.c | 8 +- > app/test/test_spinlock.c | 8 +- > app/test/test_stack_perf.c | 12 +-- > app/test/test_ticketlock.c | 8 +- > app/test/test_timer.c | 16 ++-- > devtools/checkpatches.sh | 8 ++ > drivers/event/opdl/opdl_ring.c | 47 ++++++------ > drivers/net/failsafe/meson.build | 1 - > drivers/net/thunderx/nicvf_rxtx.c | 5 +- > drivers/net/thunderx/nicvf_struct.h | 2 +- > lib/bpf/bpf_pkt.c | 4 +- > lib/distributor/distributor_private.h | 2 +- > lib/distributor/rte_distributor_single.c | 44 +++++------ > lib/eal/arm/include/rte_pause_64.h | 28 +++---- > lib/eal/common/eal_common_errno.c | 1 + > lib/eal/common/eal_memcfg.h | 2 +- > lib/eal/include/generic/rte_pause.h | 52 ++++++------- > lib/eal/include/generic/rte_rwlock.h | 46 ++++++------ > lib/eal/include/generic/rte_spinlock.h | 21 +++--- > lib/eal/include/rte_mcslock.h | 12 +-- > lib/eal/include/rte_pflock.h | 22 +++--- > lib/eal/include/rte_ticketlock.h | 8 +- > lib/eal/loongarch/include/rte_pause.h | 2 - > lib/eal/ppc/include/rte_pause.h | 2 - > lib/eal/riscv/include/rte_pause.h | 2 - > lib/eal/x86/include/rte_spinlock.h | 2 +- > lib/ring/rte_ring_c11_pvt.h | 28 +++---- > lib/ring/rte_ring_core.h | 4 +- > lib/ring/rte_ring_generic_pvt.h | 19 +++-- > lib/ring/rte_ring_peek_elem_pvt.h | 2 +- > meson.build | 1 + > 38 files changed, 326 insertions(+), 274 deletions(-) > > -- > 1.8.3.1