Commit 81bb01c9 authored by Ben Walker's avatar Ben Walker Committed by Jim Harris
Browse files

fio/nvme: Add 'hostnqn' option to fio configuration file



The user can now specify which host NQN to use for identification
purposes.

Change-Id: I50d1f868af82a72d57e4bc42d70ee74c6fb1147c
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/415551


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent e051eb83
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ struct spdk_fio_options {
	int	mem_size;
	int	shm_id;
	int	enable_sgl;
	char	*hostnqn;
};

struct spdk_fio_request {
@@ -138,6 +139,13 @@ static bool
probe_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
	 struct spdk_nvme_ctrlr_opts *opts)
{
	struct thread_data	*td = cb_ctx;
	struct spdk_fio_options *fio_options = td->eo;

	if (fio_options->hostnqn) {
		snprintf(opts->hostnqn, sizeof(opts->hostnqn), "%s", fio_options->hostnqn);
	}

	return true;
}

@@ -668,6 +676,15 @@ static struct fio_option options[] = {
		.category	= FIO_OPT_C_ENGINE,
		.group		= FIO_OPT_G_INVALID,
	},
	{
		.name		= "hostnqn",
		.lname		= "Host NQN to use when connecting to controllers.",
		.type		= FIO_OPT_STR_STORE,
		.off1		= offsetof(struct spdk_fio_options, hostnqn),
		.help		= "Host NQN",
		.category	= FIO_OPT_C_ENGINE,
		.group		= FIO_OPT_G_INVALID,
	},
	{
		.name		= NULL,
	},