get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 126471,
    "url": "http://patches.dpdk.org/api/patches/126471/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230424130208.9517-3-fengchengwen@huawei.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": "<20230424130208.9517-3-fengchengwen@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230424130208.9517-3-fengchengwen@huawei.com",
    "date": "2023-04-24T13:02:07",
    "name": "[RFC,2/3] examples/coroutine: support coroutine examples",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "25b505d26f59f18b55c25b50047dd8df6800675c",
    "submitter": {
        "id": 2146,
        "url": "http://patches.dpdk.org/api/people/2146/?format=api",
        "name": "fengchengwen",
        "email": "fengchengwen@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230424130208.9517-3-fengchengwen@huawei.com/mbox/",
    "series": [
        {
            "id": 27847,
            "url": "http://patches.dpdk.org/api/series/27847/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27847",
            "date": "2023-04-24T13:02:05",
            "name": "introduce coroutine library",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/27847/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/126471/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/126471/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 425F4429DB;\n\tMon, 24 Apr 2023 15:09:19 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id EFBB042B8E;\n\tMon, 24 Apr 2023 15:09:15 +0200 (CEST)",
            "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id A7671410D0\n for <dev@dpdk.org>; Mon, 24 Apr 2023 15:09:13 +0200 (CEST)",
            "from dggpeml500024.china.huawei.com (unknown [172.30.72.57])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Q4ljY29LxzncKN;\n Mon, 24 Apr 2023 21:05:21 +0800 (CST)",
            "from localhost.localdomain (10.50.163.32) by\n dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2507.23; Mon, 24 Apr 2023 21:09:11 +0800"
        ],
        "From": "Chengwen Feng <fengchengwen@huawei.com>",
        "To": "<thomas@monjalon.net>, <ferruh.yigit@amd.com>",
        "CC": "<dev@dpdk.org>",
        "Subject": "[RFC 2/3] examples/coroutine: support coroutine examples",
        "Date": "Mon, 24 Apr 2023 13:02:07 +0000",
        "Message-ID": "<20230424130208.9517-3-fengchengwen@huawei.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20230424130208.9517-1-fengchengwen@huawei.com>",
        "References": "<20230424130208.9517-1-fengchengwen@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.50.163.32]",
        "X-ClientProxiedBy": "dggems706-chm.china.huawei.com (10.3.19.183) To\n dggpeml500024.china.huawei.com (7.185.36.10)",
        "X-CFilter-Loop": "Reflected",
        "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": "This patch adds coroutine example, usage:\n1. start examples: dpdk-coroutine -a 0000:7d:00.2  -l 10-11\n2. will output:\nStart yield coroutine test!\n\tI am in yield coroutine 111!\n\tI am in yield coroutine 222!\n\tI am in yield coroutine 333!\n\tI am in yield coroutine 111!\n\tI am in yield coroutine 222!\n\tI am in yield coroutine 333!\n...\nStart delay coroutine test!\n\tI am in delay coroutine 111!\n\tI am in delay coroutine 222!\n\tI am in delay coroutine 222!\n\tI am in delay coroutine 111!\n\tI am in delay coroutine 222!\n\tI am in delay coroutine 222!\n...\n3. use ctrl+c to exit example.\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\n---\n examples/coroutine/main.c      | 153 +++++++++++++++++++++++++++++++++\n examples/coroutine/meson.build |  10 +++\n examples/meson.build           |   1 +\n 3 files changed, 164 insertions(+)\n create mode 100644 examples/coroutine/main.c\n create mode 100644 examples/coroutine/meson.build",
    "diff": "diff --git a/examples/coroutine/main.c b/examples/coroutine/main.c\nnew file mode 100644\nindex 0000000000..2704ad1dc9\n--- /dev/null\n+++ b/examples/coroutine/main.c\n@@ -0,0 +1,153 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2023 HiSilicon Limited\n+ */\n+\n+#include <stdint.h>\n+#include <stdlib.h>\n+#include <getopt.h>\n+#include <signal.h>\n+#include <stdbool.h>\n+#include <unistd.h>\n+\n+#include <rte_common.h>\n+#include <rte_coroutine.h>\n+#include <rte_lcore.h>\n+#include <rte_launch.h>\n+\n+static volatile bool force_quit;\n+\n+static struct rte_schedule *target_s;\n+\n+static void\n+yield_coroutine_1(void *arg)\n+{\n+\tRTE_SET_USED(arg);\n+\tint i = 10;\n+\twhile (i--) {\n+\t\tprintf(\"\\tI am in yield coroutine 111!\\n\");\n+\t\trte_co_yield();\n+\t}\n+}\n+\n+static void\n+yield_coroutine_2(void *arg)\n+{\n+\tRTE_SET_USED(arg);\n+\tint i = 10;\n+\twhile (i--) {\n+\t\tprintf(\"\\tI am in yield coroutine 222!\\n\");\n+\t\trte_co_yield();\n+\t}\n+}\n+\n+static void\n+yield_coroutine_3(void *arg)\n+{\n+\tRTE_SET_USED(arg);\n+\tint i = 10;\n+\twhile (i--) {\n+\t\tprintf(\"\\tI am in yield coroutine 333!\\n\");\n+\t\trte_co_yield();\n+\t}\n+}\n+\n+static void\n+yield_coroutine_test(void)\n+{\n+\tprintf(\"Start yield coroutine test!\\n\");\n+\trte_co_create(target_s, yield_coroutine_1, NULL, 0);\n+\trte_co_create(target_s, yield_coroutine_2, NULL, 0);\n+\trte_co_create(target_s, yield_coroutine_3, NULL, 0);\n+\tsleep(1);\n+}\n+\n+static void\n+delay_coroutine_1(void *arg)\n+{\n+\tRTE_SET_USED(arg);\n+\tint i = 10;\n+\twhile (i--) {\n+\t\tprintf(\"\\tI am in delay coroutine 111!\\n\");\n+\t\trte_co_delay(100 * 1000);\n+\t}\n+}\n+\n+static void\n+delay_coroutine_2(void *arg)\n+{\n+\tRTE_SET_USED(arg);\n+\tint i = 20;\n+\twhile (i--) {\n+\t\tprintf(\"\\tI am in delay coroutine 222!\\n\");\n+\t\trte_co_delay(50 * 1000);\n+\t}\n+}\n+\n+static void\n+delay_coroutine_test(void)\n+{\n+\tprintf(\"Start delay coroutine test!\\n\");\n+\trte_co_create(target_s, delay_coroutine_1, NULL, 0);\n+\trte_co_create(target_s, delay_coroutine_2, NULL, 0);\n+\tsleep(1);\n+}\n+\n+static int\n+co_main_loop(void *arg)\n+{\n+\tRTE_SET_USED(arg);\n+\twhile (!force_quit)\n+\t\trte_schedule_run(target_s);\n+\treturn 0;\n+}\n+\n+static void\n+signal_handler(int signum)\n+{\n+\tif (signum == SIGINT || signum == SIGTERM) {\n+\t\tprintf(\"\\n\\nSignal %d received, preparing to exit...\\n\",\n+\t\t\tsignum);\n+\t\tforce_quit = true;\n+\t}\n+}\n+\n+int\n+main(int argc, char **argv)\n+{\n+\tuint32_t lcore_id = rte_lcore_id();\n+\tint ret;\n+\n+\t/* Init EAL. 8< */\n+\tret = rte_eal_init(argc, argv);\n+\tif (ret < 0)\n+\t\trte_exit(EXIT_FAILURE, \"Invalid EAL arguments\\n\");\n+\n+\tforce_quit = false;\n+\tsignal(SIGINT, signal_handler);\n+\tsignal(SIGTERM, signal_handler);\n+\n+\t/* Check if there is enough lcores for all ports. */\n+\tif (rte_lcore_count() < 2)\n+\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\"There should be at least one worker lcore.\\n\");\n+\n+\ttarget_s = rte_schedule_create(\"co-sched-test\", 128);\n+\tif (target_s == NULL)\n+\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\"Create target scheduler failed!\\n\");\n+\n+\tlcore_id = rte_get_next_lcore(lcore_id, true, true);\n+\trte_eal_remote_launch(co_main_loop, NULL, lcore_id);\n+\n+\tyield_coroutine_test();\n+\tdelay_coroutine_test();\n+\n+\t/* force_quit is true when we get here */\n+\trte_eal_mp_wait_lcore();\n+\n+\t/* clean up the EAL */\n+\trte_eal_cleanup();\n+\n+\tprintf(\"Bye...\\n\");\n+\treturn 0;\n+}\ndiff --git a/examples/coroutine/meson.build b/examples/coroutine/meson.build\nnew file mode 100644\nindex 0000000000..c3576fe2f3\n--- /dev/null\n+++ b/examples/coroutine/meson.build\n@@ -0,0 +1,10 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2023 HiSilicon Limited\n+\n+allow_experimental_apis = true\n+\n+deps += ['coroutine']\n+\n+sources = files(\n+        'main.c',\n+)\ndiff --git a/examples/meson.build b/examples/meson.build\nindex 6968c09252..111d628065 100644\n--- a/examples/meson.build\n+++ b/examples/meson.build\n@@ -11,6 +11,7 @@ all_examples = [\n         'bbdev_app',\n         'bond',\n         'cmdline',\n+\t'coroutine',\n         'distributor',\n         'dma',\n         'ethtool',\n",
    "prefixes": [
        "RFC",
        "2/3"
    ]
}