aboutsummaryrefslogtreecommitdiff
path: root/platform/linux-dpdk/include/odp_pool_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linux-dpdk/include/odp_pool_internal.h')
-rw-r--r--platform/linux-dpdk/include/odp_pool_internal.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/platform/linux-dpdk/include/odp_pool_internal.h b/platform/linux-dpdk/include/odp_pool_internal.h
index 0b5df61af..39ca0f002 100644
--- a/platform/linux-dpdk/include/odp_pool_internal.h
+++ b/platform/linux-dpdk/include/odp_pool_internal.h
@@ -106,6 +106,25 @@ static inline pool_t *pool_entry_from_hdl(odp_pool_t pool_hdl)
return &_odp_pool_glb->pool[_odp_typeval(pool_hdl) - 1];
}
+static inline int _odp_buffer_alloc_multi(pool_t *pool,
+ odp_buffer_hdr_t *buf_hdr[], int num)
+{
+ int i;
+ struct rte_mempool *mp = pool->rte_mempool;
+
+ for (i = 0; i < num; i++) {
+ struct rte_mbuf *mbuf;
+
+ mbuf = rte_mbuf_raw_alloc(mp);
+ if (odp_unlikely(mbuf == NULL))
+ return i;
+
+ buf_hdr[i] = mbuf_to_buf_hdr(mbuf);
+ }
+
+ return i;
+}
+
static inline void _odp_buffer_free_multi(odp_buffer_hdr_t *buf_hdr[], int num)
{
int i;