nvmf: introduce function to init listen opts
Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com> Change-Id: I21444725c5fdf5c73db67858adbe02d4108bd751 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5660 Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
87a062e688
commit
9a1c2cabc3
@ -110,6 +110,14 @@ struct spdk_nvmf_listen_opts {
|
||||
const struct spdk_json_val *transport_specific;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize listen options
|
||||
*
|
||||
* \param opts Listener options.
|
||||
* \param opts_size Must be set to sizeof(struct spdk_nvmf_listen_opts).
|
||||
*/
|
||||
void spdk_nvmf_listen_opts_init(struct spdk_nvmf_listen_opts *opts, size_t opts_size);
|
||||
|
||||
struct spdk_nvmf_poll_group_stat {
|
||||
uint32_t admin_qpairs;
|
||||
uint32_t io_qpairs;
|
||||
|
@ -620,6 +620,16 @@ nvmf_listen_opts_copy(struct spdk_nvmf_listen_opts *opts,
|
||||
SPDK_STATIC_ASSERT(sizeof(struct spdk_nvmf_listen_opts) == 16, "Incorrect size");
|
||||
}
|
||||
|
||||
void
|
||||
spdk_nvmf_listen_opts_init(struct spdk_nvmf_listen_opts *opts, size_t opts_size)
|
||||
{
|
||||
struct spdk_nvmf_listen_opts opts_local = {};
|
||||
|
||||
/* local version of opts should have defaults set here */
|
||||
|
||||
nvmf_listen_opts_copy(opts, &opts_local, opts_size);
|
||||
}
|
||||
|
||||
int
|
||||
spdk_nvmf_tgt_listen_ext(struct spdk_nvmf_tgt *tgt, const struct spdk_nvme_transport_id *trid,
|
||||
struct spdk_nvmf_listen_opts *opts)
|
||||
@ -657,7 +667,9 @@ spdk_nvmf_tgt_listen_ext(struct spdk_nvmf_tgt *tgt, const struct spdk_nvme_trans
|
||||
int
|
||||
spdk_nvmf_tgt_listen(struct spdk_nvmf_tgt *tgt, struct spdk_nvme_transport_id *trid)
|
||||
{
|
||||
struct spdk_nvmf_listen_opts opts = {.opts_size = sizeof(opts)};
|
||||
struct spdk_nvmf_listen_opts opts;
|
||||
|
||||
spdk_nvmf_listen_opts_init(&opts, sizeof(opts));
|
||||
|
||||
return spdk_nvmf_tgt_listen_ext(tgt, trid, &opts);
|
||||
}
|
||||
|
@ -938,8 +938,8 @@ rpc_nvmf_subsystem_add_listener(struct spdk_jsonrpc_request *request,
|
||||
}
|
||||
|
||||
ctx->op = NVMF_RPC_LISTEN_ADD;
|
||||
spdk_nvmf_listen_opts_init(&ctx->opts, sizeof(ctx->opts));
|
||||
ctx->opts.transport_specific = params;
|
||||
ctx->opts.opts_size = sizeof(ctx->opts);
|
||||
|
||||
rc = spdk_nvmf_subsystem_pause(subsystem, nvmf_rpc_listen_paused, ctx);
|
||||
if (rc != 0) {
|
||||
|
@ -9,6 +9,7 @@
|
||||
spdk_nvmf_get_first_tgt;
|
||||
spdk_nvmf_get_next_tgt;
|
||||
spdk_nvmf_tgt_write_config_json;
|
||||
spdk_nvmf_listen_opts_init;
|
||||
spdk_nvmf_tgt_listen;
|
||||
spdk_nvmf_tgt_listen_ext;
|
||||
spdk_nvmf_tgt_stop_listen;
|
||||
|
Loading…
Reference in New Issue
Block a user