Commit 2d610abe authored by Changqi Lu's avatar Changqi Lu Committed by Tomasz Zawadzki
Browse files

lib/env_dpdk: add spdk_get_tid function



Function spdk_get_tid is added to get the tid
of the current thread.

Change-Id: I6c13f86a543231391a6f48b3e111ee76ce73df57
Signed-off-by: default avatarChangqi Lu <luchangqi.123@bytedance.com>
Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/23389


Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent f470a0dc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -7,6 +7,10 @@
Added public API 'spdk_nvmf_subsystem_set_cntlid_range' to set controller ID
range for a subsystem.

### env_dpdk

`spdk_get_tid` is added to get the tid of the current thread.

## v24.05

### accel
+5 −0
Original line number Diff line number Diff line
@@ -1445,6 +1445,11 @@ int spdk_pci_register_error_handler(spdk_pci_error_handler sighandler, void *ctx
 */
void spdk_pci_unregister_error_handler(spdk_pci_error_handler sighandler);

/**
 * Get the tid of the current thread
 */
int spdk_get_tid(void);

#ifdef __cplusplus
}
#endif
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk

SO_VER := 14
SO_MINOR := 0
SO_MINOR := 1

CFLAGS += $(ENV_CFLAGS)
C_SRCS = env.c memory.c pci.c init.c threads.c
+7 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <rte_mempool.h>
#include <rte_memzone.h>
#include <rte_version.h>
#include <rte_eal.h>

static __thread bool g_is_thread_unaffinitized;

@@ -431,3 +432,9 @@ spdk_env_dpdk_dump_mem_stats(FILE *file)
	fprintf(file, "DPDK malloc heaps.\n");
	rte_malloc_dump_heaps(file);
}

int
spdk_get_tid(void)
{
	return rte_sys_gettid();
}
+1 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@
	spdk_pci_get_event;
	spdk_pci_register_error_handler;
	spdk_pci_unregister_error_handler;
	spdk_get_tid;

	# Public functions in env_dpdk.h
	spdk_env_dpdk_post_init;