build: Example applications build to build/example

This mirrors build/bin and build/lib

Change-Id: Ide1d17dfc8b425adfbe67f381c93c236653bd301
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2380
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Ben Walker 2020-05-11 15:02:01 -07:00 committed by Tomasz Zawadzki
parent c3b5ae0c60
commit 85bdd43b40
34 changed files with 83 additions and 71 deletions

View File

@ -79,6 +79,7 @@ clean: $(DIRS-y)
$(Q)rm -f include/spdk/config.h $(Q)rm -f include/spdk/config.h
$(Q)rm -rf build/bin $(Q)rm -rf build/bin
$(Q)rm -rf build/fio $(Q)rm -rf build/fio
$(Q)rm -rf build/examples
install: all install: all
$(Q)echo "Installed to $(DESTDIR)$(CONFIG_PREFIX)" $(Q)echo "Installed to $(DESTDIR)$(CONFIG_PREFIX)"
@ -109,6 +110,7 @@ build_dir: mk/cc.mk
$(Q)mkdir -p build/lib $(Q)mkdir -p build/lib
$(Q)mkdir -p build/bin $(Q)mkdir -p build/bin
$(Q)mkdir -p build/fio $(Q)mkdir -p build/fio
$(Q)mkdir -p build/examples
include/spdk/config.h: mk/config.mk scripts/genconfig.py include/spdk/config.h: mk/config.mk scripts/genconfig.py
$(Q)echo "#ifndef SPDK_CONFIG_H" > $@.tmp; \ $(Q)echo "#ifndef SPDK_CONFIG_H" > $@.tmp; \

View File

@ -218,7 +218,7 @@ if [ $SPDK_RUN_FUNCTIONAL_TEST -eq 1 ]; then
run_test "rocksdb" ./test/blobfs/rocksdb/rocksdb.sh run_test "rocksdb" ./test/blobfs/rocksdb/rocksdb.sh
run_test "blobstore" ./test/blobstore/blobstore.sh run_test "blobstore" ./test/blobstore/blobstore.sh
run_test "blobfs" ./test/blobfs/blobfs.sh run_test "blobfs" ./test/blobfs/blobfs.sh
run_test "hello_blob" ./examples/blob/hello_world/hello_blob \ run_test "hello_blob" $SPDK_EXAMPLE_DIR/hello_blob \
examples/blob/hello_world/hello_blob.conf examples/blob/hello_world/hello_blob.conf
fi fi

View File

@ -213,7 +213,7 @@ To verify that the drive is emulated correctly, one can check the output of the
device): device):
``` ```
$ examples/nvme/identify/identify $ build/examples/identify
===================================================== =====================================================
NVMe Controller at 0000:00:0a.0 [1d1d:1f1f] NVMe Controller at 0000:00:0a.0 [1d1d:1f1f]
===================================================== =====================================================

View File

@ -110,7 +110,7 @@ with no arguments to see the help output. If your system has its IOMMU
enabled you can run the examples as your regular user. If it doesn't, you'll enabled you can run the examples as your regular user. If it doesn't, you'll
need to run as a privileged user (root). need to run as a privileged user (root).
A good example to start with is `examples/nvme/identify/identify`, which prints A good example to start with is `build/examples/identify`, which prints
out information about all of the NVMe devices on your system. out information about all of the NVMe devices on your system.
Larger, more fully functional applications are available in the `app` Larger, more fully functional applications are available in the `app`

View File

@ -39,7 +39,7 @@ SPDK's identify example application displays whether a device has a controller
memory buffer and which operations it supports. Run it as follows: memory buffer and which operations it supports. Run it as follows:
~~~{.sh} ~~~{.sh}
./examples/nvme/identify/identify -r traddr:<pci id of ssd> ./build/examples/identify -r traddr:<pci id of ssd>
~~~ ~~~
# cmb_copy: An example P2P Application {#p2p_cmb_copy} # cmb_copy: An example P2P Application {#p2p_cmb_copy}
@ -47,7 +47,7 @@ memory buffer and which operations it supports. Run it as follows:
Run the cmb_copy example application. Run the cmb_copy example application.
~~~{.sh} ~~~{.sh}
./examples/nvme/cmb_copy/cmb_copy -r <pci id of write ssd>-1-0-1 -w <pci id of write ssd>-1-0-1 -c <pci id of the ssd with cmb> ./build/examples/cmb_copy -r <pci id of write ssd>-1-0-1 -w <pci id of write ssd>-1-0-1 -c <pci id of the ssd with cmb>
~~~ ~~~
This should copy a single LBA (LBA 0) from namespace 1 on the read This should copy a single LBA (LBA 0) from namespace 1 on the read
NVMe SSD to LBA 0 on namespace 1 on the write SSD using the CMB as the NVMe SSD to LBA 0 on namespace 1 on the write SSD using the CMB as the

View File

