iscsi: Add the param MinConnectionPerSession to iSCSI options
The static variable g_connections_per_lcore can be configured by .INI config file. However it had not been added in the iSCSI options because it was not iSCSI global parameter. This patch is necessary for JSON config file to configure it. Change-Id: I12aa1d94dd467969a6853b9fb3f8a627d0d70766 Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/403623 Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
85fd46bfb8
commit
19b8d9b10a
@ -56,9 +56,8 @@
|
|||||||
memset(&(conn)->portal, 0, sizeof(*(conn)) - \
|
memset(&(conn)->portal, 0, sizeof(*(conn)) - \
|
||||||
offsetof(struct spdk_iscsi_conn, portal));
|
offsetof(struct spdk_iscsi_conn, portal));
|
||||||
|
|
||||||
#define DEFAULT_CONNECTIONS_PER_LCORE 4
|
|
||||||
#define SPDK_MAX_POLLERS_PER_CORE 4096
|
#define SPDK_MAX_POLLERS_PER_CORE 4096
|
||||||
static int g_connections_per_lcore = DEFAULT_CONNECTIONS_PER_LCORE;
|
static int g_connections_per_lcore;
|
||||||
static uint32_t *g_num_connections;
|
static uint32_t *g_num_connections;
|
||||||
|
|
||||||
struct spdk_iscsi_conn *g_conns_array;
|
struct spdk_iscsi_conn *g_conns_array;
|
||||||
|
@ -78,6 +78,7 @@
|
|||||||
#define DEFAULT_TIMEOUT 60
|
#define DEFAULT_TIMEOUT 60
|
||||||
#define MAX_NOPININTERVAL 60
|
#define MAX_NOPININTERVAL 60
|
||||||
#define DEFAULT_NOPININTERVAL 30
|
#define DEFAULT_NOPININTERVAL 30
|
||||||
|
#define DEFAULT_CONNECTIONS_PER_LCORE 4
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SPDK iSCSI target currently only supports 64KB as the maximum data segment length
|
* SPDK iSCSI target currently only supports 64KB as the maximum data segment length
|
||||||
@ -282,6 +283,7 @@ struct spdk_iscsi_opts {
|
|||||||
bool ImmediateData;
|
bool ImmediateData;
|
||||||
uint32_t ErrorRecoveryLevel;
|
uint32_t ErrorRecoveryLevel;
|
||||||
bool AllowDuplicateIsid;
|
bool AllowDuplicateIsid;
|
||||||
|
uint32_t min_connections_per_core;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct spdk_iscsi_globals {
|
struct spdk_iscsi_globals {
|
||||||
|
@ -590,6 +590,7 @@ spdk_iscsi_opts_init(struct spdk_iscsi_opts *opts)
|
|||||||
opts->discovery_auth_group = 0;
|
opts->discovery_auth_group = 0;
|
||||||
opts->authfile = strdup(SPDK_ISCSI_DEFAULT_AUTHFILE);
|
opts->authfile = strdup(SPDK_ISCSI_DEFAULT_AUTHFILE);
|
||||||
opts->nodebase = strdup(SPDK_ISCSI_DEFAULT_NODEBASE);
|
opts->nodebase = strdup(SPDK_ISCSI_DEFAULT_NODEBASE);
|
||||||
|
opts->min_connections_per_core = DEFAULT_CONNECTIONS_PER_LCORE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -754,7 +755,7 @@ spdk_iscsi_read_config_file_params(struct spdk_conf_section *sp,
|
|||||||
}
|
}
|
||||||
min_conn_per_core = spdk_conf_section_get_intval(sp, "MinConnectionsPerCore");
|
min_conn_per_core = spdk_conf_section_get_intval(sp, "MinConnectionsPerCore");
|
||||||
if (min_conn_per_core >= 0) {
|
if (min_conn_per_core >= 0) {
|
||||||
spdk_iscsi_conn_set_min_per_core(min_conn_per_core);
|
opts->min_connections_per_core = min_conn_per_core;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -807,6 +808,8 @@ spdk_iscsi_initialize_iscsi_globals(struct spdk_iscsi_opts *opts)
|
|||||||
g_spdk_iscsi.req_discovery_auth_mutual = opts->req_discovery_auth;
|
g_spdk_iscsi.req_discovery_auth_mutual = opts->req_discovery_auth;
|
||||||
g_spdk_iscsi.discovery_auth_group = opts->discovery_auth_group;
|
g_spdk_iscsi.discovery_auth_group = opts->discovery_auth_group;
|
||||||
|
|
||||||
|
spdk_iscsi_conn_set_min_per_core(opts->min_connections_per_core);
|
||||||
|
|
||||||
g_spdk_iscsi.session = spdk_dma_zmalloc(sizeof(void *) * g_spdk_iscsi.MaxSessions, 0, NULL);
|
g_spdk_iscsi.session = spdk_dma_zmalloc(sizeof(void *) * g_spdk_iscsi.MaxSessions, 0, NULL);
|
||||||
if (!g_spdk_iscsi.session) {
|
if (!g_spdk_iscsi.session) {
|
||||||
SPDK_ERRLOG("spdk_dma_zmalloc() failed for session array\n");
|
SPDK_ERRLOG("spdk_dma_zmalloc() failed for session array\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user