diff --git a/include/spdk/env.h b/include/spdk/env.h index f8cb058dd..78ac29acb 100644 --- a/include/spdk/env.h +++ b/include/spdk/env.h @@ -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. * diff --git a/lib/env_dpdk/spdk_env_dpdk.map b/lib/env_dpdk/spdk_env_dpdk.map index 028796e1c..e899ad326 100644 --- a/lib/env_dpdk/spdk_env_dpdk.map +++ b/lib/env_dpdk/spdk_env_dpdk.map @@ -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; diff --git a/lib/env_dpdk/threads.c b/lib/env_dpdk/threads.c index 01c7b8d9f..8831b8c38 100644 --- a/lib/env_dpdk/threads.c +++ b/lib/env_dpdk/threads.c @@ -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) {