@ -147,7 +147,7 @@ vagrant@vagrant:~/spdk_repo/spdk$ make
vagrant@vagrant:~/spdk_repo/spdk$ sudo ./scripts/setup.sh vagrant@vagrant:~/spdk_repo/spdk$ sudo ./scripts/setup.sh
0000:00:0e.0 (80ee 4e56): nvme -> uio_pci_generic 0000:00:0e.0 (80ee 4e56): nvme -> uio_pci_generic
vagrant@vagrant:~/spdk_repo/spdk$ sudo examples/nvme/hello_world/hello_world vagrant@vagrant:~/spdk_repo/spdk$ sudo build/examples/hello_world
Starting SPDK v18.10-pre / DPDK 18.05.0 initialization... Starting SPDK v18.10-pre / DPDK 18.05.0 initialization...
[ DPDK EAL parameters: hello_world -c 0x1 --legacy-mem --file-prefix=spdk0 --base-virtaddr=0x200000000000 --proc-type=auto ] [ DPDK EAL parameters: hello_world -c 0x1 --legacy-mem --file-prefix=spdk0 --base-virtaddr=0x200000000000 --proc-type=auto ]
EAL: Detected 4 lcore(s) EAL: Detected 4 lcore(s)

View File

@ -31,7 +31,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# #
SPDK_ROOT_DIR := $(CURDIR)/../../.. SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
APP = arbitration APP = arbitration

View File

@ -35,10 +35,10 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
APP = identify APP = identify
include $(SPDK_ROOT_DIR)/mk/nvme.libtest.mk
install: $(APP) install: $(APP)
$(INSTALL_EXAMPLE) $(INSTALL_EXAMPLE)
uninstall: uninstall:
$(UNINSTALL_EXAMPLE) $(UNINSTALL_EXAMPLE)
include $(SPDK_ROOT_DIR)/mk/nvme.libtest.mk

View File

@ -35,15 +35,15 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../..)
APP = perf APP = perf
ifeq ($(OS),Linux)
SYS_LIBS += -laio
CFLAGS += -DHAVE_LIBAIO
endif
include $(SPDK_ROOT_DIR)/mk/nvme.libtest.mk
install: $(APP) install: $(APP)
$(INSTALL_EXAMPLE) $(INSTALL_EXAMPLE)
uninstall: uninstall:
$(UNINSTALL_EXAMPLE) $(UNINSTALL_EXAMPLE)
include $(SPDK_ROOT_DIR)/mk/nvme.libtest.mk
ifeq ($(OS),Linux)
SYS_LIBS += -laio
CFLAGS += -DHAVE_LIBAIO
endif

View File

@ -36,7 +36,7 @@ NVME_DIR := $(SPDK_ROOT_DIR)/lib/nvme
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
include $(SPDK_ROOT_DIR)/mk/spdk.modules.mk include $(SPDK_ROOT_DIR)/mk/spdk.modules.mk
C_SRCS = $(APP:%=%.c) C_SRCS := $(APP:%=%.c)
# Unable to combine the FIO plugin and the VPP socket abstraction (license incompatibility) # Unable to combine the FIO plugin and the VPP socket abstraction (license incompatibility)
SPDK_LIB_LIST = $(filter-out sock_vpp,$(SOCK_MODULES_LIST)) SPDK_LIB_LIST = $(filter-out sock_vpp,$(SOCK_MODULES_LIST))

View File

@ -34,11 +34,16 @@
include $(SPDK_ROOT_DIR)/mk/spdk.app_vars.mk include $(SPDK_ROOT_DIR)/mk/spdk.app_vars.mk
# Applications in app/ go into build/bin/. # Applications in app/ go into build/bin/.
# Applications in examples/ go into build/examples/.
# Use findstring to identify if the current directory is in the app # Use findstring to identify if the current directory is in the app
# directory. If it is, change the APP location to build. # or examples directory. If it is, change the APP location.
APP_NAME := $(notdir $(APP)) APP_NAME := $(notdir $(APP))
ifneq (,$(findstring $(SPDK_ROOT_DIR)/app,$(CURDIR))) ifneq (,$(findstring $(SPDK_ROOT_DIR)/app,$(CURDIR)))
APP := $(APP_NAME:%=$(SPDK_ROOT_DIR)/build/bin/%) APP := $(APP_NAME:%=$(SPDK_ROOT_DIR)/build/bin/%)
else
ifneq (,$(findstring $(SPDK_ROOT_DIR)/examples,$(CURDIR)))
APP := $(APP_NAME:%=$(SPDK_ROOT_DIR)/build/examples/%)
endif
endif endif
LIBS += $(SPDK_LIB_LINKER_ARGS) LIBS += $(SPDK_LIB_LINKER_ARGS)

View File

