From f3950cf45731a0959da97e137a72fe6622f2c306 Mon Sep 17 00:00:00 2001 From: Yuriy Umanets Date: Thu, 20 Jan 2022 09:47:02 +0200 Subject: [PATCH] fio/bdev_plugin: Added env_context to fio config FIO config can have "env_context" field now. It allows passing to DPDK the start-up options essential for mlx5 crypto/reduce support. This enables using FIO plugin for testing mlx5 crypto/compress vbdev PMDs. For example: env_context=--allow=0000:01:00.0,class=crypto,wcs_file=/path/credentials.txt Signed-off-by: Yuriy Umanets Change-Id: I8b862a431fa5b838e337a64e736d4f6700f83599 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11633 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Aleksey Marchuk Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Paul Luse --- examples/bdev/fio_plugin/fio_plugin.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/examples/bdev/fio_plugin/fio_plugin.c b/examples/bdev/fio_plugin/fio_plugin.c index d1a08996c..5d8bfe739 100644 --- a/examples/bdev/fio_plugin/fio_plugin.c +++ b/examples/bdev/fio_plugin/fio_plugin.c @@ -66,6 +66,7 @@ struct spdk_fio_options { void *pad; char *conf; char *json_conf; + char *env_context; char *log_flags; unsigned mem_mb; int mem_single_seg; @@ -299,6 +300,9 @@ spdk_init_thread_poll(void *arg) opts.mem_size = eo->mem_mb; } opts.hugepage_single_segments = eo->mem_single_seg; + if (eo->env_context) { + opts.env_context = eo->env_context; + } if (spdk_env_init(&opts) < 0) { SPDK_ERRLOG("Unable to initialize SPDK env\n"); @@ -1267,6 +1271,15 @@ static struct fio_option options[] = { .category = FIO_OPT_C_ENGINE, .group = FIO_OPT_G_INVALID, }, + { + .name = "env_context", + .lname = "Environment context options", + .type = FIO_OPT_STR_STORE, + .off1 = offsetof(struct spdk_fio_options, env_context), + .help = "Opaque context for use of the env implementation", + .category = FIO_OPT_C_ENGINE, + .group = FIO_OPT_G_INVALID, + }, { .name = NULL, },