gen_nvme.sh will no longer generate the legacy configuration.
"--json" option will still work for any current users of the script.
Tests were modified to no longer use the "--json" option.
Meanwhile others were simplified with switch to "--json-with-subsystems".
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I8450be98660e54c64c27d8401fc40d649f9403ea
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4802
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Support for legacy configuration has been removed from SPDK
at this point.
This patch focuses on adjustement in documentation and examples.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Icfe8baf7a7497ffa86fde9038001429c5a7bc4f6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4801
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
All options -c, --config and --json are valid, but have to
point to JSON configuration file.
Adjusted UT since JSON configs don't work with --wait-for-rpc.
Since this removes last reference to legacy INI configuration,
updated conf library to no longer mention the deprecation.
All uses of conf library are for explicit reason and not
related to SPDK event framework configuration.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ic9a702465982daf715ce1c2ab863c48584734611
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4752
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This is a drop-in replacement.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia858b755718da97e48035b7e7ca4544f6f9b9a63
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4807
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Currently, NASM in version 2.14 or newer is required. However, the
old code assumed that nasm -v returns version in the form of x.y.z,
however, some builds return only the x.y. In such a case, check would
always fail to detect proper version since the following would be
be always true:
NASM version 2.14
2.14 -> 214 -> [[ 214 -lt "21400" ]]
Change-Id: I63bfc7aa84383bf2d71e936ae534536ecf25723a
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4809
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
INI is deprecated, use JSON configs for fio plugin instead.
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I3075e79ed7601116e837536a818821372362eb8d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4762
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
If a host matching the removed hosts' NQN exists, it is now
disconnected.
Change-Id: I0bec29eda2dc220114b9197d4eb765899b9e1517
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4684
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>
Community-CI: Broadcom CI
Prior to this patch the bdevperf application enabled using the zcopy API
by default. This means that on bdevs that don't natively support zcopy the
API emulates zero-copy by allocating a buffer. In my test environment, I
measured a 25% decrease in IOPS when zcopy was enabled. This patch changes
the default value so that zcopy is disabled by default. For bdevs that support
zcopy, use the -Z flag to enable using zcopy API.
Change-Id: Ib7e5c24f76eb16ffef038687daca58c0ffad1c1c
Signed-off-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4324
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
For virtio-user library and coming vfio-user feature, the client needs
to send the memory file descriptors to target so that the two processes
can setup shared memory region to do data processing without memory copy.
Currently virtio-user will read /proc/self/maps to get memory file descriptor,
since DPDK already provides this such APIs, so here we can just use it,
for existing virtio-user library we may replace it with the new added
API.
Change-Id: Icfeae465d53826d0c8d1b335287634b03cd174aa
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4428
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>
The files for external_code tests were copies of the same files
in SPDK. Intention of external_code tests is to verify
that nothing breaks in regards to building process.
The copies were getting out of sync with functional changes.
So to address this:
- hello_bdev app is now symlinked
- vbdev_passthrough is copied from respective files
- RPC and name of the module were changed to not conflict with
the original passthrough module
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Idb83b8a06dea7143505d2062b23bfb35c86e3274
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4804
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This patch removes legacy config from bdev fio_plugin.
Both configuration options are valid, but they should
point to JSON files.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I5ae8102752317fe6da8ae7d0a69f444cb0751efa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3721
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
The current approach checks "rc == 0". It worked before adding
polling of poll group since a single qpair should return 1
completion for its own icreq while poll group can return
several completions for all qpairs attached to this poll
group (but .e.g not for those qpair who is waiting for the
completion).
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I60d05d8d6640e4e2bbaf3cd533d2f5a3637adea1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4768
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Remove spdk_app_get_running_config() that allowed printing
legacy configuration by the apps.
Along with usr1_handler callback that was used to call that
function.
It was only used in iscsi_tgt so it is removed there.
The app_repeat test was using SIGUSR1 to trigger a
spdk_app_stop/spdk_app_start cycle. But we can use
SIGTERM for that instead. While here, do a bit of
cleanup in the app_repeat test app.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ie8449e8bcd979b237c68ef94f50fb7a3cb6c19db
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4750
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Change-Id: I2866994df8a5f268d7dea2154e0df87786397142
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4685
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
As stated in a66c52fd this is racy and also masks out all potential
failures since wait() will not indicate if all processes succeded
or failed, it will return only with exit status from the last
process it handled.
Change-Id: I9e2b5d01ac8f951082e0b28eeae5455ecd0c8e74
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4680
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Newer compilers (gcc 10.x) shipped with, e.g., Clearlinux, Fedora32,
will simply fail upon hitting this error. Ignore it.
CPPFLAGS is used since CFLAGS would override its default options
defined in a Makefile breaking compilation on older gccs as a result.
Change-Id: I75c7938268736365a41b49373c948e779d57253b
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4679
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
These are not understood by the older versions of the compiler, like
the one shipped with Centos7. The flags in question are:
-Wno-stringop-truncation
-Wno-unknown-warning-option
Change-Id: Icc29ebcf5080c908e23aa2df290a6c452f3e185c
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4671
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This routine depends on nvme-cli which on FreeBSD can be installed
only through ports - this operation is not supported by SPDK's
provisioning tooling, like pkgdep.sh or vm_setup.sh. Considering
that, it's unlikely that working nvme tool will be available on
generic FreeBSD system, thus skip this work entirely.
Change-Id: Ib2f12a65b6f000f1b4d9d3beda6b349685f263c7
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4670
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
If devices are not picked up from the cache, iter_all_pci_class_code()
will pick lspci in first instance to iterate over the pci bus. If said
tool is installed on FreeBSD, it will return BDFs in format which won't
be understood by pciconf (which is used to determine which driver given
device is bound to):
pciconf: cannot parse selector pci0000:00:06.0
To make sure pciconf understands the argument it's given, simply
replace .function with :function (0000:00:06.0 -> 0000:00:06:0).
Change-Id: I59d4f7050c65df99626a3d449aa0a5bb122d4081
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4665
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
If they are not, there's no point to continue setup on FreeBSD.
Change-Id: I6d94712f1507c0597fbd569ff73c52f262ab9df9
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4658
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
In case contigmem is loaded, but the kernel environment hasn't been
properly updated with hw.contigmem.* options, kenv will fail,
breaking the check to determine if contigmem should be unloaded.
Avoid the above scenario by determining first if given option is
actually set in kernel's environment.
Change-Id: I4118b7622fd876b28f0c07d081c583f5782f0357
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4656
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
During tests with new qcow2 image there is error:
ERROR: use the -f option to force overwrite of /dev/sdb1
when creating filesystem using mkfs.btrfs, adding -f
resolve this issue.
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: If6548d3d5781e2b46f794422144e2a635e700559
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4660
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
SPDK is removing legacy INI style configuration
and the examples in this dir are representing
and documenting it.
Those should be removed, instead of being converted.
Because JSON does not support inline comments
and all of the JSON RPC is already documented
extensively https://spdk.io/doc/jsonrpc.html.
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Change-Id: I8609bc107736aea53e9d64e05d0d3221bd73b567
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4782
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
The virtio nvme was removed from SPDK, so this TODO
would never get implemented.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Iafa701249ed3fafa45d028f2bb929a024b78a0b6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4784
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This reverts commit cff7c8f1f7.
DPDK submodule is updated with the actual fix:
(9471c59) vhost: fix external backends readiness
https://review.spdk.io/gerrit/c/spdk/dpdk/+/4219
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I130d1d0b7aab86f3eb2bf420aa8644d4607e1eeb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4783
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
If the namespace is a zoned namespace, get and print a zone report.
Since a ZNS drive can have thousands of zones, request a zone report
containing only the first 8 zones.
The code does take a ZNS drive with less than 8 zones into account,
even though such a drive is unlikely to exist in the wild.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I28ecb4d7c60ab5a911d7b1faae595f43ef6706e1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4794
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Add support for the ZNS zone management receive command.
An internal nvme_zns_zone_mgmt_recv() function is created
that matches the parameters of the zone management receive
function in the ZNS specification.
Convenience functions are provided for the following
Zone Receive Action: Report Zones.
Zone Receive Actions not implemented: Extended Report
Zones.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I23589a602336da5dffccec7230d07026a868e81b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4793
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Add a function to get the number of zones for a zoned namespace.
Since the ZNS specification does not allow zone size == 0,
divide by zero should not be possible on a spec compliant drive.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I15e0ac8a72e244e248b7fb44f7156b182ecd98b4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4792
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Add a function to get the zone size of a zoned namespace.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Change-Id: I89429fa2fd36307a8b34bdf91e3251c68596a48c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4791
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>
Community-CI: Broadcom CI
This patch removes callback function for subsystems to
present their options for legacy config.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I63076fc03eff45da5d57fab03501602922a20e3e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4749
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This patch removes function for bdev modules to
present options of the bdevs.
blob_bdev.h refers to the spdk_bdev_module, so would need
to be bumped too.
At this time spdk_bdev_module is left unchanged to prevent
that.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3cacb087c998d928c5d8c2722b7f041d82bb43f1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4748
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Use spdk_nvme_detach_async() and spdk_nvme_detach_poll_async() with
a local variable detach_ctx to detach multiple controllers.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I77cdc07ddfcd97569e31eeb245cd4e5a26289dbd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4441
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Use spdk_nvme_detach_async() and spdk_nvme_detach_poll_async() with
a local variable detach_ctx to detach multiple controllers.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I43428a41df2b6f26b62cf03990d35add9a3663d6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4440
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Use spdk_nvme_detach_async() and spdk_nvme_detach_poll_async() with
a local variable detach_ctx to detach multiple controllers.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I05c504428df56f4ab5d1ffdd19ac81e6c062c89d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4439
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Add two new public APIs, spdk_nvme_detach_async() and
spdk_nvme_detach_poll_async() to detach multiple controllers in parallel
as a simple manner to users.
Hold the target controller to nvme_ctrlr_detach_ctx because users
will free any object which held it after returning spdk_nvme_detach_async().
spdk_nvme_detach_ctx holds all nvme_ctrlr_detach_ctx in a sequence
by linked list.
spdk_nvme_detach_ctx has a boolean variable polling_started to prevent
the user from calling spdk_nvme_detach_async() while
spdk_nvme_detach_poll_async() is called repeatedly.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>i
Change-Id: Ib049c19f7ef24410b963fd5c777a21184f3012d1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4758
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Add two new helper functions, nvme_ctrlr_detach_async() and
nvme_ctrlr_detach_poll_async() to make the internal of
spdk_nvme_detach() asynchronous.
Use callback function to remove controller from the attached list after
completing shutdown and before freeing to avoid conflict between
attach and detach.
Update MOCKs in the corresponding unit test cases.
The next patch will add two public APIs spdk_nvme_detach_async()
and spdk_nvme_detach_poll_async() based on this patch.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifbdfec2a1facde9354007c6248f280e245a36eed
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4416
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Following the last patch, separate nvme_ctrlr_destruct()
into nvme_ctrlr_destruct_async() and nvme_ctrlr_destruct_poll_async(),
but keep nvme_ctrlr_destruct() by replacing the internal by
nvme_ctrlr_destruct_async() and nvme_ctrlr_destruct_poll_async().
Add shutdown_complete to nvme_ctrlr_detach_ctx. If shutdown_complete is true,
we can destruct the controller. The case that nvme_ctrlr_shutdown_async()
failed sets shutdown_complete to true. The case that nvme_ctrlr_disable()
is called sets shutdown_complete to true unconditionally.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3994e259f9d3ccf8fede3ac03aadef911eefb9dd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4415
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This patch is the first of the patch series to make spdk_nvme_detach()
asynchronous.
We have lengthy shutdown notification, i.e., we have to wait a long time
until shutdown processing is completed, in some SSDs. If the running system
has many such SSDs, we see large intolerable delay.
SPDK provides a controller option, no_shn_notification as a workaround.
We can use the workaround if the use case of the detach is to switch to
the next application without system reboot. However, we cannot use the
workaround if we want to do system reboot after detach.
To mitigate such lengthy shutdown notification, we need to parallelize
detachment among SSDs.
Hence the patch series will introduce an asynchronous detach API and
will use the API to parallelize detachment.
This patch adds the following changes.
Introduce a context structure and separate nvme_ctrlr_shutdown()
itno nvme_ctrlr_shutdown_async() and nvme_ctrlr_shutdown_poll_async()
using the context structure.
Name the context structure as nvme_ctrlr_detach_ctx because it will be
used only in internal APIs. The upcoming public APIs will support
multiple detachment and will have the contest structure named as
spdk_nvme_detach_ctx.
Use TSC instead of counter because polling interval will be controlled
by the caller.
Use the convenient macro, SPDK_CEIL_DIV(), to round off the time
value in milliseconds.
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9e2355fd24b6d6a4d6c1813577d53822304d4f33
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4414
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Update a few print outputs to out not product name but bdev name
because bdev pointer is not available there after replacing
spdk_bdev_get_by_name() and spdk_bdev_open() by spdk_bdev_open_ext().
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I624fea3a0a12c1049e950bddae8cea9f88b16db5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4702
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>