Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/136745/?format=api
http://patches.dpdk.org/api/patches/136745/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1707894382-307-28-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": "<1707894382-307-28-git-send-email-roretzla@linux.microsoft.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1707894382-307-28-git-send-email-roretzla@linux.microsoft.com", "date": "2024-02-14T07:06:10", "name": "[v3,27/39] mempool: use C11 alignas", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "6cdd9e0f61793c513729faa7c772c6a5e11a2a33", "submitter": { "id": 2077, "url": "http://patches.dpdk.org/api/people/2077/?format=api", "name": "Tyler Retzlaff", "email": "roretzla@linux.microsoft.com" }, "delegate": { "id": 24651, "url": "http://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1707894382-307-28-git-send-email-roretzla@linux.microsoft.com/mbox/", "series": [ { "id": 31102, "url": "http://patches.dpdk.org/api/series/31102/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31102", "date": "2024-02-14T07:05:44", "name": "use C11 alignas and normalize type alignment", "version": 3, "mbox": "http://patches.dpdk.org/series/31102/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/136745/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/136745/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 0B62143B27;\n\tWed, 14 Feb 2024 08:10:59 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B5E6D43338;\n\tWed, 14 Feb 2024 08:07:15 +0100 (CET)", "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 9223542FB7\n for <dev@dpdk.org>; Wed, 14 Feb 2024 08:06:27 +0100 (CET)", "by linux.microsoft.com (Postfix, from userid 1086)\n id B252120B201B; Tue, 13 Feb 2024 23:06:24 -0800 (PST)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com B252120B201B", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1707894385;\n bh=3m+F3vPz+DLSvcp982KEeXzetXO3X09CjX1z9EBWlUQ=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=gGO/WgK4DYMjqUxDn5bSc/YckxsRsBurvfiS/hn8oIVywMPqHDLnYDVrsWYIh9ONd\n h2Ms4LBr/VE3A/cu68hM44AxAhRlTDj8ZcDeyQt3b6FwZj9R2sOKE8SpgkJ274ZAQb\n rFQ+Ov0zr92rpCR3R+eSQid3GVqRXjuQ3J3WNjuI=", "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 v3 27/39] mempool: use C11 alignas", "Date": "Tue, 13 Feb 2024 23:06:10 -0800", "Message-Id": "<1707894382-307-28-git-send-email-roretzla@linux.microsoft.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1707894382-307-1-git-send-email-roretzla@linux.microsoft.com>", "References": "<1707873986-29352-1-git-send-email-roretzla@linux.microsoft.com>\n <1707894382-307-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>,\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": "* 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>\n---\n lib/mempool/rte_mempool.h | 27 ++++++++++++++-------------\n 1 file changed, 14 insertions(+), 13 deletions(-)", "diff": "diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h\nindex 6fa4d48..23fd5c8 100644\n--- a/lib/mempool/rte_mempool.h\n+++ b/lib/mempool/rte_mempool.h\n@@ -34,6 +34,7 @@\n * user cache created with rte_mempool_cache_create().\n */\n \n+#include <stdalign.h>\n #include <stdio.h>\n #include <stdint.h>\n #include <inttypes.h>\n@@ -66,7 +67,7 @@\n * captured since they can be calculated from other stats.\n * For example: put_cache_objs = put_objs - put_common_pool_objs.\n */\n-struct rte_mempool_debug_stats {\n+struct __rte_cache_aligned rte_mempool_debug_stats {\n \tuint64_t put_bulk; /**< Number of puts. */\n \tuint64_t put_objs; /**< Number of objects successfully put. */\n \tuint64_t put_common_pool_bulk; /**< Number of bulks enqueued in common pool. */\n@@ -80,13 +81,13 @@ struct rte_mempool_debug_stats {\n \tuint64_t get_success_blks; /**< Successful allocation number of contiguous blocks. */\n \tuint64_t get_fail_blks; /**< Failed allocation number of contiguous blocks. */\n \tRTE_CACHE_GUARD;\n-} __rte_cache_aligned;\n+};\n #endif\n \n /**\n * A structure that stores a per-core object cache.\n */\n-struct rte_mempool_cache {\n+struct __rte_cache_aligned rte_mempool_cache {\n \tuint32_t size;\t /**< Size of the cache */\n \tuint32_t flushthresh; /**< Threshold before we flush excess elements */\n \tuint32_t len;\t /**< Current cache count */\n@@ -109,8 +110,8 @@ struct rte_mempool_cache {\n \t * Cache is allocated to this size to allow it to overflow in certain\n \t * cases to avoid needless emptying of cache.\n \t */\n-\tvoid *objs[RTE_MEMPOOL_CACHE_MAX_SIZE * 2] __rte_cache_aligned;\n-} __rte_cache_aligned;\n+\talignas(RTE_CACHE_LINE_SIZE) void *objs[RTE_MEMPOOL_CACHE_MAX_SIZE * 2];\n+};\n \n /**\n * A structure that stores the size of mempool elements.\n@@ -218,15 +219,15 @@ struct rte_mempool_memhdr {\n * The structure is cache-line aligned to avoid ABI breakages in\n * a number of cases when something small is added.\n */\n-struct rte_mempool_info {\n+struct __rte_cache_aligned rte_mempool_info {\n \t/** Number of objects in the contiguous block */\n \tunsigned int contig_block_size;\n-} __rte_cache_aligned;\n+};\n \n /**\n * The RTE mempool structure.\n */\n-struct rte_mempool {\n+struct __rte_cache_aligned rte_mempool {\n \tchar name[RTE_MEMPOOL_NAMESIZE]; /**< Name of mempool. */\n \tunion {\n \t\tvoid *pool_data; /**< Ring or pool to store objects. */\n@@ -268,7 +269,7 @@ struct rte_mempool {\n \t */\n \tstruct rte_mempool_debug_stats stats[RTE_MAX_LCORE + 1];\n #endif\n-} __rte_cache_aligned;\n+};\n \n /** Spreading among memory channels not required. */\n #define RTE_MEMPOOL_F_NO_SPREAD\t\t0x0001\n@@ -688,7 +689,7 @@ typedef int (*rte_mempool_get_info_t)(const struct rte_mempool *mp,\n \n \n /** Structure defining mempool operations structure */\n-struct rte_mempool_ops {\n+struct __rte_cache_aligned rte_mempool_ops {\n \tchar name[RTE_MEMPOOL_OPS_NAMESIZE]; /**< Name of mempool ops struct. */\n \trte_mempool_alloc_t alloc; /**< Allocate private data. */\n \trte_mempool_free_t free; /**< Free the external pool. */\n@@ -713,7 +714,7 @@ struct rte_mempool_ops {\n \t * Dequeue a number of contiguous object blocks.\n \t */\n \trte_mempool_dequeue_contig_blocks_t dequeue_contig_blocks;\n-} __rte_cache_aligned;\n+};\n \n #define RTE_MEMPOOL_MAX_OPS_IDX 16 /**< Max registered ops structs */\n \n@@ -726,14 +727,14 @@ struct rte_mempool_ops {\n * any function pointers stored directly in the mempool struct would not be.\n * This results in us simply having \"ops_index\" in the mempool struct.\n */\n-struct rte_mempool_ops_table {\n+struct __rte_cache_aligned rte_mempool_ops_table {\n \trte_spinlock_t sl; /**< Spinlock for add/delete. */\n \tuint32_t num_ops; /**< Number of used ops structs in the table. */\n \t/**\n \t * Storage for all possible ops structs.\n \t */\n \tstruct rte_mempool_ops ops[RTE_MEMPOOL_MAX_OPS_IDX];\n-} __rte_cache_aligned;\n+};\n \n /** Array of registered ops structs. */\n extern struct rte_mempool_ops_table rte_mempool_ops_table;\n", "prefixes": [ "v3", "27/39" ] }{ "id": 136745, "url": "