From 1cb73242f05c330916d59e4d2a1ebd01bbf0df66 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Mon, 10 Aug 2020 10:08:10 -0400 Subject: [PATCH] bdev_fio: remove legacy config support This patch removes legacy config from bdev fio_plugin. Both configuration options are valid, but they should point to JSON files. Signed-off-by: Tomasz Zawadzki Signed-off-by: Karol Latecki Change-Id: I5ae8102752317fe6da8ae7d0a69f444cb0751efa Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3721 Reviewed-by: Ben Walker Reviewed-by: Paul Luse Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris Reviewed-by: Changpeng Liu Tested-by: SPDK CI Jenkins --- CHANGELOG.md | 5 +++ examples/bdev/fio_plugin/README.md | 2 +- examples/bdev/fio_plugin/bdev.conf.in | 3 -- examples/bdev/fio_plugin/bdev.json | 17 +++++++++++ examples/bdev/fio_plugin/example_config.fio | 3 +- examples/bdev/fio_plugin/fio_plugin.c | 34 +++------------------ 6 files changed, 29 insertions(+), 35 deletions(-) delete mode 100644 examples/bdev/fio_plugin/bdev.conf.in create mode 100644 examples/bdev/fio_plugin/bdev.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c5ac7063..6c53f681f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,11 @@ and removed `usr1_handler` from `struct spdk_app_opts` callback that was used to Updated DPDK submodule to DPDK 20.08. +### fio + +Bdev fio_plugin no longer supports legacy configuration files. Options `spdk_conf` and +`spdk_json_conf` have to point to valid JSON configuration. + ### gpt Removed option to disable GPT probing via legacy configuration. Please use generic diff --git a/examples/bdev/fio_plugin/README.md b/examples/bdev/fio_plugin/README.md index 369756fe3..ad62247f5 100644 --- a/examples/bdev/fio_plugin/README.md +++ b/examples/bdev/fio_plugin/README.md @@ -49,7 +49,7 @@ directory as this README). The fio configuration file must contain one new parameter: - spdk_conf=./examples/bdev/fio_plugin/bdev.conf + spdk_json_conf=./examples/bdev/fio_plugin/bdev.json This must point at an SPDK configuration file. There are a number of example configuration files in the SPDK repository under etc/spdk. diff --git a/examples/bdev/fio_plugin/bdev.conf.in b/examples/bdev/fio_plugin/bdev.conf.in deleted file mode 100644 index 948cebe33..000000000 --- a/examples/bdev/fio_plugin/bdev.conf.in +++ /dev/null @@ -1,3 +0,0 @@ -[Malloc] - NumberOfLuns 1 - LunSizeInMB 128 diff --git a/examples/bdev/fio_plugin/bdev.json b/examples/bdev/fio_plugin/bdev.json new file mode 100644 index 000000000..ea698461e --- /dev/null +++ b/examples/bdev/fio_plugin/bdev.json @@ -0,0 +1,17 @@ +{ + "subsystems": [ + { + "subsystem": "bdev", + "config": [ + { + "params": { + "block_size": 512, + "num_blocks": 262144, + "name": "Malloc0" + }, + "method": "bdev_malloc_create" + } + ] + } + ] +} diff --git a/examples/bdev/fio_plugin/example_config.fio b/examples/bdev/fio_plugin/example_config.fio index 3a35432e9..64cf54046 100644 --- a/examples/bdev/fio_plugin/example_config.fio +++ b/examples/bdev/fio_plugin/example_config.fio @@ -1,6 +1,6 @@ [global] ioengine=spdk_bdev -spdk_conf=./examples/bdev/fio_plugin/bdev.conf.in +spdk_json_conf=./examples/bdev/fio_plugin/bdev.json thread=1 group_reporting=1 direct=1 @@ -13,4 +13,5 @@ rw=randrw bs=4k [test] +filename=Malloc0 numjobs=1 diff --git a/examples/bdev/fio_plugin/fio_plugin.c b/examples/bdev/fio_plugin/fio_plugin.c index 66b3f7c7d..f707e7d3c 100644 --- a/examples/bdev/fio_plugin/fio_plugin.c +++ b/examples/bdev/fio_plugin/fio_plugin.c @@ -35,7 +35,6 @@ #include "spdk/bdev.h" #include "spdk/accel_engine.h" -#include "spdk/conf.h" #include "spdk/env.h" #include "spdk/thread.h" #include "spdk/log.h" @@ -198,12 +197,8 @@ spdk_fio_bdev_init_start(void *arg) { bool *done = arg; - if (g_json_config_file != NULL) { - spdk_app_json_config_load(g_json_config_file, SPDK_DEFAULT_RPC_ADDR, - spdk_fio_bdev_init_done, done, true); - } else { - spdk_subsystem_init(spdk_fio_bdev_init_done, done); - } + spdk_app_json_config_load(g_json_config_file, SPDK_DEFAULT_RPC_ADDR, + spdk_fio_bdev_init_done, done, true); } static void @@ -226,7 +221,6 @@ spdk_init_thread_poll(void *arg) struct spdk_fio_options *eo = arg; struct spdk_fio_thread *fio_thread; struct spdk_fio_thread *thread, *tmp; - struct spdk_conf *config = NULL; struct spdk_env_opts opts; bool done; int rc; @@ -245,26 +239,7 @@ spdk_init_thread_poll(void *arg) rc = EINVAL; goto err_exit; } else if (eo->conf && strlen(eo->conf)) { - config = spdk_conf_allocate(); - if (!config) { - SPDK_ERRLOG("Unable to allocate configuration file\n"); - rc = ENOMEM; - goto err_exit; - } - - rc = spdk_conf_read(config, eo->conf); - if (rc != 0) { - SPDK_ERRLOG("Invalid configuration file format\n"); - spdk_conf_free(config); - goto err_exit; - } - if (spdk_conf_first_section(config) == NULL) { - SPDK_ERRLOG("Invalid configuration file format\n"); - spdk_conf_free(config); - rc = EINVAL; - goto err_exit; - } - spdk_conf_set_as_default(config); + g_json_config_file = eo->conf; } else if (eo->json_conf && strlen(eo->json_conf)) { g_json_config_file = eo->json_conf; } else { @@ -284,7 +259,6 @@ spdk_init_thread_poll(void *arg) if (spdk_env_init(&opts) < 0) { SPDK_ERRLOG("Unable to initialize SPDK env\n"); - spdk_conf_free(config); rc = EINVAL; goto err_exit; } @@ -781,7 +755,7 @@ static struct fio_option options[] = { .lname = "SPDK configuration file", .type = FIO_OPT_STR_STORE, .off1 = offsetof(struct spdk_fio_options, conf), - .help = "A SPDK configuration file", + .help = "A SPDK JSON configuration file", .category = FIO_OPT_C_ENGINE, .group = FIO_OPT_G_INVALID, },