get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57047,
    "url": "https://patches.dpdk.org/api/patches/57047/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190724172037.7776-1-stephen@networkplumber.org/",
    "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": "<20190724172037.7776-1-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190724172037.7776-1-stephen@networkplumber.org",
    "date": "2019-07-24T17:20:37",
    "name": "eal/interrupts: add function to allow interruptible epoll",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8b58d751d27c36093a2c9dfcc74314c8d057e948",
    "submitter": {
        "id": 27,
        "url": "https://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 24651,
        "url": "https://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190724172037.7776-1-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 5721,
            "url": "https://patches.dpdk.org/api/series/5721/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5721",
            "date": "2019-07-24T17:20:37",
            "name": "eal/interrupts: add function to allow interruptible epoll",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/5721/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/57047/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/57047/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 BB8BA1C236;\n\tWed, 24 Jul 2019 19:20:52 +0200 (CEST)",
            "from mail-pg1-f193.google.com (mail-pg1-f193.google.com\n\t[209.85.215.193]) by dpdk.org (Postfix) with ESMTP id 118051C000\n\tfor <dev@dpdk.org>; Wed, 24 Jul 2019 19:20:50 +0200 (CEST)",
            "by mail-pg1-f193.google.com with SMTP id i70so10811386pgd.4\n\tfor <dev@dpdk.org>; Wed, 24 Jul 2019 10:20:50 -0700 (PDT)",
            "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\tz13sm39656744pjn.32.2019.07.24.10.20.48\n\t(version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);\n\tWed, 24 Jul 2019 10:20:49 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=vU4+nNmg8qRPbw50HdOvOdU2lhcADhEPpe0HhzYlBQs=;\n\tb=y48HeUX46WvDEVDz8s4tiFTo1PkTtr3/fIfj3rfSt3EZ7+Jpc/XwrUseBXOTvQ8vfx\n\tY3QHlhpWJ9UVXBvbPjEZrLcVGtijRewoWEGc4d8rzQM6AE5K6S2yFvbGgvFX+nnfuEwn\n\twMt5p1xoj6gISUzmGs1X5CR1vBidadNemjMxicErjB3/CmaZNPPMBhE4oHKYxKBKqiz7\n\tuTpMUd2/AAJ4FDpKLkM+fORfatGqiYFeq8bcdijMD8l0PbB4NA3BrKyAv5M504g7w3Rg\n\tQZWwwUV0qrwBjfiSGx9CRLB5NalCKJOp1BbfoqctXEw+Fmo1HIAdBoNWZCB24Jr6OPDy\n\tchIA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=vU4+nNmg8qRPbw50HdOvOdU2lhcADhEPpe0HhzYlBQs=;\n\tb=q1JbOKisbyfQZgF7mKiVzFrvS9fa4nHmfoGq/rtCIjDZrLL7nwqJEUQvlCNOxJIfdO\n\tzF+vGA3KHn0RpvlHQms2rQn7QZPY60XCFd6hQMlKVZPQB72N5C0PenJD8q2ksuMYgInT\n\t5DuP104Dh4E4iSlXYZhI7BY8bnDySwzLeZfQuOy0zM8mLmGwGPgUJJhttuLOwhshBoqu\n\tqnvNvY9fcaaCBpFpidk3i/Pvm7PX8WhZRh6H8H4P1SnwaGvu5H1zZ1K/+0MnHvuyGSvt\n\tlYmz5t7haCEAEUXscGpdVyz+8WPSEYPo8GtoO3+IbkU2gxmA4UPZL3lWrRGa5Zs9Bbw6\n\tUMIA==",
        "X-Gm-Message-State": "APjAAAX+RYKbkBfAk47B40kE9GW5zLXbeIspo1IB1QBS77lqPglsOTaR\n\t44MZziHX2eohDPFLHbDJSvVqzwT/",
        "X-Google-Smtp-Source": "APXvYqzo61IdDNPa81MQslfx3JT0JgXZRoardD6HLLEJDun6P4ggNIv/M3oIreDSQ2SWhHAzlusT7Q==",
        "X-Received": "by 2002:aa7:82da:: with SMTP id\n\tf26mr12474329pfn.82.1563988849852; \n\tWed, 24 Jul 2019 10:20:49 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Date": "Wed, 24 Jul 2019 10:20:37 -0700",
        "Message-Id": "<20190724172037.7776-1-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH] eal/interrupts: add function to allow\n\tinterruptible epoll",
        "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://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The existing definition of rte_epoll_wait retries if interrupted\nby a signal. This behavior makes it hard to use rte_epoll_wait\nfor applications that want to use signals do do things like\nexit polling loop and shutdown.\n\nSince changing existing semantic might break applications, add\na new rte_epoll_wait_interruptible() function that does the\nsame thing as rte_epoll_wait but will return -1 and errno of EINTR\nif it receives a signal.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n .../common/include/rte_eal_interrupts.h       | 23 +++++++++\n lib/librte_eal/freebsd/eal/eal_interrupts.c   | 12 +++++\n lib/librte_eal/linux/eal/eal_interrupts.c     | 47 ++++++++++++-------\n lib/librte_eal/rte_eal_version.map            |  1 +\n 4 files changed, 65 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/include/rte_eal_interrupts.h b/lib/librte_eal/common/include/rte_eal_interrupts.h\nindex b370c0d26458..ac1c830f37a1 100644\n--- a/lib/librte_eal/common/include/rte_eal_interrupts.h\n+++ b/lib/librte_eal/common/include/rte_eal_interrupts.h\n@@ -87,6 +87,7 @@ struct rte_intr_handle {\n \n /**\n  * It waits for events on the epoll instance.\n+ * Retries if signal received.\n  *\n  * @param epfd\n  *   Epoll instance fd on which the caller wait for events.\n@@ -105,6 +106,28 @@ int\n rte_epoll_wait(int epfd, struct rte_epoll_event *events,\n \t       int maxevents, int timeout);\n \n+/**\n+ * It waits for events on the epoll instance.\n+ * Does not retry if signal received.\n+ *\n+ * @param epfd\n+ *   Epoll instance fd on which the caller wait for events.\n+ * @param events\n+ *   Memory area contains the events that will be available for the caller.\n+ * @param maxevents\n+ *   Up to maxevents are returned, must greater than zero.\n+ * @param timeout\n+ *   Specifying a timeout of -1 causes a block indefinitely.\n+ *   Specifying a timeout equal to zero cause to return immediately.\n+ * @return\n+ *   - On success, returns the number of available event.\n+ *   - On failure, a negative value.\n+ */\n+__rte_experimental\n+int\n+rte_epoll_wait_interruptible(int epfd, struct rte_epoll_event *events,\n+\t       int maxevents, int timeout);\n+\n /**\n  * It performs control operations on epoll instance referred by the epfd.\n  * It requests that the operation op be performed for the target fd.\ndiff --git a/lib/librte_eal/freebsd/eal/eal_interrupts.c b/lib/librte_eal/freebsd/eal/eal_interrupts.c\nindex f6831b7902c5..d3f8fd78a1ee 100644\n--- a/lib/librte_eal/freebsd/eal/eal_interrupts.c\n+++ b/lib/librte_eal/freebsd/eal/eal_interrupts.c\n@@ -649,6 +649,18 @@ rte_epoll_wait(int epfd, struct rte_epoll_event *events,\n \treturn -ENOTSUP;\n }\n \n+int\n+rte_epoll_wait_interruptible(int epfd, struct rte_epoll_event *events,\n+\t\t\t     int maxevents, int timeout)\n+{\n+\tRTE_SET_USED(epfd);\n+\tRTE_SET_USED(events);\n+\tRTE_SET_USED(maxevents);\n+\tRTE_SET_USED(timeout);\n+\n+\treturn -ENOTSUP;\n+}\n+\n int\n rte_epoll_ctl(int epfd, int op, int fd, struct rte_epoll_event *event)\n {\ndiff --git a/lib/librte_eal/linux/eal/eal_interrupts.c b/lib/librte_eal/linux/eal/eal_interrupts.c\nindex 1955324d3045..b6ae12a282e7 100644\n--- a/lib/librte_eal/linux/eal/eal_interrupts.c\n+++ b/lib/librte_eal/linux/eal/eal_interrupts.c\n@@ -1239,9 +1239,9 @@ rte_intr_tls_epfd(void)\n \treturn RTE_PER_LCORE(_epfd);\n }\n \n-int\n-rte_epoll_wait(int epfd, struct rte_epoll_event *events,\n-\t       int maxevents, int timeout)\n+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@@ -1255,29 +1255,40 @@ rte_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-\twhile (1) {\n-\t\trc = epoll_wait(epfd, evs, maxevents, timeout);\n-\t\tif (likely(rc > 0)) {\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} else if (rc < 0) {\n-\t\t\tif (errno == EINTR)\n-\t\t\t\tcontinue;\n+retry:\n+\trc = epoll_wait(epfd, evs, maxevents, timeout);\n+\tif (likely(rc > 0)) {\n+\t\t/* epoll_wait has at least one fd ready to read */\n+\t\trc = eal_epoll_process_event(evs, rc, events);\n+\t} else if (rc < 0) {\n+\t\tif (errno == EINTR) {\n+\t\t\tif (!interruptible)\n+\t\t\t\tgoto retry;\n+\t\t} else {\n \t\t\t/* epoll_wait fail */\n-\t\t\tRTE_LOG(ERR, EAL, \"epoll_wait returns with fail %s\\n\",\n+\t\t\tRTE_LOG(ERR, EAL,\n+\t\t\t\t\"epoll_wait returns with fail %s\\n\",\n \t\t\t\tstrerror(errno));\n-\t\t\trc = -1;\n-\t\t\tbreak;\n-\t\t} else {\n-\t\t\t/* rc == 0, epoll_wait timed out */\n-\t\t\tbreak;\n \t\t}\n \t}\n \n \treturn rc;\n }\n \n+int\n+rte_epoll_wait(int epfd, struct rte_epoll_event *events,\n+\t       int maxevents, int timeout)\n+{\n+\treturn eal_epoll_wait(epfd, events, maxevents, timeout, false);\n+}\n+\n+int\n+rte_epoll_wait_interruptible(int epfd, struct rte_epoll_event *events,\n+\t\t\t     int maxevents, int timeout)\n+{\n+\treturn eal_epoll_wait(epfd, events, maxevents, timeout, true);\n+}\n+\n static inline void\n eal_epoll_data_safe_free(struct rte_epoll_event *ev)\n {\ndiff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map\nindex 234487787994..e1aeb99ba9c8 100644\n--- a/lib/librte_eal/rte_eal_version.map\n+++ b/lib/librte_eal/rte_eal_version.map\n@@ -331,6 +331,7 @@ EXPERIMENTAL {\n \trte_dev_hotplug_handle_enable;\n \trte_dev_iterator_init;\n \trte_dev_iterator_next;\n+\trte_epoll_wait_interruptible;\n \trte_extmem_attach;\n \trte_extmem_detach;\n \trte_extmem_register;\n",
    "prefixes": []
}