get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 92867,
    "url": "https://patches.dpdk.org/api/patches/92867/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210505073348.6394-17-mk@semihalf.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": "<20210505073348.6394-17-mk@semihalf.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210505073348.6394-17-mk@semihalf.com",
    "date": "2021-05-05T07:33:42",
    "name": "[v2,16/22] net/ena: handle spurious wakeups in ENA_WAIT_EVENT",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9a7fb95499020ec0967458db6511af659677cbf8",
    "submitter": {
        "id": 786,
        "url": "https://patches.dpdk.org/api/people/786/?format=api",
        "name": "Michal Krawczyk",
        "email": "mk@semihalf.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210505073348.6394-17-mk@semihalf.com/mbox/",
    "series": [
        {
            "id": 16820,
            "url": "https://patches.dpdk.org/api/series/16820/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=16820",
            "date": "2021-05-05T07:33:26",
            "name": "net/ena: update ENA PMD to v2.3.0",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/16820/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/92867/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/92867/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 C257CA0524;\n\tWed,  5 May 2021 09:36:20 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 500BB41179;\n\tWed,  5 May 2021 09:34:24 +0200 (CEST)",
            "from mail-wr1-f41.google.com (mail-wr1-f41.google.com\n [209.85.221.41]) by mails.dpdk.org (Postfix) with ESMTP id 3DA3541167\n for <dev@dpdk.org>; Wed,  5 May 2021 09:34:20 +0200 (CEST)",
            "by mail-wr1-f41.google.com with SMTP id d11so660928wrw.8\n for <dev@dpdk.org>; Wed, 05 May 2021 00:34:20 -0700 (PDT)",
            "from DESKTOP-U5LNN3J.localdomain (89-79-189-199.dynamic.chello.pl.\n [89.79.189.199])\n by smtp.gmail.com with ESMTPSA id t17sm4679856wmq.12.2021.05.05.00.34.18\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 05 May 2021 00:34:18 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=semihalf-com.20150623.gappssmtp.com; s=20150623;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=0DC6sU1JOHLsjCHn+VAmJsB4JcbXF3RB9z1naoaLY9I=;\n b=kfQe9GuqIhpNIODNuUPI21mF97GzhP61Bw89dG7huwimfajtcchlEMlsMKuyPxAa0g\n O2+DEo+tWoIQOg8sh/77ekzAcVfuoIOVj+1hNVmE+Ws4egxCrFo+SBLmbXLYkwdN4s1s\n em7Wyv8X1NN87LOaAM4t2rQRLvrjSG2Td06Wsc6SSmkBOt0e/QRf5BXYsGor3Jwc+W6K\n D3V3ZK+0iYSTZztYVB+Xb9AqdAkMjJpuD8Q28K5RRL3LsnfDedGaIbr7SeIgEde9gU4+\n +Sbu8GeVMz1AGian/pyAVrWOhS3y90IRtWCzq460C3ysQci0AMbEgt+iiZYD6zXT8lDV\n 2VLQ==",
        "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=0DC6sU1JOHLsjCHn+VAmJsB4JcbXF3RB9z1naoaLY9I=;\n b=XjZp0D9zLXM2YTBAIR61fwiOvDzRHGTTb4kNQS/eFg2SOuY/JxX+to8obJEPjsIdY7\n K2D8NCilCi06+FLDDF8m04mgViaFqdtWyHG3cufxcpXrwzopv+j1ZGk+sI0TUkkbpX9D\n V3C9GEBb3NeLC7uhjJe1f8SZ9yhKZM48bOzK4NjDpVr8Eji2jMqbLK8GyCBEPfppFSkJ\n x4VKLqmJd9cwc2syauykxgrrzW/152MY688VABpgPuKHF118lkkv/w1OGNkDUw0fZPHQ\n JXUzy9CLsfweB895q8loAUoZzrKAG2YdQUTDOXfVMZggh3X0t/dAOTOZFt5OUVJ+hCwA\n xIsw==",
        "X-Gm-Message-State": "AOAM531JRSYsPbF7TE9RPzK/A8CrelNByHZMbuL4TdSckq2cF6mZKW7m\n jGRuURgbn32kEHCcts3aKKDi0QmdIYBuxoRV",
        "X-Google-Smtp-Source": "\n ABdhPJxpsrrkMI9GGzQ2Wr24Vpp0rkH4A4tLrvFmtNnC2rV2DSDWAtLR6EbYB95nVErlo6Zp7xUeZw==",
        "X-Received": "by 2002:a05:6000:1866:: with SMTP id\n d6mr22851258wri.141.1620200059693;\n Wed, 05 May 2021 00:34:19 -0700 (PDT)",
        "From": "Michal Krawczyk <mk@semihalf.com>",
        "To": "dev@dpdk.org",
        "Cc": "ndagan@amazon.com, gtzalik@amazon.com, igorch@amazon.com,\n upstream@semihalf.com, Stanislaw Kardach <kda@semihalf.com>,\n Michal Krawczyk <mk@semihalf.com>, Shay Agroskin <shayagr@amazon.com>",
        "Date": "Wed,  5 May 2021 09:33:42 +0200",
        "Message-Id": "<20210505073348.6394-17-mk@semihalf.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210505073348.6394-1-mk@semihalf.com>",
        "References": "<20210430125725.28796-1-mk@semihalf.com>\n <20210505073348.6394-1-mk@semihalf.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v2 16/22] net/ena: handle spurious wakeups in\n ENA_WAIT_EVENT",
        "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": "From: Stanislaw Kardach <kda@semihalf.com>\n\npthread_cond_timedwait() may spuriously wakeup according to POSIX.\nTherefore it is required to check whether predicate is actually true\nbefore finishing the waiting loop.\n\nSigned-off-by: Stanislaw Kardach <kda@semihalf.com>\nReviewed-by: Michal Krawczyk <mk@semihalf.com>\nReviewed-by: Igor Chauskin <igorch@amazon.com>\nReviewed-by: Shay Agroskin <shayagr@amazon.com>\n---\n drivers/net/ena/base/ena_plat_dpdk.h | 75 +++++++++++++++++-----------\n 1 file changed, 47 insertions(+), 28 deletions(-)",
    "diff": "diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h\nindex 591bc6c8bb..bfb4b9aaa8 100644\n--- a/drivers/net/ena/base/ena_plat_dpdk.h\n+++ b/drivers/net/ena/base/ena_plat_dpdk.h\n@@ -77,6 +77,14 @@ typedef uint64_t dma_addr_t;\n #define mmiowb rte_io_wmb\n #define __iomem\n \n+#ifndef READ_ONCE\n+#define READ_ONCE(var) (*((volatile typeof(var) *)(&(var))))\n+#endif\n+\n+#define READ_ONCE8(var) READ_ONCE(var)\n+#define READ_ONCE16(var) READ_ONCE(var)\n+#define READ_ONCE32(var) READ_ONCE(var)\n+\n #define US_PER_S 1000000\n #define ENA_GET_SYSTEM_USECS()\t\t\t\t\t\t       \\\n \t(rte_get_timer_cycles() * US_PER_S / rte_get_timer_hz())\n@@ -137,40 +145,59 @@ extern int ena_logtype_com;\n \t({(void)flags; rte_spinlock_unlock(&(spinlock)); })\n #define ENA_SPINLOCK_DESTROY(spinlock) ((void)spinlock)\n \n-#define q_waitqueue_t\t\t\t\t\t\t\t       \\\n-\tstruct {\t\t\t\t\t\t\t       \\\n-\t\tpthread_cond_t cond;\t\t\t\t\t       \\\n-\t\tpthread_mutex_t mutex;\t\t\t\t\t       \\\n-\t}\n+typedef struct {\n+\tpthread_cond_t cond;\n+\tpthread_mutex_t mutex;\n+\tuint8_t flag;\n+} ena_wait_event_t;\n \n-#define ena_wait_queue_t q_waitqueue_t\n-\n-#define ENA_WAIT_EVENT_INIT(waitqueue)\t\t\t\t\t       \\\n+#define ENA_WAIT_EVENT_INIT(waitevent)\t\t\t\t\t       \\\n \tdo {\t\t\t\t\t\t\t\t       \\\n-\t\tpthread_mutex_init(&(waitqueue).mutex, NULL);\t\t       \\\n-\t\tpthread_cond_init(&(waitqueue).cond, NULL);\t\t       \\\n+\t\tena_wait_event_t *_we = &(waitevent);\t\t\t       \\\n+\t\tpthread_mutex_init(&_we->mutex, NULL);\t\t\t       \\\n+\t\tpthread_cond_init(&_we->cond, NULL);\t\t\t       \\\n+\t\t_we->flag = 0;\t\t\t\t\t\t       \\\n \t} while (0)\n \n #define ENA_WAIT_EVENT_WAIT(waitevent, timeout)\t\t\t\t       \\\n \tdo {\t\t\t\t\t\t\t\t       \\\n+\t\tena_wait_event_t *_we = &(waitevent);\t\t\t       \\\n+\t\ttypeof(timeout) _tmo = (timeout);\t\t\t       \\\n+\t\tint ret = 0;\t\t\t\t\t\t       \\\n \t\tstruct timespec wait;\t\t\t\t\t       \\\n \t\tstruct timeval now;\t\t\t\t\t       \\\n \t\tunsigned long timeout_us;\t\t\t\t       \\\n \t\tgettimeofday(&now, NULL);\t\t\t\t       \\\n-\t\twait.tv_sec = now.tv_sec + timeout / 1000000UL;\t\t       \\\n-\t\ttimeout_us = timeout % 1000000UL;\t\t\t       \\\n+\t\twait.tv_sec = now.tv_sec + _tmo / 1000000UL;\t\t       \\\n+\t\ttimeout_us = _tmo % 1000000UL;\t\t\t\t       \\\n \t\twait.tv_nsec = (now.tv_usec + timeout_us) * 1000UL;\t       \\\n-\t\tpthread_mutex_lock(&waitevent.mutex);\t\t\t       \\\n-\t\tpthread_cond_timedwait(&waitevent.cond,\t\t\t       \\\n-\t\t\t\t&waitevent.mutex, &wait);\t\t       \\\n-\t\tpthread_mutex_unlock(&waitevent.mutex);\t\t\t       \\\n+\t\tpthread_mutex_lock(&_we->mutex);\t\t\t       \\\n+\t\twhile (ret == 0 && !_we->flag) {\t\t\t       \\\n+\t\t\tret = pthread_cond_timedwait(&_we->cond,\t       \\\n+\t\t\t\t&_we->mutex, &wait);\t\t\t       \\\n+\t\t}\t\t\t\t\t\t\t       \\\n+\t\t/* Asserts only if not working on ena_wait_event_t */\t       \\\n+\t\tif (unlikely(ret != 0 && ret != ETIMEDOUT))\t\t       \\\n+\t\t\trte_panic(\"Invalid wait event. pthread ret: %d\\n\",     \\\n+\t\t\t\t  ret);\t\t\t\t\t       \\\n+\t\telse if (unlikely(ret == ETIMEDOUT))\t\t\t       \\\n+\t\t\tena_trc_err(NULL,\t\t\t\t       \\\n+\t\t\t\t\"Timeout waiting for \" #waitevent \"\\n\");       \\\n+\t\t_we->flag = 0;\t\t\t\t\t\t       \\\n+\t\tpthread_mutex_unlock(&_we->mutex);\t\t\t       \\\n+\t} while (0)\n+#define ENA_WAIT_EVENT_SIGNAL(waitevent)\t\t\t\t       \\\n+\tdo {\t\t\t\t\t\t\t\t       \\\n+\t\tena_wait_event_t *_we = &(waitevent);\t\t\t       \\\n+\t\tpthread_mutex_lock(&_we->mutex);\t\t\t       \\\n+\t\t_we->flag = 1;\t\t\t\t\t\t       \\\n+\t\tpthread_cond_signal(&_we->cond);\t\t\t       \\\n+\t\tpthread_mutex_unlock(&_we->mutex);\t\t\t       \\\n \t} while (0)\n-#define ENA_WAIT_EVENT_SIGNAL(waitevent) pthread_cond_signal(&waitevent.cond)\n /* pthread condition doesn't need to be rearmed after usage */\n #define ENA_WAIT_EVENT_CLEAR(...)\n-#define ENA_WAIT_EVENT_DESTROY(admin_queue) ((void)(admin_queue))\n+#define ENA_WAIT_EVENT_DESTROY(waitevent) ((void)(waitevent))\n \n-#define ena_wait_event_t ena_wait_queue_t\n #define ENA_MIGHT_SLEEP()\n \n #define ena_time_t uint64_t\n@@ -284,15 +311,7 @@ extern rte_atomic64_t ena_alloc_cnt;\n #define ENA_TIME_EXPIRE(timeout)  (timeout < rte_get_timer_cycles())\n #define ENA_GET_SYSTEM_TIMEOUT(timeout_us)\t\t\t\t       \\\n     (timeout_us * rte_get_timer_hz() / 1000000 + rte_get_timer_cycles())\n-#define ENA_WAIT_EVENTS_DESTROY(waitqueue) ((void)(waitqueue))\n-\n-#ifndef READ_ONCE\n-#define READ_ONCE(var) (*((volatile typeof(var) *)(&(var))))\n-#endif\n-\n-#define READ_ONCE8(var) READ_ONCE(var)\n-#define READ_ONCE16(var) READ_ONCE(var)\n-#define READ_ONCE32(var) READ_ONCE(var)\n+#define ENA_WAIT_EVENTS_DESTROY(admin_queue) ((void)(admin_queue))\n \n /* The size must be 8 byte align */\n #define ENA_MEMCPY_TO_DEVICE_64(dst, src, size)\t\t\t\t       \\\n",
    "prefixes": [
        "v2",
        "16/22"
    ]
}