From patchwork Fri Feb 23 19:03:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 681 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 463CF43BA4; Fri, 23 Feb 2024 20:08:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD4D942E41; Fri, 23 Feb 2024 20:05:11 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 1EB9F4027A for ; Fri, 23 Feb 2024 20:04:21 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 0D0CC20B74C0; Fri, 23 Feb 2024 11:04:16 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0D0CC20B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1708715056; bh=C+H9f4i5Nx6CBMIFevTWDMIyO84JBZbtc6eusR10T2c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d1blb5eE1LkJPEodPopFcPTzAfJCQ6mJoyuLcq8ltw3/g+xd0YCMDwCdCbhTCfR+y 99menx7Dcvu5AjSePMsGoLW8pTw374j68gX19w/ltAyf4iVBWJIS/G/L/bY2hx6oQS 6KvWC6AYuuX1zvFyVKsnC+5s8knBipr4TystHA6U= 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 v5 00/39] use C11 alignas Date: Fri, 23 Feb 2024 11:03:35 -0800 Message-Id: <1708715054-22386-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 The current location used for __rte_aligned(a) for alignment of types and variables is not compatible with MSVC. There is only a single location accepted by both toolchains. For variables standard C11 offers alignas(a) supported by conformant compilers i.e. both MSVC and GCC. For types the standard offers no alignment facility that compatibly interoperates with C and C++ but may be achieved by relocating the placement of __rte_aligned(a) to the aforementioned location accepted by all currently supported toolchains. ** NOTE ** Finally, In the interest of not creating more API (internal or not) the series does not introduce a wrapper for C11 alignas. If we don't introduce a macro an application can't take a dependency. v5: * rebase series. * reword all commit messages with why the change is necessary. * document guidance for the usage of __rte_aligned macro indicating that it should be used for type alignment only and advising that for variable alignment standard C11 alignas(a) should be preferred. 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 | 23 +++++++++++++------- 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/ethdev/rte_flow_driver.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 ++-- 105 files changed, 408 insertions(+), 346 deletions(-)