engines/xnvme: add subnqn to fio-options
authorAnkit Kumar <ankit.kumar@samsung.com>
Thu, 22 Dec 2022 04:39:50 +0000 (10:09 +0530)
committerVincent Fu <vincent.fu@samsung.com>
Thu, 22 Dec 2022 13:50:03 +0000 (08:50 -0500)
For fio to utilize a fabrics target with multiple systems, it needs a
way for the user to specify which subsystem to use. This is done by
providing 'subnqn' as fio-option.

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
HOWTO.rst
engines/xnvme.c
fio.1

index aba6c9b3b9d78ede27e1bd3b9cf89d82b1441775..0fec38a76528145d20001ea369aa29124f986ce4 100644 (file)
--- a/HOWTO.rst
+++ b/HOWTO.rst
@@ -2880,6 +2880,11 @@ with the caveat that when used on the command line, they must come after the
 
        xnvme namespace identifier for userspace NVMe driver, SPDK or vfio.
 
 
        xnvme namespace identifier for userspace NVMe driver, SPDK or vfio.
 
+.. option:: xnvme_dev_subnqn=str : [xnvme]
+
+       Sets the subsystem NQN for fabrics. This is for xNVMe to utilize a
+       fabrics target with multiple systems.
+
 .. option:: xnvme_iovec=int : [xnvme]
 
        If this option is set. xnvme will use vectored read/write commands.
 .. option:: xnvme_iovec=int : [xnvme]
 
        If this option is set. xnvme will use vectored read/write commands.
index ee6b67c1223075a9001ca1209da0e5b420758345..208d917d63663c65d52a6e7fb62f83c18ef3bc3d 100644 (file)
@@ -78,6 +78,7 @@ struct xnvme_fioe_options {
        char *xnvme_async;
        char *xnvme_sync;
        char *xnvme_admin;
        char *xnvme_async;
        char *xnvme_sync;
        char *xnvme_admin;
+       char *xnvme_dev_subnqn;
 };
 
 static struct fio_option options[] = {
 };
 
 static struct fio_option options[] = {
@@ -145,6 +146,15 @@ static struct fio_option options[] = {
                .category = FIO_OPT_C_ENGINE,
                .group = FIO_OPT_G_XNVME,
        },
                .category = FIO_OPT_C_ENGINE,
                .group = FIO_OPT_G_XNVME,
        },
+       {
+               .name = "xnvme_dev_subnqn",
+               .lname = "Subsystem nqn for Fabrics",
+               .type = FIO_OPT_STR_STORE,
+               .off1 = offsetof(struct xnvme_fioe_options, xnvme_dev_subnqn),
+               .help = "Subsystem NQN for Fabrics",
+               .category = FIO_OPT_C_ENGINE,
+               .group = FIO_OPT_G_XNVME,
+       },
        {
                .name = "xnvme_iovec",
                .lname = "Vectored IOs",
        {
                .name = "xnvme_iovec",
                .lname = "Vectored IOs",
@@ -181,6 +191,7 @@ static struct xnvme_opts xnvme_opts_from_fioe(struct thread_data *td)
        struct xnvme_opts opts = xnvme_opts_default();
 
        opts.nsid = o->xnvme_dev_nsid;
        struct xnvme_opts opts = xnvme_opts_default();
 
        opts.nsid = o->xnvme_dev_nsid;
+       opts.subnqn = o->xnvme_dev_subnqn;
        opts.be = o->xnvme_be;
        opts.async = o->xnvme_async;
        opts.sync = o->xnvme_sync;
        opts.be = o->xnvme_be;
        opts.async = o->xnvme_async;
        opts.sync = o->xnvme_sync;
diff --git a/fio.1 b/fio.1
index 004d3ba0ea5bc8df81b64900382338dbfbb806f6..134aed541e112b3c5f05e20ae1d35d4ac8201eac 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -2627,6 +2627,10 @@ Use Linux Block Layer ioctl() and sysfs for admin commands.
 .BI (xnvme)xnvme_dev_nsid\fR=\fPint
 xnvme namespace identifier for userspace NVMe driver SPDK or vfio.
 .TP
 .BI (xnvme)xnvme_dev_nsid\fR=\fPint
 xnvme namespace identifier for userspace NVMe driver SPDK or vfio.
 .TP
+.BI (xnvme)xnvme_dev_subnqn\fR=\fPstr
+Sets the subsystem NQN for fabrics. This is for xNVMe to utilize a fabrics
+target with multiple systems.
+.TP
 .BI (xnvme)xnvme_iovec
 If this option is set, xnvme will use vectored read/write commands.
 .TP
 .BI (xnvme)xnvme_iovec
 If this option is set, xnvme will use vectored read/write commands.
 .TP