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 <tomasz.zawadzki@intel.com>
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I5ae8102752317fe6da8ae7d0a69f444cb0751efa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3721
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Tomasz Zawadzki 2020-08-10 10:08:10 -04:00 committed by Jim Harris
parent c72a16431a
commit 1cb73242f0
6 changed files with 29 additions and 35 deletions

View File

@ -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

View File

@ -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.

View File

@ -1,3 +0,0 @@
[Malloc]
NumberOfLuns 1
LunSizeInMB 128

View File

@ -0,0 +1,17 @@
{
"subsystems": [
{
"subsystem": "bdev",
"config": [
{
"params": {
"block_size": 512,
"num_blocks": 262144,
"name": "Malloc0"
},
"method": "bdev_malloc_create"
}
]
}
]
}

View File

@ -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

View File

@ -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,
},