module/event_nvmf: add a map file and remove spdk prefix.
Signed-off-by: Seth Howell <seth.howell@intel.com> Change-Id: Ibfaa6bca27faf12455bf325bfb97303805c51f14 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2352 Community-CI: Mellanox Build Bot Community-CI: Broadcom CI Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
ab56b08875
commit
b257424be4
@ -41,4 +41,6 @@ SO_SUFFIX := $(SO_VER).$(SO_MINOR)
|
|||||||
C_SRCS = conf.c nvmf_rpc.c nvmf_tgt.c
|
C_SRCS = conf.c nvmf_rpc.c nvmf_tgt.c
|
||||||
LIBNAME = event_nvmf
|
LIBNAME = event_nvmf
|
||||||
|
|
||||||
|
SPDK_MAP_FILE = $(SPDK_ROOT_DIR)/mk/spdk_blank.map
|
||||||
|
|
||||||
include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk
|
include $(SPDK_ROOT_DIR)/mk/spdk.lib.mk
|
||||||
|
@ -47,7 +47,7 @@ struct spdk_nvmf_tgt_conf *g_spdk_nvmf_tgt_conf = NULL;
|
|||||||
uint32_t g_spdk_nvmf_tgt_max_subsystems = 0;
|
uint32_t g_spdk_nvmf_tgt_max_subsystems = 0;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
spdk_add_nvmf_discovery_subsystem(void)
|
nvmf_add_discovery_subsystem(void)
|
||||||
{
|
{
|
||||||
struct spdk_nvmf_subsystem *subsystem;
|
struct spdk_nvmf_subsystem *subsystem;
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ spdk_add_nvmf_discovery_subsystem(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_nvmf_read_config_file_tgt_max_subsystems(struct spdk_conf_section *sp,
|
nvmf_read_config_file_tgt_max_subsystems(struct spdk_conf_section *sp,
|
||||||
int *deprecated_values)
|
int *deprecated_values)
|
||||||
{
|
{
|
||||||
int tgt_max_subsystems;
|
int tgt_max_subsystems;
|
||||||
@ -102,8 +102,8 @@ spdk_nvmf_read_config_file_tgt_max_subsystems(struct spdk_conf_section *sp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
spdk_nvmf_read_config_file_tgt_conf(struct spdk_conf_section *sp,
|
nvmf_read_config_file_tgt_conf(struct spdk_conf_section *sp,
|
||||||
struct spdk_nvmf_tgt_conf *conf)
|
struct spdk_nvmf_tgt_conf *conf)
|
||||||
{
|
{
|
||||||
int acceptor_poll_rate;
|
int acceptor_poll_rate;
|
||||||
const char *conn_scheduler;
|
const char *conn_scheduler;
|
||||||
@ -143,21 +143,21 @@ spdk_nvmf_read_config_file_tgt_conf(struct spdk_conf_section *sp,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
spdk_nvmf_parse_tgt_max_subsystems(void)
|
nvmf_parse_tgt_max_subsystems(void)
|
||||||
{
|
{
|
||||||
struct spdk_conf_section *sp;
|
struct spdk_conf_section *sp;
|
||||||
int deprecated_values = 0;
|
int deprecated_values = 0;
|
||||||
|
|
||||||
sp = spdk_conf_find_section(NULL, "Nvmf");
|
sp = spdk_conf_find_section(NULL, "Nvmf");
|
||||||
if (sp != NULL) {
|
if (sp != NULL) {
|
||||||
spdk_nvmf_read_config_file_tgt_max_subsystems(sp, &deprecated_values);
|
nvmf_read_config_file_tgt_max_subsystems(sp, &deprecated_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
return deprecated_values;
|
return deprecated_values;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct spdk_nvmf_tgt_conf *
|
static struct spdk_nvmf_tgt_conf *
|
||||||
spdk_nvmf_parse_tgt_conf(void)
|
nvmf_parse_tgt_conf(void)
|
||||||
{
|
{
|
||||||
struct spdk_nvmf_tgt_conf *conf;
|
struct spdk_nvmf_tgt_conf *conf;
|
||||||
struct spdk_conf_section *sp;
|
struct spdk_conf_section *sp;
|
||||||
@ -175,7 +175,7 @@ spdk_nvmf_parse_tgt_conf(void)
|
|||||||
|
|
||||||
sp = spdk_conf_find_section(NULL, "Nvmf");
|
sp = spdk_conf_find_section(NULL, "Nvmf");
|
||||||
if (sp != NULL) {
|
if (sp != NULL) {
|
||||||
rc = spdk_nvmf_read_config_file_tgt_conf(sp, conf);
|
rc = nvmf_read_config_file_tgt_conf(sp, conf);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
free(conf);
|
free(conf);
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -186,7 +186,7 @@ spdk_nvmf_parse_tgt_conf(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
spdk_nvmf_parse_nvmf_tgt(void)
|
nvmf_parse_nvmf_tgt(void)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
int using_deprecated_options;
|
int using_deprecated_options;
|
||||||
@ -196,7 +196,7 @@ spdk_nvmf_parse_nvmf_tgt(void)
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!g_spdk_nvmf_tgt_max_subsystems) {
|
if (!g_spdk_nvmf_tgt_max_subsystems) {
|
||||||
using_deprecated_options = spdk_nvmf_parse_tgt_max_subsystems();
|
using_deprecated_options = nvmf_parse_tgt_max_subsystems();
|
||||||
if (using_deprecated_options < 0) {
|
if (using_deprecated_options < 0) {
|
||||||
SPDK_ERRLOG("Deprecated options detected for the NVMe-oF target.\n"
|
SPDK_ERRLOG("Deprecated options detected for the NVMe-oF target.\n"
|
||||||
"The following options are no longer controlled by the target\n"
|
"The following options are no longer controlled by the target\n"
|
||||||
@ -208,9 +208,9 @@ spdk_nvmf_parse_nvmf_tgt(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!g_spdk_nvmf_tgt_conf) {
|
if (!g_spdk_nvmf_tgt_conf) {
|
||||||
g_spdk_nvmf_tgt_conf = spdk_nvmf_parse_tgt_conf();
|
g_spdk_nvmf_tgt_conf = nvmf_parse_tgt_conf();
|
||||||
if (!g_spdk_nvmf_tgt_conf) {
|
if (!g_spdk_nvmf_tgt_conf) {
|
||||||
SPDK_ERRLOG("spdk_nvmf_parse_tgt_conf() failed\n");
|
SPDK_ERRLOG("nvmf_parse_tgt_conf() failed\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -225,9 +225,9 @@ spdk_nvmf_parse_nvmf_tgt(void)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = spdk_add_nvmf_discovery_subsystem();
|
rc = nvmf_add_discovery_subsystem();
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
SPDK_ERRLOG("spdk_add_nvmf_discovery_subsystem failed\n");
|
SPDK_ERRLOG("nvmf_add_discovery_subsystem failed\n");
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,8 +235,8 @@ spdk_nvmf_parse_nvmf_tgt(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
spdk_nvmf_tgt_parse_listen_ip_addr(char *address,
|
nvmf_tgt_parse_listen_ip_addr(char *address,
|
||||||
struct spdk_nvme_transport_id *trid)
|
struct spdk_nvme_transport_id *trid)
|
||||||
{
|
{
|
||||||
char *host;
|
char *host;
|
||||||
char *port;
|
char *port;
|
||||||
@ -261,8 +261,8 @@ spdk_nvmf_tgt_parse_listen_ip_addr(char *address,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
spdk_nvmf_tgt_parse_listen_fc_addr(const char *address,
|
nvmf_tgt_parse_listen_fc_addr(const char *address,
|
||||||
struct spdk_nvme_transport_id *trid)
|
struct spdk_nvme_transport_id *trid)
|
||||||
{
|
{
|
||||||
/* transport address format and requirements,
|
/* transport address format and requirements,
|
||||||
* "nn-0xWWNN:pn-0xWWPN" - size equals 43 bytes and is required to
|
* "nn-0xWWNN:pn-0xWWPN" - size equals 43 bytes and is required to
|
||||||
@ -282,7 +282,7 @@ spdk_nvmf_tgt_parse_listen_fc_addr(const char *address,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_nvmf_tgt_listen_done(void *cb_arg, int status)
|
nvmf_tgt_listen_done(void *cb_arg, int status)
|
||||||
{
|
{
|
||||||
/* TODO: Config parsing should wait for this operation to finish. */
|
/* TODO: Config parsing should wait for this operation to finish. */
|
||||||
|
|
||||||
@ -292,7 +292,7 @@ spdk_nvmf_tgt_listen_done(void *cb_arg, int status)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp)
|
nvmf_parse_subsystem(struct spdk_conf_section *sp)
|
||||||
{
|
{
|
||||||
const char *nqn, *mode;
|
const char *nqn, *mode;
|
||||||
size_t i;
|
size_t i;
|
||||||
@ -468,9 +468,9 @@ spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp)
|
|||||||
|
|
||||||
if (trid.trtype == SPDK_NVME_TRANSPORT_RDMA ||
|
if (trid.trtype == SPDK_NVME_TRANSPORT_RDMA ||
|
||||||
trid.trtype == SPDK_NVME_TRANSPORT_TCP) {
|
trid.trtype == SPDK_NVME_TRANSPORT_TCP) {
|
||||||
ret = spdk_nvmf_tgt_parse_listen_ip_addr(address_dup, &trid);
|
ret = nvmf_tgt_parse_listen_ip_addr(address_dup, &trid);
|
||||||
} else if (trid.trtype == SPDK_NVME_TRANSPORT_FC) {
|
} else if (trid.trtype == SPDK_NVME_TRANSPORT_FC) {
|
||||||
ret = spdk_nvmf_tgt_parse_listen_fc_addr(address_dup, &trid);
|
ret = nvmf_tgt_parse_listen_fc_addr(address_dup, &trid);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(address_dup);
|
free(address_dup);
|
||||||
@ -483,7 +483,7 @@ spdk_nvmf_parse_subsystem(struct spdk_conf_section *sp)
|
|||||||
SPDK_ERRLOG("Failed to listen on transport address\n");
|
SPDK_ERRLOG("Failed to listen on transport address\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
spdk_nvmf_subsystem_add_listener(subsystem, &trid, spdk_nvmf_tgt_listen_done, NULL);
|
spdk_nvmf_subsystem_add_listener(subsystem, &trid, nvmf_tgt_listen_done, NULL);
|
||||||
allow_any_listener = false;
|
allow_any_listener = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,7 +508,7 @@ done:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
spdk_nvmf_parse_subsystems(void)
|
nvmf_parse_subsystems(void)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
struct spdk_conf_section *sp;
|
struct spdk_conf_section *sp;
|
||||||
@ -516,7 +516,7 @@ spdk_nvmf_parse_subsystems(void)
|
|||||||
sp = spdk_conf_first_section(NULL);
|
sp = spdk_conf_first_section(NULL);
|
||||||
while (sp != NULL) {
|
while (sp != NULL) {
|
||||||
if (spdk_conf_section_match_prefix(sp, "Subsystem")) {
|
if (spdk_conf_section_match_prefix(sp, "Subsystem")) {
|
||||||
rc = spdk_nvmf_parse_subsystem(sp);
|
rc = nvmf_parse_subsystem(sp);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -526,17 +526,17 @@ spdk_nvmf_parse_subsystems(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct spdk_nvmf_parse_transport_ctx {
|
struct nvmf_parse_transport_ctx {
|
||||||
struct spdk_conf_section *sp;
|
struct spdk_conf_section *sp;
|
||||||
spdk_nvmf_parse_conf_done_fn cb_fn;
|
nvmf_parse_conf_done_fn cb_fn;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void spdk_nvmf_parse_transport(struct spdk_nvmf_parse_transport_ctx *ctx);
|
static void nvmf_parse_transport(struct nvmf_parse_transport_ctx *ctx);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_nvmf_tgt_add_transport_done(void *cb_arg, int status)
|
nvmf_tgt_add_transport_done(void *cb_arg, int status)
|
||||||
{
|
{
|
||||||
struct spdk_nvmf_parse_transport_ctx *ctx = cb_arg;
|
struct nvmf_parse_transport_ctx *ctx = cb_arg;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
@ -550,21 +550,21 @@ spdk_nvmf_tgt_add_transport_done(void *cb_arg, int status)
|
|||||||
ctx->sp = spdk_conf_next_section(ctx->sp);
|
ctx->sp = spdk_conf_next_section(ctx->sp);
|
||||||
while (ctx->sp) {
|
while (ctx->sp) {
|
||||||
if (spdk_conf_section_match_prefix(ctx->sp, "Transport")) {
|
if (spdk_conf_section_match_prefix(ctx->sp, "Transport")) {
|
||||||
spdk_nvmf_parse_transport(ctx);
|
nvmf_parse_transport(ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ctx->sp = spdk_conf_next_section(ctx->sp);
|
ctx->sp = spdk_conf_next_section(ctx->sp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* done with transports, parse Subsystem sections */
|
/* done with transports, parse Subsystem sections */
|
||||||
rc = spdk_nvmf_parse_subsystems();
|
rc = nvmf_parse_subsystems();
|
||||||
|
|
||||||
ctx->cb_fn(rc);
|
ctx->cb_fn(rc);
|
||||||
free(ctx);
|
free(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_nvmf_parse_transport(struct spdk_nvmf_parse_transport_ctx *ctx)
|
nvmf_parse_transport(struct nvmf_parse_transport_ctx *ctx)
|
||||||
{
|
{
|
||||||
const char *type;
|
const char *type;
|
||||||
struct spdk_nvmf_transport_opts opts = { 0 };
|
struct spdk_nvmf_transport_opts opts = { 0 };
|
||||||
@ -653,7 +653,7 @@ spdk_nvmf_parse_transport(struct spdk_nvmf_parse_transport_ctx *ctx)
|
|||||||
|
|
||||||
transport = spdk_nvmf_transport_create(type, &opts);
|
transport = spdk_nvmf_transport_create(type, &opts);
|
||||||
if (transport) {
|
if (transport) {
|
||||||
spdk_nvmf_tgt_add_transport(g_spdk_nvmf_tgt, transport, spdk_nvmf_tgt_add_transport_done, ctx);
|
spdk_nvmf_tgt_add_transport(g_spdk_nvmf_tgt, transport, nvmf_tgt_add_transport_done, ctx);
|
||||||
} else {
|
} else {
|
||||||
goto error_out;
|
goto error_out;
|
||||||
}
|
}
|
||||||
@ -667,11 +667,11 @@ error_out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
spdk_nvmf_parse_transports(spdk_nvmf_parse_conf_done_fn cb_fn)
|
nvmf_parse_transports(nvmf_parse_conf_done_fn cb_fn)
|
||||||
{
|
{
|
||||||
struct spdk_nvmf_parse_transport_ctx *ctx;
|
struct nvmf_parse_transport_ctx *ctx;
|
||||||
|
|
||||||
ctx = calloc(1, sizeof(struct spdk_nvmf_parse_transport_ctx));
|
ctx = calloc(1, sizeof(struct nvmf_parse_transport_ctx));
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
SPDK_ERRLOG("Failed alloc of context memory for parse transports\n");
|
SPDK_ERRLOG("Failed alloc of context memory for parse transports\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -688,7 +688,7 @@ spdk_nvmf_parse_transports(spdk_nvmf_parse_conf_done_fn cb_fn)
|
|||||||
|
|
||||||
while (ctx->sp != NULL) {
|
while (ctx->sp != NULL) {
|
||||||
if (spdk_conf_section_match_prefix(ctx->sp, "Transport")) {
|
if (spdk_conf_section_match_prefix(ctx->sp, "Transport")) {
|
||||||
spdk_nvmf_parse_transport(ctx);
|
nvmf_parse_transport(ctx);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
ctx->sp = spdk_conf_next_section(ctx->sp);
|
ctx->sp = spdk_conf_next_section(ctx->sp);
|
||||||
@ -701,7 +701,7 @@ spdk_nvmf_parse_transports(spdk_nvmf_parse_conf_done_fn cb_fn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
spdk_nvmf_parse_conf(spdk_nvmf_parse_conf_done_fn cb_fn)
|
nvmf_parse_conf(nvmf_parse_conf_done_fn cb_fn)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
@ -711,13 +711,13 @@ spdk_nvmf_parse_conf(spdk_nvmf_parse_conf_done_fn cb_fn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* NVMf section */
|
/* NVMf section */
|
||||||
rc = spdk_nvmf_parse_nvmf_tgt();
|
rc = nvmf_parse_nvmf_tgt();
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Transport sections */
|
/* Transport sections */
|
||||||
rc = spdk_nvmf_parse_transports(cb_fn);
|
rc = nvmf_parse_transports(cb_fn);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -67,8 +67,8 @@ extern uint32_t g_spdk_nvmf_tgt_max_subsystems;
|
|||||||
|
|
||||||
extern struct spdk_nvmf_tgt *g_spdk_nvmf_tgt;
|
extern struct spdk_nvmf_tgt *g_spdk_nvmf_tgt;
|
||||||
|
|
||||||
typedef void (*spdk_nvmf_parse_conf_done_fn)(int status);
|
typedef void (*nvmf_parse_conf_done_fn)(int status);
|
||||||
|
|
||||||
int spdk_nvmf_parse_conf(spdk_nvmf_parse_conf_done_fn cb_fn);
|
int nvmf_parse_conf(nvmf_parse_conf_done_fn cb_fn);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -41,8 +41,8 @@ static const struct spdk_json_object_decoder nvmf_rpc_subsystem_tgt_opts_decoder
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_rpc_nvmf_set_max_subsystems(struct spdk_jsonrpc_request *request,
|
rpc_nvmf_set_max_subsystems(struct spdk_jsonrpc_request *request,
|
||||||
const struct spdk_json_val *params)
|
const struct spdk_json_val *params)
|
||||||
{
|
{
|
||||||
struct spdk_json_write_ctx *w;
|
struct spdk_json_write_ctx *w;
|
||||||
uint32_t max_subsystems = 0;
|
uint32_t max_subsystems = 0;
|
||||||
@ -70,7 +70,7 @@ spdk_rpc_nvmf_set_max_subsystems(struct spdk_jsonrpc_request *request,
|
|||||||
spdk_json_write_bool(w, true);
|
spdk_json_write_bool(w, true);
|
||||||
spdk_jsonrpc_end_result(request, w);
|
spdk_jsonrpc_end_result(request, w);
|
||||||
}
|
}
|
||||||
SPDK_RPC_REGISTER("nvmf_set_max_subsystems", spdk_rpc_nvmf_set_max_subsystems,
|
SPDK_RPC_REGISTER("nvmf_set_max_subsystems", rpc_nvmf_set_max_subsystems,
|
||||||
SPDK_RPC_STARTUP)
|
SPDK_RPC_STARTUP)
|
||||||
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(nvmf_set_max_subsystems, set_nvmf_target_max_subsystems)
|
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(nvmf_set_max_subsystems, set_nvmf_target_max_subsystems)
|
||||||
|
|
||||||
@ -117,8 +117,8 @@ static const struct spdk_json_object_decoder nvmf_rpc_subsystem_tgt_conf_decoder
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_rpc_nvmf_set_config(struct spdk_jsonrpc_request *request,
|
rpc_nvmf_set_config(struct spdk_jsonrpc_request *request,
|
||||||
const struct spdk_json_val *params)
|
const struct spdk_json_val *params)
|
||||||
{
|
{
|
||||||
struct spdk_nvmf_tgt_conf *conf;
|
struct spdk_nvmf_tgt_conf *conf;
|
||||||
struct spdk_json_write_ctx *w;
|
struct spdk_json_write_ctx *w;
|
||||||
@ -159,5 +159,5 @@ spdk_rpc_nvmf_set_config(struct spdk_jsonrpc_request *request,
|
|||||||
spdk_json_write_bool(w, true);
|
spdk_json_write_bool(w, true);
|
||||||
spdk_jsonrpc_end_result(request, w);
|
spdk_jsonrpc_end_result(request, w);
|
||||||
}
|
}
|
||||||
SPDK_RPC_REGISTER("nvmf_set_config", spdk_rpc_nvmf_set_config, SPDK_RPC_STARTUP)
|
SPDK_RPC_REGISTER("nvmf_set_config", rpc_nvmf_set_config, SPDK_RPC_STARTUP)
|
||||||
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(nvmf_set_config, set_nvmf_target_config)
|
SPDK_RPC_REGISTER_ALIAS_DEPRECATED(nvmf_set_config, set_nvmf_target_config)
|
||||||
|
@ -91,11 +91,11 @@ static struct spdk_poller *g_acceptor_poller = NULL;
|
|||||||
static void nvmf_tgt_advance_state(void);
|
static void nvmf_tgt_advance_state(void);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_spdk_nvmf_shutdown_cb(void *arg1)
|
nvmf_shutdown_cb(void *arg1)
|
||||||
{
|
{
|
||||||
/* Still in initialization state, defer shutdown operation */
|
/* Still in initialization state, defer shutdown operation */
|
||||||
if (g_tgt_state < NVMF_TGT_RUNNING) {
|
if (g_tgt_state < NVMF_TGT_RUNNING) {
|
||||||
spdk_thread_send_msg(spdk_get_thread(), _spdk_nvmf_shutdown_cb, NULL);
|
spdk_thread_send_msg(spdk_get_thread(), nvmf_shutdown_cb, NULL);
|
||||||
return;
|
return;
|
||||||
} else if (g_tgt_state != NVMF_TGT_RUNNING && g_tgt_state != NVMF_TGT_ERROR) {
|
} else if (g_tgt_state != NVMF_TGT_RUNNING && g_tgt_state != NVMF_TGT_ERROR) {
|
||||||
/* Already in Shutdown status, ignore the signal */
|
/* Already in Shutdown status, ignore the signal */
|
||||||
@ -112,14 +112,14 @@ _spdk_nvmf_shutdown_cb(void *arg1)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_nvmf_subsystem_fini(void)
|
nvmf_subsystem_fini(void)
|
||||||
{
|
{
|
||||||
_spdk_nvmf_shutdown_cb(NULL);
|
nvmf_shutdown_cb(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Round robin selection of poll groups */
|
/* Round robin selection of poll groups */
|
||||||
static struct nvmf_tgt_poll_group *
|
static struct nvmf_tgt_poll_group *
|
||||||
spdk_nvmf_get_next_pg(void)
|
nvmf_get_next_pg(void)
|
||||||
{
|
{
|
||||||
struct nvmf_tgt_poll_group *pg;
|
struct nvmf_tgt_poll_group *pg;
|
||||||
|
|
||||||
@ -133,13 +133,13 @@ spdk_nvmf_get_next_pg(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct nvmf_tgt_poll_group *
|
static struct nvmf_tgt_poll_group *
|
||||||
spdk_nvmf_get_optimal_pg(struct spdk_nvmf_qpair *qpair)
|
nvmf_get_optimal_pg(struct spdk_nvmf_qpair *qpair)
|
||||||
{
|
{
|
||||||
struct nvmf_tgt_poll_group *pg, *_pg = NULL;
|
struct nvmf_tgt_poll_group *pg, *_pg = NULL;
|
||||||
struct spdk_nvmf_poll_group *group = spdk_nvmf_get_optimal_poll_group(qpair);
|
struct spdk_nvmf_poll_group *group = spdk_nvmf_get_optimal_poll_group(qpair);
|
||||||
|
|
||||||
if (group == NULL) {
|
if (group == NULL) {
|
||||||
_pg = spdk_nvmf_get_next_pg();
|
_pg = nvmf_get_next_pg();
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ nvmf_tgt_get_pg(struct spdk_nvmf_qpair *qpair)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* Get the next available poll group for the new host */
|
/* Get the next available poll group for the new host */
|
||||||
pg = spdk_nvmf_get_next_pg();
|
pg = nvmf_get_next_pg();
|
||||||
new_trid->pg = pg;
|
new_trid->pg = pg;
|
||||||
memcpy(new_trid->host_trid.traddr, trid.traddr,
|
memcpy(new_trid->host_trid.traddr, trid.traddr,
|
||||||
SPDK_NVMF_TRADDR_MAX_LEN + 1);
|
SPDK_NVMF_TRADDR_MAX_LEN + 1);
|
||||||
@ -227,11 +227,11 @@ nvmf_tgt_get_pg(struct spdk_nvmf_qpair *qpair)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CONNECT_SCHED_TRANSPORT_OPTIMAL_GROUP:
|
case CONNECT_SCHED_TRANSPORT_OPTIMAL_GROUP:
|
||||||
pg = spdk_nvmf_get_optimal_pg(qpair);
|
pg = nvmf_get_optimal_pg(qpair);
|
||||||
break;
|
break;
|
||||||
case CONNECT_SCHED_ROUND_ROBIN:
|
case CONNECT_SCHED_ROUND_ROBIN:
|
||||||
default:
|
default:
|
||||||
pg = spdk_nvmf_get_next_pg();
|
pg = nvmf_get_next_pg();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -470,8 +470,8 @@ nvmf_tgt_parse_conf_done(int status)
|
|||||||
static void
|
static void
|
||||||
nvmf_tgt_parse_conf_start(void *ctx)
|
nvmf_tgt_parse_conf_start(void *ctx)
|
||||||
{
|
{
|
||||||
if (spdk_nvmf_parse_conf(nvmf_tgt_parse_conf_done)) {
|
if (nvmf_parse_conf(nvmf_tgt_parse_conf_done)) {
|
||||||
SPDK_ERRLOG("spdk_nvmf_parse_conf() failed\n");
|
SPDK_ERRLOG("nvmf_parse_conf() failed\n");
|
||||||
g_tgt_state = NVMF_TGT_ERROR;
|
g_tgt_state = NVMF_TGT_ERROR;
|
||||||
nvmf_tgt_advance_state();
|
nvmf_tgt_advance_state();
|
||||||
}
|
}
|
||||||
@ -515,7 +515,7 @@ fixup_identify_ctrlr(struct spdk_nvmf_request *req)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
spdk_nvmf_custom_identify_hdlr(struct spdk_nvmf_request *req)
|
nvmf_custom_identify_hdlr(struct spdk_nvmf_request *req)
|
||||||
{
|
{
|
||||||
struct spdk_nvme_cmd *cmd = spdk_nvmf_request_get_cmd(req);
|
struct spdk_nvme_cmd *cmd = spdk_nvmf_request_get_cmd(req);
|
||||||
struct spdk_bdev *bdev;
|
struct spdk_bdev *bdev;
|
||||||
@ -576,7 +576,7 @@ nvmf_tgt_advance_state(void)
|
|||||||
/* Config parsed */
|
/* Config parsed */
|
||||||
if (g_spdk_nvmf_tgt_conf->admin_passthru.identify_ctrlr) {
|
if (g_spdk_nvmf_tgt_conf->admin_passthru.identify_ctrlr) {
|
||||||
SPDK_NOTICELOG("Custom identify ctrlr handler enabled\n");
|
SPDK_NOTICELOG("Custom identify ctrlr handler enabled\n");
|
||||||
spdk_nvmf_set_custom_admin_cmd_hdlr(SPDK_NVME_OPC_IDENTIFY, spdk_nvmf_custom_identify_hdlr);
|
spdk_nvmf_set_custom_admin_cmd_hdlr(SPDK_NVME_OPC_IDENTIFY, nvmf_custom_identify_hdlr);
|
||||||
}
|
}
|
||||||
/* Create poll group threads, and send a message to each thread
|
/* Create poll group threads, and send a message to each thread
|
||||||
* and create a poll group.
|
* and create a poll group.
|
||||||
@ -638,7 +638,7 @@ nvmf_tgt_advance_state(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_nvmf_subsystem_init(void)
|
nvmf_subsystem_init(void)
|
||||||
{
|
{
|
||||||
g_tgt_state = NVMF_TGT_INIT_NONE;
|
g_tgt_state = NVMF_TGT_INIT_NONE;
|
||||||
nvmf_tgt_advance_state();
|
nvmf_tgt_advance_state();
|
||||||
@ -657,7 +657,7 @@ get_conn_sched_string(enum spdk_nvmf_connect_sched sched)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spdk_nvmf_subsystem_write_config_json(struct spdk_json_write_ctx *w)
|
nvmf_subsystem_write_config_json(struct spdk_json_write_ctx *w)
|
||||||
{
|
{
|
||||||
spdk_json_write_array_begin(w);
|
spdk_json_write_array_begin(w);
|
||||||
|
|
||||||
@ -681,9 +681,9 @@ spdk_nvmf_subsystem_write_config_json(struct spdk_json_write_ctx *w)
|
|||||||
|
|
||||||
static struct spdk_subsystem g_spdk_subsystem_nvmf = {
|
static struct spdk_subsystem g_spdk_subsystem_nvmf = {
|
||||||
.name = "nvmf",
|
.name = "nvmf",
|
||||||
.init = spdk_nvmf_subsystem_init,
|
.init = nvmf_subsystem_init,
|
||||||
.fini = spdk_nvmf_subsystem_fini,
|
.fini = nvmf_subsystem_fini,
|
||||||
.write_config_json = spdk_nvmf_subsystem_write_config_json,
|
.write_config_json = nvmf_subsystem_write_config_json,
|
||||||
};
|
};
|
||||||
|
|
||||||
SPDK_SUBSYSTEM_REGISTER(g_spdk_subsystem_nvmf)
|
SPDK_SUBSYSTEM_REGISTER(g_spdk_subsystem_nvmf)
|
||||||
|
@ -254,6 +254,8 @@ function confirm_abi_deps() {
|
|||||||
name = spdk_blobfs_fuse_stop
|
name = spdk_blobfs_fuse_stop
|
||||||
[suppress_variable]
|
[suppress_variable]
|
||||||
name = SPDK_LOG_APP_RPC
|
name = SPDK_LOG_APP_RPC
|
||||||
|
[suppress_function]
|
||||||
|
name = spdk_nvmf_parse_conf
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
for object in "$libdir"/libspdk_*.so; do
|
for object in "$libdir"/libspdk_*.so; do
|
||||||
|
Loading…
Reference in New Issue
Block a user