get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 92620,
    "url": "http://patches.dpdk.org/api/patches/92620/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210502023333.30351-2-dmitry.kozliuk@gmail.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": "<20210502023333.30351-2-dmitry.kozliuk@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210502023333.30351-2-dmitry.kozliuk@gmail.com",
    "date": "2021-05-02T02:33:32",
    "name": "[2/3] eal/windows: fix interrupt thread handle leakage",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f9fdeb06fdfa349b7bd536938bcc59cc6edc7753",
    "submitter": {
        "id": 1581,
        "url": "http://patches.dpdk.org/api/people/1581/?format=api",
        "name": "Dmitry Kozlyuk",
        "email": "dmitry.kozliuk@gmail.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210502023333.30351-2-dmitry.kozliuk@gmail.com/mbox/",
    "series": [
        {
            "id": 16786,
            "url": "http://patches.dpdk.org/api/series/16786/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16786",
            "date": "2021-05-02T02:33:31",
            "name": "[1/3] eal/windows: fix use of incorrect thread ID",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/16786/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/92620/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/92620/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 DABF6A0524;\n\tSun,  2 May 2021 04:33:50 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 945D941110;\n\tSun,  2 May 2021 04:33:44 +0200 (CEST)",
            "from mail-lf1-f52.google.com (mail-lf1-f52.google.com\n [209.85.167.52])\n by mails.dpdk.org (Postfix) with ESMTP id 9F59540692;\n Sun,  2 May 2021 04:33:43 +0200 (CEST)",
            "by mail-lf1-f52.google.com with SMTP id 124so2997206lff.5;\n Sat, 01 May 2021 19:33:43 -0700 (PDT)",
            "from localhost.localdomain (broadband-37-110-65-23.ip.moscow.rt.ru.\n [37.110.65.23])\n by smtp.gmail.com with ESMTPSA id w26sm716970lfn.82.2021.05.01.19.33.42\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sat, 01 May 2021 19:33:42 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=OIkV9lF5P4FL0Qog325tf+flJAw1LR3JAkiHJ8u2jeI=;\n b=MrWk/nqp2NPjTUWB38mp9JacRmBi1ygp3CMhfQNraBmt940+6/TgWxuqIG6vbL5SDx\n 5ZS+ynMxBjOQ7ihfaUogjyYhqQNcko31OEljfe7dH6u7CAP6IL46sYqMNvsoZJKenz/8\n v9wu4tj7yMpWVKSecvjZif2wr7+y29dAhE4fWk5BCjY96eiTsPPiRL6spe83s3cYrYLF\n X9+Bv0PZgF/h5oAxOMOERkFo89bFePShrPK+yBy7OZIUplmb7CdRVOA15DQDTHzFSGcD\n cJJA1pOlSsJCNF+jUnSinlUH0i2kZL+aa6KSomygKaNmDTZ7C7D3420+jlKqX12zENxf\n 6P+Q==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=OIkV9lF5P4FL0Qog325tf+flJAw1LR3JAkiHJ8u2jeI=;\n b=ay7SZUByn2oZ6B8JibXYIgotyP8Fbt5F1GB9i8tHTFM2VI0l/UtqvF2K4QYa7OMY3s\n TBGX8NbgZHMQw48r7hLqX7RmSINJytN4XWwzG9dwcwECpWK0cAim4tJLxs3DvagwP+BU\n eGXzrIwaElZk9Q+mHnq1a3sXBAr3oldhmjBUPizPQV3TV1VuSQFuSh6qYSAfZ4zkHtgQ\n ZaZCcpmRFvm/tSijtKCzoXS9IepmcgWAFVfOymddCzxMjvsYsBzCZ526z6h9pJx/2bY2\n Coe6du5eozRHw4On9gMwZitDxJ++NNFi7nqgq1k70LCrrZUn1xIVaj75QwBqQa7+AX0w\n J5fw==",
        "X-Gm-Message-State": "AOAM531ohL5LSPYclQK2BgX2qR2MfXIkeFTCWn0+0i/2m0YwMl+DcBH3\n jBKePgl1Fi/Ben/Le/BVHGm6JoJCgpuNAg==",
        "X-Google-Smtp-Source": "\n ABdhPJyg8x3cee63iCO9vf7epQ3P6toQpZ3QaatIMcD+KQt3NwrkyUMGquuDnurw5+qbiikTKxfBSg==",
        "X-Received": "by 2002:a19:c218:: with SMTP id l24mr8738559lfc.529.1619922823018;\n Sat, 01 May 2021 19:33:43 -0700 (PDT)",
        "From": "Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>",
        "To": "dev@dpdk.org",
        "Cc": "Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>, stable@dpdk.org,\n Harman Kalra <hkalra@marvell.com>,\n Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,\n Dmitry Malloy <dmitrym@microsoft.com>,\n Pallavi Kadam <pallavi.kadam@intel.com>",
        "Date": "Sun,  2 May 2021 05:33:32 +0300",
        "Message-Id": "<20210502023333.30351-2-dmitry.kozliuk@gmail.com>",
        "X-Mailer": "git-send-email 2.29.3",
        "In-Reply-To": "<20210502023333.30351-1-dmitry.kozliuk@gmail.com>",
        "References": "<20210502023333.30351-1-dmitry.kozliuk@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 2/3] eal/windows: fix interrupt thread handle\n leakage",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Each time a work was scheduled in the interrupt thread,\nusually an alarm, a handle was opened but not closed.\n\nOpening a handle is a system call, which harms alarm precision.\nInstead of opening and closing a handle each time, open it\nwhen interrupt thread starts and close it when the thread finishes.\n\nFixes: 5c016fc0205a (\"eal/windows: add interrupt thread skeleton\")\nCc: stable@dpdk.org\n\nSigned-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>\n---\n lib/eal/windows/eal_interrupts.c | 34 +++++++++++++++++++++++---------\n 1 file changed, 25 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/lib/eal/windows/eal_interrupts.c b/lib/eal/windows/eal_interrupts.c\nindex 9cde02b003..f24ed6e54e 100644\n--- a/lib/eal/windows/eal_interrupts.c\n+++ b/lib/eal/windows/eal_interrupts.c\n@@ -10,6 +10,7 @@\n static pthread_t intr_thread;\n \n static HANDLE intr_iocp;\n+static HANDLE intr_thread_handle;\n \n static void\n eal_intr_process(const OVERLAPPED_ENTRY *event)\n@@ -17,9 +18,27 @@ eal_intr_process(const OVERLAPPED_ENTRY *event)\n \tRTE_SET_USED(event);\n }\n \n+static int\n+eal_intr_thread_handle_init(void)\n+{\n+\tDWORD thread_id = GetCurrentThreadId();\n+\n+\tintr_thread_handle = OpenThread(THREAD_ALL_ACCESS, FALSE, thread_id);\n+\tif (intr_thread_handle == NULL) {\n+\t\tRTE_LOG_WIN32_ERR(\"OpenThread(%lu)\", thread_id);\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n static void *\n eal_intr_thread_main(LPVOID arg __rte_unused)\n {\n+\tif (eal_intr_thread_handle_init() < 0) {\n+\t\tRTE_LOG(ERR, EAL, \"Cannot open interrupt thread handle\\n\");\n+\t\tgoto cleanup;\n+\t}\n+\n \twhile (1) {\n \t\tOVERLAPPED_ENTRY events[16];\n \t\tULONG event_count, i;\n@@ -46,6 +65,10 @@ eal_intr_thread_main(LPVOID arg __rte_unused)\n \t\t\teal_intr_process(&events[i]);\n \t}\n \n+\tCloseHandle(intr_thread_handle);\n+\tintr_thread_handle = NULL;\n+\n+cleanup:\n \tintr_thread = 0;\n \n \tCloseHandle(intr_iocp);\n@@ -93,15 +116,8 @@ rte_intr_rx_ctl(__rte_unused struct rte_intr_handle *intr_handle,\n int\n eal_intr_thread_schedule(void (*func)(void *arg), void *arg)\n {\n-\tHANDLE handle;\n-\n-\thandle = OpenThread(THREAD_ALL_ACCESS, FALSE, intr_thread);\n-\tif (handle == NULL) {\n-\t\tRTE_LOG_WIN32_ERR(\"OpenThread(%llu)\", intr_thread);\n-\t\treturn -ENOENT;\n-\t}\n-\n-\tif (!QueueUserAPC((PAPCFUNC)(ULONG_PTR)func, handle, (ULONG_PTR)arg)) {\n+\tif (!QueueUserAPC((PAPCFUNC)(ULONG_PTR)func,\n+\t\t\tintr_thread_handle, (ULONG_PTR)arg)) {\n \t\tRTE_LOG_WIN32_ERR(\"QueueUserAPC()\");\n \t\treturn -EINVAL;\n \t}\n",
    "prefixes": [
        "2/3"
    ]
}