Due to upcoming change we cannot use the same count
pointer in rpc call and bdev creation function.
With async bdev creation there will be a problem
when freeing context.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I98da89481d7f506161d8adf5a1b2365907385a13
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468463
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
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: Ben Walker <benjamin.walker@intel.com>
This also requires change of type for count field
in rpc_bdev_nvme_attach_controller_ctx structure
and argument type in spdk_bdev_nvme_create function.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ifc679558b0744ada021f5ce367beb83b35f30b3a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470135
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: Ben Walker <benjamin.walker@intel.com>
OCSSD NVMe will use separate RPC call to create bdevs
so don't call bdev_nvme_create_bdevs for it.
Additionally change bdev_nvme_create_bdevs arguments
to take nvme_async_probe_ctx structure to simplify
future changes.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I07ad8034058d8b3a0c78627db1fd0ba3db5a211b
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468223
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>
This is required to use spdk_bdev_nvme_create function
for other NVMe modes.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I47dcb41689c7ec696ca6e76c35c81b497655d29a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468342
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>
This change will make possible to use connect_attach_cb
function with other NVMe bdev types. Changing
bdev_nvme_create_and_get_bdev_names function name
to more suitable.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I0bf79aba65914b4ac1826200f7d049e1c26276f4
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468594
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>
In current code there is no possibility to remove ocf instance
permanently, even we call delete_ocf_bdev rpc command, on next examine
this instance will be loaded.
This patch introduces changes to delete_ocf_bdev rpc command. When we call
this command via rpc, core related to particular vbdev will be removed
from ocf cache before removing this cache instance. Thanks to that, on
next examine we will not detect this core in cache metadata and therefore
we will not create this instance on next load.
However, in any other situation, we will not touch metadata, so in case of
dirty shutdown/hot remove, on next load, we will recovery this instance.
Signed-off-by: Marcin Dziegielewski <marcin.dziegielewski@intel.com>
Change-Id: Iebef80989ea22ccea7f1b6ba4d734a40c1d5cc5d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465675
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Separating these two functions will make possible to use
create_ctrlr function for othe NVMe bdev types in the
future.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I3d503a3bf0d317f77beeb827c761b93d66a643ea
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468593
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>
Zoned bdev properties were added to the result of the get_bdevs RPC
call:
- zoned: indicates whether the device is zoned or a regular
block device
- zone_size: number of blocks in a single zone
- max_open_zones: maximum number of open zones
- optimal_open_zones: optimal number of open zones
The "zoned" field is a boolean and is always present, while the rest is
only available for zoned bdevs.
Change-Id: Ib82b39d4ab20543d0a754dbc4c0317885fb831d1
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467144
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
In prep for future RAID1E patch so that the completion function
can be shared by multiple RAID levels.
Change-Id: I169e2d64388fab701e9b467f8803aacd5d1250d2
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469743
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Small cleanup in prep for future RAID levels and to improve
readability.
Change-Id: I66ae64320593ee5b242ccdc50a0041a4ec8207fb
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469742
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Fixes#962
Issue mentioned above was caused by race between examine on ocf bdev
(which is partially asynhronous) and bdev delete.
This patch adds new ocf bdev state "starting" it means that register
procedure was started, base on this state, we are not allowing to
destruct vbdev during registering path.
Deleting of vbdev will be still possible on started vbdev or when
register procedure are not started yet.
Signed-off-by: Marcin Dziegielewski <marcin.dziegielewski@intel.com>
Change-Id: I12099dfba75a46f95299c118f748d39af27df86a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469406
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>
Realted to #957
Normally we are using vbdev_ocf_qcxt allocated by spdk device (ctx_buf),
but after io_device_destroy_cb this context can be freed, so we allocate a
local copy to use for issuing requests on ocf bdev stop. Unfortunately,
in current code we are not freeing it, this patch fix that issue.
Signed-off-by: Marcin Dziegielewski <marcin.dziegielewski@intel.com>
Change-Id: I2d5c0b529f4ff79960945b9e598f21602209f839
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468983
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
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>
Adding a new element to this struct in an upcoming patch and want
it to look pretty and be consistent with everything else.
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I514244ea9441081ba83bd7425101a2bd3ba532c1
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467885
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 prep for addition of RAID 1E, these functions only apply to
RAID0 now.
Change-Id: I30c4dc9a167d0523e2da2ef2d9861230f12f1a5a
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467554
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>
Next patch will rename the relevant functions so it's clear they're
RAID 0. This patch simply takes those functions which include RAID
specific mapping and assign them to existing functions via func
pointers in the RAID struct.
Change-Id: I8c7724d855937a9c1ca78cdb8ec500521f23b12d
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467553
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 prep for using it as part of a func pointer delcaration in
an upcoming patch.
Change-Id: I3272c4e0f16a894b52a0601323c7d9148592ca3f
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467698
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>
In prep for upcoming patch that needs it declared earlier.
Change-Id: Ia618d95108c0ab5e71618470ac36f822a9aa0129
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467552
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: Maciej Szwed <maciej.szwed@intel.com>
In prep for replacing some of the internal r/w calls with function
pointers based on RAID level, just call spdk_bdev_io_get_buf()
directly in the submit path for reads. This:
* will reduce the number of places where unique calls to the
upcoming function pointer will be
* bring it in line with how the majority of other bdev modules look
* actually increase UT coverage by about 10% as we're now calling
spdk_bdev_io_get_buf() and it's callback.
Change-Id: I7e6da0dab80687988ba52f57b0d9e2dbf20676dc
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467538
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>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I8824b118575c0033bb8a31464112d77dce088067
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467324
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
The new name comes first, the old name comes last.
Eliminates warnings at app start time for
set_bdev_nvme_options and set_bdev_nvme_hotplug
aliases.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia5ff3012e97bf59a6ecd9282dfc5cc0796ca7630
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466967
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Scan build is really pessimistic and assumes that
mempool functions can dequeue NULL buffers even if they
return success. This is obviously a false possitive, but
the mempool dequeue is done in a DPDK inline function
that we can't decorate with usual assert(buf != NULL).
Instead, under #ifdef __clang_analyzer__ we'll now
preinitialize the dequeued buffer array with some dummy
objects.
Change-Id: I070cfbfd39b6a66d25cd5f9a7c0dfbfadc4cb92a
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463232
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.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>