From: Masoud Hasanifard <masoudhasanifard@gmail.com>
To: dev@dpdk.org
Cc: Masoud Hasanifard <masoudhasanifard@gmail.com>
Subject: [PATCH] hash: Correctly set the compare function.
Date: Sat, 17 Sep 2016 14:13:24 +0430 [thread overview]
Message-ID: <1474105404-27654-1-git-send-email-masoudhasanifard@gmail.com> (raw)
Set cmp_jump_table_idx to KEY_CUSTOM in rte_hash_cmp_eq so that the custom
function we are setting in rte_hash_set_cmp_func properly works. The custom
function is only called by rte_hash_cmp_eq if cmp_jump_table_idx is set to
KEY_CUSTOM.
---
lib/librte_hash/rte_cuckoo_hash.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c
index 26e54f6..2e6429f 100644
--- a/lib/librte_hash/rte_cuckoo_hash.c
+++ b/lib/librte_hash/rte_cuckoo_hash.c
@@ -98,6 +98,7 @@ rte_hash_find_existing(const char *name)
void rte_hash_set_cmp_func(struct rte_hash *h, rte_hash_cmp_eq_t func)
{
+ h->cmp_jump_table_idx = KEY_CUSTOM;
h->rte_hash_custom_cmp_eq = func;
}
--
2.7.4
next reply other threads:[~2016-09-17 9:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-17 9:43 Masoud Hasanifard [this message]
2016-09-19 18:36 ` [PATCH] hash: Correctly set the compare function De Lara Guarch, Pablo
2016-09-21 21:29 ` Thomas Monjalon
2016-09-21 21:30 ` De Lara Guarch, Pablo
2016-09-22 15:42 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1474105404-27654-1-git-send-email-masoudhasanifard@gmail.com \
--to=masoudhasanifard@gmail.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.