Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/53337/?format=api
http://patches.dpdk.org/api/patches/53337/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190508225924.21200-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": "<20190508225924.21200-2-dharmik.thakkar@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190508225924.21200-2-dharmik.thakkar@arm.com", "date": "2019-05-08T22:59:23", "name": "[v2,1/2] hash: fix bugs in 'free key with position'", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "771afd55e6c52df1bd9629ca6eb4aff9cd76a58f", "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/20190508225924.21200-2-dharmik.thakkar@arm.com/mbox/", "series": [ { "id": 4606, "url": "http://patches.dpdk.org/api/series/4606/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4606", "date": "2019-05-08T22:59:22", "name": "hash: fix bugs in 'free key with position'", "version": 2, "mbox": "http://patches.dpdk.org/series/4606/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/53337/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/53337/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 9DF254C8F;\n\tThu, 9 May 2019 00:59:39 +0200 (CEST)", "from foss.arm.com (foss.arm.com [217.140.101.70])\n\tby dpdk.org (Postfix) with ESMTP id DC1682BD5;\n\tThu, 9 May 2019 00:59:36 +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 24835A78;\n\tWed, 8 May 2019 15:59:36 -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\tA9CE63F7BD; Wed, 8 May 2019 15:59:35 -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": "Wed, 8 May 2019 22:59:23 +0000", "Message-Id": "<20190508225924.21200-2-dharmik.thakkar@arm.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190508225924.21200-1-dharmik.thakkar@arm.com>", "References": "<20190508165121.20471-1-dharmik.thakkar@arm.com>\n\t<20190508225924.21200-1-dharmik.thakkar@arm.com>", "Subject": "[dpdk-dev] [PATCH v2 1/2] hash: fix bugs in 'free key with position'", "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 fixes 2 bugs-\n1] Incorrect position returned to the free slots.\n2] Incorrect computation of total_entries\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 | 15 ++++++++++-----\n 1 file changed, 10 insertions(+), 5 deletions(-)", "diff": "diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c\nindex 261267b7fd3d..ed2e96b6f178 100644\n--- a/lib/librte_hash/rte_cuckoo_hash.c\n+++ b/lib/librte_hash/rte_cuckoo_hash.c\n@@ -1587,14 +1587,19 @@ 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->use_local_cache ?\n+\t\th->entries + (RTE_MAX_LCORE - 1) * (LCORE_CACHE_SIZE - 1) + 1\n+\t\t\t\t\t\t\t: h->entries + 1;\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 +1624,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": [ "v2", "1/2" ] }{ "id": 53337, "url": "