get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 41191,
    "url": "https://patches.dpdk.org/api/patches/41191/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/40da3a6a106dd43bfd551b0307e91d0d0f642486.1529071026.git.anatoly.burakov@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<40da3a6a106dd43bfd551b0307e91d0d0f642486.1529071026.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/40da3a6a106dd43bfd551b0307e91d0d0f642486.1529071026.git.anatoly.burakov@intel.com",
    "date": "2018-06-15T14:25:08",
    "name": "[8/8] ipc: remove main IPC thread",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6ff4e62a30df2c166afbfb09e0e977b68bb18bed",
    "submitter": {
        "id": 4,
        "url": "https://patches.dpdk.org/api/people/4/?format=api",
        "name": "Burakov, Anatoly",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/40da3a6a106dd43bfd551b0307e91d0d0f642486.1529071026.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 145,
            "url": "https://patches.dpdk.org/api/series/145/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=145",
            "date": "2018-06-15T14:25:00",
            "name": "Remove IPC threads",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/145/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/41191/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/41191/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 41FA11D6B6;\n\tFri, 15 Jun 2018 16:25:27 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id 3D80B1D656\n\tfor <dev@dpdk.org>; Fri, 15 Jun 2018 16:25:15 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t15 Jun 2018 07:25:13 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga006.fm.intel.com with ESMTP; 15 Jun 2018 07:25:10 -0700",
            "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tw5FEP9L0028208; Fri, 15 Jun 2018 15:25:09 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id w5FEP9AX019501;\n\tFri, 15 Jun 2018 15:25:09 +0100",
            "(from aburakov@localhost)\n\tby sivswdev01.ir.intel.com with LOCAL id w5FEP9um019493;\n\tFri, 15 Jun 2018 15:25:09 +0100"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.51,227,1526367600\"; d=\"scan'208\";a=\"237756434\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "konstantin.ananyev@intel.com, thomas@monjalon.net,\n\tbruce.richardson@intel.com, Jianfeng Tan <jianfeng.tan@intel.com>",
        "Date": "Fri, 15 Jun 2018 15:25:08 +0100",
        "Message-Id": "<40da3a6a106dd43bfd551b0307e91d0d0f642486.1529071026.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": [
            "<cover.1529071026.git.anatoly.burakov@intel.com>",
            "<cover.1529071026.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<cover.1529071026.git.anatoly.burakov@intel.com>",
            "<cover.1529071026.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH 8/8] ipc: remove main IPC thread",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Previously, to handle requests from peer(s), or replies for a\nrequest (sync or async) by itself, a dedicated IPC thread was set\nup.\n\nNow that every other piece of the puzzle is in place, we can get rid\nof the IPC thread, and move waiting for IPC messages entirely into the\ninterrupt thread.\n\nSigned-off-by: Jianfeng Tan <jianfeng.tan@intel.com>\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\nSuggested-by: Thomas Monjalon <thomas@monjalon.net>\n---\n\nNotes:\n    RFC->RFCv2:\n    - Fixed resource leaks\n    - Improved readability\n\n lib/librte_eal/common/eal_common_proc.c | 46 ++++++++++++++-----------\n 1 file changed, 25 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_proc.c b/lib/librte_eal/common/eal_common_proc.c\nindex 6f3366403..162d67ca5 100644\n--- a/lib/librte_eal/common/eal_common_proc.c\n+++ b/lib/librte_eal/common/eal_common_proc.c\n@@ -25,6 +25,7 @@\n #include <rte_cycles.h>\n #include <rte_eal.h>\n #include <rte_errno.h>\n+#include <rte_interrupts.h>\n #include <rte_lcore.h>\n #include <rte_log.h>\n #include <rte_tailq.h>\n@@ -101,6 +102,8 @@ static struct {\n \t/**< used in async requests only */\n };\n \n+static struct rte_intr_handle ipc_intr_handle;\n+\n /* forward declarations */\n static int\n mp_send(struct rte_mp_msg *msg, const char *peer, int type);\n@@ -350,18 +353,17 @@ process_msg(struct mp_msg_internal *m, struct sockaddr_un *s)\n \t}\n }\n \n-static void *\n+static void\n mp_handle(void *arg __rte_unused)\n {\n \tstruct mp_msg_internal msg;\n \tstruct sockaddr_un sa;\n \n \twhile (1) {\n-\t\tif (read_msg(&msg, &sa) == 0)\n-\t\t\tprocess_msg(&msg, &sa);\n+\t\tif (read_msg(&msg, &sa) < 0)\n+\t\t\tbreak;\n+\t\tprocess_msg(&msg, &sa);\n \t}\n-\n-\treturn NULL;\n }\n \n static int\n@@ -570,7 +572,6 @@ rte_mp_channel_init(void)\n {\n \tchar path[PATH_MAX];\n \tint dir_fd;\n-\tpthread_t mp_handle_tid;\n \n \t/* create filter path */\n \tcreate_socket_path(\"*\", path, sizeof(path));\n@@ -585,36 +586,32 @@ rte_mp_channel_init(void)\n \tif (dir_fd < 0) {\n \t\tRTE_LOG(ERR, EAL, \"failed to open %s: %s\\n\",\n \t\t\tmp_dir_path, strerror(errno));\n-\t\treturn -1;\n+\t\tgoto fail;\n \t}\n \n \tif (flock(dir_fd, LOCK_EX)) {\n \t\tRTE_LOG(ERR, EAL, \"failed to lock %s: %s\\n\",\n \t\t\tmp_dir_path, strerror(errno));\n-\t\tclose(dir_fd);\n-\t\treturn -1;\n+\t\tgoto fail;\n \t}\n \n \tif (rte_eal_process_type() == RTE_PROC_PRIMARY &&\n \t\t\tunlink_sockets(mp_filter)) {\n \t\tRTE_LOG(ERR, EAL, \"failed to unlink mp sockets\\n\");\n-\t\tclose(dir_fd);\n-\t\treturn -1;\n+\t\tgoto fail;\n \t}\n \n \tif (open_socket_fd() < 0) {\n-\t\tclose(dir_fd);\n-\t\treturn -1;\n+\t\tgoto fail;\n \t}\n \n-\tif (rte_ctrl_thread_create(&mp_handle_tid, \"rte_mp_handle\",\n-\t\t\tNULL, mp_handle, NULL) < 0) {\n-\t\tRTE_LOG(ERR, EAL, \"failed to create mp thead: %s\\n\",\n-\t\t\tstrerror(errno));\n-\t\tclose(mp_fd);\n-\t\tclose(dir_fd);\n-\t\tmp_fd = -1;\n-\t\treturn -1;\n+\tipc_intr_handle.fd = mp_fd;\n+\tipc_intr_handle.type = RTE_INTR_HANDLE_IPC;\n+\n+\tif (rte_intr_callback_register(&ipc_intr_handle, mp_handle, NULL) < 0) {\n+\t\tRTE_LOG(ERR, EAL, \"failed to register IPC interrupt callback: %s\\n\",\n+\t\t\t\tstrerror(errno));\n+\t\tgoto fail;\n \t}\n \n \t/* unlock the directory */\n@@ -622,6 +619,13 @@ rte_mp_channel_init(void)\n \tclose(dir_fd);\n \n \treturn 0;\n+fail:\n+\tif (dir_fd >= 0)\n+\t\tclose(dir_fd);\n+\tif (mp_fd >= 0)\n+\t\tclose(mp_fd);\n+\tmp_fd = -1;\n+\treturn -1;\n }\n \n /**\n",
    "prefixes": [
        "8/8"
    ]
}