#include <rte_cpuflags.h>
#include <rte_log.h>
#include <rte_spinlock.h>
+#include <rte_tailq.h>
#include "rte_fbk_hash.h"
fbk_hash_list = RTE_TAILQ_CAST(rte_fbk_hash_tailq.head,
rte_fbk_hash_list);
- rte_rwlock_read_lock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_read_lock();
TAILQ_FOREACH(te, fbk_hash_list, next) {
h = (struct rte_fbk_hash_table *) te->data;
if (strncmp(name, h->name, RTE_FBK_HASH_NAMESIZE) == 0)
break;
}
- rte_rwlock_read_unlock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_read_unlock();
if (te == NULL) {
rte_errno = ENOENT;
return NULL;
snprintf(hash_name, sizeof(hash_name), "FBK_%s", params->name);
- rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_write_lock();
/* guarantee there's no existing */
TAILQ_FOREACH(te, fbk_hash_list, next) {
#endif
/* Set up hash table context. */
- snprintf(ht->name, sizeof(ht->name), "%s", params->name);
+ strlcpy(ht->name, params->name, sizeof(ht->name));
ht->entries = params->entries;
ht->entries_per_bucket = params->entries_per_bucket;
ht->used_entries = 0;
TAILQ_INSERT_TAIL(fbk_hash_list, te, next);
exit:
- rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_write_unlock();
return ht;
}
fbk_hash_list = RTE_TAILQ_CAST(rte_fbk_hash_tailq.head,
rte_fbk_hash_list);
- rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_write_lock();
/* find out tailq entry */
TAILQ_FOREACH(te, fbk_hash_list, next) {
}
if (te == NULL) {
- rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_write_unlock();
return;
}
TAILQ_REMOVE(fbk_hash_list, te, next);
- rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_write_unlock();
rte_free(ht);
rte_free(te);