2018-10-18 18:29:15 +00:00
|
|
|
|
2018-08-07 21:40:54 +00:00
|
|
|
# An Overview of SPDK Applications {#app_overview}
|
2018-07-03 16:28:23 +00:00
|
|
|
|
2018-08-07 21:40:54 +00:00
|
|
|
SPDK is primarily a development kit that delivers libraries and header files for
|
|
|
|
use in other applications. However, SPDK also contains a number of applications.
|
|
|
|
These applications are primarily used to test the libraries, but many are full
|
|
|
|
featured and high quality. The major applications in SPDK are:
|
2018-07-03 16:28:23 +00:00
|
|
|
|
2018-08-07 21:40:54 +00:00
|
|
|
- @ref iscsi
|
|
|
|
- @ref nvmf
|
|
|
|
- @ref vhost
|
|
|
|
- SPDK Target (a unified application combining the above three)
|
2018-07-03 16:28:23 +00:00
|
|
|
|
2018-08-07 21:40:54 +00:00
|
|
|
There are also a number of tools and examples in the `examples` directory.
|
2018-07-03 16:28:23 +00:00
|
|
|
|
2018-08-07 21:40:54 +00:00
|
|
|
The SPDK targets are all based on a common framework so they have much in
|
|
|
|
common. The framework defines a concept called a `subsystem` and all
|
|
|
|
functionality is implemented in various subsystems. Subsystems have a unified
|
|
|
|
initialization and teardown path.
|
|
|
|
|
|
|
|
# Configuring SPDK Applications {#app_config}
|
|
|
|
|
|
|
|
## Command Line Parameters {#app_cmd_line_args}
|
|
|
|
|
|
|
|
The SPDK application framework defines a set of base command line flags for all
|
|
|
|
applications that use it. Specific applications may implement additional flags.
|
2018-07-03 16:28:23 +00:00
|
|
|
|
2018-08-16 11:43:38 +00:00
|
|
|
Param | Long Param | Type | Default | Description
|
|
|
|
-------- | ---------------------- | -------- | ---------------------- | -----------
|
|
|
|
-c | --config | string | | @ref cmd_arg_config_file
|
2018-08-28 19:26:23 +00:00
|
|
|
-d | --limit-coredump | flag | false | @ref cmd_arg_limit_coredump
|
|
|
|
-e | --tpoint-group-mask | integer | 0x0 | @ref cmd_arg_limit_tpoint_group_mask
|
2018-08-16 11:43:38 +00:00
|
|
|
-g | --single-file-segments | flag | | @ref cmd_arg_single_file_segments
|
|
|
|
-h | --help | flag | | show all available parameters and exit
|
|
|
|
-i | --shm-id | integer | | @ref cmd_arg_multi_process
|
|
|
|
-m | --cpumask | CPU mask | 0x1 | application @ref cpu_mask
|
|
|
|
-n | --mem-channels | integer | all channels | number of memory channels used for DPDK
|
|
|
|
-p | --master-core | integer | first core in CPU mask | master (primary) core for DPDK
|
|
|
|
-r | --rpc-socket | string | /var/tmp/spdk.sock | RPC listen address
|
|
|
|
-s | --mem-size | integer | all hugepage memory | @ref cmd_arg_memory_size
|
2018-10-18 18:29:15 +00:00
|
|
|
| | --silence-noticelog | flag | | disable notice level logging to `stderr`
|
2018-08-16 11:43:38 +00:00
|
|
|
-u | --no-pci | flag | | @ref cmd_arg_disable_pci_access.
|
2018-10-18 18:29:15 +00:00
|
|
|
| | --wait-for-rpc | flag | | @ref cmd_arg_deferred_initialization
|
2018-08-16 11:43:38 +00:00
|
|
|
-B | --pci-blacklist | B:D:F | | @ref cmd_arg_pci_blacklist_whitelist.
|
|
|
|
-W | --pci-whitelist | B:D:F | | @ref cmd_arg_pci_blacklist_whitelist.
|
|
|
|
-R | --huge-unlink | flag | | @ref cmd_arg_huge_unlink
|
2018-11-06 06:10:11 +00:00
|
|
|
| | --huge-dir | string | the first discovered | allocate hugepages from a specific mount
|
2018-11-27 07:50:57 +00:00
|
|
|
-L | --logflag | string | | @ref cmd_arg_debug_log_flags
|
2018-08-16 11:43:38 +00:00
|
|
|
|
2018-07-03 16:28:23 +00:00
|
|
|
|
|
|
|
### Configuration file {#cmd_arg_config_file}
|
|
|
|
|
2018-08-07 21:40:54 +00:00
|
|
|
Historically, the SPDK applications were configured using a configuration file.
|
|
|
|
This is still supported, but is considered deprecated in favor of JSON RPC
|
|
|
|
configuration. See @ref jsonrpc for details.
|
2018-07-03 16:28:23 +00:00
|
|
|
|
2018-08-16 11:43:38 +00:00
|
|
|
Note that `--config` and `--wait-for-rpc` cannot be used at the same time.
|
2018-07-03 16:28:23 +00:00
|
|
|
|
2018-08-28 19:26:23 +00:00
|
|
|
### Limit coredump {#cmd_arg_limit_coredump}
|
|
|
|
|
|
|
|
By default, an SPDK application will set resource limits for core file sizes
|
|
|
|
to RLIM_INFINITY. Specifying `--limit-coredump` will not set the resource limits.
|
|
|
|
|
|
|
|
### Tracepoint group mask {#cmd_arg_limit_tpoint_group_mask}
|
|
|
|
|
|
|
|
SPDK has an experimental low overhead tracing framework. Tracepoints in this
|
|
|
|
framework are organized into tracepoint groups. By default, all tracepoint
|
|
|
|
groups are disabled. `--tpoint-group-mask` can be used to enable a specific
|
|
|
|
subset of tracepoint groups in the application.
|
|
|
|
|
|
|
|
Note: Additional documentation on the tracepoint framework is in progress.
|
|
|
|
|
2018-07-03 16:28:23 +00:00
|
|
|
### Deferred initialization {#cmd_arg_deferred_initialization}
|
|
|
|
|
2018-08-07 21:40:54 +00:00
|
|
|
SPDK applications progress through a set of states beginning with `STARTUP` and
|
|
|
|
ending with `RUNTIME`.
|
2018-07-03 16:28:23 +00:00
|
|
|
|
2018-08-16 11:43:38 +00:00
|
|
|
If the `--wait-for-rpc` parameter is provided SPDK will pause just before starting
|
|
|
|
subsystem initialization. This state is called `STARTUP`. The JSON RPC server is
|
|
|
|
ready but only a small subsystem of commands are available to set up initialization
|
2018-08-07 21:40:54 +00:00
|
|
|
parameters. Those parameters can't be changed after the SPDK application enters
|
|
|
|
`RUNTIME` state. When the client finishes configuring the SPDK subsystems it
|
|
|
|
needs to issue the @ref rpc_start_subsystem_init RPC command to begin the
|
|
|
|
initialization process. After `rpc_start_subsystem_init` returns `true` SPDK
|
|
|
|
will enter the `RUNTIME` state and the list of available commands becomes much
|
|
|
|
larger.
|
2018-07-03 16:28:23 +00:00
|
|
|
|
2018-08-07 21:40:54 +00:00
|
|
|
To see which RPC methods are available in the current state, issue the
|
|
|
|
`get_rpc_methods` with the parameter `current` set to `true`.
|
2018-07-03 16:28:23 +00:00
|
|
|
|
|
|
|
For more details see @ref jsonrpc documentation.
|
|
|
|
|
2018-08-16 11:43:38 +00:00
|
|
|
### Create just one hugetlbfs file {#cmd_arg_single_file_segments}
|
|
|
|
|
|
|
|
Instead of creating one hugetlbfs file per page, this option makes SPDK create
|
2018-08-27 08:42:35 +00:00
|
|
|
one file per hugepages per socket. This is needed for @ref virtio to be used
|
2018-08-16 11:43:38 +00:00
|
|
|
with more than 8 hugepages. See @ref virtio_2mb.
|
|
|
|
|
|
|
|
### Multi process mode {#cmd_arg_multi_process}
|
|
|
|
|
|
|
|
When `--shm-id` is specified, the application is started in multi-process mode.
|
|
|
|
Applications using the same shm-id share their memory and
|
|
|
|
[NVMe devices](@ref nvme_multi_process). The first app to start with a given id
|
|
|
|
becomes a primary process, with the rest, called secondary processes, only
|
|
|
|
attaching to it. When the primary process exits, the secondary ones continue to
|
|
|
|
operate, but no new processes can be attached at this point. All processes within
|
|
|
|
the same shm-id group must use the same
|
|
|
|
[--single-file-segments setting](@ref cmd_arg_single_file_segments).
|
|
|
|
|
|
|
|
### Memory size {#cmd_arg_memory_size}
|
|
|
|
|
|
|
|
Total size of the hugepage memory to reserve. If DPDK env layer is used, it will
|
|
|
|
reserve memory from all available hugetlbfs mounts, starting with the one with
|
|
|
|
the highest page size. This option accepts a number of bytes with a possible
|
|
|
|
binary prefix, e.g. 1024, 1024M, 1G. The default unit is megabyte.
|
|
|
|
|
2018-10-29 07:02:30 +00:00
|
|
|
Starting with DPDK 18.05.1, it's possible to reserve hugepages at runtime, meaning
|
|
|
|
that SPDK application can be started with 0 pre-reserved memory. Unlike hugepages
|
|
|
|
pre-reserved at the application startup, the hugepages reserved at runtime will be
|
|
|
|
released to the system as soon as they're no longer used.
|
|
|
|
|
2018-07-03 16:28:23 +00:00
|
|
|
### Disable PCI access {#cmd_arg_disable_pci_access}
|
|
|
|
|
2018-08-07 21:40:54 +00:00
|
|
|
If SPDK is run with PCI access disabled it won't detect any PCI devices. This
|
|
|
|
includes primarily NVMe and IOAT devices. Also, the VFIO and UIO kernel modules
|
|
|
|
are not required in this mode.
|
2018-07-03 16:28:23 +00:00
|
|
|
|
|
|
|
### PCI address blacklist and whitelist {#cmd_arg_pci_blacklist_whitelist}
|
|
|
|
|
2018-08-16 11:43:38 +00:00
|
|
|
If blacklist is used, then all devices with the provided PCI address will be
|
|
|
|
ignored. If a whitelist is used, only whitelisted devices will be probed.
|
|
|
|
`-B` or `-W` can be used more than once, but cannot be mixed together. That is,
|
|
|
|
`-B` and `-W` cannot be used at the same time.
|
|
|
|
|
|
|
|
### Unlink hugepage files after initialization {#cmd_arg_huge_unlink}
|
2018-07-03 16:28:23 +00:00
|
|
|
|
2018-08-16 11:43:38 +00:00
|
|
|
By default, each DPDK-based application tries to remove any orphaned hugetlbfs
|
|
|
|
files during its initialization. This option removes hugetlbfs files of the current
|
|
|
|
process as soon as they're created, but is not compatible with `--shm-id`.
|
2018-07-03 16:28:23 +00:00
|
|
|
|
2018-08-16 11:43:38 +00:00
|
|
|
### Debug log {#cmd_arg_debug_log_flags}
|
2018-07-03 16:28:23 +00:00
|
|
|
|
2018-08-16 11:43:38 +00:00
|
|
|
Enable a specific debug log type. This option can be used more than once. A list of
|
2018-11-27 07:50:57 +00:00
|
|
|
all available types is provided in the `--help` output, with `--logflag all`
|
2018-08-16 11:43:38 +00:00
|
|
|
enabling all of them. Debug logs are only available in debug builds of SPDK.
|
2018-07-03 16:28:23 +00:00
|
|
|
|
|
|
|
## CPU mask {#cpu_mask}
|
|
|
|
|
|
|
|
Whenever the `CPU mask` is mentioned it is a string in one of the following formats:
|
|
|
|
|
|
|
|
- Case insensitive hexadecimal string with or without "0x" prefix.
|
|
|
|
- Comma separated list of CPUs or list of CPU ranges. Use '-' to define range.
|
|
|
|
|
|
|
|
### Example
|
|
|
|
|
|
|
|
The following CPU masks are equal and correspond to CPUs 0, 1, 2, 8, 9, 10, 11 and 12:
|
|
|
|
|
|
|
|
~~~
|
|
|
|
0x1f07
|
|
|
|
0x1F07
|
|
|
|
1f07
|
|
|
|
[0,1,2,8-12]
|
|
|
|
[0, 1, 2, 8, 9, 10, 11, 12]
|
|
|
|
~~~
|