#include <sys/queue.h>
#include <string.h>
#include <rte_mbuf.h>
+#include <rte_memory.h>
#include <rte_memzone.h>
#include <rte_errno.h>
#include <rte_string_fns.h>
-#include <rte_tailq.h>
#include <rte_eal_memconfig.h>
#include "rte_distributor.h"
TAILQ_HEAD(rte_distributor_list, rte_distributor);
+static struct rte_tailq_elem rte_distributor_tailq = {
+ .name = "RTE_DISTRIBUTOR",
+};
+EAL_REGISTER_TAILQ(rte_distributor_tailq)
+
/**** APIs called by workers ****/
void
return NULL;
}
- /* check that we have an initialised tail queue */
- distributor_list = RTE_TAILQ_LOOKUP_BY_IDX(RTE_TAILQ_DISTRIBUTOR,
- rte_distributor_list);
- if (distributor_list == NULL) {
- rte_errno = E_RTE_NO_TAILQ;
- return NULL;
- }
-
snprintf(mz_name, sizeof(mz_name), RTE_DISTRIB_PREFIX"%s", name);
mz = rte_memzone_reserve(mz_name, sizeof(*d), socket_id, NO_FLAGS);
if (mz == NULL) {
snprintf(d->name, sizeof(d->name), "%s", name);
d->num_workers = num_workers;
+ distributor_list = RTE_TAILQ_CAST(rte_distributor_tailq.head,
+ rte_distributor_list);
+
rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
TAILQ_INSERT_TAIL(distributor_list, d, next);
rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);