get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/137131/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 137131,
    "url": "http://patches.dpdk.org/api/patches/137131/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1708715054-22386-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": "<1708715054-22386-28-git-send-email-roretzla@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1708715054-22386-28-git-send-email-roretzla@linux.microsoft.com",
    "date": "2024-02-23T19:04:02",
    "name": "[v5,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": 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/1708715054-22386-28-git-send-email-roretzla@linux.microsoft.com/mbox/",
    "series": [
        {
            "id": 31207,
            "url": "http://patches.dpdk.org/api/series/31207/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31207",
            "date": "2024-02-23T19:03:37",
            "name": "use C11 alignas",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/31207/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/137131/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/137131/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 9348143BA4;\n\tFri, 23 Feb 2024 20:07:02 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5BB0E42DE7;\n\tFri, 23 Feb 2024 20:04:49 +0100 (CET)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 1CEF84068A\n for <dev@dpdk.org>; Fri, 23 Feb 2024 20:04:19 +0100 (CET)",
            "by linux.microsoft.com (Postfix, from userid 1086)\n id A22B220B74DB; Fri, 23 Feb 2024 11:04:16 -0800 (PST)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com A22B220B74DB",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1708715057;\n bh=GnrZsgcLonOTrf0c7osnympUTbM2ZjPc8uiywB6qd20=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=K+y0f2HtE1OaTCqodM8PiaJdCMZro5FgO3CIsJH3RqsB4n4DJYBQU7yRZpEHTfdv8\n p7gNigsSdz8XQnIdWXFk/NUPisIzQDGCj105BMhSvr+nxeFg/VZxB/H7282sAT8O4M\n W6dj9zAJ5HGG9QK5u5x8HTnV4y9d9VbaAGROG/7I=",
        "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 v5 27/39] mempool: use C11 alignas",
        "Date": "Fri, 23 Feb 2024 11:04:02 -0800",
        "Message-Id": "<1708715054-22386-28-git-send-email-roretzla@linux.microsoft.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1708715054-22386-1-git-send-email-roretzla@linux.microsoft.com>",
        "References": "<1707873986-29352-1-git-send-email-roretzla@linux.microsoft.com>\n <1708715054-22386-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/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": [
        "v5",
        "27/39"
    ]
}