Commit d69349af authored by Niklas Cassel's avatar Niklas Cassel Committed by Jim Harris
Browse files

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: default avatarNiklas 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: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 09dd961b
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -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);
		}
	}