[dpdk-dev] DPDK hash function related question

Yeddula, Avinash ayeddula at ciena.com
Tue Sep 22 00:34:05 CEST 2015


Hello All,

I'm DPDK extensible bucket hash in the rte_table library of packet framework. My question is related to the actual hash function that computes the hash signature.

All the available examples have initialized it to test_hash.   I do not see any hash function available in rte_table library , that computes the actual signature



struct rte_table_hash_ext_params   hash_table_params = {

    .key_size = TABLE_ENTRY_KEY_SIZE,

    .n_keys = TABLE_MAX_SIZE,

    .n_buckets = TABLE_MAX_BUCKET_COUNT,

    .n_buckets_ext = TABLE_MAX_EXT_BUCKET_COUNT,

    .f_hash = test_hash,

    .seed = 0,

    .signature_offset = 0;

    .key_offset = __builtin_offsetof(struct metadata_t, tbl_key),

};



So, I wanted to use hash functions from DPDK rte_hash library. This is what I'm doing and looking at the code this looks ok to me.

I'm at least a week or 2 away from testing this part of the code. I wanted to confirm that, there is no fundamental flaw in using the DPDK rte_hash library and rte_table library like this. Could someone confirm this please ?



#define DEFAULT_HASH_FUNC rte_hash_crc



struct rte_table_hash_ext_params   hash_table_params = {

    .key_size = TABLE_ENTRY_KEY_SIZE,

    .n_keys = TABLE_MAX_SIZE,

    .n_buckets = TABLE_MAX_BUCKET_COUNT,

    .n_buckets_ext = TABLE_MAX_EXT_BUCKET_COUNT,

    .f_hash = DEFAULT_HASH_FUNC ,

    .seed = 0,

    .signature_offset = 0;

    .key_offset = __builtin_offsetof(struct metadata_t, tbl_key),

};



Thanks

-Avinash




More information about the dev mailing list