@ -33,11 +33,16 @@
include $(SPDK_ROOT_DIR)/mk/spdk.app_vars.mk include $(SPDK_ROOT_DIR)/mk/spdk.app_vars.mk
# Applications in app/ go into build/bin/. # Applications in app/ go into build/bin/.
# Applications in examples/ go into build/examples/.
# Use findstring to identify if the current directory is in the app # Use findstring to identify if the current directory is in the app
# directory. If it is, change the APP location to build. # directory. If it is, change the APP location to build.
APP_NAME := $(notdir $(APP)) APP_NAME := $(notdir $(APP))
ifneq (,$(findstring $(SPDK_ROOT_DIR)/app,$(CURDIR))) ifneq (,$(findstring $(SPDK_ROOT_DIR)/app,$(CURDIR)))
APP := $(APP_NAME:%=$(SPDK_ROOT_DIR)/build/bin/%) APP := $(APP_NAME:%=$(SPDK_ROOT_DIR)/build/bin/%)
else
ifneq (,$(findstring $(SPDK_ROOT_DIR)/examples,$(CURDIR)))
APP := $(APP_NAME:%=$(SPDK_ROOT_DIR)/build/examples/%)
endif
endif endif
LIBS += $(SPDK_LIB_LINKER_ARGS) LIBS += $(SPDK_LIB_LINKER_ARGS)

View File

@ -338,7 +338,7 @@ UNINSTALL_APP=\
INSTALL_EXAMPLE=\ INSTALL_EXAMPLE=\
$(Q)echo " INSTALL $(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))"; \ $(Q)echo " INSTALL $(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))"; \
install -d -m 755 "$(DESTDIR)$(bindir)"; \ install -d -m 755 "$(DESTDIR)$(bindir)"; \
install -m 755 "$(APP)" "$(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))" install -m 755 "$<" "$(DESTDIR)$(bindir)/spdk_$(strip $(subst /,_,$(subst $(SPDK_ROOT_DIR)/examples/, ,$(CURDIR))))"
# Uninstall an example binary # Uninstall an example binary
UNINSTALL_EXAMPLE=\ UNINSTALL_EXAMPLE=\

View File

@ -184,8 +184,7 @@ Following VM initialization you must:
``` ```
$ sudo scripts/setup.sh $ sudo scripts/setup.sh
$ cd examples/bdev/hello_world $ sudo ./build/examples/hello_bdev
$ sudo ./hello_bdev
``` ```
### Running autorun.sh with vagrant ### Running autorun.sh with vagrant

View File

@ -368,7 +368,7 @@ killprocess "$spdk_tgt_pid"
# End bdev configuration # End bdev configuration
#----------------------------------------------------- #-----------------------------------------------------
run_test "bdev_hello_world" $rootdir/examples/bdev/hello_world/hello_bdev --json "$conf_file" -b "$hello_world_bdev" run_test "bdev_hello_world" $SPDK_EXAMPLE_DIR/hello_bdev --json "$conf_file" -b "$hello_world_bdev"
run_test "bdev_bounds" bdev_bounds run_test "bdev_bounds" bdev_bounds
run_test "bdev_nbd" nbd_function_test $conf_file "$bdevs_name" run_test "bdev_nbd" nbd_function_test $conf_file "$bdevs_name"
if [[ $CONFIG_FIO_PLUGIN == y ]]; then if [[ $CONFIG_FIO_PLUGIN == y ]]; then

View File

@ -38,7 +38,7 @@ run_step() {
} }
run_bsdump() { run_bsdump() {
$rootdir/examples/blob/cli/blobcli -c $ROCKSDB_CONF -b Nvme0n1 -D &> bsdump.txt $SPDK_EXAMPLE_DIR/blobcli -c $ROCKSDB_CONF -b Nvme0n1 -D &> bsdump.txt
} }
# In the autotest job, we copy the rocksdb source to just outside the spdk directory. # In the autotest job, we copy the rocksdb source to just outside the spdk directory.

View File

@ -17,7 +17,7 @@ $rootdir/scripts/gen_nvme.sh > $testdir/blobcli.conf
dd if=/dev/urandom of=$testdir/test.pattern bs=1M count=1 dd if=/dev/urandom of=$testdir/test.pattern bs=1M count=1
(cd $testdir \ (cd $testdir \
&& $rootdir/examples/blob/cli/blobcli -c $testdir/blobcli.conf -b Nvme0n1 -T $testdir/test.bs > $testdir/btest.out) && $SPDK_EXAMPLE_DIR/blobcli -c $testdir/blobcli.conf -b Nvme0n1 -T $testdir/test.bs > $testdir/btest.out)
# the test script will import the test pattern generated by dd and then export # the test script will import the test pattern generated by dd and then export
# it to a file so we can compare and confirm basic read and write # it to a file so we can compare and confirm basic read and write

View File

@ -178,6 +178,7 @@ fi
# Export location of where all the SPDK binaries are # Export location of where all the SPDK binaries are
export SPDK_BIN_DIR="$rootdir/build/bin" export SPDK_BIN_DIR="$rootdir/build/bin"
export SPDK_EXAMPLE_DIR="$rootdir/build/examples"
# pass our valgrind desire on to unittest.sh # pass our valgrind desire on to unittest.sh
if [ $SPDK_RUN_VALGRIND -eq 0 ]; then if [ $SPDK_RUN_VALGRIND -eq 0 ]; then

View File

