get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 137244,
    "url": "http://patches.dpdk.org/api/patches/137244/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1708971946-18231-10-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-10-git-send-email-roretzla@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1708971946-18231-10-git-send-email-roretzla@linux.microsoft.com",
    "date": "2024-02-26T18:25:16",
    "name": "[v6,09/39] hash: use C11 alignas",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8191e3893599a8bb19a2381a9d265cda6122f068",
    "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-10-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/137244/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/137244/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 52D6B43B7E;\n\tMon, 26 Feb 2024 19:26:46 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A0F3A42E80;\n\tMon, 26 Feb 2024 19:26:12 +0100 (CET)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 10CC642E28\n for <dev@dpdk.org>; Mon, 26 Feb 2024 19:25:50 +0100 (CET)",
            "by linux.microsoft.com (Postfix, from userid 1086)\n id C230A20B74C9; Mon, 26 Feb 2024 10:25:48 -0800 (PST)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com C230A20B74C9",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1708971948;\n bh=6PLD4GJPCJtO9J9OJHEwAB5lPUfUbsGzbxCNysXZp7k=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=EiwHMCntbid1ZBCq4Fb9k2WpPnwxeweYJqSrzYyUieBkghsPz+H7Fv3exJGcZoN+Y\n lLg7TqnCmXIrtNVIjgB+1eYeJYJpHVetmEg9axwb+uJfpvb+X6i3q/HycLCbX/aZTS\n sBiWFsz1fBUeY1O8jSWqyXyCMvpApbnClDIAJvxs=",
        "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 09/39] hash: use C11 alignas",
        "Date": "Mon, 26 Feb 2024 10:25:16 -0800",
        "Message-Id": "<1708971946-18231-10-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/hash/rte_cuckoo_hash.h | 16 +++++++++-------\n lib/hash/rte_thash.c       |  4 +++-\n lib/hash/rte_thash.h       |  8 ++++----\n 3 files changed, 16 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h\nindex 8ea793c..a528f1d 100644\n--- a/lib/hash/rte_cuckoo_hash.h\n+++ b/lib/hash/rte_cuckoo_hash.h\n@@ -11,6 +11,8 @@\n #ifndef _RTE_CUCKOO_HASH_H_\n #define _RTE_CUCKOO_HASH_H_\n \n+#include <stdalign.h>\n+\n #if defined(RTE_ARCH_X86)\n #include \"rte_cmp_x86.h\"\n #endif\n@@ -117,10 +119,10 @@ enum cmp_jump_table_case {\n \n #define RTE_HASH_TSX_MAX_RETRY  10\n \n-struct lcore_cache {\n+struct __rte_cache_aligned lcore_cache {\n \tunsigned len; /**< Cache len */\n \tuint32_t objs[LCORE_CACHE_SIZE]; /**< Cache objects */\n-} __rte_cache_aligned;\n+};\n \n /* Structure that stores key-value pair */\n struct rte_hash_key {\n@@ -141,7 +143,7 @@ enum rte_hash_sig_compare_function {\n };\n \n /** Bucket structure */\n-struct rte_hash_bucket {\n+struct __rte_cache_aligned rte_hash_bucket {\n \tuint16_t sig_current[RTE_HASH_BUCKET_ENTRIES];\n \n \tRTE_ATOMIC(uint32_t) key_idx[RTE_HASH_BUCKET_ENTRIES];\n@@ -149,10 +151,10 @@ struct rte_hash_bucket {\n \tuint8_t flag[RTE_HASH_BUCKET_ENTRIES];\n \n \tvoid *next;\n-} __rte_cache_aligned;\n+};\n \n /** A hash table structure. */\n-struct rte_hash {\n+struct __rte_cache_aligned rte_hash {\n \tchar name[RTE_HASH_NAMESIZE];   /**< Name of the hash. */\n \tuint32_t entries;               /**< Total table entries. */\n \tuint32_t num_buckets;           /**< Number of buckets in table. */\n@@ -170,7 +172,7 @@ struct rte_hash {\n \n \t/* Fields used in lookup */\n \n-\tuint32_t key_len __rte_cache_aligned;\n+\talignas(RTE_CACHE_LINE_SIZE) uint32_t key_len;\n \t/**< Length of hash key. */\n \tuint8_t hw_trans_mem_support;\n \t/**< If hardware transactional memory is used. */\n@@ -220,7 +222,7 @@ struct rte_hash {\n \tuint32_t *ext_bkt_to_free;\n \tRTE_ATOMIC(uint32_t) *tbl_chng_cnt;\n \t/**< Indicates if the hash table changed from last read. */\n-} __rte_cache_aligned;\n+};\n \n struct queue_node {\n \tstruct rte_hash_bucket *bkt; /* Current bucket on the bfs search */\ndiff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c\nindex e8de071..6464fd3 100644\n--- a/lib/hash/rte_thash.c\n+++ b/lib/hash/rte_thash.c\n@@ -2,6 +2,8 @@\n  * Copyright(c) 2021 Intel Corporation\n  */\n \n+#include <stdalign.h>\n+\n #include <sys/queue.h>\n \n #include <rte_thash.h>\n@@ -80,7 +82,7 @@ struct rte_thash_subtuple_helper {\n \tuint32_t\ttuple_offset;\t/** < Offset in bits of the subtuple */\n \tuint32_t\ttuple_len;\t/** < Length in bits of the subtuple */\n \tuint32_t\tlsb_msk;\t/** < (1 << reta_sz_log) - 1 */\n-\t__extension__ uint32_t\tcompl_table[0] __rte_cache_aligned;\n+\t__extension__ alignas(RTE_CACHE_LINE_SIZE) uint32_t\tcompl_table[0];\n \t/** < Complementary table */\n };\n \ndiff --git a/lib/hash/rte_thash.h b/lib/hash/rte_thash.h\nindex 2681b1b..30b657e 100644\n--- a/lib/hash/rte_thash.h\n+++ b/lib/hash/rte_thash.h\n@@ -99,14 +99,14 @@ struct rte_ipv6_tuple {\n \t};\n };\n \n+#ifdef RTE_ARCH_X86\n+union __rte_aligned(XMM_SIZE) rte_thash_tuple {\n+#else\n union rte_thash_tuple {\n+#endif\n \tstruct rte_ipv4_tuple\tv4;\n \tstruct rte_ipv6_tuple\tv6;\n-#ifdef RTE_ARCH_X86\n-} __rte_aligned(XMM_SIZE);\n-#else\n };\n-#endif\n \n /**\n  * Prepare special converted key to use with rte_softrss_be()\n",
    "prefixes": [
        "v6",
        "09/39"
    ]
}