Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/55376/?format=api
http://patches.dpdk.org/api/patches/55376/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190625211520.43181-2-honnappa.nagarahalli@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": "<20190625211520.43181-2-honnappa.nagarahalli@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190625211520.43181-2-honnappa.nagarahalli@arm.com", "date": "2019-06-25T21:15:18", "name": "[1/3] lib/hash: use ordered loads only if signature matches", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c076caeb4da24e523ca0f134794ff3f9c292417f", "submitter": { "id": 1045, "url": "http://patches.dpdk.org/api/people/1045/?format=api", "name": "Honnappa Nagarahalli", "email": "honnappa.nagarahalli@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/20190625211520.43181-2-honnappa.nagarahalli@arm.com/mbox/", "series": [ { "id": 5166, "url": "http://patches.dpdk.org/api/series/5166/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5166", "date": "2019-06-25T21:15:17", "name": "lib/hash: perf improvements for lock-free", "version": 1, "mbox": "http://patches.dpdk.org/series/5166/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/55376/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/55376/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 343321B9A1;\n\tTue, 25 Jun 2019 23:15:44 +0200 (CEST)", "from foss.arm.com (foss.arm.com [217.140.110.172])\n\tby dpdk.org (Postfix) with ESMTP id BAC8A1B993;\n\tTue, 25 Jun 2019 23:15:40 +0200 (CEST)", "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n\tby usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 03DDBC0A;\n\tTue, 25 Jun 2019 14:15:40 -0700 (PDT)", "from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com\n\t[10.118.12.65])\n\tby usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id\n\tE4F163F7D8; Tue, 25 Jun 2019 14:15:39 -0700 (PDT)" ], "From": "Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>", "To": "yipeng1.wang@intel.com, sameh.gobriel@intel.com,\n\tbruce.richardson@intel.com, pablo.de.lara.guarch@intel.com,\n\thonnappa.nagarahalli@arm.com", "Cc": "gavin.hu@arm.com, ruifeng.wang@arm.com, dev@dpdk.org, nd@arm.com,\n\tstable@dpdk.org", "Date": "Tue, 25 Jun 2019 16:15:18 -0500", "Message-Id": "<20190625211520.43181-2-honnappa.nagarahalli@arm.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190625211520.43181-1-honnappa.nagarahalli@arm.com>", "References": "<20190625211520.43181-1-honnappa.nagarahalli@arm.com>", "Subject": "[dpdk-dev] [PATCH 1/3] lib/hash: use ordered loads only if\n\tsignature matches", "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": "Relaxed signature comparison is done first. Further ordered loads\nare done only if the signature matches. Any false positives are\ncaught by the full key comparison.\n\nFixes: e605a1d36 (\"hash: add lock-free r/w concurrency\")\nCc: stable@dpdk.org\n\nSigned-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nReviewed-by: Gavin Hu <gavin.hu@arm.com>\nTested-by: Ruifeng Wang <ruifeng.wang@arm.com>\n---\n lib/librte_hash/rte_cuckoo_hash.c | 35 ++++++++++++++++++-------------\n 1 file changed, 21 insertions(+), 14 deletions(-)", "diff": "diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c\nindex 953928f27..f37f6957d 100644\n--- a/lib/librte_hash/rte_cuckoo_hash.c\n+++ b/lib/librte_hash/rte_cuckoo_hash.c\n@@ -1188,22 +1188,29 @@ search_one_bucket_lf(const struct rte_hash *h, const void *key, uint16_t sig,\n \tstruct rte_hash_key *k, *keys = h->key_store;\n \n \tfor (i = 0; i < RTE_HASH_BUCKET_ENTRIES; i++) {\n-\t\tkey_idx = __atomic_load_n(&bkt->key_idx[i],\n+\t\t/* Signature comparison is done before the acquire-load\n+\t\t * of the key index to achieve better performance.\n+\t\t * Any false positives will be caught in full comparison\n+\t\t * of the key.\n+\t\t */\n+\t\tif (bkt->sig_current[i] == sig) {\n+\t\t\tkey_idx = __atomic_load_n(&bkt->key_idx[i],\n \t\t\t\t\t __ATOMIC_ACQUIRE);\n-\t\tif (bkt->sig_current[i] == sig && key_idx != EMPTY_SLOT) {\n-\t\t\tk = (struct rte_hash_key *) ((char *)keys +\n-\t\t\t\t\tkey_idx * h->key_entry_size);\n-\t\t\tpdata = __atomic_load_n(&k->pdata,\n-\t\t\t\t\t__ATOMIC_ACQUIRE);\n+\t\t\tif (key_idx != EMPTY_SLOT) {\n+\t\t\t\tk = (struct rte_hash_key *) ((char *)keys +\n+\t\t\t\t\t\tkey_idx * h->key_entry_size);\n+\t\t\t\tpdata = __atomic_load_n(&k->pdata,\n+\t\t\t\t\t\t__ATOMIC_ACQUIRE);\n \n-\t\t\tif (rte_hash_cmp_eq(key, k->key, h) == 0) {\n-\t\t\t\tif (data != NULL)\n-\t\t\t\t\t*data = pdata;\n-\t\t\t\t/*\n-\t\t\t\t * Return index where key is stored,\n-\t\t\t\t * subtracting the first dummy index\n-\t\t\t\t */\n-\t\t\t\treturn key_idx - 1;\n+\t\t\t\tif (rte_hash_cmp_eq(key, k->key, h) == 0) {\n+\t\t\t\t\tif (data != NULL)\n+\t\t\t\t\t\t*data = pdata;\n+\t\t\t\t\t/*\n+\t\t\t\t\t * Return index where key is stored,\n+\t\t\t\t\t * subtracting the first dummy index\n+\t\t\t\t\t */\n+\t\t\t\t\treturn key_idx - 1;\n+\t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n", "prefixes": [ "1/3" ] }{ "id": 55376, "url": "