thread: add spdk_env_get_primary_core

Change-Id: I5b337477e41da7d424cccc48366ca6018b776ee2
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2448
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Xiaodong Liu 2020-05-14 03:27:49 -04:00 committed by Jim Harris
parent 34ea308e12
commit 6194cb2e15
3 changed files with 14 additions and 0 deletions

View File

@ -467,6 +467,13 @@ uint32_t spdk_env_get_core_count(void);
*/
uint32_t spdk_env_get_current_core(void);
/**
* Get the index of the primary dedicated CPU core for this application.
*
* \return the index of the primary dedicated CPU core.
*/
uint32_t spdk_env_get_primary_core(void);
/**
* Get the index of the first dedicated CPU core for this application.
*

View File

@ -33,6 +33,7 @@
spdk_mempool_lookup;
spdk_env_get_core_count;
spdk_env_get_current_core;
spdk_env_get_primary_core;
spdk_env_get_first_core;
spdk_env_get_last_core;
spdk_env_get_next_core;

View File

@ -48,6 +48,12 @@ spdk_env_get_current_core(void)
return rte_lcore_id();
}
uint32_t
spdk_env_get_primary_core(void)
{
return rte_get_master_lcore();
}
uint32_t
spdk_env_get_first_core(void)
{