bdev/ftl: Add ftl_path parameter to rpc parsing

Signed-off-by: Maciej Szczepaniak <maciej.szczepaniak@intel.com>
Change-Id: I51cc68536f162b0d920d135ba491b1657e699618
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/880
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Maciej Szczepaniak 2020-02-12 15:11:25 +01:00 committed by Tomasz Zawadzki
parent 01ea524068
commit 12642633bf
3 changed files with 12 additions and 0 deletions

View File

@ -246,6 +246,9 @@ bdev_ftl_write_config_json(struct spdk_bdev *bdev, struct spdk_json_write_ctx *w
spdk_json_write_named_uint64(w, "limit_low_threshold", conf->limits[SPDK_FTL_LIMIT_LOW].thld);
spdk_json_write_named_uint64(w, "limit_start", conf->limits[SPDK_FTL_LIMIT_START].limit);
spdk_json_write_named_uint64(w, "limit_start_threshold", conf->limits[SPDK_FTL_LIMIT_START].thld);
if (conf->l2p_path) {
spdk_json_write_named_string(w, "l2p_path", conf->l2p_path);
}
spdk_uuid_fmt_lower(uuid, sizeof(uuid), &attrs.uuid);
spdk_json_write_named_string(w, "uuid", uuid);

View File

@ -54,6 +54,7 @@ free_rpc_bdev_ftl_create(struct rpc_bdev_ftl_create *req)
free(req->base_bdev);
free(req->uuid);
free(req->cache_bdev);
free((char *)req->ftl_conf.l2p_path);
}
static const struct spdk_json_object_decoder rpc_bdev_ftl_create_decoders[] = {
@ -73,6 +74,11 @@ static const struct spdk_json_object_decoder rpc_bdev_ftl_create_decoders[] = {
"use_append", offsetof(struct rpc_bdev_ftl_create, ftl_conf) +
offsetof(struct spdk_ftl_conf, use_append), spdk_json_decode_bool, true
},
{
"l2p_path", offsetof(struct rpc_bdev_ftl_create, ftl_conf) +
offsetof(struct spdk_ftl_conf, l2p_path),
spdk_json_decode_string, true
},
{
"limit_crit", offsetof(struct rpc_bdev_ftl_create, ftl_conf) +
offsetof(struct spdk_ftl_conf, limits[SPDK_FTL_LIMIT_CRIT]) +

View File

@ -1550,6 +1550,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,
l2p_path=args.l2p_path,
use_append=args.use_append,
**arg_limits))
@ -1564,6 +1565,8 @@ 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('--l2p_path', help='Path to persistent memory file or device to store l2p onto, '
'by default l2p is kept in DRAM and is volatile (optional)')
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'