get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 47196,
    "url": "http://patches.dpdk.org/api/patches/47196/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1540233588-202969-2-git-send-email-yipeng1.wang@intel.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": "<1540233588-202969-2-git-send-email-yipeng1.wang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1540233588-202969-2-git-send-email-yipeng1.wang@intel.com",
    "date": "2018-10-22T18:39:45",
    "name": "[v8,1/4] hash: fix race condition in iterate",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "eef45940a0adbc5b894f65651bcf472de4d35432",
    "submitter": {
        "id": 754,
        "url": "http://patches.dpdk.org/api/people/754/?format=api",
        "name": "Wang, Yipeng1",
        "email": "yipeng1.wang@intel.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/1540233588-202969-2-git-send-email-yipeng1.wang@intel.com/mbox/",
    "series": [
        {
            "id": 2017,
            "url": "http://patches.dpdk.org/api/series/2017/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2017",
            "date": "2018-10-22T18:39:44",
            "name": "hash: add extendable bucket and partial key hashing",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/2017/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/47196/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/47196/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 10BB01B1EA;\n\tTue, 23 Oct 2018 03:45:05 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id EB03C4F98\n\tfor <dev@dpdk.org>; Tue, 23 Oct 2018 03:44:59 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t22 Oct 2018 18:44:58 -0700",
            "from skx-yipeng.jf.intel.com ([10.54.81.175])\n\tby orsmga002.jf.intel.com with ESMTP; 22 Oct 2018 18:44:57 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.54,414,1534834800\"; d=\"scan'208\";a=\"102426687\"",
        "From": "Yipeng Wang <yipeng1.wang@intel.com>",
        "To": "bruce.richardson@intel.com",
        "Cc": "dev@dpdk.org,\n\tyipeng1.wang@intel.com,\n\thonnappa.nagarahalli@arm.com",
        "Date": "Mon, 22 Oct 2018 11:39:45 -0700",
        "Message-Id": "<1540233588-202969-2-git-send-email-yipeng1.wang@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1540233588-202969-1-git-send-email-yipeng1.wang@intel.com>",
        "References": "<1540233588-202969-1-git-send-email-yipeng1.wang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v8 1/4] hash: fix race condition in iterate",
        "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": "In rte_hash_iterate, the reader lock did not protect the\nwhile loop which checks empty entry. This created a race\ncondition that the entry may become empty when enters\nthe lock, then a wrong key data value would be read out.\n\nThis commit reads out the position in the while condition,\nwhich makes sure that the position will not be changed\nto empty before entering the lock.\n\nFixes: f2e3001b53ec (\"hash: support read/write concurrency\")\nCc: stable@dpdk.org\n\nSigned-off-by: Yipeng Wang <yipeng1.wang@intel.com>\nReported-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nReviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nAcked-by: Dharmik Thakkar <dharmik.thakkar@arm.com>\n---\n lib/librte_hash/rte_cuckoo_hash.c | 5 ++---\n 1 file changed, 2 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c\nindex f7b86c8..da8ddf4 100644\n--- a/lib/librte_hash/rte_cuckoo_hash.c\n+++ b/lib/librte_hash/rte_cuckoo_hash.c\n@@ -1318,7 +1318,7 @@ rte_hash_iterate(const struct rte_hash *h, const void **key, void **data, uint32\n \tidx = *next % RTE_HASH_BUCKET_ENTRIES;\n \n \t/* If current position is empty, go to the next one */\n-\twhile (h->buckets[bucket_idx].key_idx[idx] == EMPTY_SLOT) {\n+\twhile ((position = h->buckets[bucket_idx].key_idx[idx]) == EMPTY_SLOT) {\n \t\t(*next)++;\n \t\t/* End of table */\n \t\tif (*next == total_entries)\n@@ -1326,9 +1326,8 @@ rte_hash_iterate(const struct rte_hash *h, const void **key, void **data, uint32\n \t\tbucket_idx = *next / RTE_HASH_BUCKET_ENTRIES;\n \t\tidx = *next % RTE_HASH_BUCKET_ENTRIES;\n \t}\n+\n \t__hash_rw_reader_lock(h);\n-\t/* Get position of entry in key table */\n-\tposition = h->buckets[bucket_idx].key_idx[idx];\n \tnext_key = (struct rte_hash_key *) ((char *)h->key_store +\n \t\t\t\tposition * h->key_entry_size);\n \t/* Return key and data */\n",
    "prefixes": [
        "v8",
        "1/4"
    ]
}