Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/137254/?format=api
http://patches.dpdk.org/api/patches/137254/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1708971946-18231-18-git-send-email-roretzla@linux.microsoft.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<1708971946-18231-18-git-send-email-roretzla@linux.microsoft.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1708971946-18231-18-git-send-email-roretzla@linux.microsoft.com", "date": "2024-02-26T18:25:24", "name": "[v6,17/39] table: use C11 alignas", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "995128a4e2349fa0dc8b46063236044be654ff47", "submitter": { "id": 2077, "url": "http://patches.dpdk.org/api/people/2077/?format=api", "name": "Tyler Retzlaff", "email": "roretzla@linux.microsoft.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1708971946-18231-18-git-send-email-roretzla@linux.microsoft.com/mbox/", "series": [ { "id": 31229, "url": "http://patches.dpdk.org/api/series/31229/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31229", "date": "2024-02-26T18:25:09", "name": "use C11 alignas", "version": 6, "mbox": "http://patches.dpdk.org/series/31229/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/137254/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/137254/checks/", "tags": {}, "related": [], "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id BF19743B7E;\n\tMon, 26 Feb 2024 19:28:01 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 9B33E42ECC;\n\tMon, 26 Feb 2024 19:26:23 +0100 (CET)", "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 929DF42E52\n for <dev@dpdk.org>; Mon, 26 Feb 2024 19:25:50 +0100 (CET)", "by linux.microsoft.com (Postfix, from userid 1086)\n id 448B820B74D1; Mon, 26 Feb 2024 10:25:48 -0800 (PST)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 448B820B74D1", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1708971949;\n bh=tY+ib1a5vBunUMctFokCefqzLnfhOlZ6yQPL6iSHQek=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=HnKuK5iU+snOQdNfus7W1rVRV0u1OZDM4EWoQYnO+jmoiJ42ipG6cHvn4MWu/UR22\n F1Enh7BtNDzTCpr/2pNoEq6U5q5crEAK8/MlAB1aYz8Kimzc05O9+JRBW8Hs3mARcC\n 2es+ApnSk2hUswyR6UG3gj+54e10BYM7qrf6jptY=", "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>", "To": "dev@dpdk.org", "Cc": "Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Bruce Richardson <bruce.richardson@intel.com>,\n Chengwen Feng <fengchengwen@huawei.com>,\n Cristian Dumitrescu <cristian.dumitrescu@intel.com>,\n David Christensen <drc@linux.vnet.ibm.com>,\n David Hunt <david.hunt@intel.com>, Ferruh Yigit <ferruh.yigit@amd.com>,\n Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,\n Jasvinder Singh <jasvinder.singh@intel.com>,\n Jerin Jacob <jerinj@marvell.com>, Kevin Laatz <kevin.laatz@intel.com>,\n Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,\n Min Zhou <zhoumin@loongson.cn>, Ruifeng Wang <ruifeng.wang@arm.com>,\n Sameh Gobriel <sameh.gobriel@intel.com>,\n Stanislaw Kardach <kda@semihalf.com>,\n Thomas Monjalon <thomas@monjalon.net>,\n Vladimir Medvedkin <vladimir.medvedkin@intel.com>,\n Yipeng Wang <yipeng1.wang@intel.com>,\n Tyler Retzlaff <roretzla@linux.microsoft.com>", "Subject": "[PATCH v6 17/39] table: use C11 alignas", "Date": "Mon, 26 Feb 2024 10:25:24 -0800", "Message-Id": "<1708971946-18231-18-git-send-email-roretzla@linux.microsoft.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1708971946-18231-1-git-send-email-roretzla@linux.microsoft.com>", "References": "<1707873986-29352-1-git-send-email-roretzla@linux.microsoft.com>\n <1708971946-18231-1-git-send-email-roretzla@linux.microsoft.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "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>,\n <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>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "The current location used for __rte_aligned(a) for alignment of types\nand variables is not compatible with MSVC. There is only a single\nlocation accepted by both toolchains.\n\nFor variables standard C11 offers alignas(a) supported by conformant\ncompilers i.e. both MSVC and GCC.\n\nFor types the standard offers no alignment facility that compatibly\ninteroperates with C and C++ but may be achieved by relocating the\nplacement of __rte_aligned(a) to the aforementioned location accepted\nby all currently supported toolchains.\n\nTo allow alignment for both compilers do the following:\n\n* Move __rte_aligned from the end of {struct,union} definitions to\n be between {struct,union} and tag.\n\n The placement between {struct,union} and the tag allows the desired\n alignment to be imparted on the type regardless of the toolchain being\n used for all of GCC, LLVM, MSVC compilers building both C and C++.\n\n* Replace use of __rte_aligned(a) on variables/fields with alignas(a).\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\n---\n lib/table/rte_swx_table_learner.c | 4 ++--\n lib/table/rte_table_acl.c | 3 ++-\n lib/table/rte_table_array.c | 7 ++++---\n lib/table/rte_table_hash_cuckoo.c | 4 +++-\n lib/table/rte_table_hash_ext.c | 3 ++-\n lib/table/rte_table_hash_key16.c | 4 +++-\n lib/table/rte_table_hash_key32.c | 4 +++-\n lib/table/rte_table_hash_key8.c | 4 +++-\n lib/table/rte_table_hash_lru.c | 3 ++-\n lib/table/rte_table_lpm.c | 3 ++-\n lib/table/rte_table_lpm_ipv6.c | 3 ++-\n 11 files changed, 28 insertions(+), 14 deletions(-)", "diff": "diff --git a/lib/table/rte_swx_table_learner.c b/lib/table/rte_swx_table_learner.c\nindex 2b5e6bd..55a3645 100644\n--- a/lib/table/rte_swx_table_learner.c\n+++ b/lib/table/rte_swx_table_learner.c\n@@ -145,13 +145,13 @@ struct table_params {\n \tsize_t total_size;\n };\n \n-struct table {\n+struct __rte_cache_aligned table {\n \t/* Table parameters. */\n \tstruct table_params params;\n \n \t/* Table buckets. */\n \tuint8_t buckets[];\n-} __rte_cache_aligned;\n+};\n \n /* The timeout (in cycles) is stored in the table as a 32-bit value by truncating its least\n * significant 32 bits. Therefore, to make sure the time is always advancing when adding the timeout\ndiff --git a/lib/table/rte_table_acl.c b/lib/table/rte_table_acl.c\nindex 83411d2..2764cda 100644\n--- a/lib/table/rte_table_acl.c\n+++ b/lib/table/rte_table_acl.c\n@@ -2,6 +2,7 @@\n * Copyright(c) 2010-2014 Intel Corporation\n */\n \n+#include <stdalign.h>\n #include <string.h>\n #include <stdio.h>\n \n@@ -47,7 +48,7 @@ struct rte_table_acl {\n \tuint8_t *acl_rule_memory; /* Memory to store the rules */\n \n \t/* Memory to store the action table and stack of free entries */\n-\tuint8_t memory[0] __rte_cache_aligned;\n+\talignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0];\n };\n \n \ndiff --git a/lib/table/rte_table_array.c b/lib/table/rte_table_array.c\nindex 80bc2a7..31a17d5 100644\n--- a/lib/table/rte_table_array.c\n+++ b/lib/table/rte_table_array.c\n@@ -2,6 +2,7 @@\n * Copyright(c) 2010-2014 Intel Corporation\n */\n \n+#include <stdalign.h>\n #include <string.h>\n #include <stdio.h>\n \n@@ -27,7 +28,7 @@\n \n #endif\n \n-struct rte_table_array {\n+struct __rte_cache_aligned rte_table_array {\n \tstruct rte_table_stats stats;\n \n \t/* Input parameters */\n@@ -39,8 +40,8 @@ struct rte_table_array {\n \tuint32_t entry_pos_mask;\n \n \t/* Internal table */\n-\tuint8_t array[0] __rte_cache_aligned;\n-} __rte_cache_aligned;\n+\talignas(RTE_CACHE_LINE_SIZE) uint8_t array[0];\n+};\n \n static void *\n rte_table_array_create(void *params, int socket_id, uint32_t entry_size)\ndiff --git a/lib/table/rte_table_hash_cuckoo.c b/lib/table/rte_table_hash_cuckoo.c\nindex 0f4900c..d3b60f3 100644\n--- a/lib/table/rte_table_hash_cuckoo.c\n+++ b/lib/table/rte_table_hash_cuckoo.c\n@@ -1,6 +1,8 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n * Copyright(c) 2010-2017 Intel Corporation\n */\n+\n+#include <stdalign.h>\n #include <string.h>\n #include <stdio.h>\n \n@@ -42,7 +44,7 @@ struct rte_table_hash {\n \tstruct rte_hash *h_table;\n \n \t/* Lookup table */\n-\tuint8_t memory[0] __rte_cache_aligned;\n+\talignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0];\n };\n \n static int\ndiff --git a/lib/table/rte_table_hash_ext.c b/lib/table/rte_table_hash_ext.c\nindex 2148d83..61e3c79 100644\n--- a/lib/table/rte_table_hash_ext.c\n+++ b/lib/table/rte_table_hash_ext.c\n@@ -2,6 +2,7 @@\n * Copyright(c) 2010-2017 Intel Corporation\n */\n \n+#include <stdalign.h>\n #include <string.h>\n #include <stdio.h>\n \n@@ -99,7 +100,7 @@ struct rte_table_hash {\n \tuint32_t *bkt_ext_stack;\n \n \t/* Table memory */\n-\tuint8_t memory[0] __rte_cache_aligned;\n+\talignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0];\n };\n \n static int\ndiff --git a/lib/table/rte_table_hash_key16.c b/lib/table/rte_table_hash_key16.c\nindex 7734aef..2af34a5 100644\n--- a/lib/table/rte_table_hash_key16.c\n+++ b/lib/table/rte_table_hash_key16.c\n@@ -1,6 +1,8 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n * Copyright(c) 2010-2017 Intel Corporation\n */\n+\n+#include <stdalign.h>\n #include <string.h>\n #include <stdio.h>\n \n@@ -83,7 +85,7 @@ struct rte_table_hash {\n \tuint32_t *stack;\n \n \t/* Lookup table */\n-\tuint8_t memory[0] __rte_cache_aligned;\n+\talignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0];\n };\n \n static int\ndiff --git a/lib/table/rte_table_hash_key32.c b/lib/table/rte_table_hash_key32.c\nindex fcb4348..06e5cf4 100644\n--- a/lib/table/rte_table_hash_key32.c\n+++ b/lib/table/rte_table_hash_key32.c\n@@ -1,6 +1,8 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n * Copyright(c) 2010-2017 Intel Corporation\n */\n+\n+#include <stdalign.h>\n #include <string.h>\n #include <stdio.h>\n \n@@ -83,7 +85,7 @@ struct rte_table_hash {\n \tuint32_t *stack;\n \n \t/* Lookup table */\n-\tuint8_t memory[0] __rte_cache_aligned;\n+\talignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0];\n };\n \n static int\ndiff --git a/lib/table/rte_table_hash_key8.c b/lib/table/rte_table_hash_key8.c\nindex bbe6562..2ab8e1b 100644\n--- a/lib/table/rte_table_hash_key8.c\n+++ b/lib/table/rte_table_hash_key8.c\n@@ -1,6 +1,8 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n * Copyright(c) 2010-2017 Intel Corporation\n */\n+\n+#include <stdalign.h>\n #include <string.h>\n #include <stdio.h>\n \n@@ -79,7 +81,7 @@ struct rte_table_hash {\n \tuint32_t *stack;\n \n \t/* Lookup table */\n-\tuint8_t memory[0] __rte_cache_aligned;\n+\talignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0];\n };\n \n static int\ndiff --git a/lib/table/rte_table_hash_lru.c b/lib/table/rte_table_hash_lru.c\nindex cb4f329..8604a64 100644\n--- a/lib/table/rte_table_hash_lru.c\n+++ b/lib/table/rte_table_hash_lru.c\n@@ -2,6 +2,7 @@\n * Copyright(c) 2010-2017 Intel Corporation\n */\n \n+#include <stdalign.h>\n #include <string.h>\n #include <stdio.h>\n \n@@ -76,7 +77,7 @@ struct rte_table_hash {\n \tuint32_t *key_stack;\n \n \t/* Table memory */\n-\tuint8_t memory[0] __rte_cache_aligned;\n+\talignas(RTE_CACHE_LINE_SIZE) uint8_t memory[0];\n };\n \n static int\ndiff --git a/lib/table/rte_table_lpm.c b/lib/table/rte_table_lpm.c\nindex b9cff25..978d7e5 100644\n--- a/lib/table/rte_table_lpm.c\n+++ b/lib/table/rte_table_lpm.c\n@@ -2,6 +2,7 @@\n * Copyright(c) 2010-2014 Intel Corporation\n */\n \n+#include <stdalign.h>\n #include <string.h>\n #include <stdio.h>\n \n@@ -47,7 +48,7 @@ struct rte_table_lpm {\n \n \t/* Next Hop Table (NHT) */\n \tuint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS];\n-\tuint8_t nht[0] __rte_cache_aligned;\n+\talignas(RTE_CACHE_LINE_SIZE) uint8_t nht[0];\n };\n \n static void *\ndiff --git a/lib/table/rte_table_lpm_ipv6.c b/lib/table/rte_table_lpm_ipv6.c\nindex e4e823a..1d54f83 100644\n--- a/lib/table/rte_table_lpm_ipv6.c\n+++ b/lib/table/rte_table_lpm_ipv6.c\n@@ -2,6 +2,7 @@\n * Copyright(c) 2010-2014 Intel Corporation\n */\n \n+#include <stdalign.h>\n #include <string.h>\n #include <stdio.h>\n \n@@ -44,7 +45,7 @@ struct rte_table_lpm_ipv6 {\n \n \t/* Next Hop Table (NHT) */\n \tuint32_t nht_users[RTE_TABLE_LPM_MAX_NEXT_HOPS];\n-\tuint8_t nht[0] __rte_cache_aligned;\n+\talignas(RTE_CACHE_LINE_SIZE) uint8_t nht[0];\n };\n \n static void *\n", "prefixes": [ "v6", "17/39" ] }{ "id": 137254, "url": "