3 testdir
=$
(readlink
-f $
(dirname $0))
4 rootdir
=$
(readlink
-f $testdir/..
/..
)
5 source $rootdir/scripts
/common.sh
6 source $rootdir/test
/common
/autotest_common.sh
8 rpc_py
=$rootdir/scripts
/rpc.py
11 function vmd_identify
() {
12 for bdf
in $pci_devs; do
13 $SPDK_EXAMPLE_DIR/identify
-i 0 -V -r "trtype:PCIe traddr:$bdf"
18 for bdf
in $pci_devs; do
19 $SPDK_EXAMPLE_DIR/perf
-q 128 -w read -o 12288 -t 1 -LL -i 0 -V -r "trtype:PCIe traddr:$bdf"
24 for bdf
in $pci_devs; do
25 fio_nvme
$testdir/config
/config.fio
--filename="trtype=PCIe traddr=${bdf//:/.} ns=1"
29 function vmd_bdev_svc
() {
30 $rootdir/test
/app
/bdev_svc
/bdev_svc
--wait-for-rpc &
32 trap 'killprocess $svcpid; exit 1' SIGINT SIGTERM EXIT
34 # Wait until bdev_svc starts
38 $rpc_py framework_start_init
40 for bdf
in $pci_devs; do
41 $rpc_py bdev_nvme_attach_controller
-b NVMe_
$bdf -t PCIe
-a $bdf
44 trap - SIGINT SIGTERM EXIT
48 # Re-run setup.sh script and only attach VMD devices to uio/vfio.
49 $rootdir/scripts
/setup.sh
reset
51 vmd_id
=$
(grep "PCI_DEVICE_ID_INTEL_VMD" $rootdir/include
/spdk
/pci_ids.h |
awk -F"x" '{print $2}')
53 for bdf
in $
(iter_pci_dev_id
8086 $vmd_id); do
54 if pci_can_use
$bdf; then
55 VMD_WHITELIST
+=("$bdf")
58 PCI_WHITELIST
="${VMD_WHITELIST[*]}" $rootdir/scripts
/setup.sh
60 pci_devs
=$
($SPDK_BIN_DIR/spdk_lspci |
grep "NVMe disk behind VMD" |
awk '{print $1}')
62 if [[ -z "$pci_devs" ]]; then
63 echo "Couldn't find any NVMe device behind a VMD."
67 run_test
"vmd_identify" vmd_identify
68 run_test
"vmd_hello_world" $SPDK_EXAMPLE_DIR/hello_world
-V
69 run_test
"vmd_perf" vmd_perf
70 if [[ $CONFIG_FIO_PLUGIN == y
]]; then
71 run_test
"vmd_fio" vmd_fio
74 run_test
"vmd_bdev_svc" vmd_bdev_svc
76 # Re-run setup.sh again so that other tests may continue
77 $rootdir/scripts
/setup.sh
reset
78 $rootdir/scripts
/setup.sh