get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 53359,
    "url": "http://patches.dpdk.org/api/patches/53359/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190509171907.14693-4-dharmik.thakkar@arm.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": "<20190509171907.14693-4-dharmik.thakkar@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190509171907.14693-4-dharmik.thakkar@arm.com",
    "date": "2019-05-09T17:19:07",
    "name": "[v4,3/3] test/hash: add test for 'free key with position'",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0952499352a8ec630973250ec4271ebfc12efeec",
    "submitter": {
        "id": 1108,
        "url": "http://patches.dpdk.org/api/people/1108/?format=api",
        "name": "Dharmik Thakkar",
        "email": "dharmik.thakkar@arm.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190509171907.14693-4-dharmik.thakkar@arm.com/mbox/",
    "series": [
        {
            "id": 4621,
            "url": "http://patches.dpdk.org/api/series/4621/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4621",
            "date": "2019-05-09T17:19:04",
            "name": "hash: fix bugs in 'free key with position'",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/4621/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/53359/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/53359/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 D74CB5681;\n\tThu,  9 May 2019 19:20:03 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.101.70])\n\tby dpdk.org (Postfix) with ESMTP id BE0A14C6C\n\tfor <dev@dpdk.org>; Thu,  9 May 2019 19:19:57 +0200 (CEST)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249])\n\tby usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0809C169E;\n\tThu,  9 May 2019 10:19:57 -0700 (PDT)",
            "from dp6132.austin.arm.com (dp6132.austin.arm.com [10.118.12.38])\n\tby usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id\n\t962093F6C4; Thu,  9 May 2019 10:19:56 -0700 (PDT)"
        ],
        "From": "Dharmik Thakkar <dharmik.thakkar@arm.com>",
        "To": "Yipeng Wang <yipeng1.wang@intel.com>,\n\tSameh Gobriel <sameh.gobriel@intel.com>,\n\tBruce Richardson <bruce.richardson@intel.com>,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>",
        "Cc": "dev@dpdk.org, honnappa.nagarahalli@arm.com, zhongdahulinfan@163.com,\n\tDharmik Thakkar <dharmik.thakkar@arm.com>",
        "Date": "Thu,  9 May 2019 17:19:07 +0000",
        "Message-Id": "<20190509171907.14693-4-dharmik.thakkar@arm.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190509171907.14693-1-dharmik.thakkar@arm.com>",
        "References": "<20190509133924.7153-1-dharmik.thakkar@arm.com>\n\t<20190509171907.14693-1-dharmik.thakkar@arm.com>",
        "Subject": "[dpdk-dev] [PATCH v4 3/3] test/hash: add test for 'free key with\n\tposition'",
        "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": "This patch adds a unit test for rte_hash_free_key_with_position().\n\nSuggested-by: Linfan <zhongdahulinfan@163.com>\nSigned-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>\n---\n app/test/test_hash.c | 94 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 94 insertions(+)",
    "diff": "diff --git a/app/test/test_hash.c b/app/test/test_hash.c\nindex 390fbef87f42..e162592965ce 100644\n--- a/app/test/test_hash.c\n+++ b/app/test/test_hash.c\n@@ -481,6 +481,98 @@ static int test_add_update_delete_free(void)\n \treturn 0;\n }\n \n+/*\n+ * Sequence of operations for a single key with 'rw concurrency lock free' set:\n+ *\t- add\n+ *\t- delete: hit\n+ *\t- free: hit\n+ * Repeat the test case when 'multi writer add' is enabled.\n+ *\t- add\n+ *\t- delete: hit\n+ *\t- free: hit\n+ */\n+static int test_add_delete_free_lf(void)\n+{\n+/* Should match the #define LCORE_CACHE_SIZE value in rte_cuckoo_hash.h */\n+#define LCORE_CACHE_SIZE\t64\n+\tstruct rte_hash *handle;\n+\thash_sig_t hash_value;\n+\tint pos, expectedPos, delPos;\n+\tuint8_t extra_flag;\n+\tuint32_t i, ip_src;\n+\n+\textra_flag = ut_params.extra_flag;\n+\tut_params.extra_flag = RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF;\n+\thandle = rte_hash_create(&ut_params);\n+\tRETURN_IF_ERROR(handle == NULL, \"hash creation failed\");\n+\tut_params.extra_flag = extra_flag;\n+\n+\t/*\n+\t * The number of iterations is at least the same as the number of slots\n+\t * rte_hash allocates internally. This is to reveal potential issues of\n+\t * not freeing keys successfully.\n+\t */\n+\tfor (i = 0; i < ut_params.entries + 1; i++) {\n+\t\thash_value = rte_hash_hash(handle, &keys[0]);\n+\t\tpos = rte_hash_add_key_with_hash(handle, &keys[0], hash_value);\n+\t\tprint_key_info(\"Add\", &keys[0], pos);\n+\t\tRETURN_IF_ERROR(pos < 0, \"failed to add key (pos=%d)\", pos);\n+\t\texpectedPos = pos;\n+\n+\t\tpos = rte_hash_del_key_with_hash(handle, &keys[0], hash_value);\n+\t\tprint_key_info(\"Del\", &keys[0], pos);\n+\t\tRETURN_IF_ERROR(pos != expectedPos,\n+\t\t\t\t\"failed to delete key (pos=%d)\", pos);\n+\t\tdelPos = pos;\n+\n+\t\tpos = rte_hash_free_key_with_position(handle, delPos);\n+\t\tprint_key_info(\"Free\", &keys[0], delPos);\n+\t\tRETURN_IF_ERROR(pos != 0,\n+\t\t\t\t\"failed to free key (pos=%d)\", delPos);\n+\t}\n+\n+\trte_hash_free(handle);\n+\n+\textra_flag = ut_params.extra_flag;\n+\tut_params.extra_flag = RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF |\n+\t\t\t\tRTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD;\n+\thandle = rte_hash_create(&ut_params);\n+\tRETURN_IF_ERROR(handle == NULL, \"hash creation failed\");\n+\tut_params.extra_flag = extra_flag;\n+\n+\tip_src = keys[0].ip_src;\n+\t/*\n+\t * The number of iterations is at least the same as the number of slots\n+\t * rte_hash allocates internally. This is to reveal potential issues of\n+\t * not freeing keys successfully.\n+\t */\n+\tfor (i = 0; i < ut_params.entries + (RTE_MAX_LCORE - 1) *\n+\t\t\t\t\t(LCORE_CACHE_SIZE - 1) + 1; i++) {\n+\t\tkeys[0].ip_src++;\n+\t\thash_value = rte_hash_hash(handle, &keys[0]);\n+\t\tpos = rte_hash_add_key_with_hash(handle, &keys[0], hash_value);\n+\t\tprint_key_info(\"Add\", &keys[0], pos);\n+\t\tRETURN_IF_ERROR(pos < 0, \"failed to add key (pos=%d)\", pos);\n+\t\texpectedPos = pos;\n+\n+\t\tpos = rte_hash_del_key_with_hash(handle, &keys[0], hash_value);\n+\t\tprint_key_info(\"Del\", &keys[0], pos);\n+\t\tRETURN_IF_ERROR(pos != expectedPos,\n+\t\t\t\"failed to delete key (pos=%d)\", pos);\n+\t\tdelPos = pos;\n+\n+\t\tpos = rte_hash_free_key_with_position(handle, delPos);\n+\t\tprint_key_info(\"Free\", &keys[0], delPos);\n+\t\tRETURN_IF_ERROR(pos != 0,\n+\t\t\t\"failed to free key (pos=%d)\", delPos);\n+\t}\n+\tkeys[0].ip_src = ip_src;\n+\n+\trte_hash_free(handle);\n+\n+\treturn 0;\n+}\n+\n /*\n  * Sequence of operations for retrieving a key with its position\n  *\n@@ -1743,6 +1835,8 @@ test_hash(void)\n \t\treturn -1;\n \tif (test_add_update_delete_free() < 0)\n \t\treturn -1;\n+\tif (test_add_delete_free_lf() < 0)\n+\t\treturn -1;\n \tif (test_five_keys() < 0)\n \t\treturn -1;\n \tif (test_full_bucket() < 0)\n",
    "prefixes": [
        "v4",
        "3/3"
    ]
}