2019-06-27 10:49:26 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
testdir=$(readlink -f $(dirname $0))
|
|
|
|
rootdir=$(readlink -f $testdir/../..)
|
|
|
|
source $rootdir/scripts/common.sh
|
|
|
|
source $rootdir/test/common/autotest_common.sh
|
|
|
|
|
2019-07-01 07:58:39 -04:00
|
|
|
rpc_py=$rootdir/scripts/rpc.py
|
|
|
|
|
2019-06-27 10:49:26 -04:00
|
|
|
pci_devs=$($rootdir/app/spdk_lspci/spdk_lspci | grep "NVMe disk behind VMD" | awk '{print $1}')
|
|
|
|
|
2019-07-25 14:45:20 +02:00
|
|
|
if [ -z $pci_devs ]; then
|
2019-06-27 10:49:26 -04:00
|
|
|
echo "Couldn't find any NVMe device behind a VMD."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
timing_enter vmd
|
|
|
|
|
|
|
|
timing_enter identify
|
|
|
|
for bdf in $pci_devs; do
|
|
|
|
$rootdir/examples/nvme/identify/identify -i 0 -V -r "trtype:PCIe traddr:$bdf"
|
|
|
|
done
|
|
|
|
timing_exit identify
|
|
|
|
|
|
|
|
timing_enter hello_world
|
|
|
|
$rootdir/examples/nvme/hello_world/hello_world -V
|
|
|
|
timing_exit
|
|
|
|
|
|
|
|
timing_enter perf
|
|
|
|
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"
|
|
|
|
done
|
|
|
|
timing_exit perf
|
|
|
|
|
|
|
|
if [ -d /usr/src/fio ]; then
|
|
|
|
timing_enter fio_plugin
|
|
|
|
PLUGIN_DIR=$rootdir/examples/nvme/fio_plugin
|
|
|
|
for bdf in $pci_devs; do
|
|
|
|
fio_nvme $testdir/config/config.fio --filename="trtype=PCIe traddr=${bdf//:/.} ns=1"
|
|
|
|
report_test_completion "bdev_fio"
|
|
|
|
done
|
|
|
|
timing_exit fio_plugin
|
|
|
|
fi
|
|
|
|
|
2019-07-01 07:58:39 -04:00
|
|
|
$rootdir/test/app/bdev_svc/bdev_svc --wait-for-rpc & svcpid=$!
|
2019-08-09 10:46:01 +02:00
|
|
|
trap 'killprocess $svcpid; exit 1' SIGINT SIGTERM EXIT
|
2019-07-01 07:58:39 -04:00
|
|
|
# Wait until bdev_svc starts
|
|
|
|
waitforlisten $svcpid
|
|
|
|
|
|
|
|
$rpc_py enable_vmd
|
2019-09-11 15:30:14 +02:00
|
|
|
$rpc_py framework_start_init
|
2019-07-01 07:58:39 -04:00
|
|
|
|
|
|
|
for bdf in $pci_devs; do
|
2019-08-23 09:50:51 -04:00
|
|
|
$rpc_py bdev_nvme_attach_controller -b NVMe_$bdf -t PCIe -a $bdf
|
2019-07-01 07:58:39 -04:00
|
|
|
done
|
|
|
|
|
2019-06-27 10:49:26 -04:00
|
|
|
timing_exit vmd
|