1、下载spdk
git clone GitHub - spdk/spdk: Storage Performance Development Kit
2、编译
cd spdk
git submodule update --init
安装依赖
./scripts/pkgdep.sh 如果是测试rdma升级带参数“scripts/pkgdep.sh --rdma”
./configure 如果是测试rdma编译带参数“./configure --with-rdma”
make,如果后期出现错误,尝试重新编译,基本上是依赖更新造成的,重新编译基本上可以解决
3、安装检验测试
./test/unit/unittest.sh
执行完成后,出现all unit test passed,表示没有问题
4、mellanox spdk target端
mellanox 和nvme盘插在同一主机上
进入spdk目录
sudo scripts/setup.sh
配置mellanox ip
sudo systemctl stop NetworkManager
ifconfig eth1 192.168.100.8 netmask 255.255.255.0 up
启动target
sudo build/bin/nvmf_tgt
另起一个终端
创建rdma接口
sudo scripts/rpc.py nvmf_create_transport -t RDMA -u 8192 -i 131072 -c 8192 -r -d 64
attach controller
sudo scripts/rpc.py bdev_nvme_attach_controller -b NVMe1 -t PCIe -a 0000:14:00.0
创建subsystem
sudo scripts/rpc.py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a -s SPDK00000000000001 -d SPDK_Controller1
绑定ns到subsystem
sudo scripts/rpc.py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 NVMe1n1
监听端口
sudo scripts/rpc.py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t rdma -a 192.168.100.8 -s 4420
5、mellanox spdk initiator端
配置mellanox ip
sudo systemctl stop NetworkManager
ifconfig eth1 192.168.100.8 netmask 255.255.255.0 up
进入spdk目录
sudo scripts/setup.sh
. /build/examples/perf -q 128 -o 4096 -w randrw -t 600 -r 'trtype:RDMA adrfam:IPv4 traddr:192.168.100.8 trsvcid:4420' -M 50