Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/53327/?format=api
http://patches.dpdk.org/api/patches/53327/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190508165121.20471-3-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": "<20190508165121.20471-3-dharmik.thakkar@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190508165121.20471-3-dharmik.thakkar@arm.com", "date": "2019-05-08T16:51:21", "name": "[2/2] test/hash: add test for 'free key with position'", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "34547e937bd7faea639bb07bc07822460002c41b", "submitter": { "id": 1108, "url": "http://patches.dpdk.org/api/people/1108/?format=api", "name": "Dharmik Thakkar", "email": "dharmik.thakkar@arm.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/20190508165121.20471-3-dharmik.thakkar@arm.com/mbox/", "series": [ { "id": 4600, "url": "http://patches.dpdk.org/api/series/4600/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4600", "date": "2019-05-08T16:51:19", "name": "hash: fix bugs in 'free key with position'", "version": 1, "mbox": "http://patches.dpdk.org/series/4600/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/53327/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/53327/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 932C44C8F;\n\tWed, 8 May 2019 18:51:47 +0200 (CEST)", "from foss.arm.com (foss.arm.com [217.140.101.70])\n\tby dpdk.org (Postfix) with ESMTP id DC9C13DC\n\tfor <dev@dpdk.org>; Wed, 8 May 2019 18:51:41 +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 2065315AB;\n\tWed, 8 May 2019 09:51:41 -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\tAEE683F238; Wed, 8 May 2019 09:51:40 -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": "Wed, 8 May 2019 16:51:21 +0000", "Message-Id": "<20190508165121.20471-3-dharmik.thakkar@arm.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190508165121.20471-1-dharmik.thakkar@arm.com>", "References": "<20190508165121.20471-1-dharmik.thakkar@arm.com>", "Subject": "[dpdk-dev] [PATCH 2/2] 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 | 83 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 83 insertions(+)", "diff": "diff --git a/app/test/test_hash.c b/app/test/test_hash.c\nindex 390fbef87f42..a6949f2579a2 100644\n--- a/app/test/test_hash.c\n+++ b/app/test/test_hash.c\n@@ -481,6 +481,87 @@ 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+#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+\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+\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 +1824,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": [ "2/2" ] }{ "id": 53327, "url": "