Add option to the xnvme fio engine for picking a memory backend. Update the fio document. Signed-off-by: Mads Ynddal <m.ynddal@xxxxxxxxxxx> Signed-off-by: Ankit Kumar <ankit.kumar@xxxxxxxxxxx> --- HOWTO.rst | 17 +++++++++++++++++ engines/xnvme.c | 11 +++++++++++ fio.1 | 22 ++++++++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/HOWTO.rst b/HOWTO.rst index 0fec38a7..0a48a453 100644 --- a/HOWTO.rst +++ b/HOWTO.rst @@ -2885,6 +2885,23 @@ with the caveat that when used on the command line, they must come after the Sets the subsystem NQN for fabrics. This is for xNVMe to utilize a fabrics target with multiple systems. +.. option:: xnvme_mem=str : [xnvme] + + Select the xnvme memory backend. This can take these values. + + **posix** + This is the default posix memory backend for linux NVMe driver. + **hugepage** + Use hugepages, instead of existing posix memory backend. The + memory backend uses hugetlbfs. This require users to allocate + hugepages, mount hugetlbfs and set an enviornment variable for + XNVME_HUGETLB_PATH. + **spdk** + Uses SPDK's memory allocator. + **vfio** + Uses libvfn's memory allocator. This also specifies the use + of libvfn backend instead of SPDK. + .. option:: xnvme_iovec=int : [xnvme] If this option is set. xnvme will use vectored read/write commands. diff --git a/engines/xnvme.c b/engines/xnvme.c index 208d917d..bb92a121 100644 --- a/engines/xnvme.c +++ b/engines/xnvme.c @@ -75,6 +75,7 @@ struct xnvme_fioe_options { unsigned int xnvme_dev_nsid; unsigned int xnvme_iovec; char *xnvme_be; + char *xnvme_mem; char *xnvme_async; char *xnvme_sync; char *xnvme_admin; @@ -109,6 +110,15 @@ static struct fio_option options[] = { .category = FIO_OPT_C_ENGINE, .group = FIO_OPT_G_XNVME, }, + { + .name = "xnvme_mem", + .lname = "xNVMe Memory Backend", + .type = FIO_OPT_STR_STORE, + .off1 = offsetof(struct xnvme_fioe_options, xnvme_mem), + .help = "Select xNVMe memory backend", + .category = FIO_OPT_C_ENGINE, + .group = FIO_OPT_G_XNVME, + }, { .name = "xnvme_async", .lname = "xNVMe Asynchronous command-interface", @@ -193,6 +203,7 @@ static struct xnvme_opts xnvme_opts_from_fioe(struct thread_data *td) opts.nsid = o->xnvme_dev_nsid; opts.subnqn = o->xnvme_dev_subnqn; opts.be = o->xnvme_be; + opts.mem = o->xnvme_mem; opts.async = o->xnvme_async; opts.sync = o->xnvme_sync; opts.admin = o->xnvme_admin; diff --git a/fio.1 b/fio.1 index 134aed54..eb87533f 100644 --- a/fio.1 +++ b/fio.1 @@ -2631,6 +2631,28 @@ xnvme namespace identifier for userspace NVMe driver SPDK or vfio. Sets the subsystem NQN for fabrics. This is for xNVMe to utilize a fabrics target with multiple systems. .TP +.BI (xnvme)xnvme_mem\fR=\fPstr +Select the xnvme memory backend. This can take these values. +.RS +.RS +.TP +.B posix +This is the default posix memory backend for linux NVMe driver. +.TP +.BI hugepage +Use hugepages, instead of existing posix memory backend. The memory backend +uses hugetlbfs. This require users to allocate hugepages, mount hugetlbfs and +set an enviornment variable for XNVME_HUGETLB_PATH. +.TP +.BI spdk +Uses SPDK's memory allocator. +.TP +.BI vfio +Uses libvfn's memory allocator. This also specifies the use of libvfn backend +instead of SPDK. +.RE +.RE +.TP .BI (xnvme)xnvme_iovec If this option is set, xnvme will use vectored read/write commands. .TP -- 2.17.1