From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 39CED5424 for ; Thu, 3 Jan 2019 09:26:48 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 3 Jan 2019 10:26:46 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x038Qiqg002007; Thu, 3 Jan 2019 10:26:45 +0200 From: Yongseok Koh To: alejandro.lucero@netronome.com, cristian.dumitrescu@intel.com Cc: stable@dpdk.org, guruprasadx.rao@intel.com Date: Thu, 3 Jan 2019 00:26:26 -0800 Message-Id: <20190103082627.17224-1-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 17.11 1/2] table: fix casting cuckoo hash function X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 08:26:48 -0000 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 Signed-off-by: Yongseok Koh --- 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