conf: Transport should be explictly configured in conf file
According to the currrent logic, it should be explictly defined in the configuration file if the NVMe-oF target is started by configuration file without using rpc calls. If no transport is defined, we do not need to parse the following subsystems but should terminate the NVMe-oF target . Change-Id: I2e2db8406a30a9bf7e54d38f8d08a8d92ef158c9 Signed-off-by: Ziye Yang <optimistyzy@gmail.com> Reviewed-on: https://review.gerrithub.io/432376 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Seth Howell <seth.howell5141@gmail.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
38259b9982
commit
6134d778d4
@ -60,14 +60,23 @@
|
||||
|
||||
# Define NVMf protocol global options
|
||||
[Nvmf]
|
||||
# Set the maximum number of submission and completion queues per session.
|
||||
# Setting this to '8', for example, allows for 8 submission and 8 completion queues
|
||||
# per session.
|
||||
MaxQueuesPerSession 4
|
||||
# Set how often the acceptor polls for incoming connections. The acceptor is also
|
||||
# responsible for polling existing connections that have gone idle. 0 means continuously
|
||||
# poll. Units in microseconds.
|
||||
AcceptorPollRate 10000
|
||||
|
||||
[Transport]
|
||||
# Set a transport type, this is mandatory
|
||||
Type RDMA
|
||||
|
||||
# Set the maximum number of outstanding I/O per queue.
|
||||
#MaxQueueDepth 128
|
||||
|
||||
# Set the maximum number of submission and completion queues per session.
|
||||
# Setting this to '8', for example, allows for 8 submission and 8 completion queues
|
||||
# per session.
|
||||
#MaxQueuesPerSession 4
|
||||
|
||||
# Set the maximum in-capsule data size. Must be a multiple of 16.
|
||||
# 0 is a valid choice.
|
||||
#InCapsuleDataSize 4096
|
||||
@ -75,10 +84,11 @@
|
||||
# Set the maximum I/O size. Must be a multiple of 4096.
|
||||
#MaxIOSize 131072
|
||||
|
||||
# Set how often the acceptor polls for incoming connections. The acceptor is also
|
||||
# responsible for polling existing connections that have gone idle. 0 means continuously
|
||||
# poll. Units in microseconds.
|
||||
AcceptorPollRate 10000
|
||||
# Set the I/O unit size, and this value should not be larger than MaxIOSize
|
||||
#IOUnitSize 131072
|
||||
|
||||
# Set the maximum number of IO for admin queue
|
||||
#MaxAQDepth 32
|
||||
|
||||
[Nvme]
|
||||
# NVMe Device Whitelist
|
||||
|
@ -544,6 +544,13 @@ spdk_nvmf_parse_transports(spdk_nvmf_parse_conf_done_fn cb_fn)
|
||||
|
||||
ctx->cb_fn = cb_fn;
|
||||
ctx->sp = spdk_conf_first_section(NULL);
|
||||
if (ctx->sp == NULL) {
|
||||
free(ctx);
|
||||
cb_fn(0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (ctx->sp != NULL) {
|
||||
if (spdk_conf_section_match_prefix(ctx->sp, "Transport")) {
|
||||
spdk_nvmf_parse_transport(ctx);
|
||||
@ -554,7 +561,10 @@ spdk_nvmf_parse_transports(spdk_nvmf_parse_conf_done_fn cb_fn)
|
||||
|
||||
/* if we get here, there are no transports defined in conf file */
|
||||
free(ctx);
|
||||
cb_fn(spdk_nvmf_parse_subsystems());
|
||||
SPDK_ERRLOG("\nNo valid transport is defined yet.\n"
|
||||
"When using configuration file, at least one valid transport must be defined.\n"
|
||||
"You can refer the [Transport] section in spdk/etc/spdk/nvmf.conf.in as an example.\n");
|
||||
cb_fn(-1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user