DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] DPDK build issues with gcc-8
@ 2018-03-19 17:50 Stephen Hemminger
  0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2018-03-19 17:50 UTC (permalink / raw)
  To: dev, guruprasadx.rao

Tried building DPDK with gcc-8 and got several new warnings.
Working on trivial patches for most of them, but the DPDK rte_table interface
for hashing has a more fundamental problem which Gcc-8 discovers.

The code is trying to cast an RTE hash function into a RTE table hash function
with a different signature.  It works because the two are mostly the same, but
it really shouldn't be done that way:

Warning:
  CC rte_table_hash_cuckoo.o
lib/librte_table/rte_table_hash_cuckoo.c: In function ‘rte_table_hash_cuckoo_create’:
lib/librte_table/rte_table_hash_cuckoo.c:110: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),
                ^

RTE hash:
/** Type of function that can be used for calculating the hash value. */
typedef uint32_t (*rte_hash_function)(const void *key, uint32_t key_len,
				      uint32_t init_val);


RTE table hash:

/** Hash function */
typedef uint64_t (*rte_table_hash_op_hash)(
	void *key,
	void *key_mask,
	uint32_t key_size,
	uint64_t seed);

Just turning off the warning is not an acceptable solution. The API should really
be fixed. My preference would be to eliminate rte_table_hash_op_hash typedef
and keep rte_hash_function.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-19 17:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-19 17:50 [dpdk-dev] DPDK build issues with gcc-8 Stephen Hemminger

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).