Commit cc541400 authored by Marcin Spiewak's avatar Marcin Spiewak Committed by Jim Harris
Browse files

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 <mask>') as the dpdk doesn't allow
IDs greater than RTE_MAX_LCORE. Therefore they
must be mapped to lower lcore values using
'--lcores <maping_list>' passed to dpdk

Change-Id: If68f15cef2bca9e42a3457bf35477793b58ec53d
Signed-off-by: default avatarMarcin Spiewak <marcin.spiewak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17399


Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent b1a23196
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
+7 −2
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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
}