get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 138850,
    "url": "http://patchwork.dpdk.org/api/patches/138850/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240327091440.1166119-2-rjarry@redhat.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20240327091440.1166119-2-rjarry@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240327091440.1166119-2-rjarry@redhat.com",
    "date": "2024-03-27T09:14:41",
    "name": "[v5] graph: expose node context as pointers",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "1e9a596decc6edff1748b91ea26be1d7d5fdc2fd",
    "submitter": {
        "id": 2850,
        "url": "http://patchwork.dpdk.org/api/people/2850/?format=api",
        "name": "Robin Jarry",
        "email": "rjarry@redhat.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240327091440.1166119-2-rjarry@redhat.com/mbox/",
    "series": [
        {
            "id": 31626,
            "url": "http://patchwork.dpdk.org/api/series/31626/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31626",
            "date": "2024-03-27T09:14:41",
            "name": "[v5] graph: expose node context as pointers",
            "version": 5,
            "mbox": "http://patchwork.dpdk.org/series/31626/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/138850/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/138850/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 3164B43D66;\n\tWed, 27 Mar 2024 10:17:15 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 128BA410FD;\n\tWed, 27 Mar 2024 10:17:14 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by mails.dpdk.org (Postfix) with ESMTP id 0BDAB4029F\n for <dev@dpdk.org>; Wed, 27 Mar 2024 10:16:14 +0100 (CET)",
            "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-259-llpJsRWOMk2hhUQ9iw_CwQ-1; Wed, 27 Mar 2024 05:16:10 -0400",
            "from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com\n [10.11.54.9])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 22DEE185A784;\n Wed, 27 Mar 2024 09:16:09 +0000 (UTC)",
            "from ringo.redhat.com (unknown [10.39.208.34])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 5CD15492BC8;\n Wed, 27 Mar 2024 09:16:06 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1711530973;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=RyQg/VR/A9X3CWm/PkCJKLVGVPJw1dS0KgBrbAAodPg=;\n b=T5VTon/9kNa4bg4j0QmBglYmIOqfS+FN1nwd3gCEYKcEfaoe9vxR/Gi1AWO+dyvWhUD2gZ\n Syf+mbMWiS8Q8L034oWA0rl3FeiNcZBJ244TtP9IbgCsyCULzVwUhzTvA/o4jokRYbStoj\n aiRfzO95APKJZVdng/uk2pr4Bg0ZgEY=",
        "X-MC-Unique": "llpJsRWOMk2hhUQ9iw_CwQ-1",
        "From": "Robin Jarry <rjarry@redhat.com>",
        "To": "dev@dpdk.org, Jerin Jacob <jerinj@marvell.com>,\n Kiran Kumar K <kirankumark@marvell.com>,\n Nithin Dabilpuram <ndabilpuram@marvell.com>,\n Zhirun Yan <yanzhirun_163@163.com>",
        "Cc": "Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "Subject": "[PATCH v5] graph: expose node context as pointers",
        "Date": "Wed, 27 Mar 2024 10:14:41 +0100",
        "Message-ID": "<20240327091440.1166119-2-rjarry@redhat.com>",
        "In-Reply-To": "<20240325100500.694748-2-rjarry@redhat.com>",
        "References": "<20240325100500.694748-2-rjarry@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.11.54.9",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "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": "In some cases, the node context data is used to store two pointers\nbecause the data is larger than the reserved 16 bytes. Having to define\nintermediate structures just to be able to cast is tedious. And without\nintermediate structures, casting to opaque pointers is hard without\nviolating strict aliasing rules.\n\nAdd an unnamed union to allow storing opaque pointers in the node\ncontext. Unfortunately, aligning an unnamed union that contains an array\nproduces inconsistent results between C and C++. To preserve ABI/API\ncompatibility in both C and C++, move all fast-path area fields into an\nunnamed struct which is cache aligned. Use __rte_cache_min_aligned to\npreserve existing alignment on architectures where cache lines are 128\nbytes.\n\nAdd a static assert to ensure that the unnamed union is not larger than\nthe context array (RTE_NODE_CTX_SZ).\n\nSigned-off-by: Robin Jarry <rjarry@redhat.com>\n---\n\nNotes:\n    v5:\n    \n    * Helper functions to hide casting proved to be harder than expected.\n      Naive casting may even be impossible without breaking strict aliasing\n      rules. The only other option would be to use explicit memcpy calls.\n    * Unnamed union tentative again. As suggested by Tyler (thank you!),\n      using an intermediate unnamed struct to carry the alignment produces\n      consistent ABI in C and C++.\n    * Also, Tyler (thank you!) suggested that the fast path area alignment\n      size may be incorrect for architectures where the cache line is not 64\n      bytes. There will be a 64 bytes hole in the structure at the end of\n      the unnamed struct before the zero length next nodes array. Use\n      __rte_cache_min_aligned to preserve existing alignment.\n    \n    v4:\n    \n    * Replaced the unnamed union with helper inline functions.\n    \n    v3:\n    \n    * Added __extension__ to the unnamed struct inside the union.\n    * Fixed C++ header checks.\n    * Replaced alignas() with an explicit static_assert.\n\n lib/graph/rte_graph_worker_common.h | 27 ++++++++++++++++++++-------\n 1 file changed, 20 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/lib/graph/rte_graph_worker_common.h b/lib/graph/rte_graph_worker_common.h\nindex 36d864e2c14e..84d4997bbbf6 100644\n--- a/lib/graph/rte_graph_worker_common.h\n+++ b/lib/graph/rte_graph_worker_common.h\n@@ -12,7 +12,9 @@\n  * process, enqueue and move streams of objects to the next nodes.\n  */\n \n+#include <assert.h>\n #include <stdalign.h>\n+#include <stddef.h>\n \n #include <rte_common.h>\n #include <rte_cycles.h>\n@@ -111,14 +113,21 @@ struct __rte_cache_aligned rte_node {\n \t\t} dispatch;\n \t};\n \t/* Fast path area  */\n+\t__extension__ struct __rte_cache_min_aligned {\n #define RTE_NODE_CTX_SZ 16\n-\talignas(RTE_CACHE_LINE_SIZE) uint8_t ctx[RTE_NODE_CTX_SZ]; /**< Node Context. */\n-\tuint16_t size;\t\t/**< Total number of objects available. */\n-\tuint16_t idx;\t\t/**< Number of objects used. */\n-\trte_graph_off_t off;\t/**< Offset of node in the graph reel. */\n-\tuint64_t total_cycles;\t/**< Cycles spent in this node. */\n-\tuint64_t total_calls;\t/**< Calls done to this node. */\n-\tuint64_t total_objs;\t/**< Objects processed by this node. */\n+\t\tunion {\n+\t\t\tuint8_t ctx[RTE_NODE_CTX_SZ];\n+\t\t\t__extension__ struct {\n+\t\t\t\tvoid *ctx_ptr;\n+\t\t\t\tvoid *ctx_ptr2;\n+\t\t\t};\n+\t\t}; /**< Node Context. */\n+\t\tuint16_t size;\t\t/**< Total number of objects available. */\n+\t\tuint16_t idx;\t\t/**< Number of objects used. */\n+\t\trte_graph_off_t off;\t/**< Offset of node in the graph reel. */\n+\t\tuint64_t total_cycles;\t/**< Cycles spent in this node. */\n+\t\tuint64_t total_calls;\t/**< Calls done to this node. */\n+\t\tuint64_t total_objs;\t/**< Objects processed by this node. */\n \t\tunion {\n \t\t\tvoid **objs;\t   /**< Array of object pointers. */\n \t\t\tuint64_t objs_u64;\n@@ -127,9 +136,13 @@ struct __rte_cache_aligned rte_node {\n \t\t\trte_node_process_t process; /**< Process function. */\n \t\t\tuint64_t process_u64;\n \t\t};\n+\t};\n \talignas(RTE_CACHE_LINE_MIN_SIZE) struct rte_node *nodes[]; /**< Next nodes. */\n };\n \n+static_assert(offsetof(struct rte_node, size) - offsetof(struct rte_node, ctx) == RTE_NODE_CTX_SZ,\n+\t\"rte_node context must be RTE_NODE_CTX_SZ bytes exactly\");\n+\n /**\n  * @internal\n  *\n",
    "prefixes": [
        "v5"
    ]
}