nvme/fio_plugin: fix zone_append option with multiple files per thread

Each fio thread can have multiple files that it writes to.
Which is why the per thread spdk_fio_setup() fio callback does
for_each_file() {...}.

One of these files can be e.g. a zoned namespace with append support,
another file could be a zoned namespace on another controller without
append support, and a third file could be a conventional namespace
(which never supports the zone append command).

Right now, we will return a fatal error if a thread has e.g. a zoned
namespace (with append support) together with a conventional namespace.

Instead of returning a fatal error, enable zone append only on the
namespaces that support zone append, and allow namespaces that do
not support zone append to continue as usual (using regular writes).

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Ic6456d408cbe91563acd337a4b70c6e871fe34c6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7611
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Niklas Cassel 2021-04-26 10:03:28 +00:00 committed by Jim Harris
parent 09dd961b35
commit d69349af6b

View File

@ -424,15 +424,14 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
return;
}
if (fio_options->zone_append) {
if (spdk_nvme_ns_get_csi(ns) == SPDK_NVME_CSI_ZNS &&
spdk_nvme_ctrlr_get_flags(ctrlr) & SPDK_NVME_CTRLR_ZONE_APPEND_SUPPORTED) {
fprintf(stdout, "Using zone append instead of write\n");
if (fio_options->zone_append && spdk_nvme_ns_get_csi(ns) == SPDK_NVME_CSI_ZNS) {
if (spdk_nvme_ctrlr_get_flags(ctrlr) & SPDK_NVME_CTRLR_ZONE_APPEND_SUPPORTED) {
fprintf(stdout, "Using zone appends instead of writes on: '%s'\n",
fio_qpair->f->file_name);
fio_qpair->zone_append_enabled = true;
} else {
SPDK_ERRLOG("zone_append=1 requested, but namespace lacks support\n");
g_error = true;
return;
SPDK_WARNLOG("Falling back to writes on: '%s' - ns lacks zone append cmd\n",
fio_qpair->f->file_name);
}
}