From: Yongseok Koh <yskoh@mellanox.com>
To: alejandro.lucero@netronome.com, cristian.dumitrescu@intel.com
Cc: stable@dpdk.org, guruprasadx.rao@intel.com
Subject: [dpdk-stable] [PATCH 17.11 1/2] table: fix casting cuckoo hash function
Date: Thu, 3 Jan 2019 00:26:26 -0800 [thread overview]
Message-ID: <20190103082627.17224-1-yskoh@mellanox.com> (raw)
GCC 8.1 error:
lib/librte_table/rte_table_hash_cuckoo.c: In function
‘rte_table_hash_cuckoo_create’:
lib/librte_table/rte_table_hash_cuckoo.c:139:16: error: cast between
incompatible function types from ‘rte_table_hash_op_hash’ {aka ‘long
unsigned int (*)(void *, void *, unsigned int, long unsigned int)’} to
‘uint32_t (*)(const void *, uint32_t, uint32_t)’ {aka ‘unsigned int
(*)(const void *, unsigned int, unsigned int)’}
[-Werror=cast-function-type]
.hash_func = (rte_hash_function)(p->f_hash),
^
This issue is fixed by [1] in dpdk/master, but this patch is a workaround
to not break API/ABI in stable branch and originally suggested by
Andy Green [2].
[1] commit 8ea41438832a ("table: add dedicated params struct for cuckoo hash")
[2] https://mails.dpdk.org/archives/dev/2018-May/100405.html
Fixes: 5a80bf0ae613 ("table: add cuckoo hash")
Cc: guruprasadx.rao@intel.com
Suggested-by: Andy Green <andy@warmcat.com>
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
---
lib/librte_table/rte_table_hash_cuckoo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_table/rte_table_hash_cuckoo.c b/lib/librte_table/rte_table_hash_cuckoo.c
index f3845c752..c65228254 100644
--- a/lib/librte_table/rte_table_hash_cuckoo.c
+++ b/lib/librte_table/rte_table_hash_cuckoo.c
@@ -136,7 +136,7 @@ rte_table_hash_cuckoo_create(void *params,
struct rte_hash_parameters hash_cuckoo_params = {
.entries = p->n_keys,
.key_len = p->key_size,
- .hash_func = (rte_hash_function)(p->f_hash),
+ .hash_func = (rte_hash_function)(void *)(p->f_hash),
.hash_func_init_val = p->seed,
.socket_id = socket_id,
.name = p->name
--
2.11.0
next reply other threads:[~2019-01-03 8:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-03 8:26 Yongseok Koh [this message]
2019-01-03 8:26 ` [dpdk-stable] [PATCH 17.11 2/2] net/nfp: replace strncpy by strlcpy Yongseok Koh
2019-01-03 8:31 ` Yongseok Koh
2019-01-03 8:29 ` [dpdk-stable] [PATCH 17.11 1/2] table: fix casting cuckoo hash function Yongseok Koh
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=20190103082627.17224-1-yskoh@mellanox.com \
--to=yskoh@mellanox.com \
--cc=alejandro.lucero@netronome.com \
--cc=cristian.dumitrescu@intel.com \
--cc=guruprasadx.rao@intel.com \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).