From patchwork Wed Feb 14 16:35:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 646 Return-Path: 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 5F76D43B38; Wed, 14 Feb 2024 17:36:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F252942E49; Wed, 14 Feb 2024 17:36:07 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id A4BDD4026A for ; Wed, 14 Feb 2024 17:36:06 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id C57DB20B2000; Wed, 14 Feb 2024 08:36:05 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C57DB20B2000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707928565; bh=PRcX68orZtfK3wCdRY3/iQOXnXge4wAJQRoTrnRA2X4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KyxFD738pstNf/hQ2QUnqXhui+83WHpE+z2omA+7b9Rva0b/IEb3QXgRmNBP9f//E U4BetFgUp3Jlup3j4JI8S3tj61YTJdGgbzXYtWj8W+twKLoAnkug0UuyaRHjITNhEG L6FwUpJLzLvNdPrAZY0/PiKaBZ0c/dQLyq3u7nhI= From: Tyler Retzlaff To: dev@dpdk.org Cc: Andrew Rybchenko , Bruce Richardson , Chengwen Feng , Cristian Dumitrescu , David Christensen , David Hunt , Ferruh Yigit , Honnappa Nagarahalli , Jasvinder Singh , Jerin Jacob , Kevin Laatz , Konstantin Ananyev , Min Zhou , Ruifeng Wang , Sameh Gobriel , Stanislaw Kardach , Thomas Monjalon , Vladimir Medvedkin , Yipeng Wang , Tyler Retzlaff Subject: [PATCH v4 00/39] use C11 alignas and normalize type alignment Date: Wed, 14 Feb 2024 08:35:25 -0800 Message-Id: <1707928564-28796-1-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707873986-29352-1-git-send-email-roretzla@linux.microsoft.com> References: <1707873986-29352-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This series normalizes type and object alignment by doing the following. Fill in expansion of existing __rte_aligned, __rte_cache_aligned and __rte_cache_min_aligned macros for MSVC. Where __rte_aligned, __rte_cache_aligned and __rte_cache_min_aligned are used to align *types* move them to a location on the type definition that both GCC and MSVC accept for both C and C++ compilation. Where __rte_aligned, __rte_cache_aligned or __rte_cache_min_aligned are used to align *objects* replace their usage with standard C11 alignas. I've elected to put the series forward without introducing a new macro similar to __rte_alignas. Assuming the convention of a lower case macro starting with __rte is intended to be internal only and providing it would only permit unintended use by applications. v4: * restore explicit alignment of 8-byte integers in mbuf and ring patches, natural alignment may be 4-bytes on 32-bit targets. v3: * add missing patches for __rte_cache_aligned and __rte_cache_min_aligned v2: * add missing #include for alignas macro. Tyler Retzlaff (39): eal: use C11 alignas eal: redefine macro to be integer literal for MSVC stack: use C11 alignas sched: use C11 alignas ring: use C11 alignas pipeline: use C11 alignas net: use C11 alignas mbuf: use C11 alignas hash: use C11 alignas eventdev: use C11 alignas ethdev: use C11 alignas dmadev: use C11 alignas distributor: use C11 alignas acl: use C11 alignas vhost: use C11 alignas timer: use C11 alignas table: use C11 alignas reorder: use C11 alignas regexdev: use C11 alignas rcu: use C11 alignas power: use C11 alignas rawdev: use C11 alignas port: use C11 alignas pdcp: use C11 alignas node: use C11 alignas mldev: use C11 alignas mempool: use C11 alignas member: use C11 alignas lpm: use C11 alignas ipsec: use C11 alignas jobstats: use C11 alignas bpf: use C11 alignas compressdev: use C11 alignas cryptodev: use C11 alignas dispatcher: use C11 alignas fib: use C11 alignas gpudev: use C11 alignas graph: use C11 alignas ip_frag: use C11 alignas lib/acl/acl_run.h | 4 ++-- lib/acl/acl_run_altivec.h | 6 ++++-- lib/acl/acl_run_neon.h | 6 ++++-- lib/bpf/bpf_pkt.c | 4 ++-- lib/compressdev/rte_comp.h | 4 ++-- lib/compressdev/rte_compressdev_internal.h | 8 +++---- lib/cryptodev/cryptodev_pmd.h | 8 +++---- lib/cryptodev/rte_cryptodev_core.h | 4 ++-- lib/dispatcher/rte_dispatcher.c | 4 ++-- lib/distributor/distributor_private.h | 34 ++++++++++++++++-------------- lib/distributor/rte_distributor.c | 5 +++-- lib/dmadev/rte_dmadev_core.h | 4 ++-- lib/dmadev/rte_dmadev_pmd.h | 8 +++---- lib/eal/arm/include/rte_vect.h | 4 ++-- lib/eal/common/malloc_elem.h | 4 ++-- lib/eal/common/malloc_heap.h | 4 ++-- lib/eal/common/rte_keepalive.c | 3 ++- lib/eal/common/rte_random.c | 4 ++-- lib/eal/common/rte_service.c | 8 +++---- lib/eal/include/generic/rte_atomic.h | 4 ++-- lib/eal/include/rte_common.h | 12 +++++------ lib/eal/loongarch/include/rte_vect.h | 8 +++---- lib/eal/ppc/include/rte_vect.h | 4 ++-- lib/eal/riscv/include/rte_vect.h | 4 ++-- lib/eal/x86/include/rte_vect.h | 9 +++++--- lib/eal/x86/rte_power_intrinsics.c | 10 +++++---- lib/ethdev/ethdev_driver.h | 8 +++---- lib/ethdev/rte_ethdev.h | 16 +++++++------- lib/ethdev/rte_ethdev_core.h | 4 ++-- lib/eventdev/event_timer_adapter_pmd.h | 4 ++-- lib/eventdev/eventdev_pmd.h | 8 +++---- lib/eventdev/rte_event_crypto_adapter.c | 16 +++++++------- lib/eventdev/rte_event_dma_adapter.c | 16 +++++++------- lib/eventdev/rte_event_eth_rx_adapter.c | 8 +++---- lib/eventdev/rte_event_eth_tx_adapter.c | 4 ++-- lib/eventdev/rte_event_timer_adapter.c | 9 ++++---- lib/eventdev/rte_event_timer_adapter.h | 8 +++---- lib/eventdev/rte_eventdev.h | 8 +++---- lib/eventdev/rte_eventdev_core.h | 4 ++-- lib/fib/dir24_8.h | 4 +++- lib/fib/trie.h | 4 +++- lib/gpudev/gpudev_driver.h | 4 ++-- lib/graph/graph_private.h | 4 ++-- lib/graph/graph_stats.c | 4 ++-- lib/graph/rte_graph.h | 4 ++-- lib/graph/rte_graph_worker_common.h | 17 +++++++++------ lib/hash/rte_cuckoo_hash.h | 16 ++++++++------ lib/hash/rte_thash.c | 4 +++- lib/hash/rte_thash.h | 8 +++---- lib/ip_frag/ip_reassembly.h | 8 +++---- lib/ipsec/rte_ipsec.h | 4 ++-- lib/ipsec/sa.h | 4 ++-- lib/jobstats/rte_jobstats.h | 8 +++---- lib/lpm/rte_lpm.h | 5 +++-- lib/lpm/rte_lpm6.c | 8 +++---- lib/mbuf/rte_mbuf_core.h | 6 +++--- lib/member/rte_member.h | 8 +++---- lib/member/rte_member_ht.h | 4 ++-- lib/member/rte_member_sketch.c | 4 ++-- lib/mempool/rte_mempool.h | 27 ++++++++++++------------ lib/mldev/rte_mldev.h | 4 ++-- lib/mldev/rte_mldev_core.h | 4 ++-- lib/net/net_crc_avx512.c | 14 ++++++------ lib/net/net_crc_neon.c | 11 +++++----- lib/net/net_crc_sse.c | 17 ++++++++------- lib/net/rte_arp.h | 8 +++---- lib/net/rte_ether.h | 8 +++---- lib/node/node_private.h | 4 ++-- lib/node/pkt_cls.c | 4 +++- lib/pdcp/rte_pdcp.h | 4 ++-- lib/pipeline/rte_pipeline.c | 4 ++-- lib/pipeline/rte_port_in_action.c | 3 ++- lib/pipeline/rte_swx_ipsec.c | 4 +++- lib/pipeline/rte_table_action.c | 24 ++++++++++----------- lib/port/rte_port_frag.c | 4 ++-- lib/power/power_acpi_cpufreq.c | 4 ++-- lib/power/power_amd_pstate_cpufreq.c | 4 ++-- lib/power/power_cppc_cpufreq.c | 4 ++-- lib/power/power_intel_uncore.c | 4 ++-- lib/power/power_pstate_cpufreq.c | 4 ++-- lib/power/rte_power_pmd_mgmt.c | 4 ++-- lib/rawdev/rte_rawdev.h | 4 ++-- lib/rcu/rte_rcu_qsbr.h | 16 ++++++++------ lib/regexdev/rte_regexdev_core.h | 8 +++---- lib/reorder/rte_reorder.c | 8 +++---- lib/ring/rte_ring_core.h | 16 ++++++++------ lib/ring/rte_ring_peek_zc.h | 4 ++-- lib/sched/rte_sched.c | 21 +++++++++--------- lib/sched/rte_sched_common.h | 2 -- lib/stack/rte_stack.h | 16 ++++++++------ lib/table/rte_swx_table_learner.c | 4 ++-- lib/table/rte_table_acl.c | 3 ++- lib/table/rte_table_array.c | 7 +++--- lib/table/rte_table_hash_cuckoo.c | 4 +++- lib/table/rte_table_hash_ext.c | 3 ++- lib/table/rte_table_hash_key16.c | 4 +++- lib/table/rte_table_hash_key32.c | 4 +++- lib/table/rte_table_hash_key8.c | 4 +++- lib/table/rte_table_hash_lru.c | 3 ++- lib/table/rte_table_lpm.c | 3 ++- lib/table/rte_table_lpm_ipv6.c | 3 ++- lib/timer/rte_timer.c | 4 ++-- lib/vhost/vhost.h | 8 +++---- lib/vhost/vhost_crypto.c | 4 ++-- 104 files changed, 396 insertions(+), 343 deletions(-)