Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/9222/?format=api
http://patchwork.dpdk.org/api/1.0/patches/9222/?format=api", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/1.0/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" }, "msgid": "<1449022747-1056-1-git-send-email-yuwb_bjy@ctbri.com.cn>", "date": "2015-12-02T02:19:07", "name": "[dpdk-dev] hash: add rte_hash_set_cmp_func() function to DPDK_2.2.", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "05feca64c01deaa107a4382b931d5ff67e83923e", "submitter": { "id": 376, "url": "http://patchwork.dpdk.org/api/1.0/people/376/?format=api", "name": "Yu Nemo Wenbin", "email": "yuwb_bjy@ctbri.com.cn" }, "delegate": null, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1449022747-1056-1-git-send-email-yuwb_bjy@ctbri.com.cn/mbox/", "series": [], "check": "pending", "checks": "http://patchwork.dpdk.org/api/patches/9222/checks/", "tags": {}, "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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id A26738D96;\n\tWed, 2 Dec 2015 03:19:35 +0100 (CET)", "from mail.ctbri.com.cn (unknown [219.142.69.33])\n\tby dpdk.org (Postfix) with ESMTP id C057558DB\n\tfor <dev@dpdk.org>; Wed, 2 Dec 2015 03:19:33 +0100 (CET)", "from localhost.localdomain ([10.9.63.134])\n\tby mail.ctbri.com.cn (Lotus Domino Release 8.5.3FP1)\n\twith ESMTP id 2015120210193113-156462 ;\n\tWed, 2 Dec 2015 10:19:31 +0800 " ], "From": "Yu Nemo Wenbin <yuwb_bjy@ctbri.com.cn>", "To": "dev@dpdk.org", "Date": "Wed, 2 Dec 2015 10:19:07 +0800", "Message-Id": "<1449022747-1056-1-git-send-email-yuwb_bjy@ctbri.com.cn>", "X-Mailer": "git-send-email 1.9.1", "X-MIMETrack": "Itemize by SMTP Server on mailserver/ctbri(Release\n\t8.5.3FP1|March 07, 2012) at 2015/12/02 10:19:31,\n\tSerialize by Router on mailserver/ctbri(Release 8.5.3FP1|March 07,\n\t2012) at\n\t2015/12/02 10:19:34, Serialize complete at 2015/12/02 10:19:34", "X-TNEFEvaluated": "1", "Subject": "[dpdk-dev] [PATCH] hash: add rte_hash_set_cmp_func() function to\n\tDPDK_2.2.", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Give user a chance to customize the hash key compare function.\nThe default rte_hash_cmp_eq function is set in the rte_hash_create\nfunction, but these builtin ones may not be good enough, so the user\nmay call this to override the default one.\n\nSigned-off-by: Yu Nemo Wenbin <yuwb_bjy@ctbri.com.cn>\n---\n lib/librte_hash/rte_cuckoo_hash.c | 7 +++++--\n lib/librte_hash/rte_hash.h | 15 +++++++++++++++\n lib/librte_hash/rte_hash_version.map | 7 +++++++\n 3 files changed, 27 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c\nindex 88f77c3..2ccb81c 100644\n--- a/lib/librte_hash/rte_cuckoo_hash.c\n+++ b/lib/librte_hash/rte_cuckoo_hash.c\n@@ -102,8 +102,6 @@ EAL_REGISTER_TAILQ(rte_hash_tailq)\n \n #define LCORE_CACHE_SIZE\t\t8\n \n-typedef int (*rte_hash_cmp_eq_t)(const void *key1, const void *key2, size_t key_len);\n-\n struct lcore_cache {\n \tunsigned len; /**< Cache len */\n \tvoid *objs[LCORE_CACHE_SIZE]; /**< Cache objects */\n@@ -187,6 +185,11 @@ rte_hash_find_existing(const char *name)\n \treturn h;\n }\n \n+void rte_hash_set_cmp_func(struct rte_hash *h, rte_hash_cmp_eq_t func)\n+{\n+ h->rte_hash_cmp_eq = func;\n+}\n+\n struct rte_hash *\n rte_hash_create(const struct rte_hash_parameters *params)\n {\ndiff --git a/lib/librte_hash/rte_hash.h b/lib/librte_hash/rte_hash.h\nindex b678766..dfca5ef 100644\n--- a/lib/librte_hash/rte_hash.h\n+++ b/lib/librte_hash/rte_hash.h\n@@ -66,6 +66,9 @@ typedef uint32_t hash_sig_t;\n typedef uint32_t (*rte_hash_function)(const void *key, uint32_t key_len,\n \t\t\t\t uint32_t init_val);\n \n+/** Type of function used to compare the hash key. */\n+typedef int (*rte_hash_cmp_eq_t)(const void *key1, const void *key2, size_t key_len);\n+\n /**\n * Parameters used when creating the hash table.\n */\n@@ -104,6 +107,18 @@ struct rte_hash *\n rte_hash_create(const struct rte_hash_parameters *params);\n \n /**\n+ * Set the rte_hash_set_cmp_func.\n+ * Set a new hash compare function other than the default one.\n+ *\n+ * @note Function pointer does not work with multi-process, so don't use it\n+ * in multi-process mode.\n+ *\n+ * @param h\n+ * Hash table to reset\n+ */\n+void rte_hash_set_cmp_func(struct rte_hash *h, rte_hash_cmp_eq_t func);\n+\n+/**\n * Find an existing hash table object and return a pointer to it.\n *\n * @param name\ndiff --git a/lib/librte_hash/rte_hash_version.map b/lib/librte_hash/rte_hash_version.map\nindex 906c8ad..1aa94f9 100644\n--- a/lib/librte_hash/rte_hash_version.map\n+++ b/lib/librte_hash/rte_hash_version.map\n@@ -32,3 +32,10 @@ DPDK_2.1 {\n \trte_hash_reset;\n \n } DPDK_2.0;\n+\n+DPDK_2.2 {\n+\tglobal:\n+\n+\trte_hash_set_cmp_func;\n+\n+} DPDK_2.1;\n", "prefixes": [ "dpdk-dev" ] }{ "id": 9222, "url": "