If PRACT is enabled, and metadata size is 8 bytes, for extended
LBA format, the controller will insert/strip the metadata, so
we don't need to pass the metadata buffer, so we should exclude
this metadata buffer from host buffer.
So here add a function to calculate host buffer size.
Change-Id: I42d8d9cbfbf7ba2bc4bf64d65260c6cfe9bd4cb1
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6789
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Purpose: To setup an accelerated function callback
for created spdk_nvme_poll_group. In this patch,
we just create the interface. The real usage of this
call back will be provided in the other patch.
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I0d936aa4eba4dbfcc0137942156b9f2919eb5b78
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6758
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
For each active namespace, print the command set identifier.
This will work on namespaces that do not support or report a namespace
type, as spdk_nvme_ns_get_csi() will return SPDK_NVME_CSI_NVM for such
cases.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I05fa7fd6bb3d9ea32dac236c98baef90347094ca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6905
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
If the test run is aborted early (i.e. Ctrl-C), we
should use the elapsed time as the divisor instead
of the originally specified time.
Fixes issue #1800.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3312cc83f3422ec46ad584e3ee2b40f3ad9ec6f5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6474
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: <dongx.yi@intel.com>
This is a workaround for issue #1799 that would require
a fix from Google Cloud Platform. GCP NVMe SSDs do
not support overlapped GET_FEATURE commands - the
cdw0 value on completions get mixed up.
On GCP the result is that identify app reports only
1 SQ/CQ supported when in fact it supports 16.
We can easily workaround this in the identify app by
submitting one GET_FEATURE and then polling for its
completion before submitting the next one.
We may consider reverting this in the future should GCP
provide a fix, but there is really no harm in keeping
this patch long term since this isn't an I/O path issue.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I536033677a8364c955d562226e3feba4dbad0e07
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6454
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
print_qid_mappings=1 will now add logging messages
showing the {filename,qid} tuples associated with
each job.
Note that for the nvme plugin, the filename is
essentially the transport ID. We just print that
filename for simplicity rather than reconstructing
a transport ID string from the ctrlr object.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9b714ac009fd16b96ed87c2c056be251009815b8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6396
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Now when we have support for spdk_nvme_zns_zone_append() and
spdk_nvme_zns_zone_appendv(), hook them up in the nvme fio plugin.
Note that fio itself does not have support for zone append,
since unlike SPDK, there is no user facing zone append API in
Linux. Therefore, this new option simply replaces writes with
zone appends in the SPDK fio backend.
This is however still useful for the following reasons:
-Provides a way to test zone append in SPDK.
-By using zone append, we can test with iodepth > 1.
With regular writes, the user can only specify iodepth=1.
This is because for zone namespaces, writes have to target
the write pointer. Having more than one write in flight, per
zone, will lead to I/O errors.
In Linux, it is possible to use fio with iodepth > 1
on zoned namespaces, simply because of the mq-deadline
scheduler, which throttles writes such that there is only
one write in flight, per zone, even if user space has
queued up more.
Since a user might not want to use zone append unconditionally,
even on a namespace that supports it, make this an option
rather than enabling it unconditionally.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I028b79f6445bc63b68c97d1370c6f8139779666d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6330
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Use the new function spdk_nvme_zns_ns_get_zone_size_sectors() where
it is appropriate (in comparison to the existing
spdk_nvme_zns_ns_get_zone_size() variant).
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: Ic929ffbc5a1f4a16ba6719a985c05ae625caed46
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6417
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Add an optional limit, -z N, to the zone report dump option -z.
The variable g_zone_report_limit replaces the MAX_ZONE_DESC_ENTRIES such
that the maximum-number of zone-descriptors is overwritable. It also
replaces g_zone_report_full as it is represented by the limit-value 0,
e.g. "no limit" dump the full report.
The print of the section-header now includes the total amount of zones
and the limit. With this information, the header's width varies. A
helper-function, print_uline(), for printing an "underline" using a
given marker, is also added.
Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: Ic8abead693ed83bb8612eef1f35605098ccade84
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6036
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Despite spdk_nvme_transport_id_parse() checking optarg for NULL, then
the Jenkins CI doing code-analysis fails with the error message:
"Null pointer passed as an argument to a 'nonnull' parameter"
This adds an assertion to satisfy the code-analysis.
Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: I35f7ee659624c1d5a2abda91bccac9fb58393063
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6068
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Identify application prints the PMR details if it is supported
Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: Iaba4c15e18e1402035b11a34b2defe8078855751
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6209
Community-CI: Broadcom CI
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
The original value of bs is 4096, we can rewrite it in another script.
When spdk_nvme_ns_supports_extended_lba(ns) is 1, we need to
test with an integer multiple value of extended_sector_size, such as 4160.
Change-Id: I8257bee4f741f62597bb2bb645ee9c59cf57bf33
Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6018
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
NVMe namespace ID (i.e., ns) is a key of Transport ID, which is
supported by perf, but it's missed in the help. In addtion, a
note is added to specify multiple '-r' parameters can be used
to test multiple disks/targets.
Signed-off-by: Allen Zhu <allenz@mellanox.com>
Change-Id: Icf55e6213a63d97396bdc7022e4c0d09c67aab9a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6141
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
It may be an interesting test case to send I/O to hot
removed namespaces, but for a perf tool it seems better
to stop sending them once we get an INVALID_NAMESPACE
status code.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie458fa63b12114cf05d5a3f1702e37f91d8a00f6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6091
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
The nvme perf tool can be useful to generate I/O for
stress conditions. But if we use it for situations
where we expect a high rate of failures, the excessive
spew can significantly clutter the log.
So add a new -Q option (meaning "quiet") which will
rate limit these error messages.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia8ab2e1ea1cfab9f43d87bcabe8f3f7589b77cda
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6077
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Next patch will add rate limiting on some of the
error messages. Separating the read error message
from the write error message will allow us to
rate limit them independently.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id49b64aa1ee545874d7230399a5127c47f217836
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6076
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: sunshihao <sunshihao@huawei.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
We konw bs should be extended_sector_size(ns) * num_blocks.
In other words, bs should be an integral multiple of extended_sector_size.
num_blocks cannot be got here, so we used integral multiple.
Change-Id: Ie521db194cdad6f2d2247fd2704cab92c36ddb82
Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5881
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
When NVMf target linked with vfio-user library, we can use
vfio-user client library to connect to the target.
Here is the three examples that can work with target:
identify -r 'trtype:VFIOUSER traddr:/var/run/muser/domain/muser0/8' -g
perf -r 'trtype:VFIOUSER traddr:/var/run/muser/domain/muser0/8' -g -q 1 -o 4096 -w read -t 10
reconnect -r 'trtype:VFIOUSER traddr:/var/run/muser/domain/muser0/8' -g -q 32 -o 4096 -w randrw \
-M 50 -t 10 -c 0xE
You can run the following test script test/nvmf/target/nvmf_vfio_user.sh to have a quick test,
currently enabled with NVMe Identify,Perf,Reconnect tools.
Change-Id: Ieb9842b2f372184fffbf7f23e4aad26feb47c350
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3839
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
There was some confusion from a user on whether thread=1
means only one thread is supported. So add some extra
documentation around this section to clarify this a bit
more, since the option is a bit confusing.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ibcccd1759180e2e6c47e736d94ffbeafc405f7bb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5995
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: <dongx.yi@intel.com>
Community-CI: Mellanox Build Bot
Perf tool doesn't have handlers for SIGINT and SIGTERM
signals, so when the tool is killed with e.g. ctrl-c
all SPDK and transport resources are destroyed
ungracefully. In the case of RDMA we may have
IO requests inflight and if the request is processed
by the driver when the corresponding MR is destroyed by
the kernel, it may cause an error on the target side.
Such errors are not harmful but it is better to
have a graceful shutdown procedure.
Fixes issue #1549
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I7818a4705d2b5cf4a5f3ca4745c62392312d22d2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5869
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Fixes: 5ef79a17ec (add an option to dump the full zns zone report)
max_zones_per_buf was only used in an assert. Per-patch
testing doesn't do a release build, so this wasn't found
until running nightly tests.
So rework the code a bit to print error message and exit
instead of this unexpected condition occurs.
While here, change another error message to use stderr
instead of stdout.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2c2893089cc82f76d7dd6b569952dd4a9f907ebc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5949
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Add a new option, -z, to dump the full zone report for
NVMe Zoned Namepaces.
Rather than allocating a buffer that can exactly hold the number
of zones we request, allocate a fixed size buffer of size MDTS.
That way, the controller will copy as many zones as it can,
while not exceeding the buffer. The nr_zones field in the
received report indicates the number of zones that were
successfully copied to the buffer.
The full zns zone report can be larger than MDTS, therefore
we now need to put the spdk_nvme_zns_report_zones() call
inside a loop.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: If3ff84876289a491d0482e74c58c5a11de7e19df
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5896
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Exit after showing the help text.
If the user specifies -H, it is confusing that
the regular execution of the program continues,
which might mislead the user to think that the
option they specified is not taking effect.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I52d8e0f6c720c7ce1d66bddb99181babb12cef1f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5895
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
A new option -O is added to indicate the IO unit size.
Multiple IOVs are created according to the IO unit size.
We are able to test multiple-SGL SGL requests in NVMEoF
RDMA with this patch.
Signed-off-by: Allen Zhu <allenz@mellanox.com>
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Change-Id: I7624966b585bf0a9d2bbbb6263fa06fbcdb65820
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4377
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: sunshihao <sunshihao@huawei.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Add one optional parameter to enable single memory segment, which
can be tested with libvfio-user NVMeoF target.
Change-Id: I6d77b0c33f13500e24266ca190d2ee797708a65e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5593
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
According to the SPDK nvme fio plugin documentation:
"Blocksize should be set as the sum of data and metadata.
For example, if data blocksize is 512 Byte, host generated
PI metadata is 8 Byte, then blocksize in fio configure file
should be 520 Byte."
Error out if this requirement is not satisfied.
This requirement does not apply for the separate metadata case.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I730a83beb6a85695c8a4b80995340b4064375d5a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5557
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
All of our Makefiles duplicate huge lists of libraries
in SPDK_LIB_LIST. We have a very precise and accurate
accounting of the library dependencies in
mk/spdk.lib_deps.mk which can be used to generate
the full list if the app specifies the modules and
subsystem libraries it wishes to link.
I did a first pass through all of the existing
Makefiles to take advantage of this new functionality.
There may be more optimizations we can make later but
don't want to hold up this patch for all of them.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icdaf6f749a6908df2c2ce2db22631a4af4ff3a9e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5553
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Currently, NVMe perf worker starts IO and measurements as soon as all
its QPs were connected. But other workers may still be connecting and
not started their measurements yet. With large number of QPs when
connections take a long time this can cause inaccurate performance
reporting.
This patch adds synchronization point for workers after all QPs were
connected and before start of IO and measurements.
Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: If0c9be8dd41c8e851aae6b3e71afa3efe5314330
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5126
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
While here, replace use of "slave workers" in some
comments with "secondary workers".
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2169c108da18d449a66a29daa77a3f9c3145d4b2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5352
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This helps us remove master/slave terminology from
SPDK and is aligned with similar changes made recently
in DPDK.
While updating nvme/identify to use the new member
name, also replace g_master_core there with g_main_core.
Other nvme utility usage of "master_core" will be updated
in a later patch.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0ec4e3e9b644bec21b3729809bf5c4d35b10837f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5351
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
The old pci_whitelist/pci_blacklist are now deprecated.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9fddec0c90691dd385eb21d13be849247f144889
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5279
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
POSIX defines PRId64/PRIu64/PRIx64 for printing 64-bit values in a
portable way. Replace a few references to %ld to remove the assumption
about the size of a long.
Where the value being printed is an unsigned 64-bit value, use PRIu64
instead of %ld.
Signed-off-by: Nick Connolly <nick.connolly@mayadata.io>
Change-Id: Ifa558522437f4922b922abf17712173cb5ca1184
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5134
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This patch is used to test the allowed pci list feature.
The reason we add in perf because NVMe Device is the typical
pci device. And we also want to make sure it works.
Change-Id: Ic98ddcfecb162ffb74c9bdf3bc9e702633ddd3e2
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3246
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
There is no need for an additional function to calculate the max transfer
size based on mdts.
nvme_ctrlr_identify_done() already initializes ctrlr->max_xfer_size
based on mdts, and spdk_nvme_ns_get_max_io_xfer_size() simply returns
ns->ctrlr->max_xfer_size.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I747ff8ac9767eababffc3c7e0b6846029a98b826
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4985
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Simon A. F. Lund <simon.lund@samsung.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Added plugin-option 'initial_zone_reset', providing the option to reset
all zones on all namespaces with the Zoned Command Set enabled upon
initialization.
The default is not to reset. The option is exposed even when the ZBD
plumbing is not available. However, it will then inform the user that
ZBD/ZNS is not supported instead of resetting.
The plugin-option provides a short-term solution to an observed issue
with consecutive invocations of fio exhausting maximum-active-resources.
A longer-term solution would be to add a 'max_active_zones' limit in fio
and ensure that fio does not exceed that limit.
Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: I65341c028a97657370b315fb298bf97651b9bffd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4949
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Preparation patch for the addition of the 'initial_zone_reset' plugin-option.
Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: I768fc207b74cfa2a516009e10fc2a4646d06ba72
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4948
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
All zone management receive helper functions (including
spdk_nvme_zns_report_zones()) are implemented to match the parameters of
the zone management receive function in the ZNS specification.
The documentation for spdk_nvme_zns_report_zones() states:
"param partial_report If true, nr_zones field in the zone report indicates
the number of zone descriptors that were successfully written to the zone
report. If false, nr_zones field in the zone report indicates the number
of zone descriptors that match the report_opts criteria."
This matches the description of the "Partial Report" bit in the ZNS spec.
Since the FIO function parse_zone_info() calls the io_ops->report_zones()
function multiple times, until all zones have been reported, it expects
the return from this function to represent the number of zones that were
successfully reported.
By setting the partial_report bit to false, the controller will return
the total number of zones, and since spdk_fio_report_zones() loops until
idx < report->nr_zones, and writes to zbdz[idx], the current code will
overwrite heap memory, since idx will take on index values that are out
of bounds for the memory allocated by the FIO function parse_zone_info().
Therefore, spdk_fio_report_zones() has to set the partial_report bit to
true when calling the NVMe level function spdk_nvme_zns_report_zones().
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I8846711bfed4faadac0315b450158293cefa36f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4871
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Simon A. F. Lund <simon.lund@samsung.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Print the Zoned Namespace Command Set Specific data structures,
if the namespace/controller supports them.
spdk_nvme_zns_ctrlr_get_data() returns NULL for a controller
that does not support the ZNS specific controller data struct.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I0acd2695976fc598b61591989f612db35ac821db
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4839
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
In spdk_fio_report_zones(), log_err did not prefix messages with
"spdk/nvme", making it hard to determine who dumped the error-message.
In spdk_fio_reset_wp() log_err described the wrong function.
This change fixes the above.
Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: I41df6d451e88942806c8b5a3cf9a0902d98cb186
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4916
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
When _reset_wp() received a range to reset, then the loop kept resetting
the first zone in the range.
Also, the processing of command-completion were re-using the same
'completion' state, thus a previous completion would short-circuit
command-completion such that it would never be processed.
This change fixes that.
Also, the reset-loop assumes that the given offset is a valid zone-start
LBA, a check is added to verify that and return -EINVAL if it is not.
Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: I1a1e4be2e1f67c2d8fecb5fc36a211b2dbb5a921
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4915
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
When a device has resource-limitations such as the
maximum-open-resources (mor) and this threshold is exceeded, then IO
will fail upon completion. Such behavior is not the most user-friendly
way to tell the user that they should provide a value for the
fio-parameter 'max_open_zones'.
This change provides an arguably more user-friendly approach by checking
whether the device is limited and in case it is:
* Provide a default value for 'max_open_zones', inform the user, and
continue
* Verify 'max_open_zones' and in case of error inform the user and
return error
Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: I76cb045d560b9ec5701d97b82a62947af11960b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4914
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Currently, error handling code in examples/nvme/identify frees the qpair
before calling exit().
However, since every SPDK process starts off by triggering a reset
(in state NVME_CTRLR_STATE_INIT), which causes all the qpairs to be
deleted, there is not really a reason to do a nice cleanup on error.
Additionally, other examples, e.g. examples/nvme/hello_world does not
do a nice cleanup on error, so it is inconsistent if identify does so.
Proper freeing of the qpairs is still done in the normal case where
we don't get any errors (in this example, and in other examples).
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I0db612934464e6e84eaf466c12eb35eaa396e511
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4838
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
The printout in read_complete() says "Read I/O failed, aborting run",
however, execution still continues, and prints and prints the buffer
where the result was supposed to be stored.
Since we got a read error, we will not have gotten any data stored
in the buffer, so it is simply confusing to print it.
Calling exit() in the read_complete() error handling code code also
makes it consistent with the error handling code in write_complete()
and reset_zone_complete().
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I6e542758c57efc376f921857c2cdb24e252d49c6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4837
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This adds initial support for ZNS by aligning the NVMe spec. defined ZNS
structures and commands with the fio Zone representation and
implementation of the following io-engine functions:
get_zoned_model() / spdk_fio_get_zoned_model(), when namespace is ZNS
and the Zoned-Command-Set is enabled, then this function informs fio
that the device is ZBD_HOST_MANAGED.
report_zones() / spdk_fio_report_zones(), submits a single
zone-mgmt-recv and waits for its completion, converts the spec-defined
zone-descriptors to the fio ZBD_ZONE representation and returns the
number of zones in the converted report.
reset_wp() / spdk_fio_reset_wp(), submits multiple zone-mgmt-send,
covering the range [offset, offset+length] and waits for their
completion.
Four helper-functions are added to assist in the above implementations.
get_fio_qpair(), this helper is added to retrieve the namespace matching
the given fio-file, ensuring that management commands reach the correct
namespace.
spdk_fio_qpair_mdts_nbytes(), this helper is added to assist
report_zones() retrieve the zone-report within the bounds of the
maximum-data-transfer of the device.
The functions pcu() and pcu_cb() provide a means to submit
management-commands and waiting for their completions. They are needed
since, although mgmt-send/recv are IO-commands in the context of NVMe,
then for fio they are not part of the regular queue/event/getevents but
utilized in a synchronous/blocking manner.
Note, in the fio-zone-representation, then the start/len/capacity/wp
fields are in units of bytes, whereas the corresponding values in NVMe
are in lbas/sectors. It is worth noting as the offset <-> lba
conversions do not take NVMe configurations with extended-lba format
into account. Thus, the implementation is initial support for ZNS as
more work is needed to support pi/extended-lba configurations.
Note, a guard FIO_HAS_ZBD checks for the required io-engine ops version
and indirectly testing for available of fio Zone representation by
testing for a macro introduced in the same fio-release as the required
fio Zone representation.
Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: Id3d1d61a52db2e55019032c724197df4d559271a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4836
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>