【spdk】spdk compressdev测试

spdk-23.09\go\rpc\README.md go client

启应用

启哪个应用?
./build/bin/iscsi_tgt --wait-for-rpc &

/usr/local/daos-2.4/prereq/release/spdk/share/spdk/scripts/rpc.py bdev_malloc_create -b Malloc0 1024 4096 #1G bs=4k

/usr/local/daos-2.4/prereq/release/spdk/share/spdk/scripts/rpc.py bdev_get_bdevs #查看bdevs

/usr/local/daos-2.4/prereq/release/spdk/share/spdk/scripts/rpc.py bdev_lvol_create_lvstore Malloc0 lvs
/usr/local/daos-2.4/prereq/release/spdk/share/spdk/scripts/rpc.py bdev_lvol_create -t -l lvs lv0 1024

mount /dev/pmem0 /tmp/pmem
/usr/local/daos-2.4/prereq/release/spdk/share/spdk/scripts/rpc.py bdev_compress_create -b lvs/lv0 -p /tmp/pmem

[root@localhost spdk]# ./scripts/rpc.py bdev_compress_create -b lvs/lv0 -p /tmp/pmem
request:
{
“base_bdev_name”: “lvs/lv0”,
“pm_path”: “/tmp/pmem”,
“method”: “bdev_compress_create”,
“req_id”: 1
}
Got JSON-RPC error response
response:
{
“code”: -32601,
“message”: “Method not found”
}

需解决以上问题

解决方法, 编译SPDK时需要加上相关的库

–with-crypto
–with-vbdev-compress --with-dpdk-compressdev

./configure --prefix=output_dir --with-dpdk --disable-unit-tests --with-vhost --with-crypto --without-rbd --without-vtune --without-shared --with-rdma --with-vbdev-compress --with-dpdk-compressdev

配置QAT PMD

如下 按步骤执行

1.启动应用 加–wait-for-rpc
2…/spdk/scripts/rpc.py framework_start_init #启动加速框架
3…/spdk/scripts/rpc.py accel_get_module_info #获取加速模块
[root@localhost test]# …/spdk/scripts/rpc.py framework_start_init
[root@localhost test]# …/spdk/scripts/rpc.py accel_get_module_info
[
{
“module”: “software”,
“supported ops”: [
“copy”,
“fill”,
“dualcast”,
“compare”,
“crc32c”,
“copy_crc32c”,
“compress”,
“decompress”,
“encrypt”,
“decrypt”,
“xor”
]
},
{
“module”: “dpdk_cryptodev”,
“supported ops”: [
“copy”,
“fill”
]
},
{
“module”: “dpdk_compressdev”,
“supported ops”: []
}
]

[root@localhost test]# …/spdk/scripts/rpc.py compressdev_scan_accel_module -h
usage: rpc.py [options] compressdev_scan_accel_module [-h] [-p PMD]

optional arguments:
-h, --help show this help message and exit
-p PMD, --pmd PMD 0 = auto-select, 1= QAT only, 2 = mlx5_pci only

[root@localhost test]# …/spdk/scripts/rpc.py compressdev_scan_accel_module -p 0
[root@localhost test]# …/spdk/scripts/rpc.py compressdev_scan_accel_module -p 1
[root@localhost test]# …/spdk/scripts/rpc.py compressdev_scan_accel_module -p 2
分别对应:(怎么都是dpdk_compressdev)
[2024-01-17 08:05:16.008732] accel.c:2312:spdk_accel_module_list_add: NOTICE: Module dpdk_compressdev already registered
[2024-01-17 08:06:37.788732] accel.c:2312:spdk_accel_module_list_add: NOTICE: Module dpdk_compressdev already registered
[2024-01-17 08:06:46.996707] accel.c:2312:spdk_accel_module_list_add: NOTICE: Module dpdk_compressdev already registered

[root@localhost spdk]# ./scripts/rpc.py --verbose DEBUG compressdev_scan_accel_module -p 0
INFO: Log level set to 10
DEBUG: Trying to connect to UNIX socket: /var/tmp/spdk.sock
DEBUG: call(‘compressdev_scan_accel_module’)
DEBUG: append request:
{“jsonrpc”: “2.0”, “method”: “compressdev_scan_accel_module”, “id”: 1, “params”: {“pmd”: 0}}

DEBUG: Flushing buffer
INFO: Requests:
{
“jsonrpc”: “2.0”,
“method”: “compressdev_scan_accel_module”,
“id”: 1,
“params”: {
“pmd”: 0
}
}

DEBUG: Trying to decode response ‘’
DEBUG: Partial response
DEBUG: Trying to decode response '{“jsonrpc”:“2.0”,“id”:1,“result”:true}

INFO: response:
{
“jsonrpc”: “2.0”,
“id”: 1,
“result”: true
}

Installing Intel QAT (IDZ 方式)

  • 下载安装driver https://github.com/intel/qatlib
./configure; make install
# Sample programs can be installed by using the “make samples-install”. The sample program “cpa_sample_code runTests=32” can be used to test compression performance.
  • 检查安装状态

    lsmod | grep qat
    qat_4xxx               20480  0
    intel_qat             270336  1 qat_4xxx
    crc8                   16384  1 intel_qat
    authenc                16384  1 intel_qat
    
    
  • 检查 service 状态

    # service qat_service start||stop||status||restart||shutdown
    # For a system with multiple Intel® QAT Endpoints, you can start, stop or restart each individual device by passing the Intel® QAT Endpoint to be restarted or stopped as a parameter qat_dev<N>, for example:
    service qat_service stop qat_dev0
    service qat_service stop qat_dev1
    # The shutdown qualifier enables the user to bring down all Intel® QAT Endpoints and unload driver modules from the kernel. This contrasts with the stop qualifier, which brings down one or more Intel® QAT Endpoints, but does not unload kernel modules, so other Intel® QAT Endpoints can still run.
    # service qat_service status
    
    Checking status of all devices.
    
    There is 3 QAT acceleration device(s) in the system:
    
    qat_dev0 - type: c6xx, inst_id: 0, node_id: 1, bsf: 0000:cc:00.0, #accel: 5 #engines: 10 state: up
    
    qat_dev1 - type: c6xx, inst_id: 1, node_id: 1, bsf: 0000:ce:00.0, #accel: 5 #engines: 10 state: up
    
    qat_dev2 - type: c6xx, inst_id: 2, node_id: 1, bsf: 0000:d0:00.0, #accel: 5 #engines: 10 state: up
    
    
  • 24
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值