Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/53357/?format=api
http://patches.dpdk.org/api/patches/53357/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190509171907.14693-2-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-2-dharmik.thakkar@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190509171907.14693-2-dharmik.thakkar@arm.com", "date": "2019-05-09T17:19:05", "name": "[v4,1/3] hash: fix position bug in 'free key with position'", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "ef951afe9de9f8fb7b16b2a5c3aaaa1700944d8c", "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-2-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/53357/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/53357/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 AC5584C77;\n\tThu, 9 May 2019 19:19:59 +0200 (CEST)", "from foss.arm.com (foss.arm.com [217.140.101.70])\n\tby dpdk.org (Postfix) with ESMTP id B32372862;\n\tThu, 9 May 2019 19:19:56 +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 F3AB815AD;\n\tThu, 9 May 2019 10:19:55 -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\t846F13F6C4; Thu, 9 May 2019 10:19:55 -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>, stable@dpdk.org", "Date": "Thu, 9 May 2019 17:19:05 +0000", "Message-Id": "<20190509171907.14693-2-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 1/3] hash: fix position bug in '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": "Currently, in rte_hash_free_key_with_position(), the position returned\nto the ring of free_slots leads to an unexpected conflict with a key\nalready in use.\n\nThis patch fixes incorrect position returned to the ring of free_slots.\n\nBugzilla ID: 261\nFixes: 9d033dac7d7c (\"hash: support no free on delete\")\nCc: honnappa.nagarahalli@arm.com\nCc: stable@dpdk.org\n\nReported-by: Linfan <zhongdahulinfan@163.com>\nSuggested-by: Linfan <zhongdahulinfan@163.com>\nSigned-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>\n---\n lib/librte_hash/rte_cuckoo_hash.c | 13 ++++++++-----\n 1 file changed, 8 insertions(+), 5 deletions(-)", "diff": "diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c\nindex 261267b7fd3d..5029f9f61fae 100644\n--- a/lib/librte_hash/rte_cuckoo_hash.c\n+++ b/lib/librte_hash/rte_cuckoo_hash.c\n@@ -1587,14 +1587,17 @@ int __rte_experimental\n rte_hash_free_key_with_position(const struct rte_hash *h,\n \t\t\t\tconst int32_t position)\n {\n-\tRETURN_IF_TRUE(((h == NULL) || (position == EMPTY_SLOT)), -EINVAL);\n+\t/* Key index where key is stored, adding the first dummy index*/\n+\tuint32_t key_idx = position + 1;\n+\n+\tRETURN_IF_TRUE(((h == NULL) || (key_idx == EMPTY_SLOT)), -EINVAL);\n \n \tunsigned int lcore_id, n_slots;\n \tstruct lcore_cache *cached_free_slots;\n-\tconst int32_t total_entries = h->num_buckets * RTE_HASH_BUCKET_ENTRIES;\n+\tconst uint32_t total_entries = h->num_buckets * RTE_HASH_BUCKET_ENTRIES;\n \n \t/* Out of bounds */\n-\tif (position >= total_entries)\n+\tif (key_idx >= total_entries)\n \t\treturn -EINVAL;\n \tif (h->ext_table_support && h->readwrite_concur_lf_support) {\n \t\tuint32_t index = h->ext_bkt_to_free[position];\n@@ -1619,11 +1622,11 @@ rte_hash_free_key_with_position(const struct rte_hash *h,\n \t\t}\n \t\t/* Put index of new free slot in cache. */\n \t\tcached_free_slots->objs[cached_free_slots->len] =\n-\t\t\t\t\t(void *)((uintptr_t)position);\n+\t\t\t\t\t(void *)((uintptr_t)key_idx);\n \t\tcached_free_slots->len++;\n \t} else {\n \t\trte_ring_sp_enqueue(h->free_slots,\n-\t\t\t\t(void *)((uintptr_t)position));\n+\t\t\t\t(void *)((uintptr_t)key_idx));\n \t}\n \n \treturn 0;\n", "prefixes": [ "v4", "1/3" ] }{ "id": 53357, "url": "