Commit ac7151b1 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

app: add function to get current core ID



Change-Id: I3428fc9944f7117facc6488489187dcf8b6ed825
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 268ee865
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -198,6 +198,11 @@ uint64_t spdk_app_get_core_mask(void);
 */
int spdk_app_get_core_count(void);

/**
 * \brief Return the lcore of the current thread.
 */
uint32_t spdk_app_get_current_core(void);

/**
 * \brief Allocate an event to be passed to \ref spdk_event_call
 */
+6 −0
Original line number Diff line number Diff line
@@ -361,6 +361,12 @@ spdk_app_get_core_count(void)
	return g_reactor_count;
}

uint32_t
spdk_app_get_current_core(void)
{
	return rte_lcore_id();
}

int
spdk_app_parse_core_mask(const char *mask, uint64_t *cpumask)
{