2019-06-18 13:19:06 +00:00
|
|
|
# Common utility functions to be sourced by the libftl test scripts
|
|
|
|
|
|
|
|
function get_chunk_size() {
|
2020-05-11 22:02:01 +00:00
|
|
|
$SPDK_EXAMPLE_DIR/identify -r "trtype:PCIe traddr:$1" \
|
2020-05-07 11:27:06 +00:00
|
|
|
| grep 'Logical blks per chunk' | sed 's/[^0-9]//g'
|
2019-06-18 13:19:06 +00:00
|
|
|
}
|
|
|
|
|
2019-09-10 13:01:27 +00:00
|
|
|
function get_num_group() {
|
2020-05-11 22:02:01 +00:00
|
|
|
$SPDK_EXAMPLE_DIR/identify -r "trtype:PCIe traddr:$1" \
|
2020-05-07 11:27:06 +00:00
|
|
|
| grep 'Groups' | sed 's/[^0-9]//g'
|
2019-09-10 13:01:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function get_num_pu() {
|
2020-05-11 22:02:01 +00:00
|
|
|
$SPDK_EXAMPLE_DIR/identify -r "trtype:PCIe traddr:$1" \
|
2020-05-07 11:27:06 +00:00
|
|
|
| grep 'PUs' | sed 's/[^0-9]//g'
|
2019-09-10 13:01:27 +00:00
|
|
|
}
|
|
|
|
|
2019-10-25 07:31:14 +00:00
|
|
|
function gen_ftl_nvme_conf() {
|
2020-05-07 11:27:06 +00:00
|
|
|
jq . <<- JSON
|
2020-03-18 10:23:51 +00:00
|
|
|
{
|
|
|
|
"subsystems": [
|
|
|
|
{
|
|
|
|
"subsystem": "bdev",
|
|
|
|
"config": [
|
|
|
|
{
|
|
|
|
"params": {
|
|
|
|
"nvme_adminq_poll_period_us": 100
|
|
|
|
},
|
|
|
|
"method": "bdev_nvme_set_options"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
JSON
|
2019-10-25 07:31:14 +00:00
|
|
|
}
|