#include <stdarg.h>
#include <sys/queue.h>
+#include <rte_string_fns.h>
#include <rte_log.h>
#include <rte_eal_memconfig.h>
#include <rte_errno.h>
#include <rte_ring.h>
#include <rte_jhash.h>
#include <rte_hash_crc.h>
+#include <rte_tailq.h>
#include "rte_efd.h"
#if defined(RTE_ARCH_X86)
/**< Array with all values of the keys of the group. */
uint8_t bin_id[EFD_MAX_GROUP_NUM_RULES];
- /**< Stores the bin for each correspending key to
+ /**< Stores the bin for each corresponding key to
* avoid having to recompute it
*/
};
num_chunks_shift = rte_bsf32(num_chunks);
- rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_write_lock();
/*
* Guarantee there's no existing: this is normally already checked
goto error_unlock_exit;
}
table->keys = key_array;
- snprintf(table->name, sizeof(table->name), "%s", name);
+ strlcpy(table->name, name, sizeof(table->name));
RTE_LOG(DEBUG, EFD, "Creating an EFD table with %u chunks,"
" which potentially supports %u entries\n",
te->data = (void *) table;
TAILQ_INSERT_TAIL(efd_list, te, next);
- rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_write_unlock();
snprintf(ring_name, sizeof(ring_name), "HT_%s", table->name);
/* Create ring (Dummy slot index is not enqueued) */
return table;
error_unlock_exit:
- rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_write_unlock();
rte_efd_free(table);
return NULL;
efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list);
- rte_rwlock_read_lock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_read_lock();
TAILQ_FOREACH(te, efd_list, next)
{
if (strncmp(name, table->name, RTE_EFD_NAMESIZE) == 0)
break;
}
- rte_rwlock_read_unlock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_read_unlock();
if (te == NULL) {
rte_errno = ENOENT;
rte_free(table->chunks[socket_id]);
efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list);
- rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_write_lock();
TAILQ_FOREACH_SAFE(te, efd_list, next, temp) {
if (te->data == (void *) table) {
}
}
- rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
+ rte_mcfg_tailq_write_unlock();
rte_ring_free(table->free_slots);
rte_free(table->offline_chunks);
rte_free(table->keys);