get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2220549,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2220549/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/b1f786b4fa5736d9bf549bac8252ae0d86c8857d.1775568640.git.tredaelli@redhat.com/",
    "project": {
        "id": 47,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/47/?format=api",
        "name": "Open vSwitch",
        "link_name": "openvswitch",
        "list_id": "ovs-dev.openvswitch.org",
        "list_email": "ovs-dev@openvswitch.org",
        "web_url": "http://openvswitch.org/",
        "scm_url": "git@github.com:openvswitch/ovs.git",
        "webscm_url": "https://github.com/openvswitch/ovs"
    },
    "msgid": "<b1f786b4fa5736d9bf549bac8252ae0d86c8857d.1775568640.git.tredaelli@redhat.com>",
    "date": "2026-04-07T13:34:30",
    "name": "[ovs-dev,v2,3/5] dpif-netdev: Add JSON output to pmd-sleep-show.",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "be3cdf530f28d1cf1c17d86ffa44e5572b94d1ab",
    "submitter": {
        "id": 70949,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/70949/?format=api",
        "name": "Timothy Redaelli",
        "email": "tredaelli@redhat.com"
    },
    "delegate": {
        "id": 75123,
        "url": "http://patchwork.ozlabs.org/api/1.1/users/75123/?format=api",
        "username": "echaudron",
        "first_name": "Eelco",
        "last_name": "Chaudron",
        "email": "echaudro@redhat.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/b1f786b4fa5736d9bf549bac8252ae0d86c8857d.1775568640.git.tredaelli@redhat.com/mbox/",
    "series": [
        {
            "id": 498985,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/498985/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=498985",
            "date": "2026-04-07T13:34:24",
            "name": "Add JSON output to several ovs-appctl commands",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/498985/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2220549/comments/",
    "check": "fail",
    "checks": "http://patchwork.ozlabs.org/api/patches/2220549/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<ovs-dev-bounces@openvswitch.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "dev@openvswitch.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "ovs-dev@lists.linuxfoundation.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=BOMxpZ16;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org)",
            "smtp2.osuosl.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key)\n header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=BOMxpZ16",
            "smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com"
        ],
        "Received": [
            "from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fqnJq3T1Gz1xy1\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 07 Apr 2026 23:35:53 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp2.osuosl.org (Postfix) with ESMTP id DB8A440658;\n\tTue,  7 Apr 2026 13:35:51 +0000 (UTC)",
            "from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id zA4NcnBLFJSW; Tue,  7 Apr 2026 13:35:51 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp2.osuosl.org (Postfix) with ESMTPS id EEDF540624;\n\tTue,  7 Apr 2026 13:35:50 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id D8B5FC04FB;\n\tTue,  7 Apr 2026 13:35:50 +0000 (UTC)",
            "from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 4BE48C04FB\n for <dev@openvswitch.org>; Tue,  7 Apr 2026 13:35:49 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id 90DF240643\n for <dev@openvswitch.org>; Tue,  7 Apr 2026 13:35:34 +0000 (UTC)",
            "from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id ioPbNy1vC1s3 for <dev@openvswitch.org>;\n Tue,  7 Apr 2026 13:35:33 +0000 (UTC)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by smtp2.osuosl.org (Postfix) with ESMTPS id 87F4240654\n for <dev@openvswitch.org>; Tue,  7 Apr 2026 13:35:33 +0000 (UTC)",
            "from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-369-h0TYXp8EMbiCmJY_F9cC_w-1; Tue,\n 07 Apr 2026 09:35:29 -0400",
            "from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])\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 mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 3BC4D18005B2; Tue,  7 Apr 2026 13:35:28 +0000 (UTC)",
            "from aldebaran.char-dominant.ts.net (unknown [10.44.34.48])\n by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 0083A1955BCC; Tue,  7 Apr 2026 13:35:26 +0000 (UTC)"
        ],
        "X-Virus-Scanned": [
            "amavis at osuosl.org",
            "amavis at osuosl.org"
        ],
        "X-Comment": "SPF check N/A for local connections - client-ip=140.211.9.56;\n helo=lists.linuxfoundation.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> ",
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 smtp2.osuosl.org EEDF540624",
            "OpenDKIM Filter v2.11.0 smtp2.osuosl.org 87F4240654"
        ],
        "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124;\n helo=us-smtp-delivery-124.mimecast.com; envelope-from=tredaelli@redhat.com;\n receiver=<UNKNOWN>",
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp2.osuosl.org 87F4240654",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775568932;\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=XweFcPn6jYf9vi1mWfpg0W4v1wiumKf5xPm0il8E0vM=;\n b=BOMxpZ169/JkAEOvvbqdqbgf0wPiiBYMnS+1vdvvFD2EynN/qM8lHMPaolPIYvGTEiJw45\n j9b8bxvtB0vVtLsW+d1xwIqB5vb+/w/K2D3A8V2GS64US7wkOQE/NqZZ8B/VaZ47+C7v8Q\n SKg3xmLgoRDr9M1Uvbg8yFY0FiiQ/qY=",
        "X-MC-Unique": "h0TYXp8EMbiCmJY_F9cC_w-1",
        "X-Mimecast-MFC-AGG-ID": "h0TYXp8EMbiCmJY_F9cC_w_1775568928",
        "To": "dev@openvswitch.org",
        "Date": "Tue,  7 Apr 2026 15:34:30 +0200",
        "Message-ID": "\n <b1f786b4fa5736d9bf549bac8252ae0d86c8857d.1775568640.git.tredaelli@redhat.com>",
        "In-Reply-To": "<cover.1775568640.git.tredaelli@redhat.com>",
        "References": "<cover.1775568640.git.tredaelli@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.12",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "VE9Et4l0iNDTiy7TwCMEdKHGFwYkkX-2k3z8LcFMqPo_1775568928",
        "X-Mimecast-Originator": "redhat.com",
        "Subject": "[ovs-dev] [PATCH v2 3/5] dpif-netdev: Add JSON output to\n pmd-sleep-show.",
        "X-BeenThere": "ovs-dev@openvswitch.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "<ovs-dev.openvswitch.org>",
        "List-Unsubscribe": "<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>",
        "List-Archive": "<http://mail.openvswitch.org/pipermail/ovs-dev/>",
        "List-Post": "<mailto:ovs-dev@openvswitch.org>",
        "List-Help": "<mailto:ovs-dev-request@openvswitch.org?subject=help>",
        "List-Subscribe": "<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=subscribe>",
        "From": "Timothy Redaelli via dev <ovs-dev@openvswitch.org>",
        "Reply-To": "Timothy Redaelli <tredaelli@redhat.com>",
        "Cc": "i.maximets@ovn.org",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "ovs-dev-bounces@openvswitch.org",
        "Sender": "\"dev\" <ovs-dev-bounces@openvswitch.org>"
    },
    "content": "When --format json is passed to ovs-appctl, pmd-sleep-show returns a\nJSON object with \"default-max-sleep-us\" and a \"threads\" object.  Each\nthread is keyed by a stable identifier (\"pmd-cNN\" derived from the core\nID) and contains \"core\", \"max-sleep-us\", and \"numa\" fields.\n\nThe \"pmd-cNN\" key format is chosen over the full thread name\n(\"pmd-cNN/id:XXX\") because the thread ID suffix is dynamic and would\nmake the key unstable across restarts.\n\nThe implementation is split into separate text and JSON helper functions.\n\nExample output:\n  {\"default-max-sleep-us\": 100,\n   \"threads\": {\"pmd-c03\": {\"core\": 3, \"max-sleep-us\": 100,\n                            \"numa\": 1}}}\n\nSigned-off-by: Timothy Redaelli <tredaelli@redhat.com>\n---\n lib/dpif-netdev.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++\n tests/pmd.at      | 19 +++++++++++++++++++\n 2 files changed, 67 insertions(+)",
    "diff": "diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c\nindex 9df05c4c2..32e1dc938 100644\n--- a/lib/dpif-netdev.c\n+++ b/lib/dpif-netdev.c\n@@ -65,6 +65,7 @@\n #include \"odp-execute.h\"\n #include \"odp-util.h\"\n #include \"openvswitch/dynamic-string.h\"\n+#include \"openvswitch/json.h\"\n #include \"openvswitch/list.h\"\n #include \"openvswitch/match.h\"\n #include \"openvswitch/ofp-parse.h\"\n@@ -1353,6 +1354,41 @@ dpif_netdev_pmd_rebalance(struct unixctl_conn *conn, int argc,\n     ds_destroy(&reply);\n }\n \n+static struct json *\n+pmd_info_sleep_show_json(struct dp_netdev *dp,\n+                         struct dp_netdev_pmd_thread **pmd_list, size_t n)\n+{\n+    struct json *json_result = json_object_create();\n+    struct json *json_threads = json_object_create();\n+\n+    json_object_put(json_result, \"default-max-sleep-us\",\n+                    json_integer_create(dp->pmd_max_sleep_default));\n+\n+    for (size_t i = 0; i < n; i++) {\n+        struct dp_netdev_pmd_thread *pmd = pmd_list[i];\n+        uint64_t max_sleep;\n+\n+        if (!pmd || pmd->core_id == NON_PMD_CORE_ID) {\n+            continue;\n+        }\n+\n+        struct json *json_pmd = json_object_create();\n+        char *key = xasprintf(\"pmd-c%02u\", pmd->core_id);\n+\n+        atomic_read_relaxed(&pmd->max_sleep, &max_sleep);\n+        json_object_put(json_pmd, \"core\",\n+                        json_integer_create(pmd->core_id));\n+        json_object_put(json_pmd, \"max-sleep-us\",\n+                        json_integer_create(max_sleep));\n+        json_object_put(json_pmd, \"numa\",\n+                        json_integer_create(pmd->numa_id));\n+        json_object_put_nocopy(json_threads, key, json_pmd);\n+    }\n+\n+    json_object_put(json_result, \"threads\", json_threads);\n+    return json_result;\n+}\n+\n static void\n pmd_info_show_sleep(struct ds *reply, unsigned core_id, int numa_id,\n                     uint64_t pmd_max_sleep)\n@@ -1420,6 +1456,18 @@ dpif_netdev_pmd_info(struct unixctl_conn *conn, int argc, const char *argv[],\n     }\n \n     sorted_poll_thread_list(dp, &pmd_list, &n);\n+\n+    if (type == PMD_INFO_SLEEP_SHOW\n+        && unixctl_command_get_output_format(conn)\n+               == UNIXCTL_OUTPUT_FMT_JSON) {\n+        struct json *json_result = pmd_info_sleep_show_json(dp, pmd_list, n);\n+        free(pmd_list);\n+        ovs_mutex_unlock(&dp_netdev_mutex);\n+        unixctl_command_reply_json(conn, json_result);\n+        ds_destroy(&reply);\n+        return;\n+    }\n+\n     for (size_t i = 0; i < n; i++) {\n         struct dp_netdev_pmd_thread *pmd = pmd_list[i];\n         if (!pmd) {\ndiff --git a/tests/pmd.at b/tests/pmd.at\nindex 8254ac3b0..702c9b950 100644\n--- a/tests/pmd.at\n+++ b/tests/pmd.at\n@@ -1303,6 +1303,25 @@ pmd thread numa_id 8 core_id 5:\n   max sleep:    1 us\n ])\n \n+dnl Check JSON output.\n+AT_CHECK([ovs-appctl --format json --pretty dpif-netdev/pmd-sleep-show], [0], [dnl\n+{\n+  \"default-max-sleep-us\": 1,\n+  \"threads\": {\n+    \"pmd-c00\": {\n+      \"core\": 0,\n+      \"max-sleep-us\": 1,\n+      \"numa\": 0},\n+    \"pmd-c03\": {\n+      \"core\": 3,\n+      \"max-sleep-us\": 1,\n+      \"numa\": 1},\n+    \"pmd-c05\": {\n+      \"core\": 5,\n+      \"max-sleep-us\": 1,\n+      \"numa\": 8}}}\n+])\n+\n dnl Check high value max sleep\n get_log_next_line_num\n AT_CHECK([ovs-vsctl set open_vswitch . other_config:pmd-sleep-max=\"10000\"])\n",
    "prefixes": [
        "ovs-dev",
        "v2",
        "3/5"
    ]
}