Hi @dpdk community,
In my application, I am using the dpdk hash table as below.
1. calculate the hash value.
2. using this signature add the key and data into a table.
3. lock is used in the 2nd call (add).
Below is the code sniffer for the same.
==================================================================
hash_sig_t sig = rte_hash_hash(hash_tablele, (void *) &new_key);
pthread_mutex_lock(&lock);
int32_t ret = rte_hash_add_key_with_hash_data(hash_table,
(void *)&new_key,
sig,
info);
if (ret < 0)
{
pthread_mutex_unlock(lock);
return TOS_E_FAIL;
}
pthread_mutex_unlock(lock);
return OK..
==================================================================
My application is having a lot of threads and when run with heavy load , I am getting a lot of insertion failure, i felt the reason could be calculating and adding the has value in 2 api's as opposed to rte_hash_add() that is safe under a lock..
Please let me know your thoughts.
Thank you,
Venkatesh.