2016-07-20 18:16:23 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
2017-04-04 23:20:16 +00:00
|
|
|
rootdir=$(readlink -f $testdir/../../..)
|
2017-07-14 23:31:43 +00:00
|
|
|
plugindir=$rootdir/examples/bdev/fio_plugin
|
2016-07-20 18:16:23 +00:00
|
|
|
|
2017-08-28 16:27:36 +00:00
|
|
|
function run_fio()
|
|
|
|
{
|
|
|
|
if [ $RUN_NIGHTLY -eq 0 ]; then
|
|
|
|
LD_PRELOAD=$plugindir/fio_plugin /usr/src/fio/fio --ioengine=spdk_bdev --iodepth=8 --bs=4k --runtime=10 $testdir/bdev.fio "$@"
|
|
|
|
else
|
|
|
|
# Use size 192KB which both exceeds typical 128KB max NVMe I/O
|
|
|
|
# size and will cross 128KB Intel DC P3700 stripe boundaries.
|
|
|
|
LD_PRELOAD=$plugindir/fio_plugin /usr/src/fio/fio --ioengine=spdk_bdev --iodepth=128 --bs=192k --runtime=100 $testdir/bdev.fio "$@"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2017-07-14 23:31:43 +00:00
|
|
|
source $rootdir/scripts/autotest_common.sh
|
2016-07-20 18:16:23 +00:00
|
|
|
|
2017-07-14 23:31:43 +00:00
|
|
|
timing_enter bdev
|
2016-07-20 18:16:23 +00:00
|
|
|
|
2017-08-10 00:28:32 +00:00
|
|
|
# Create a file to be used as an AIO backend
|
|
|
|
dd if=/dev/zero of=/tmp/aiofile bs=2048 count=5000
|
|
|
|
|
2017-01-25 23:36:40 +00:00
|
|
|
cp $testdir/bdev.conf.in $testdir/bdev.conf
|
|
|
|
$rootdir/scripts/gen_nvme.sh >> $testdir/bdev.conf
|
|
|
|
|
2016-10-11 16:02:37 +00:00
|
|
|
timing_enter bounds
|
|
|
|
$testdir/bdevio/bdevio $testdir/bdev.conf
|
|
|
|
timing_exit bounds
|
2016-07-20 18:16:23 +00:00
|
|
|
|
2017-07-14 23:31:43 +00:00
|
|
|
timing_enter nbd
|
2017-07-17 07:45:46 +00:00
|
|
|
if grep -q Nvme0 $testdir/bdev.conf; then
|
|
|
|
part_dev_by_gpt $testdir/bdev.conf Nvme0n1 $rootdir
|
2017-06-01 05:02:54 +00:00
|
|
|
fi
|
2017-07-14 23:31:43 +00:00
|
|
|
timing_exit nbd
|
2017-06-01 05:02:54 +00:00
|
|
|
|
2017-07-20 14:11:47 +00:00
|
|
|
timing_enter bdev_svc
|
2017-07-14 23:31:43 +00:00
|
|
|
bdevs=$(discover_bdevs $rootdir $testdir/bdev.conf | jq -r '.[] | select(.bdev_opened_for_write == false)')
|
2017-07-20 14:11:47 +00:00
|
|
|
timing_exit bdev_svc
|
|
|
|
|
2017-07-14 23:31:43 +00:00
|
|
|
if [ -d /usr/src/fio ] && [ $SPDK_RUN_ASAN -eq 0 ]; then
|
|
|
|
timing_enter fio
|
2016-07-20 18:16:23 +00:00
|
|
|
|
2017-07-19 21:55:03 +00:00
|
|
|
timing_enter fio_rw_verify
|
2017-07-14 23:31:43 +00:00
|
|
|
# Generate the fio config file given the list of all unclaimed bdevs
|
|
|
|
fio_config_gen $testdir/bdev.fio verify
|
|
|
|
for b in $(echo $bdevs | jq -r '.name'); do
|
|
|
|
fio_config_add_job $testdir/bdev.fio $b
|
|
|
|
done
|
2016-08-04 23:12:51 +00:00
|
|
|
|
2017-08-28 16:27:36 +00:00
|
|
|
run_fio --spdk_conf=./test/lib/bdev/bdev.conf
|
2017-07-14 23:31:43 +00:00
|
|
|
|
|
|
|
rm -f *.state
|
|
|
|
rm -f $testdir/bdev.fio
|
2017-07-19 21:55:03 +00:00
|
|
|
timing_exit fio_rw_verify
|
|
|
|
|
|
|
|
timing_enter fio_trim
|
|
|
|
# Generate the fio config file given the list of all unclaimed bdevs that support unmap
|
|
|
|
fio_config_gen $testdir/bdev.fio trim
|
|
|
|
for b in $(echo $bdevs | jq -r 'select(.supported_io_types.unmap == true) | .name'); do
|
|
|
|
fio_config_add_job $testdir/bdev.fio $b
|
|
|
|
done
|
|
|
|
|
2017-08-28 16:27:36 +00:00
|
|
|
run_fio --spdk_conf=./test/lib/bdev/bdev.conf
|
2017-07-19 21:55:03 +00:00
|
|
|
|
|
|
|
rm -f *.state
|
|
|
|
rm -f $testdir/bdev.fio
|
|
|
|
timing_exit fio_trim
|
|
|
|
|
2017-07-14 23:31:43 +00:00
|
|
|
timing_exit fio
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $RUN_NIGHTLY -eq 1 ]; then
|
2017-04-14 22:41:24 +00:00
|
|
|
# Temporarily disabled - infinite loop
|
2017-07-19 21:55:03 +00:00
|
|
|
timing_enter reset
|
2017-04-14 22:41:24 +00:00
|
|
|
#$testdir/bdevperf/bdevperf -c $testdir/bdev.conf -q 16 -w reset -s 4096 -t 60
|
2017-07-19 21:55:03 +00:00
|
|
|
timing_exit reset
|
2016-07-20 18:16:23 +00:00
|
|
|
fi
|
|
|
|
|
2017-08-11 22:06:17 +00:00
|
|
|
|
|
|
|
if grep -q Nvme0 $testdir/bdev.conf; then
|
|
|
|
part_dev_by_gpt $testdir/bdev.conf Nvme0n1 $rootdir reset
|
|
|
|
fi
|
|
|
|
|
2017-08-10 00:28:32 +00:00
|
|
|
rm -f /tmp/aiofile
|
2017-01-25 23:36:40 +00:00
|
|
|
rm -f $testdir/bdev.conf
|
2017-07-14 23:31:43 +00:00
|
|
|
timing_exit bdev
|