diff options
author | 2016-07-31 11:16:27 +0300 | |
---|---|---|
committer | 2016-07-31 11:21:40 +0300 | |
commit | dceb010b01e9f8a0e9c905370d39f149f01cab7e (patch) | |
tree | 562201fb20db07440462f27e4d8b95ad3ce84611 /src/dpdk/lib/librte_mempool | |
parent | 81c896604a50486d8b658dc559f7b98492d778e5 (diff) |
dpdk 16.07 - merges of final version changes
Diffstat (limited to 'src/dpdk/lib/librte_mempool')
-rw-r--r-- | src/dpdk/lib/librte_mempool/rte_mempool.c | 3 | ||||
-rw-r--r-- | src/dpdk/lib/librte_mempool/rte_mempool.h | 11 | ||||
-rw-r--r-- | src/dpdk/lib/librte_mempool/rte_mempool_ops.c | 1 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/dpdk/lib/librte_mempool/rte_mempool.c b/src/dpdk/lib/librte_mempool/rte_mempool.c index 8806633b..2e28e2e8 100644 --- a/src/dpdk/lib/librte_mempool/rte_mempool.c +++ b/src/dpdk/lib/librte_mempool/rte_mempool.c @@ -1283,12 +1283,13 @@ void rte_mempool_walk(void (*func)(struct rte_mempool *, void *), { struct rte_tailq_entry *te = NULL; struct rte_mempool_list *mempool_list; + void *tmp_te; mempool_list = RTE_TAILQ_CAST(rte_mempool_tailq.head, rte_mempool_list); rte_rwlock_read_lock(RTE_EAL_MEMPOOL_RWLOCK); - TAILQ_FOREACH(te, mempool_list, next) { + TAILQ_FOREACH_SAFE(te, mempool_list, next, tmp_te) { (*func)((struct rte_mempool *) te->data, arg); } diff --git a/src/dpdk/lib/librte_mempool/rte_mempool.h b/src/dpdk/lib/librte_mempool/rte_mempool.h index 4a8fbb1e..059ad9e5 100644 --- a/src/dpdk/lib/librte_mempool/rte_mempool.h +++ b/src/dpdk/lib/librte_mempool/rte_mempool.h @@ -123,7 +123,9 @@ struct rte_mempool_objsz { /**< Total size of an object (header + elt + trailer). */ }; -#define RTE_MEMPOOL_NAMESIZE 32 /**< Maximum length of a memory pool. */ +/**< Maximum length of a memory pool's name. */ +#define RTE_MEMPOOL_NAMESIZE (RTE_RING_NAMESIZE - \ + sizeof(RTE_MEMPOOL_MZ_PREFIX) + 1) #define RTE_MEMPOOL_MZ_PREFIX "MP_" /* "MP_<name>" */ @@ -208,7 +210,12 @@ struct rte_mempool_memhdr { * The RTE mempool structure. */ struct rte_mempool { - char name[RTE_MEMPOOL_NAMESIZE]; /**< Name of mempool. */ + /* + * Note: this field kept the RTE_MEMZONE_NAMESIZE size due to ABI + * compatibility requirements, it could be changed to + * RTE_MEMPOOL_NAMESIZE next time the ABI changes + */ + char name[RTE_MEMZONE_NAMESIZE]; /**< Name of mempool. */ union { void *pool_data; /**< Ring or pool to store objects. */ uint64_t pool_id; /**< External mempool identifier. */ diff --git a/src/dpdk/lib/librte_mempool/rte_mempool_ops.c b/src/dpdk/lib/librte_mempool/rte_mempool_ops.c index fd0b64cf..5f24de25 100644 --- a/src/dpdk/lib/librte_mempool/rte_mempool_ops.c +++ b/src/dpdk/lib/librte_mempool/rte_mempool_ops.c @@ -81,6 +81,7 @@ rte_mempool_register_ops(const struct rte_mempool_ops *h) ops = &rte_mempool_ops_table.ops[ops_index]; snprintf(ops->name, sizeof(ops->name), "%s", h->name); ops->alloc = h->alloc; + ops->free = h->free; ops->enqueue = h->enqueue; ops->dequeue = h->dequeue; ops->get_count = h->get_count; |