Commit 37b5d87b authored by Jacek Kalwas's avatar Jacek Kalwas Committed by Tomasz Zawadzki
Browse files

env: expose function to get main core



Main core can be different than first core (default behavior) as it
can be specified by application argument. It can be useful to
determine if given thread is matching main core.

Signed-off-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I25292a91ad677806eaf19ad68acdda0f28da6cfb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16596


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent 1974117a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2,6 +2,10 @@

## v23.05: (Upcoming Release)

### env

New function `spdk_env_get_main_core` was added.

## v23.01

### accel
+7 −0
Original line number Diff line number Diff line
@@ -462,6 +462,13 @@ uint32_t spdk_env_get_core_count(void);
 */
uint32_t spdk_env_get_current_core(void);

/**
 * Get the index of the main dedicated CPU core for this application.
 *
 * \return the index of the main dedicated CPU core.
 */
uint32_t spdk_env_get_main_core(void);

/**
 * Get the index of the first dedicated CPU core for this application.
 *
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
	spdk_mempool_lookup;
	spdk_env_get_core_count;
	spdk_env_get_current_core;
	spdk_env_get_main_core;
	spdk_env_get_first_core;
	spdk_env_get_last_core;
	spdk_env_get_next_core;
+6 −0
Original line number Diff line number Diff line
@@ -20,6 +20,12 @@ spdk_env_get_current_core(void)
	return rte_lcore_id();
}

uint32_t
spdk_env_get_main_core(void)
{
	return rte_get_main_lcore();
}

uint32_t
spdk_env_get_first_core(void)
{