2015-09-21 15:52:41 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2016-01-05 22:31:56 +00:00
|
|
|
set -e
|
|
|
|
|
2015-09-21 15:52:41 +00:00
|
|
|
testdir=$(readlink -f $(dirname $0))
|
2017-04-04 23:20:16 +00:00
|
|
|
rootdir=$(readlink -f $testdir/../../..)
|
2015-09-21 15:52:41 +00:00
|
|
|
source $rootdir/scripts/autotest_common.sh
|
|
|
|
|
2017-06-30 14:48:53 +00:00
|
|
|
# delay time for apps to start up as primary
|
|
|
|
app_start=5
|
|
|
|
|
2016-04-13 00:58:29 +00:00
|
|
|
function linux_iter_pci {
|
2017-05-10 23:39:36 +00:00
|
|
|
lspci -mm -n -D | grep $1 | tr -d '"' | awk -F " " '{print $1}'
|
2016-04-13 00:58:29 +00:00
|
|
|
}
|
|
|
|
|
2015-10-08 19:40:44 +00:00
|
|
|
timing_enter nvme
|
|
|
|
|
2017-06-15 23:29:35 +00:00
|
|
|
if [ `uname` = Linux ]; then
|
|
|
|
start_stub "-s 2048 -i 0 -m 0xF"
|
2017-06-30 14:48:53 +00:00
|
|
|
sleep $app_start
|
2017-06-15 23:29:35 +00:00
|
|
|
trap "kill_stub; exit 1" SIGINT SIGTERM ExIT
|
|
|
|
fi
|
|
|
|
|
2016-03-23 20:34:31 +00:00
|
|
|
if [ $RUN_NIGHTLY -eq 1 ]; then
|
|
|
|
timing_enter aer
|
|
|
|
$testdir/aer/aer
|
|
|
|
timing_exit aer
|
2017-02-15 20:09:10 +00:00
|
|
|
|
|
|
|
timing_enter reset
|
|
|
|
$testdir/reset/reset -q 64 -w write -s 4096 -t 2
|
|
|
|
timing_exit reset
|
2016-03-23 20:34:31 +00:00
|
|
|
fi
|
2015-09-21 15:52:41 +00:00
|
|
|
|
2015-10-08 19:40:44 +00:00
|
|
|
timing_enter identify
|
2017-06-15 23:29:35 +00:00
|
|
|
$rootdir/examples/nvme/identify/identify -i 0
|
2017-01-13 06:20:35 +00:00
|
|
|
for bdf in $(linux_iter_pci 0108); do
|
2017-06-15 23:29:35 +00:00
|
|
|
$rootdir/examples/nvme/identify/identify -r "trtype:PCIe traddr:${bdf}" -i 0
|
2017-01-13 06:20:35 +00:00
|
|
|
done
|
2015-10-08 19:40:44 +00:00
|
|
|
timing_exit identify
|
2015-09-21 15:52:41 +00:00
|
|
|
|
2015-10-08 19:40:44 +00:00
|
|
|
timing_enter perf
|
2017-06-15 23:29:35 +00:00
|
|
|
$rootdir/examples/nvme/perf/perf -q 128 -w read -s 12288 -t 1 -LL -i 0
|
2015-10-08 19:40:44 +00:00
|
|
|
timing_exit perf
|
|
|
|
|
2016-01-22 08:39:55 +00:00
|
|
|
timing_enter reserve
|
|
|
|
$rootdir/examples/nvme/reserve/reserve
|
|
|
|
timing_exit reserve
|
|
|
|
|
2016-07-19 16:33:46 +00:00
|
|
|
timing_enter hello_world
|
|
|
|
$rootdir/examples/nvme/hello_world/hello_world
|
|
|
|
timing_exit
|
|
|
|
|
2017-06-15 23:29:35 +00:00
|
|
|
timing_enter sgl
|
|
|
|
$testdir/sgl/sgl
|
|
|
|
timing_exit sgl
|
|
|
|
|
|
|
|
timing_enter e2edp
|
|
|
|
$testdir/e2edp/nvme_dp
|
|
|
|
timing_exit e2edp
|
|
|
|
|
2016-08-01 20:18:22 +00:00
|
|
|
timing_enter overhead
|
2017-06-13 17:36:57 +00:00
|
|
|
$rootdir/test/lib/nvme/overhead/overhead -s 4096 -t 1 -H
|
2016-08-01 20:18:22 +00:00
|
|
|
timing_exit overhead
|
|
|
|
|
2017-06-15 23:29:35 +00:00
|
|
|
timing_enter arbitration
|
|
|
|
$rootdir/examples/nvme/arbitration/arbitration -t 3 -i 0
|
|
|
|
timing_exit arbitration
|
|
|
|
|
|
|
|
if [ `uname` = Linux ]; then
|
|
|
|
trap - SIGINT SIGTERM EXIT
|
|
|
|
kill_stub
|
|
|
|
fi
|
2017-06-13 18:50:32 +00:00
|
|
|
PLUGIN_DIR=$rootdir/examples/nvme/fio_plugin
|
|
|
|
|
2016-04-13 00:58:29 +00:00
|
|
|
if [ -d /usr/src/fio ]; then
|
|
|
|
timing_enter fio_plugin
|
|
|
|
for bdf in $(linux_iter_pci 0108); do
|
2017-06-12 05:08:19 +00:00
|
|
|
# Only test when ASAN is not enabled. If ASAN is enabled, we cannot test.
|
|
|
|
if [ $SPDK_RUN_ASAN -eq 0 ]; then
|
|
|
|
LD_PRELOAD=$PLUGIN_DIR/fio_plugin /usr/src/fio/fio $PLUGIN_DIR/example_config.fio --filename="trtype=PCIe traddr=${bdf//:/.} ns=1"
|
|
|
|
fi
|
2016-04-13 00:58:29 +00:00
|
|
|
break
|
|
|
|
done
|
|
|
|
|
|
|
|
timing_exit fio_plugin
|
|
|
|
fi
|
|
|
|
|
2017-06-08 18:14:25 +00:00
|
|
|
if [ $(uname -s) = Linux ] && [ $SPDK_TEST_NVME_MULTIPROCESS -eq 1 ]; then
|
2016-11-15 06:54:52 +00:00
|
|
|
timing_enter multi_process
|
2017-02-01 21:34:45 +00:00
|
|
|
$rootdir/examples/nvme/arbitration/arbitration -i 0 -s 4096 -t 10 -c 0xf &
|
2016-11-15 06:54:52 +00:00
|
|
|
pid=$!
|
2017-06-30 14:48:53 +00:00
|
|
|
sleep $app_start
|
2017-02-01 21:34:45 +00:00
|
|
|
$rootdir/examples/nvme/perf/perf -i 0 -q 1 -w randread -s 4096 -t 10 -c 0x10 &
|
2016-11-15 06:54:52 +00:00
|
|
|
sleep 1
|
|
|
|
kill -9 $!
|
|
|
|
count=0
|
|
|
|
while [ $count -le 2 ]; do
|
2017-06-15 06:02:54 +00:00
|
|
|
$rootdir/examples/nvme/perf/perf -i 0 -q 1 -w read -s 4096 -t 1 -c 0xf
|
2016-12-06 19:24:06 +00:00
|
|
|
count=$(($count + 1))
|
2016-11-15 06:54:52 +00:00
|
|
|
done
|
|
|
|
count=0
|
|
|
|
while [ $count -le 1 ]; do
|
2016-12-06 19:24:06 +00:00
|
|
|
core=$((1 << (($count + 4))))
|
|
|
|
printf -v hexcore "0x%x" "$core"
|
2017-02-01 21:34:45 +00:00
|
|
|
$rootdir/examples/nvme/perf/perf -i 0 -q 128 -w read -s 4096 -t 1 -c $hexcore &
|
2017-06-30 14:48:53 +00:00
|
|
|
sleep $app_start
|
2017-04-16 02:47:23 +00:00
|
|
|
$rootdir/examples/nvme/identify/identify -i 0 &
|
2017-06-30 14:48:53 +00:00
|
|
|
sleep $app_start
|
2016-12-06 19:24:06 +00:00
|
|
|
count=$(($count + 1))
|
2016-11-15 06:54:52 +00:00
|
|
|
done
|
|
|
|
wait $pid
|
|
|
|
timing_exit multi_process
|
|
|
|
fi
|
|
|
|
|
2015-10-08 19:40:44 +00:00
|
|
|
timing_exit nvme
|