env: Add an API to lookup the memory pool created by the primary process
Add spdk_mempool_lookup to lookup the memory pool created by the primary process. This will be utilized in SPDK multi process application future. Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I90505b6566dfc93ef5957ef4c73b1a6438c30742 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459739 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Seth Howell <seth.howell5141@gmail.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
60c8845fd0
commit
a57daa6976
@ -66,6 +66,9 @@ The parameter `free_space` has been added to spdk_ring_enqueue() to wait when
|
||||
the ring is almost full and resume when there is enough space available in
|
||||
the ring.
|
||||
|
||||
A new API `spdk_mempool_lookup` has been added to lookup the memory pool created
|
||||
by the primary process.
|
||||
|
||||
## v19.04:
|
||||
|
||||
### nvme
|
||||
|
@ -442,6 +442,15 @@ size_t spdk_mempool_count(const struct spdk_mempool *pool);
|
||||
uint32_t spdk_mempool_obj_iter(struct spdk_mempool *mp, spdk_mempool_obj_cb_t obj_cb,
|
||||
void *obj_cb_arg);
|
||||
|
||||
/**
|
||||
* Lookup the memory pool identified by the given name.
|
||||
*
|
||||
* \param name Name of the memory pool.
|
||||
*
|
||||
* \return a pointer to the memory pool on success, or NULL on failure.
|
||||
*/
|
||||
struct spdk_mempool *spdk_mempool_lookup(const char *name);
|
||||
|
||||
/**
|
||||
* Get the number of dedicated CPU cores utilized by this env abstraction.
|
||||
*
|
||||
|
@ -296,6 +296,12 @@ spdk_mempool_obj_iter(struct spdk_mempool *mp, spdk_mempool_obj_cb_t obj_cb,
|
||||
obj_cb_arg);
|
||||
}
|
||||
|
||||
struct spdk_mempool *
|
||||
spdk_mempool_lookup(const char *name)
|
||||
{
|
||||
return (struct spdk_mempool *)rte_mempool_lookup(name);
|
||||
}
|
||||
|
||||
bool
|
||||
spdk_process_is_primary(void)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user