bdev/ftl: "use_append" parameter for bdev_ftl_create RPC

Allow for using appends instead of writes.

Change-Id: I2f0d3bcdbb0eee034f7b0b6349de854ddbf7273d
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/481839
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
Wojciech Malikowski 2020-01-16 09:57:53 -05:00 committed by Jim Harris
parent b627646359
commit dcd3fc1fd1
4 changed files with 10 additions and 1 deletions

View File

@ -69,6 +69,10 @@ static const struct spdk_json_object_decoder rpc_bdev_ftl_create_decoders[] = {
"overprovisioning", offsetof(struct rpc_bdev_ftl_create, ftl_conf) +
offsetof(struct spdk_ftl_conf, lba_rsvd), spdk_json_decode_uint64, true
},
{
"use_append", offsetof(struct rpc_bdev_ftl_create, ftl_conf) +
offsetof(struct spdk_ftl_conf, use_append), spdk_json_decode_bool, true
},
{
"limit_crit", offsetof(struct rpc_bdev_ftl_create, ftl_conf) +
offsetof(struct spdk_ftl_conf, limits[SPDK_FTL_LIMIT_CRIT]) +

View File

@ -1546,6 +1546,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
cache=args.cache,
allow_open_bands=args.allow_open_bands,
overprovisioning=args.overprovisioning,
use_append=args.use_append,
**arg_limits))
p = subparsers.add_parser('bdev_ftl_create', aliases=['construct_ftl_bdev'], help='Add FTL bdev')
@ -1559,6 +1560,7 @@ Format: 'user:u1 secret:s1 muser:mu1 msecret:ms1,user:u2 secret:s2 muser:mu2 mse
' result in partial data recovery, instead of error', action='store_true')
p.add_argument('--overprovisioning', help='Percentage of device used for relocation, not exposed'
' to user (optional)', type=int)
p.add_argument('--use_append', help='Use appends instead of writes', action='store_true')
limits = p.add_argument_group('Defrag limits', 'Configures defrag limits and thresholds for'
' levels ' + str(ftl_valid_limits)[1:-1])

View File

@ -7,6 +7,7 @@ source $testdir/common.sh
tests=('-q 1 -w randwrite -t 4 -o 69632' '-q 128 -w randwrite -t 4 -o 4096' '-q 128 -w verify -t 4 -o 4096')
device=$1
use_append=$2
rpc_py=$rootdir/scripts/rpc.py
ftl_bdev_conf=$testdir/config/ftl.conf
@ -21,7 +22,8 @@ for (( i=0; i<${#tests[@]}; i++ )) do
waitforlisten $bdevperf_pid
$rpc_py bdev_nvme_attach_controller -b nvme0 -a $device -t pcie
$rpc_py bdev_ocssd_create -c nvme0 -b nvme0n1
$rpc_py bdev_ftl_create -b ftl0 -d nvme0n1
$rpc_py bdev_ftl_create -b ftl0 -d nvme0n1 $use_append
$rootdir/test/bdev/bdevperf/bdevperf.py perform_tests
$rpc_py delete_ftl_bdev -b ftl0
$rpc_py bdev_ocssd_delete nvme0n1

View File

@ -46,6 +46,7 @@ if [ -z "$nv_cache" ]; then
fi
run_test "ftl_bdevperf" $testdir/bdevperf.sh $device
run_test "ftl_bdevperf_append" $testdir/bdevperf.sh $device --use_append
run_test "ftl_restore" $testdir/restore.sh $device
if [ -n "$nv_cache" ]; then