From 63ee5362e2e61590f66f1e5598fc4ac24fa1c27b Mon Sep 17 00:00:00 2001 From: Marcin Spiewak Date: Wed, 29 Mar 2023 10:52:37 +0000 Subject: [PATCH] env: added support for lcore map This patch adds support for lcore mapping list, which is needed by spdk if someone wants to use CPUs with IDs greater than RTE_MAX_LCORE (128). For such CPUs it is impossible to include them in the core mask (passed to dpdk as '-c ') as the dpdk doesn't allow IDs greater than RTE_MAX_LCORE. Therefore they must be mapped to lower lcore values using '--lcores ' passed to dpdk Change-Id: If68f15cef2bca9e42a3457bf35477793b58ec53d Signed-off-by: Marcin Spiewak Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17399 Reviewed-by: Aleksey Marchuk Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Tested-by: SPDK CI Jenkins --- include/spdk/env.h | 1 + include/spdk/event.h | 9 +++++++-- lib/event/app.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/spdk/env.h b/include/spdk/env.h index d891da865..ca1ae9033 100644 --- a/include/spdk/env.h +++ b/include/spdk/env.h @@ -47,6 +47,7 @@ extern "C" { struct spdk_env_opts { const char *name; const char *core_mask; + const char *lcore_map; int shm_id; int mem_channel; int main_core; diff --git a/include/spdk/event.h b/include/spdk/event.h index be8c3ee62..26d434b9a 100644 --- a/include/spdk/event.h +++ b/include/spdk/event.h @@ -66,7 +66,6 @@ struct spdk_app_opts { /* Hole at bytes 17-23. */ uint8_t reserved17[7]; - const char *rpc_addr; /* Can be UNIX domain socket path or IP address + TCP port */ const char *reactor_mask; const char *tpoint_group_mask; @@ -163,8 +162,14 @@ struct spdk_app_opts { * The vf_token is an UUID that shared between SR-IOV PF and VF. */ const char *vf_token; + + /** + * Used to store lcore to CPU mappig to pass it to DPDK + */ + const char *lcore_map; /* lcore mapping */ + } __attribute__((packed)); -SPDK_STATIC_ASSERT(sizeof(struct spdk_app_opts) == 216, "Incorrect size"); +SPDK_STATIC_ASSERT(sizeof(struct spdk_app_opts) == 224, "Incorrect size"); /** * Initialize the default value of opts diff --git a/lib/event/app.c b/lib/event/app.c index f252999e4..8ba31843c 100644 --- a/lib/event/app.c +++ b/lib/event/app.c @@ -525,7 +525,7 @@ app_copy_opts(struct spdk_app_opts *opts, struct spdk_app_opts *opts_user, size_ /* You should not remove this statement, but need to update the assert statement * if you add a new field, and also add a corresponding SET_FIELD statement */ - SPDK_STATIC_ASSERT(sizeof(struct spdk_app_opts) == 216, "Incorrect size"); + SPDK_STATIC_ASSERT(sizeof(struct spdk_app_opts) == 224, "Incorrect size"); #undef SET_FIELD }