@ -13,7 +13,7 @@ source "$rootdir/test/nvmf/common.sh"
function error_cleanup() { function error_cleanup() {
# force delete pmem file and wipe on-disk metadata # force delete pmem file and wipe on-disk metadata
rm -rf /tmp/pmem rm -rf /tmp/pmem
$rootdir/examples/nvme/perf/perf -q 1 -o 131072 -w write -t 2 $SPDK_EXAMPLE_DIR/perf -q 1 -o 131072 -w write -t 2
} }
function destroy_vols() { function destroy_vols() {
@ -97,7 +97,7 @@ if [ $RUN_NIGHTLY -eq 1 ]; then
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode0 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode0 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
# Start random read writes in the background # Start random read writes in the background
$rootdir/examples/nvme/perf/perf -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" -o 4096 -q 64 -s 512 -w randrw -t 30 -c 0x18 -M 50 & $SPDK_EXAMPLE_DIR/perf -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" -o 4096 -q 64 -s 512 -w randrw -t 30 -c 0x18 -M 50 &
perf_pid=$! perf_pid=$!
# Wait for I/O to complete # Wait for I/O to complete

View File

@ -1,23 +1,23 @@
# Common utility functions to be sourced by the libftl test scripts # Common utility functions to be sourced by the libftl test scripts
function get_chunk_size() { function get_chunk_size() {
$rootdir/examples/nvme/identify/identify -r "trtype:PCIe traddr:$1" \ $SPDK_EXAMPLE_DIR/identify -r "trtype:PCIe traddr:$1" \
| grep 'Logical blks per chunk' | sed 's/[^0-9]//g' | grep 'Logical blks per chunk' | sed 's/[^0-9]//g'
} }
function get_num_group() { function get_num_group() {
$rootdir/examples/nvme/identify/identify -r "trtype:PCIe traddr:$1" \ $SPDK_EXAMPLE_DIR/identify -r "trtype:PCIe traddr:$1" \
| grep 'Groups' | sed 's/[^0-9]//g' | grep 'Groups' | sed 's/[^0-9]//g'
} }
function get_num_pu() { function get_num_pu() {
$rootdir/examples/nvme/identify/identify -r "trtype:PCIe traddr:$1" \ $SPDK_EXAMPLE_DIR/identify -r "trtype:PCIe traddr:$1" \
| grep 'PUs' | sed 's/[^0-9]//g' | grep 'PUs' | sed 's/[^0-9]//g'
} }
function has_separate_md() { function has_separate_md() {
local md_type local md_type
md_type=$($rootdir/examples/nvme/identify/identify -r "trtype:PCIe traddr:$1" \ md_type=$($SPDK_EXAMPLE_DIR/identify -r "trtype:PCIe traddr:$1" \
| grep 'Metadata Transferred' | cut -d: -f2) | grep 'Metadata Transferred' | cut -d: -f2)
if [[ "$md_type" =~ Separate ]]; then if [[ "$md_type" =~ Separate ]]; then
return 0 return 0

View File

@ -4,6 +4,6 @@ testdir=$(readlink -f $(dirname $0))
rootdir=$(readlink -f $testdir/../..) rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh source $rootdir/test/common/autotest_common.sh
run_test "ioat_perf" $rootdir/examples/ioat/perf/ioat_perf -t 1 run_test "ioat_perf" $SPDK_EXAMPLE_DIR/ioat_perf -t 1
run_test "ioat_verify" $rootdir/examples/ioat/verify/verify -t 1 run_test "ioat_verify" $SPDK_EXAMPLE_DIR/verify -t 1

View File

@ -81,7 +81,7 @@ if [ "$TEST_TYPE" != "posix" ] && [ "$TEST_TYPE" != "vpp" ]; then
exit 1 exit 1
fi fi
HELLO_SOCK_APP="${TARGET_NS_CMD[*]} $rootdir/examples/sock/hello_world/hello_sock" HELLO_SOCK_APP="${TARGET_NS_CMD[*]} $SPDK_EXAMPLE_DIR/hello_sock"
if [ $SPDK_TEST_VPP -eq 1 ]; then if [ $SPDK_TEST_VPP -eq 1 ]; then
HELLO_SOCK_APP+=" -L sock_vpp" HELLO_SOCK_APP+=" -L sock_vpp"
fi fi

View File

@ -96,7 +96,7 @@ timing_exit wait_for_vm
timing_enter copy_repo timing_enter copy_repo
files_to_copy="scripts " files_to_copy="scripts "
files_to_copy+="include/spdk/pci_ids.h " files_to_copy+="include/spdk/pci_ids.h "
files_to_copy+="examples/nvme/hotplug/hotplug " files_to_copy+="build/examples/hotplug "
( (
cd "$rootdir" cd "$rootdir"
tar -cf - $files_to_copy tar -cf - $files_to_copy
@ -107,7 +107,7 @@ insert_devices
timing_enter hotplug_test timing_enter hotplug_test
ssh_vm "examples/nvme/hotplug/hotplug -i 0 -t 25 -n 4 -r 8" & ssh_vm "build/examples/hotplug -i 0 -t 25 -n 4 -r 8" &
example_pid=$! example_pid=$!
sleep 4 sleep 4

View File

@ -41,7 +41,7 @@ timing_exit hotplug_hw_cfg
timing_enter hotplug_hw_test timing_enter hotplug_hw_test
$rootdir/examples/nvme/hotplug/hotplug -i 0 -t 100 -n 2 -r 2 2>&1 | tee -a log.txt & $SPDK_EXAMPLE_DIR/hotplug -i 0 -t 100 -n 2 -r 2 2>&1 | tee -a log.txt &
example_pid=$! example_pid=$!
trap 'killprocess $example_pid; exit 1' SIGINT SIGTERM EXIT trap 'killprocess $example_pid; exit 1' SIGINT SIGTERM EXIT

View File

@ -6,20 +6,20 @@ source $rootdir/scripts/common.sh
source $rootdir/test/common/autotest_common.sh source $rootdir/test/common/autotest_common.sh
function nvme_identify() { function nvme_identify() {
$rootdir/examples/nvme/identify/identify -i 0 $SPDK_EXAMPLE_DIR/identify -i 0
for bdf in $(get_nvme_bdfs); do for bdf in $(get_nvme_bdfs); do
$rootdir/examples/nvme/identify/identify -r "trtype:PCIe traddr:${bdf}" -i 0 $SPDK_EXAMPLE_DIR/identify -r "trtype:PCIe traddr:${bdf}" -i 0
done done
timing_exit identify timing_exit identify
} }
function nvme_perf() { function nvme_perf() {
# enable no shutdown notification option # enable no shutdown notification option
$rootdir/examples/nvme/perf/perf -q 128 -w read -o 12288 -t 1 -LL -i 0 -N $SPDK_EXAMPLE_DIR/perf -q 128 -w read -o 12288 -t 1 -LL -i 0 -N
$rootdir/examples/nvme/perf/perf -q 128 -w write -o 12288 -t 1 -LL -i 0 $SPDK_EXAMPLE_DIR/perf -q 128 -w write -o 12288 -t 1 -LL -i 0
if [ -b /dev/ram0 ]; then if [ -b /dev/ram0 ]; then
# Test perf with AIO device # Test perf with AIO device
$rootdir/examples/nvme/perf/perf /dev/ram0 -q 128 -w read -o 12288 -t 1 -LL -i 0 $SPDK_EXAMPLE_DIR/perf /dev/ram0 -q 128 -w read -o 12288 -t 1 -LL -i 0
fi fi
} }
@ -32,11 +32,11 @@ function nvme_fio_test() {
} }
function nvme_multi_secondary() { function nvme_multi_secondary() {
$rootdir/examples/nvme/perf/perf -i 0 -q 16 -w read -o 4096 -t 3 -c 0x1 & $SPDK_EXAMPLE_DIR/perf -i 0 -q 16 -w read -o 4096 -t 3 -c 0x1 &
pid0=$! pid0=$!
$rootdir/examples/nvme/perf/perf -i 0 -q 16 -w read -o 4096 -t 3 -c 0x2 & $SPDK_EXAMPLE_DIR/perf -i 0 -q 16 -w read -o 4096 -t 3 -c 0x2 &
pid1=$! pid1=$!
$rootdir/examples/nvme/perf/perf -i 0 -q 16 -w read -o 4096 -t 3 -c 0x4 $SPDK_EXAMPLE_DIR/perf -i 0 -q 16 -w read -o 4096 -t 3 -c 0x4
wait $pid0 wait $pid0
wait $pid1 wait $pid1
} }
@ -108,14 +108,14 @@ fi
run_test "nvme_reset" $testdir/reset/reset -q 64 -w write -s 4096 -t 5 run_test "nvme_reset" $testdir/reset/reset -q 64 -w write -s 4096 -t 5
run_test "nvme_identify" nvme_identify run_test "nvme_identify" nvme_identify
run_test "nvme_perf" nvme_perf run_test "nvme_perf" nvme_perf
run_test "nvme_hello_world" $rootdir/examples/nvme/hello_world/hello_world run_test "nvme_hello_world" $SPDK_EXAMPLE_DIR/hello_world
run_test "nvme_deallocated_value" $testdir/deallocated_value/deallocated_value run_test "nvme_deallocated_value" $testdir/deallocated_value/deallocated_value
run_test "nvme_sgl" $testdir/sgl/sgl run_test "nvme_sgl" $testdir/sgl/sgl
run_test "nvme_e2edp" $testdir/e2edp/nvme_dp run_test "nvme_e2edp" $testdir/e2edp/nvme_dp
run_test "nvme_reserve" $testdir/reserve/reserve run_test "nvme_reserve" $testdir/reserve/reserve
run_test "nvme_err_injection" $testdir/err_injection/err_injection run_test "nvme_err_injection" $testdir/err_injection/err_injection
run_test "nvme_overhead" $testdir/overhead/overhead -s 4096 -t 1 -H run_test "nvme_overhead" $testdir/overhead/overhead -s 4096 -t 1 -H
run_test "nvme_arbitration" $rootdir/examples/nvme/arbitration/arbitration -t 3 -i 0 run_test "nvme_arbitration" $SPDK_EXAMPLE_DIR/arbitration -t 3 -i 0
if [ $SPDK_TEST_NVME_CUSE -eq 1 ]; then if [ $SPDK_TEST_NVME_CUSE -eq 1 ]; then
run_test "nvme_cuse" $testdir/cuse/cuse run_test "nvme_cuse" $testdir/cuse/cuse
fi fi

View File

@ -6,7 +6,7 @@ ROOT_DIR=$(readlink -f $BASE_DIR/../../..)
rootdir=$ROOT_DIR rootdir=$ROOT_DIR
PLUGIN_DIR=$ROOT_DIR/build/fio PLUGIN_DIR=$ROOT_DIR/build/fio
BDEVPERF_DIR=$ROOT_DIR/test/bdev/bdevperf BDEVPERF_DIR=$ROOT_DIR/test/bdev/bdevperf
NVMEPERF_DIR=$ROOT_DIR/examples/nvme/perf NVMEPERF_DIR=$ROOT_DIR/build/examples/perf
. $ROOT_DIR/scripts/common.sh || exit 1 . $ROOT_DIR/scripts/common.sh || exit 1
. $ROOT_DIR/test/common/autotest_common.sh . $ROOT_DIR/test/common/autotest_common.sh
NVME_FIO_RESULTS=$BASE_DIR/result.json NVME_FIO_RESULTS=$BASE_DIR/result.json

View File

@ -34,13 +34,13 @@ $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPOR
$rpc_py nvmf_get_subsystems $rpc_py nvmf_get_subsystems
$rootdir/examples/nvme/identify/identify -r "\ $SPDK_EXAMPLE_DIR/identify -r "\
trtype:$TEST_TRANSPORT \ trtype:$TEST_TRANSPORT \
adrfam:IPv4 \ adrfam:IPv4 \
traddr:$NVMF_FIRST_TARGET_IP \ traddr:$NVMF_FIRST_TARGET_IP \
trsvcid:$NVMF_PORT \ trsvcid:$NVMF_PORT \
subnqn:nqn.2014-08.org.nvmexpress.discovery" -L all subnqn:nqn.2014-08.org.nvmexpress.discovery" -L all
$rootdir/examples/nvme/identify/identify -r "\ $SPDK_EXAMPLE_DIR/identify -r "\
trtype:$TEST_TRANSPORT \ trtype:$TEST_TRANSPORT \
adrfam:IPv4 \ adrfam:IPv4 \
traddr:$NVMF_FIRST_TARGET_IP \ traddr:$NVMF_FIRST_TARGET_IP \

View File

@ -40,13 +40,13 @@ ln -s /sys/kernel/config/nvmet/subsystems/$subsystemname /sys/kernel/config/nvme
sleep 4 sleep 4
$rootdir/examples/nvme/identify/identify -r "\ $SPDK_EXAMPLE_DIR/identify -r "\
trtype:$TEST_TRANSPORT \ trtype:$TEST_TRANSPORT \
adrfam:IPv4 \ adrfam:IPv4 \
traddr:$NVMF_FIRST_TARGET_IP \ traddr:$NVMF_FIRST_TARGET_IP \
trsvcid:$NVMF_PORT \ trsvcid:$NVMF_PORT \
subnqn:nqn.2014-08.org.nvmexpress.discovery" -t all subnqn:nqn.2014-08.org.nvmexpress.discovery" -t all
$rootdir/examples/nvme/identify/identify -r "\ $SPDK_EXAMPLE_DIR/identify -r "\
trtype:$TEST_TRANSPORT \ trtype:$TEST_TRANSPORT \
adrfam:IPv4 \ adrfam:IPv4 \
traddr:$NVMF_FIRST_TARGET_IP \ traddr:$NVMF_FIRST_TARGET_IP \

View File

@ -32,16 +32,16 @@ $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPOR
# Test multi-process access to local NVMe device # Test multi-process access to local NVMe device
if [ -n "$local_nvme_trid" ]; then if [ -n "$local_nvme_trid" ]; then
if [ $SPDK_RUN_NON_ROOT -eq 1 ]; then if [ $SPDK_RUN_NON_ROOT -eq 1 ]; then
perf_app="sudo -u $(logname) $rootdir/examples/nvme/perf/perf" perf_app="sudo -u $(logname) $SPDK_EXAMPLE_DIR/perf"
else else
perf_app="$rootdir/examples/nvme/perf/perf" perf_app="$SPDK_EXAMPLE_DIR/perf"
fi fi
$perf_app -i $NVMF_APP_SHM_ID -q 32 -o 4096 -w randrw -M 50 -t 1 -r "$local_nvme_trid" $perf_app -i $NVMF_APP_SHM_ID -q 32 -o 4096 -w randrw -M 50 -t 1 -r "$local_nvme_trid"
fi fi
$rootdir/examples/nvme/perf/perf -q 1 -o 4096 -w randrw -M 50 -t 1 -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" $SPDK_EXAMPLE_DIR/perf -q 1 -o 4096 -w randrw -M 50 -t 1 -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT"
$rootdir/examples/nvme/perf/perf -q 32 -o 4096 -w randrw -M 50 -t 1 -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" $SPDK_EXAMPLE_DIR/perf -q 32 -o 4096 -w randrw -M 50 -t 1 -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT"
$rootdir/examples/nvme/perf/perf -q 128 -o 262144 -w randrw -M 50 -t 2 -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" $SPDK_EXAMPLE_DIR/perf -q 128 -o 262144 -w randrw -M 50 -t 2 -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT"
sync sync
$rpc_py nvmf_delete_subsystem nqn.2016-06.io.spdk:cnode1 $rpc_py nvmf_delete_subsystem nqn.2016-06.io.spdk:cnode1
@ -75,7 +75,7 @@ if [ $RUN_NIGHTLY -eq 1 ]; then
io_size=("512" "131072") io_size=("512" "131072")
for qd in "${qd_depth[@]}"; do for qd in "${qd_depth[@]}"; do
for o in "${io_size[@]}"; do for o in "${io_size[@]}"; do
$rootdir/examples/nvme/perf/perf -q $qd -o $o -w randrw -M 50 -t 10 -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" $SPDK_EXAMPLE_DIR/perf -q $qd -o $o -w randrw -M 50 -t 10 -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT"
done done
done done

View File

@ -28,7 +28,7 @@ function disconnect_init() {
# a discovery controller that doesn't exist yet. # a discovery controller that doesn't exist yet.
function nvmf_target_disconnect_tc1() { function nvmf_target_disconnect_tc1() {
set +e set +e
$rootdir/examples/nvme/reconnect/reconnect -q 32 -o 4096 -w randrw -M 50 -t 10 -c 0xF \ $SPDK_EXAMPLE_DIR/reconnect -q 32 -o 4096 -w randrw -M 50 -t 10 -c 0xF \
-r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT"
# If the program crashes, the high bit of $? will be set so we will get a value in the hundreds. # If the program crashes, the high bit of $? will be set so we will get a value in the hundreds.
# But if the reconnect code detects errors and exits normally it will return 1. # But if the reconnect code detects errors and exits normally it will return 1.
@ -43,7 +43,7 @@ function nvmf_target_disconnect_tc2() {
disconnect_init $NVMF_FIRST_TARGET_IP disconnect_init $NVMF_FIRST_TARGET_IP
# If perf doesn't shut down, this test will time out. # If perf doesn't shut down, this test will time out.
$rootdir/examples/nvme/reconnect/reconnect -q 32 -o 4096 -w randrw -M 50 -t 10 -c 0xF \ $SPDK_EXAMPLE_DIR/reconnect -q 32 -o 4096 -w randrw -M 50 -t 10 -c 0xF \
-r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" & -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" &
reconnectpid=$! reconnectpid=$!
@ -58,7 +58,7 @@ function nvmf_target_disconnect_tc2() {
} }
function nvmf_target_disconnect_tc3() { function nvmf_target_disconnect_tc3() {
$rootdir/examples/nvme/reconnect/reconnect -q 32 -o 4096 -w randrw -M 50 -t 10 -c 0xF \ $SPDK_EXAMPLE_DIR/reconnect -q 32 -o 4096 -w randrw -M 50 -t 10 -c 0xF \
-r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT alt_traddr:$NVMF_SECOND_TARGET_IP" & -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT alt_traddr:$NVMF_SECOND_TARGET_IP" &
reconnectpid=$! reconnectpid=$!

View File

@ -19,8 +19,8 @@ if [ -z "${bdf}" ]; then
fi fi
# Expected values # Expected values
nvme_serial_number=$($rootdir/examples/nvme/identify/identify -r "trtype:PCIe traddr:${bdf}" -i 0 | grep "Serial Number:" | awk '{print $3}') nvme_serial_number=$($SPDK_EXAMPLE_DIR/identify -r "trtype:PCIe traddr:${bdf}" -i 0 | grep "Serial Number:" | awk '{print $3}')
nvme_model_number=$($rootdir/examples/nvme/identify/identify -r "trtype:PCIe traddr:${bdf}" -i 0 | grep "Model Number:" | awk '{print $3}') nvme_model_number=$($SPDK_EXAMPLE_DIR/identify -r "trtype:PCIe traddr:${bdf}" -i 0 | grep "Model Number:" | awk '{print $3}')
timing_exit nvme_identify timing_exit nvme_identify
@ -45,14 +45,14 @@ $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPOR
$rpc_py nvmf_get_subsystems $rpc_py nvmf_get_subsystems
# Discovered values # Discovered values
nvmf_serial_number=$($rootdir/examples/nvme/identify/identify -r "\ nvmf_serial_number=$($SPDK_EXAMPLE_DIR/identify -r "\
trtype:$TEST_TRANSPORT \ trtype:$TEST_TRANSPORT \
adrfam:IPv4 \ adrfam:IPv4 \
traddr:$NVMF_FIRST_TARGET_IP \ traddr:$NVMF_FIRST_TARGET_IP \
trsvcid:$NVMF_PORT \ trsvcid:$NVMF_PORT \
subnqn:nqn.2016-06.io.spdk:cnode1" | grep "Serial Number:" | awk '{print $3}') subnqn:nqn.2016-06.io.spdk:cnode1" | grep "Serial Number:" | awk '{print $3}')
nvmf_model_number=$($rootdir/examples/nvme/identify/identify -r "\ nvmf_model_number=$($SPDK_EXAMPLE_DIR/identify -r "\
trtype:$TEST_TRANSPORT \ trtype:$TEST_TRANSPORT \
adrfam:IPv4 \ adrfam:IPv4 \
traddr:$NVMF_FIRST_TARGET_IP \ traddr:$NVMF_FIRST_TARGET_IP \

View File

@ -12,9 +12,9 @@ MALLOC_BLOCK_SIZE=512
function build_nvmf_example_args() { function build_nvmf_example_args() {
if [ $SPDK_RUN_NON_ROOT -eq 1 ]; then if [ $SPDK_RUN_NON_ROOT -eq 1 ]; then
echo "sudo -u $(logname) ./examples/nvmf/nvmf/nvmf -i $NVMF_APP_SHM_ID" -g 10000 echo "sudo -u $(logname) $SPDK_EXAMPLE_DIR/nvmf -i $NVMF_APP_SHM_ID" -g 10000
else else
echo "./examples/nvmf/nvmf/nvmf -i $NVMF_APP_SHM_ID" -g 10000 echo "$SPDK_EXAMPLE_DIR/nvmf -i $NVMF_APP_SHM_ID" -g 10000
fi fi
} }
@ -48,7 +48,7 @@ done
#add listener to subsystem #add listener to subsystem
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
perf="$rootdir/examples/nvme/perf/perf" perf="$SPDK_EXAMPLE_DIR/perf"
$perf -q 64 -o 4096 -w randrw -M 30 -t 10 \ $perf -q 64 -o 4096 -w randrw -M 30 -t 10 \
-r "trtype:${TEST_TRANSPORT} adrfam:IPv4 traddr:${NVMF_FIRST_TARGET_IP} trsvcid:${NVMF_PORT} \ -r "trtype:${TEST_TRANSPORT} adrfam:IPv4 traddr:${NVMF_FIRST_TARGET_IP} trsvcid:${NVMF_PORT} \

View File

@ -34,7 +34,7 @@ $rpc_py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode0 $lvol
$rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode0 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT $rpc_py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode0 -t $TEST_TRANSPORT -a $NVMF_FIRST_TARGET_IP -s $NVMF_PORT
# Start random writes in the background # Start random writes in the background
$rootdir/examples/nvme/perf/perf -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" -o 4096 -q 128 -s 512 -w randwrite -t 10 -c 0x18 & $SPDK_EXAMPLE_DIR/perf -r "trtype:$TEST_TRANSPORT adrfam:IPv4 traddr:$NVMF_FIRST_TARGET_IP trsvcid:$NVMF_PORT" -o 4096 -q 128 -s 512 -w randwrite -t 10 -c 0x18 &
perf_pid=$! perf_pid=$!
sleep 1 sleep 1

View File

@ -10,13 +10,13 @@ VMD_WHITELIST=()
function vmd_identify() { function vmd_identify() {
for bdf in $pci_devs; do for bdf in $pci_devs; do
$rootdir/examples/nvme/identify/identify -i 0 -V -r "trtype:PCIe traddr:$bdf" $SPDK_EXAMPLE_DIR/identify -i 0 -V -r "trtype:PCIe traddr:$bdf"
done done
} }
function vmd_perf() { function vmd_perf() {
for bdf in $pci_devs; do for bdf in $pci_devs; do
$rootdir/examples/nvme/perf/perf -q 128 -w read -o 12288 -t 1 -LL -i 0 -V -r "trtype:PCIe traddr:$bdf" $SPDK_EXAMPLE_DIR/perf -q 128 -w read -o 12288 -t 1 -LL -i 0 -V -r "trtype:PCIe traddr:$bdf"
done done
} }
@ -65,7 +65,7 @@ if [[ -z "$pci_devs" ]]; then
fi fi
run_test "vmd_identify" vmd_identify run_test "vmd_identify" vmd_identify
run_test "vmd_hello_world" $rootdir/examples/nvme/hello_world/hello_world -V run_test "vmd_hello_world" $SPDK_EXAMPLE_DIR/hello_world -V
run_test "vmd_perf" vmd_perf run_test "vmd_perf" vmd_perf
if [[ $CONFIG_FIO_PLUGIN == y ]]; then if [[ $CONFIG_FIO_PLUGIN == y ]]; then
run_test "vmd_fio" vmd_fio run_test "vmd_fio" vmd_fio