env: Add SPDK wrapper for rte_mempool_get_bulk()

Needed for crypto vbdev work.

Change-Id: Ib18ce3aaecf2388cf2cdc4dea110db514c8c1f1b
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/408256
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Paul Luse 2018-04-18 16:25:05 -07:00 committed by Daniel Verkamp
parent ddeaeeec19
commit 2536874e85
3 changed files with 21 additions and 0 deletions

View File

@ -2,6 +2,10 @@
## v18.04: (Upcoming Release)
## Env
Add wrapper for DPDK rte_mempool_get_bulk() via spdk_mempool_get_bulk().
### Bdev
Add new optional bdev module interface function, init_complete, to notify bdev modules

View File

@ -284,6 +284,17 @@ void spdk_mempool_free(struct spdk_mempool *mp);
*/
void *spdk_mempool_get(struct spdk_mempool *mp);
/**
* Get multiple elements from a memory pool.
*
* \param mp Memory pool to get multiple elements from.
* \param ele_arr Array of the elements to fill.
* \param count Count of elements to get.
*
* \return 0 on success, negative errno on failure.
*/
int spdk_mempool_get_bulk(struct spdk_mempool *mp, void **ele_arr, size_t count);
/**
* Put an element back into the memory pool.
*

View File

@ -224,6 +224,12 @@ spdk_mempool_get(struct spdk_mempool *mp)
return ele;
}
int
spdk_mempool_get_bulk(struct spdk_mempool *mp, void **ele_arr, size_t count)
{
return rte_mempool_get_bulk((struct rte_mempool *)mp, ele_arr, count);
}
void
spdk_mempool_put(struct spdk_mempool *mp, void *ele)
{