get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139488,
    "url": "https://patches.dpdk.org/api/patches/139488/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240418103314.40705-2-konstantin.v.ananyev@yandex.ru/",
    "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": "<20240418103314.40705-2-konstantin.v.ananyev@yandex.ru>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240418103314.40705-2-konstantin.v.ananyev@yandex.ru",
    "date": "2024-04-18T10:33:09",
    "name": "[RFC,1/6] eal/linux: remove VLA warnings",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "48afbaca7628b8460470930ee74a1bf1f480e826",
    "submitter": {
        "id": 2660,
        "url": "https://patches.dpdk.org/api/people/2660/?format=api",
        "name": "Konstantin Ananyev",
        "email": "konstantin.v.ananyev@yandex.ru"
    },
    "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/20240418103314.40705-2-konstantin.v.ananyev@yandex.ru/mbox/",
    "series": [
        {
            "id": 31781,
            "url": "https://patches.dpdk.org/api/series/31781/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31781",
            "date": "2024-04-18T10:33:08",
            "name": "core libs: remove VLA warnings",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/31781/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/139488/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/139488/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 5E6C243E9F;\n\tThu, 18 Apr 2024 12:33:36 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6BF5240696;\n\tThu, 18 Apr 2024 12:33:35 +0200 (CEST)",
            "from forward500b.mail.yandex.net (forward500b.mail.yandex.net\n [178.154.239.144])\n by mails.dpdk.org (Postfix) with ESMTP id 9CF3A40042\n for <dev@dpdk.org>; Thu, 18 Apr 2024 12:33:33 +0200 (CEST)",
            "from mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net\n (mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net\n [IPv6:2a02:6b8:c0c:7907:0:640:8f19:0])\n by forward500b.mail.yandex.net (Yandex) with ESMTPS id DA2B5608DF;\n Thu, 18 Apr 2024 13:33:32 +0300 (MSK)",
            "by mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net\n (smtp/Yandex) with ESMTPSA id GXCBSvCo7Ko0-KcNLNLAs;\n Thu, 18 Apr 2024 13:33:31 +0300"
        ],
        "X-Yandex-Fwd": "1",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;\n t=1713436411; bh=yXAdBpOSeerebgYB6cDHc0WxJMWfYtwlmhNHTKiGdHg=;\n h=Cc:Message-Id:References:Date:In-Reply-To:Subject:To:From;\n b=IEIoqAV47vYGeKnXY9zzlu8hYv06kRgZpnjX90lEnCQjl9kyy0fOaZ3rZal0s4C6M\n fPbC8SKcZb3a35XJZm3JRzQYQk3yFI6+/zjCKPeoxVuTh1EtYQOqqhpRkezMsfpihs\n hy6UzIyj5UopmDxNIu8HZEWvzjdd8QjTuUsshnQQ=",
        "Authentication-Results": "\n mail-nwsmtp-smtp-production-main-22.iva.yp-c.yandex.net;\n dkim=pass header.i=@yandex.ru",
        "From": "Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru,\n yipeng1.wang@intel.com, sameh.gobriel@intel.com,\n bruce.richardson@intel.com, vladimir.medvedkin@intel.com,\n honnappa.nagarahalli@arm.com, roretzla@linux.microsoft.com,\n Konstantin Ananyev <konstantin.ananyev@huawei.com>",
        "Subject": "[RFC 1/6] eal/linux: remove VLA warnings",
        "Date": "Thu, 18 Apr 2024 11:33:09 +0100",
        "Message-Id": "<20240418103314.40705-2-konstantin.v.ananyev@yandex.ru>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240418103314.40705-1-konstantin.v.ananyev@yandex.ru>",
        "References": "<20240418103314.40705-1-konstantin.v.ananyev@yandex.ru>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "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": "From: Konstantin Ananyev <konstantin.ananyev@huawei.com>\n\n1) ./lib/eal/linux/eal_interrupts.c:1073:16: warning: ISO C90 forbids variable length array ‘events’ [-Wvla]\n\neal_intr_handle_interrupts() is called by eal_intr_thread_main()\nso it seems ok to simply alloc space for events from heap and reuse the\nsame buffer through the life of the thread.\n\n2) ./lib/eal/linux/eal_interrupts.c:1319:16: warning: ISO C90 forbids variable length array ‘evs’ [-Wvla]\n\nmake eal_epoll_wait() to use fixed size array and use it though multiple\niterations to preocess upt to @maxevents events.\nNote that techically it is not one to one raplacement, as here we might\nreduce number of events returned by first call to epoll_wait(..., timeout);\n\nSigned-off-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>\n---\n lib/eal/linux/eal_interrupts.c | 59 ++++++++++++++++++++++++++++++----\n 1 file changed, 52 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c\nindex 6436f796eb..58e3b8e12c 100644\n--- a/lib/eal/linux/eal_interrupts.c\n+++ b/lib/eal/linux/eal_interrupts.c\n@@ -34,6 +34,8 @@\n #define EAL_INTR_EPOLL_WAIT_FOREVER (-1)\n #define NB_OTHER_INTR               1\n \n+#define MAX_ITER_EVNUM\tRTE_EVENT_ETH_INTR_RING_SIZE\n+\n static RTE_DEFINE_PER_LCORE(int, _epfd) = -1; /**< epoll fd per thread */\n \n /**\n@@ -1068,9 +1070,9 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)\n  *  void\n  */\n static void\n-eal_intr_handle_interrupts(int pfd, unsigned totalfds)\n+eal_intr_handle_interrupts(int pfd, struct epoll_event events[],\n+\tunsigned totalfds)\n {\n-\tstruct epoll_event events[totalfds];\n \tint nfds = 0;\n \n \tfor(;;) {\n@@ -1106,6 +1108,12 @@ eal_intr_handle_interrupts(int pfd, unsigned totalfds)\n static __rte_noreturn uint32_t\n eal_intr_thread_main(__rte_unused void *arg)\n {\n+\tuint32_t n, nb_event;\n+\tstruct epoll_event *events, *p;\n+\n+\tnb_event = 0;\n+\tevents = NULL;\n+\n \t/* host thread, never break out */\n \tfor (;;) {\n \t\t/* build up the epoll fd with all descriptors we are to\n@@ -1159,8 +1167,23 @@ eal_intr_thread_main(__rte_unused void *arg)\n \t\t\t\tnumfds++;\n \t\t}\n \t\trte_spinlock_unlock(&intr_lock);\n+\n+\t\t/* alloc space for events, when necessary */\n+\t\tif (numfds > nb_event) {\n+\t\t\tn = numfds + MAX_ITER_EVNUM;\n+\t\t\tp = realloc(events, n * sizeof(events[0]));\n+\t\t\tif (p == NULL) {\n+\t\t\t\tEAL_LOG(ERR, \"failed to allocate %u events\",\n+\t\t\t\t\tnumfds);\n+\t\t\t\tnumfds = nb_event;\n+\t\t\t} else {\n+\t\t\t\tnb_event = n;\n+\t\t\t\tevents = p;\n+\t\t\t}\n+\t\t}\n+\n \t\t/* serve the interrupt */\n-\t\teal_intr_handle_interrupts(pfd, numfds);\n+\t\teal_intr_handle_interrupts(pfd, events, numfds);\n \n \t\t/**\n \t\t * when we return, we need to rebuild the\n@@ -1168,6 +1191,8 @@ eal_intr_thread_main(__rte_unused void *arg)\n \t\t */\n \t\tclose(pfd);\n \t}\n+\n+\tfree(events);\n }\n \n int\n@@ -1316,8 +1341,9 @@ static int\n eal_epoll_wait(int epfd, struct rte_epoll_event *events,\n \t       int maxevents, int timeout, bool interruptible)\n {\n-\tstruct epoll_event evs[maxevents];\n \tint rc;\n+\tuint32_t i, k, n, num;\n+\tstruct epoll_event evs[MAX_ITER_EVNUM];\n \n \tif (!events) {\n \t\tEAL_LOG(ERR, \"rte_epoll_event can't be NULL\");\n@@ -1328,12 +1354,31 @@ eal_epoll_wait(int epfd, struct rte_epoll_event *events,\n \tif (epfd == RTE_EPOLL_PER_THREAD)\n \t\tepfd = rte_intr_tls_epfd();\n \n+\tnum = maxevents;\n+\tn = RTE_MIN(RTE_DIM(evs), num);\n+\n+\t/* Process events in chunks of MAX_ITER_EVNUM */\n+\n \twhile (1) {\n-\t\trc = epoll_wait(epfd, evs, maxevents, timeout);\n+\t\trc = epoll_wait(epfd, evs, n, timeout);\n \t\tif (likely(rc > 0)) {\n+\n \t\t\t/* epoll_wait has at least one fd ready to read */\n-\t\t\trc = eal_epoll_process_event(evs, rc, events);\n-\t\t\tbreak;\n+\t\t\tfor (i = 0, k = 0; rc > 0;) {\n+\t\t\t\tk += rc;\n+\t\t\t\trc = eal_epoll_process_event(evs, rc,\n+\t\t\t\t\t\tevents + i);\n+\t\t\t\ti += rc;\n+\n+\t\t\t\t/*\n+\t\t\t\t * try to read more events that are already\n+\t\t\t\t * available (up to maxevents in total).\n+\t\t\t\t */\n+\t\t\t\tn = RTE_MIN(RTE_DIM(evs), num - k);\n+\t\t\t\trc = (n == 0) ? 0 : epoll_wait(epfd, evs, n, 0);\n+\t\t\t}\n+\t\t\treturn i;\n+\n \t\t} else if (rc < 0) {\n \t\t\tif (errno == EINTR) {\n \t\t\t\tif (interruptible)\n",
    "prefixes": [
        "RFC",
        "1/6"
    ]
}