get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139091,
    "url": "http://patchwork.dpdk.org/api/patches/139091/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240403221319.499014-2-stephen@networkplumber.org/",
    "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": "<20240403221319.499014-2-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240403221319.499014-2-stephen@networkplumber.org",
    "date": "2024-04-03T22:11:07",
    "name": "[v2,1/2] eal: add functions to generate uuid values",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "dcb6482fffef4a5db512f0077072d214be8afcee",
    "submitter": {
        "id": 27,
        "url": "http://patchwork.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "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/20240403221319.499014-2-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 31674,
            "url": "http://patchwork.dpdk.org/api/series/31674/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31674",
            "date": "2024-04-03T22:11:06",
            "name": "uuid: add generate functions and tests",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/31674/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/139091/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/139091/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 9285D43DF1;\n\tThu,  4 Apr 2024 00:13:37 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 32059402EA;\n\tThu,  4 Apr 2024 00:13:34 +0200 (CEST)",
            "from mail-pj1-f52.google.com (mail-pj1-f52.google.com\n [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id A86404027B\n for <dev@dpdk.org>; Thu,  4 Apr 2024 00:13:31 +0200 (CEST)",
            "by mail-pj1-f52.google.com with SMTP id\n 98e67ed59e1d1-2a2d159e4ffso39854a91.1\n for <dev@dpdk.org>; Wed, 03 Apr 2024 15:13:31 -0700 (PDT)",
            "from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])\n by smtp.gmail.com with ESMTPSA id\n 1-20020a17090a0f0100b002a261d1da0dsm224218pjy.24.2024.04.03.15.13.30\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 03 Apr 2024 15:13:30 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1712182411;\n x=1712787211; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=Gc9056QOjuVYfhf4bhMSmsFklkfUlX/P5ar793xxAkA=;\n b=bCHBX8o+9oSWOvE2B9WIz4cJ5kfg1vJXt4hYdMp/ButYBFwIVfSVIX4urGyV04vxdY\n UHirR3pqv3NqBy3HOQUpmPS4qni9Uklgit8m7a6I6cME6hiZPoWzcK+shWCip0hz+hmS\n XZh2+BQ6ENH3lPZ5kHpqXLDOtrhiSpI4tDpJLGCbvsq0RU4iqsFjHfjEMTXgVSPjEpL5\n 8BeRcfTwVGrwDoiVQPkkCPDvYQqLPoqujWIePYEQs2j+bl8KdM1537wFbO3IribVWb69\n 9UDT/V5Yinfx1ZgaHM7txIxICRXW7B5yNJoRhTdHsCjl3Ms88DJgYZHV8+fVLI1tk+S5\n Zi7w==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1712182411; x=1712787211;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=Gc9056QOjuVYfhf4bhMSmsFklkfUlX/P5ar793xxAkA=;\n b=FLVi6p0ascVdhcG1ng+RcTOm2dOzdHDWQcVyKWyKIq/PBp0c0MeQyI1TRRkMitygrP\n EGXAgZ+2yZrjwXQRNHP8IGJZTKPO8bayAA6p6r0iq2jjIUv/6AYLMGNl+mUvjmEV5FBm\n mZdyWKcs9HC5Ih07fmZ/N51+4C0SgCEdGRhvRvnUnzDeKnxJNCgMX0HjY0rta4b21M3e\n 9LmcK+YEaIf/0AkAjGlQ1p31qU3/4Rh2P8A+a8xx4ynbqf7nBJbCxyvKqihUZOQP7hRS\n G8LwYjG8mtLAx9Ex3L2smGbw3vF3XKwRJybH5X1/Z5VjkHxGNdizMPZtScUICG7rSsj1\n 5VRg==",
        "X-Gm-Message-State": "AOJu0YyTNUYID0x1mb+WXpoB7BuIA2nsJdejUCheE/RerzaueJTRgRBw\n cuXYv7I9BxIs6FSVt+Pry1IDBo/3gWWkUmYLXLyMcKNuw/klc+waAc8z05h6zJEucDDLmAAZKeU\n XJAtMbQ==",
        "X-Google-Smtp-Source": "\n AGHT+IGoirssC7iClxVb+RifLd1NZhYoSAjDhtpsFuw56IT3JvxDTOg64PfajUqsmynbZt82kk6zjQ==",
        "X-Received": "by 2002:a17:90b:4c12:b0:2a2:7c53:7d1f with SMTP id\n na18-20020a17090b4c1200b002a27c537d1fmr5060241pjb.17.1712182410914;\n Wed, 03 Apr 2024 15:13:30 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Subject": "[PATCH v2 1/2] eal: add functions to generate uuid values",
        "Date": "Wed,  3 Apr 2024 15:11:07 -0700",
        "Message-ID": "<20240403221319.499014-2-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20240403221319.499014-1-stephen@networkplumber.org>",
        "References": "<20240403163432.437275-1-stephen@networkplumber.org>\n <20240403221319.499014-1-stephen@networkplumber.org>",
        "MIME-Version": "1.0",
        "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": "Useful to be able to generate uuid values for tests or\nfor interaction with other subsystems as magic cookie.\nNaming and overall algorithm come from libuuid which is used\nby permission of original author.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n lib/eal/common/eal_common_uuid.c | 56 ++++++++++++++++++++++++++++++++\n lib/eal/include/rte_uuid.h       | 22 ++++++++++++-\n lib/eal/version.map              |  2 ++\n 3 files changed, 79 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/eal/common/eal_common_uuid.c b/lib/eal/common/eal_common_uuid.c\nindex 0a80bfbb38..fc8f58e8a4 100644\n--- a/lib/eal/common/eal_common_uuid.c\n+++ b/lib/eal/common/eal_common_uuid.c\n@@ -7,7 +7,12 @@\n #include <stdint.h>\n #include <stdlib.h>\n #include <ctype.h>\n+#include <time.h>\n \n+#include <rte_atomic.h>\n+#include <rte_common.h>\n+#include <rte_random.h>\n+#include <rte_time.h>\n #include <rte_uuid.h>\n \n /* UUID packed form */\n@@ -165,3 +170,54 @@ void rte_uuid_unparse(const rte_uuid_t uu, char *out, size_t len)\n \t\tuuid.node[0], uuid.node[1], uuid.node[2],\n \t\tuuid.node[3], uuid.node[4], uuid.node[5]);\n }\n+\n+void rte_uuid_generate_random(rte_uuid_t out)\n+{\n+\tunion {\n+\t\tuint64_t words[2];\n+\t\trte_uuid_t uuid;\n+\t} buf;\n+\tstruct uuid uu;\n+\n+\t/* UUID is 128 bit */\n+\tbuf.words[0] = rte_rand();\n+\tbuf.words[1] = rte_rand();\n+\n+\t/* Mark these random bytes a version 4 random uuid */\n+\tuuid_unpack(buf.uuid, &uu);\n+\tuu.clock_seq = (uu.clock_seq & 0x3FFF) | 0x8000;\n+\tuu.time_hi_and_version = (uu.time_hi_and_version & 0x0FFF) | 0x4000;\n+\tuuid_pack(&uu, out);\n+}\n+\n+void rte_uuid_generate_time(rte_uuid_t out)\n+{\n+\tstruct uuid uu;\n+\tstruct timespec ts;\n+\tuint64_t ns, rnd;\n+\tstatic uint16_t sequence;\n+\n+\t/* The time value for UUID is 100ns since 15 October 1582 */\n+\tclock_gettime(CLOCK_REALTIME, &ts);\n+\n+\tns = ts.tv_nsec / 100;\n+\tns += (uint64_t) ts.tv_sec * (NSEC_PER_SEC / 100);\n+\tns += (((uint64_t) 0x01B21DD2) << 32) + 0x13814000;\n+\n+\tuu.time_low = (uint32_t) ns;\n+\tuu.time_mid = (uint16_t) (ns >> 32);\n+\tuu.time_hi_and_version = (uint16_t) (ns >> 48);\n+\tuu.time_hi_and_version = (uu.time_hi_and_version & 0x0FFF) | 0x4000;\n+\tuu.clock_seq = rte_atomic_fetch_add_explicit(&sequence, 1,\n+\t\t\t\t\t\t     rte_memory_order_relaxed);\n+\n+\trnd = rte_rand();\n+\tmemcpy(uu.node, &rnd, 6);\n+\t/*\n+\t * What libuuid does set multicast bit.\n+\t * This avoids conflicts with network cards.\n+\t */\n+\tuu.node[0] |= 0x1;\n+\n+\tuuid_pack(&uu, out);\n+}\ndiff --git a/lib/eal/include/rte_uuid.h b/lib/eal/include/rte_uuid.h\nindex cfefd4308a..052b78a812 100644\n--- a/lib/eal/include/rte_uuid.h\n+++ b/lib/eal/include/rte_uuid.h\n@@ -18,6 +18,8 @@ extern \"C\" {\n #include <stddef.h>\n #include <string.h>\n \n+#include <rte_compat.h>\n+\n /**\n  * Struct describing a Universal Unique Identifier\n  */\n@@ -94,12 +96,30 @@ int\trte_uuid_parse(const char *in, rte_uuid_t uu);\n  * @param uu\n  *    UUID to format\n  * @param out\n- *    Resulting string buffer\n+ *    Resulting string bufferm\n  * @param len\n  *    Sizeof the available string buffer\n  */\n void\trte_uuid_unparse(const rte_uuid_t uu, char *out, size_t len);\n \n+/**\n+ * Generate a random uuid\n+ *\n+ * @param uu\n+ *   Resulting UUID\n+ */\n+__rte_experimental\n+void   rte_uuid_generate_random(rte_uuid_t uu);\n+\n+/**\n+ * Generate a uuid based on time stamp.\n+ *\n+ * @param uu\n+ *   Resulting UUID\n+ */\n+__rte_experimental\n+void   rte_uuid_generate_time(rte_uuid_t uu);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/eal/version.map b/lib/eal/version.map\nindex 3df50c3fbb..5a8aa67244 100644\n--- a/lib/eal/version.map\n+++ b/lib/eal/version.map\n@@ -396,6 +396,8 @@ EXPERIMENTAL {\n \n \t# added in 24.03\n \trte_vfio_get_device_info; # WINDOWS_NO_EXPORT\n+\trte_uuid_generate_random;\n+\trte_uuid_generate_time;\n };\n \n INTERNAL {\n",
    "prefixes": [
        "v2",
        "1/2"
    ]
}