env: Add spdk_mempool_get_name

Purpose: To get the name of a mempool

Change-Id: Ic23f93a03db9bcef54808dfd350b1403a47c21d7
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/390937
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Ziye Yang 2017-12-08 17:01:12 +08:00 committed by Ben Walker
parent edd03d6ce1
commit 2a4d18e391
2 changed files with 11 additions and 0 deletions

View File

@ -154,6 +154,11 @@ struct spdk_mempool;
struct spdk_mempool *spdk_mempool_create(const char *name, size_t count,
size_t ele_size, size_t cache_size, int socket_id);
/**
* Get the name of a mempool
*/
char *spdk_mempool_get_name(struct spdk_mempool *mp);
/**
* Free a memory pool.
*/

View File

@ -177,6 +177,12 @@ spdk_mempool_create(const char *name, size_t count,
return (struct spdk_mempool *)mp;
}
char *
spdk_mempool_get_name(struct spdk_mempool *mp)
{
return ((struct rte_mempool *)mp)->name;
}
void
spdk_mempool_free(struct spdk_mempool *mp)
{