The 2 MiB minimum may be not reasonable for some users, so it is changed
to 4 KiB to allow wider range of possible values.
The new default is introduced to keep backward compatibility (2 MiB).
Signed-off-by: Szulik, Maciej <maciej.szulik@intel.com>
Change-Id: I450ff555f73ddd9be727ecc49209eb5af90fa88e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17406
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
To avoid races that lead to use-after-free errors during esnap device
hot add/remove, we need a way to ensure that the destroy callback does
not free a bs_dev until all consumers are done.
This adds reference counting to the create_channel() and
destroy_channel() callbacks. The reference couunt is initialized to 1
and is decremented by destroy(). The destroy() and destroy_channel()
callbacks are updated to free the bs_dev only when the reference count
drops to 0.
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ie0b873717e431b33ce6548f878643dbc66d4f956
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16422
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Remove unused cleaner IO queue which is not kicked on creation.
While it is not a problem to have it,
the latest OCF code has new parallelize mechanism that uses all the IO queues.
Using an IO queue which is not kicked will hang the system.
After this change SPDK glue is somewhat closer to OCL glue,
both not using a dedicated cleaner IO queue.
Signed-off-by: Amir Haroush <amir.haroush@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Change-Id: I2e8ef0aaf11061d511151865c6062922d7934df2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17065
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Inline the internal of bdev_nvme_delete_ctrlr() and bdev_nvme_failover()
into _bdev_nvme_delete().
Change the _nvme_ctrlr_destruct() call from direct to message passing
to reduce lock hold time and avoid potential deadlock.
Then, protect nbdev_ctrlr via g_bdev_mutex_unlock and each nvme_ctrlr
via nvme_ctrlr->mutex.
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I5cc2cf781d2846c51bce631c12fceaeade860a0b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16822
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Michael Haeuptle <michaelhaeuptle@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
If we find that the discovery entry already exists, a
single break doesn't work - that just breaks out of
the TAILQ_FOREACH. So instead change it to free
the resolver object and return directly.
Fixes issue #2945.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia31d6ecfa4fdc0a168eecc8ec4659da10a870770
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17209
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
The code was already ready for that, so it's only a matter of reporting
that to the bdev layer.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I46ea2e6794e00590930651c5ff8c36588de641b4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17042
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Now that all crypto operations are using interfaces that support memory
domains, bdev_crypto can report support for memory domains.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I13a128a599f6560197fed3405599c2a6bb609703
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17041
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
There are lots of places when we need to abort accel sequence and
complete bdev_io with a failed status, so move that code to a dedicated
function.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I5f6f4146c736d9c8e04b5667117d6e7ed824a654
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17088
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
All these callbacks look identical now, so there's little point in
having three different functions doing the same thing.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I60d1426b5d2b20d924776699885e6a9dd176504a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17024
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
After changing to spdk_accel_append_*, this code is no longer necessary,
as accel operations are now executed by the base bdev/bdev layer.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2e31249dfdf7abeee420744a5cc75b8273ecbad9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17023
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Similarly to reads, writes path is now also using the spdk_accel_append*
interface for performing encrypt operation.
Additionally, this patch also changes the way aux buffer is allocated -
spdk_bdev_io_get_aux_buf() was replaced with spdk_accel_get_buf(). This
ensures that the actual data buffer will be only allocated if it's
actually needed.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I3cd1d4f5753a95709d7b81de23d9227102a74261
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17022
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
The new spdk_accel_apend_decrypt() interface is now used for all read
requests for decrypting data. This makes it possible to chain decrypt
operations with other operations in a sequence. Support for encryption
in the write path will be added in the following patches.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I2f65044eeaf92232d839ddd166ae50889b3f386d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17021
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
getaddrinfo() does not use errno to report failures, instead
does it with return value.
This patch makes sure that proper error is reported.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I56569f991ae55d4b113f280394bb9ab375465a13
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17096
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Removed bdev pmem implementation and makefiles
Removed bdev pmem rpc calls
Updated Python scripts
Updated match files for tests
Updated doc files
pkgdep and doc files will be updated when pmem
dependency is removed from libreduce
Change-Id: Ia1be5046159e04cd933ac13a0d5791e6d28219da
Signed-off-by: Marcin Spiewak <marcin.spiewak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17070
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Huawei is working on picking up support for OCF and the
associated SPDK bdev module, after Intel discontinued
support. So clarify various docs and strings to
reflect this for now. If everything goes according
to plan, deprecation notice will get removed before
23.05 release. If not, SPDK will just keep the
deprecation notice for 23.05, keep the code in-tree,
and give another release cycle to get things worked
out.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9ac6bf2f509005956440b41516ca00b0c1997361
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17085
Community-CI: Mellanox Build Bot
Reviewed-by: Amir Haroush <amir.haroush@huawei.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This patch aligns delay bdev with other bdev modules
that allow passing specific uuid during their creation.
See malloc or null bdev modules.
Change-Id: Icc5e816dd42b2e55e8d57712f2d4f125e486fdab
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16840
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Patch 55f947933 ("bdev: remove spdk_bdev_ext_io_opts from spdk_bdev_io")
changed the way bdev_nvme submits IO to the NVMe driver causing
performance degradation for requests with iovcnt = 1, as they also had
to go through the path that executes the reset_sgl/next_sge callbacks.
This patch reverts those changes back to the original code checking
iovcnt and using the non-SGL functions if possible.
Suggested-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I5e7c6620d38b7690ff862d8cd0075afacc578217
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16961
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
If the bs_dev was opened read-write, continue to take a
read-many-write-one claim. If it was opened read-only, take a
read-many-write-none claim.
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I25d977c6961f962423899fb891ec912cd847930a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16282
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
External snapshots, which will be introduced in a later commit, will
need read-only blob_bdev instances. This support is partially needed to
support underlying devices that are naturally read-only and partially to
provide an extra layer of protection against accidental writes.
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: Ibcb28d00ad644a6053aa5f4de15471c2cd8e348a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14968
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
With bdev_nvme accel_comp_poll is always created, even if it is not
really used e.g bdev_nvme with vfio-user transport.
accel_comp_poll poller is registered when accel_channel is created, in
order to start it lazily this patch creates accel_channel during first
usage.
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Change-Id: I5c710a038606ada00c9bfde6a4d9691ee8f6d204
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16957
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
There's no need to add 1 to the pipe size, it
actually results in unaligned accesses after we've
cycled through the pipe buffer for the first time.
Fixes: eb98488 ("sock/posix: Internally buffer reads.")
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iff79d40694dab1afe128ccac0c7c7a28cd827a3d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16924
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
`rpc_bdev_lvol_resize` and `rpc_bdev_lvol_create` can now use size
in MiB instead of `size` in bytes. This change make param `size`
deprecated and using both `size` and `size_in_mib` return error.
Since `bdev_lvol_resize` and `bdev_lvol_create` use size in MiB,
name of param should reflect it, previously used param `size` is
positional therefore there is no need to keep it as deprecated.
This patch fix issue: #2346
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Change-Id: Ibbe2c056bb63d9f82dee91c87fdd501ce441d5f8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16901
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Change the way we generate UUIDs to use uuid_generate_sha1()
from libuuid.
Fixes#2788.
Change-Id: Id750a7de74fb37bc3ab3ab06b3254b49d73f4be3
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15935
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
The following patches will add mutex for bdev_nvme_delete() to improve
handling race conditions. This refactoring make such change easier.
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I8971684a708bce89872f08f75db86eb3b723f380
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16821
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
If alternate paths and an active path are treated separately in
_bdev_nvme_delete(), it will be much easier to protect a path list
from delete operation by mutex.
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ie3bed095fd92b80c0487ef7b136953ad03a174eb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16820
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Factor out path deletion operation for one nvme_ctrlr into _bdev_nvme_delete().
_bdev_nvme_delete() traverses all remaining nvme_ctrlrs even after one
nvme_ctrlr was successfully deleted. To remember the successfule
deletion, use two return value variables, rc and _rc. For _rc returned by
_bdev_nvme_delete(), copy _rc to rc if _rc is zero, return _rc immediately
if _rc is not -ENXIO, or do nothing otherwise.
This improves the readability and makes us easier to add more changes.
Additionally, for _bdev_nvme_reset_io(), it is simpler to overwrite rc
to 0 if rc is -EBUSY rather than to return 0 if rc is -EBUSY. This is
very small change and hence done together.
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I57eafd22918c8c976b9c51bedb9e4369976c1d5c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16819
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
The next patch wants to use _bdev_nvme_delete() as a function name.
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Iba103868e74795bf42c443a377c77e9c073329fb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16818
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
This improves the readability and makes us easier to add more changes.
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I55d7925d70f2a204f65a81f3fc44cf96b69c3ebe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16709
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
These functions:
_vbdev_lvs_grow_examine_finish
_vbdev_lvs_grow_examine_cb
_vbdev_lvs_grow_examine
are almost exact copies of:
_vbdev_lvs_examine_finish
_vbdev_lvs_examine_cb
vbdev_lvs_examine
Remove the duplicated grow functions. Factor out the common entry point
into _vbdev_lvs_examine() which accepts a callback to perform the
required action (spdk_lvs_load or spdk_lvs_grow).
Change-Id: I9805f29e22812051608873207401e3786dab7103
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16942
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Remove _vbdev_lvol_examine_close_cb() because it is identical as the
code at the end of _vbdev_lvs_examine_finish().
Remove the INFOLOG message because it is redundant (there's an ERRLOG
just before) and inconsistent with the lvolerrno != 0 case, where there
is no such message.
Change-Id: I8488a8b5fcbaf1895f4953081d98bc13f82be221
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16941
Community-CI: Mellanox Build Bot
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 the past, we didn't use the distinction between logical block size
and physical block size. Now it's possible to optionally set the
physical block size to be different then logical block size. It's useful
for NVMe 512e Advanced Format tests.
Change-Id: I1b596da471031ee90dafc6ba6276cebf769b5ea2
Signed-off-by: Panfil, Wojciech <wojciech.panfil@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16793
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
In the past we didn't use the distinction between logical block size and physical block
size in null bdev. Now we can optionally set the physical block size to
be different then logical block size. It's useful for testing NVMe 512e
Advanced Format scenarios.
Change-Id: Ib3713af9a4d0ce7fd322170b4d87100cfc91a103
Signed-off-by: Panfil, Wojciech <wojciech.panfil@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16792
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
When bdev_rados_cluster_init encounters an error, it shuts down the cluster
before returning, but since the pointer is still set, bdev_rbd_free will
attempt to shut it down again, which causes a crash.
Therefore, set the pointer to NULL after the first shutdown to indicate
that the cluster object does not exist anymore.
Change-Id: Ie403471e8aba881cb6380e74bd1a4ca8d67cbc68
Signed-off-by: Lukas Stockner <lstockner@genesiscloud.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16203
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
The spdk_bdev_ext_io_opts structure is used to pass extra options when
submitting a bdev IO request, without having to modify/add functions to
handle new options. Additionally, the structure has a size field to
allow adding new fields without breaking the ABI (and thus having to
bump up the major version of a library).
It is also a part of spdk_bdev_io and there are several reasons for
removing it from that structure:
1. The size field only makes sense in structures that are passed
through pointers. And spdk_bdev_ext_io_opts is indeed passed as a
pointer to spdk_bdev_{readv,writev}_blocks_ext(), however it is
also embedded in spdk_bdev_io (internal.ext_opts_copy), which is
also part of the API. It means that each time a new field is added
to spdk_bdev_ext_io_opts, the size of spdk_bdev_io will also
change, so we will need to bump the major version of libspdk_bdev
anyway, thus making spdk_bdev_ext_io_opts.size useless.
2. The size field also makes internal.ext_opts cumbersome to use, as
each time one of its fields is accessed, we need to check the size.
Currently the code doesn't do that, because all of the existing
spdk_bdev_ext_io_opts fields were present when this structure was
initially introduced, but we'd need to do check the size before
accessing any new fields.
3. spdk_bdev_ext_io_opts has a metadata field, while spdk_bdev_io
already has u.bdev.md_buf, which means that we store the same thing
in several different places in spdk_bdev_io (u.bdev.md_buf,
u.bdev.ext_opts->metadata, internal.ext_opts->metadata).
Therefore, this patch removes all references to spdk_bdev_ext_io_opts
from spdk_bdev_io and replaces them with fields (memory_domain,
memory_domain_ctx) that were missing in spdk_bdev_io. Unfortunately,
this change breaks the API and requires changes in bdev modules that
supported spdk_bdev_io.u.bdev.ext_opts.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I49b7524eb84d1d4d7f12b7ab025fec36da1ee01f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16773
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Also deprecate the existing spdk_nvmf_request_data() API, which is
incompatible with iovecs.
Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I44df8ff30a431873a0c2f34b0cdb58df858fd7e3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16200
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
It has been implemented in commit 56e2d632ce to reset all nvme_ctrlrs
of a bdev controller sequentially. Update the log.
Change-Id: Id87bf99d7e269c8ad0d6b2576e2329455601ec55
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16653
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
With the introduction bdev module claims v2, existing consumers should
transition off of v1 claims. This transitions blob bdevs from v1
exclusive writer claims to v2 read write once claims.
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Change-Id: I1884585a540fa17ee341430e03de3c4f5d35322b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16168
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
We used hardcoded value set by bdev module, however
this value might be changed, so get a real value
from iobug config
Signed-off-by: Alexey Marchuk <alexeymar@nvidia.com>
Change-Id: Id15b602f699f3dd63aeff11fb063bb62c384663d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16601
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
For JSON RPC, boolean response with false value may not be regarded as error.
Previously many cases were replaced to use
spdk_jsonrpc_send_error_response() explicitly. Replace one of the
remaining cases in this patch.
rpc_blobfs_detect() uses boolean response for not only true but also
false, but it had a memory leak bug. Fix it together in this patch.
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Iaff21115282f638038345daa986b5c743ba9a3ed
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16621
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
For JSON RPC, boolean response with false value may not be regarded as error.
Previously many cases were replaced to use
spdk_jsonrpc_send_error_response() explicitly. However, this pattern did
not become established and new bdev modules used
spdk_jsonrpc_send_bool_response() with false.
Once again, replace remaining cases in this patch.
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Ie8858bc8ff7c36bc3a829977044a91d459db76f2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16555
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
The NVMe bdev module has been refined since the bdev_nvme_apply_firmware
RPC was added. It is enough to open any one NVMe bdev even if one NVMe
controller has multiple namespaces. Hence, let's remove
spdk_bdev_first/next() calls from rpc_bdev_nvme_apply_firmware() rather
than replacing these by spdk_for_each_bdev(). Additionally, not only
spdk_bdev_close() but also spdk_put_io_channel() and
spdk_jsonrpc_send_*_response() should be done on the original thread.
Hence, redirect to the original thread always when a NVMe command is
returned, and rename firm_ctx->thread by firm_ctx->orig_thread for
clarification. orig_thread will be better than comment.
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I90b1986584b3926980fd265e4fded194eb5a2d00
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16541
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
It is enough to embed an instance of rpc_apply_firmware structure into
firmware_update_info structure.
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I41a480a0b8cd56f4b537512d5f83c5cbd5eee718
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16540
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Previously, bdev_nvme_apply_firmware() used a temporary character array
to reduce the calls of spdk_jsonrpc_send_error_response().
Change these to call spdk_jsonrpc_send_error_response() directly.
This will simplify the next patch to replace spdk_bdev_first/next() by
spdk_for_each_bdev()ss.
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I87ffc9416232dcaba30202ebbe0cb4b185a9563d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16539
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>