Commit Graph

211 Commits

Author SHA1 Message Date
Jim Harris
743292aa0f bdev/nvme: move code to nvme_ctrlr_populate_namespaces_done
This is in preparation for making this code path asynchronous.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ifd0ca2a997f5d89307deb7ae686480544fb73140

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475922
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>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-28 12:14:50 +00:00
Jim Harris
d3726b6e19 bdev/nvme: pass probe_ctx to populate_namespace functions
This is in preparation for making the per-ns-type
populate_namespace functions asynchronous.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I63176e0d117eb91de82b3f8b68a18de592e0a980

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475921
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>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-28 12:14:50 +00:00
Jim Harris
de76e8105f bdev/nvme: simplify bdev_nvme_populate_namespaces
There's no need to support cb_fn/cb_arg parameters
to bdev_nvme_populate_namespaces.  Just have it
call populate_namespaces_cb() directly.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I9cf5f1f79ea8650b2e82654a0ce770d89e0a06f7

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475920
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>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-11-28 12:14:50 +00:00
Jim Harris
a3dd00ed97 bdev/nvme: remove extra OCSSD check
OCSSD is handled specially now by nvme_ctrlr_populate_namespaces,
so we don't need any extra handling.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I39a9f0a9d14aa8c32c1fda6055e26d8eb712b107

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475919
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-28 12:14:50 +00:00
Maciej Szwed
d179541e0f bdev/nvme: Add nvme_bdev_attach/detach_bdev_to/from_ctrlr functions
Some NVMe modes will be creating bdevs by their own.
For such case they have to have a way to add and remove
bdevs to/from controller.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ia188ad43695689358569cfd230b6bc39c15efce2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469980
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-28 12:14:50 +00:00
Maciej Szwed
b5b6a1ce81 bdev/nvme: Rename common remove functions
Rename common remove functions so that they align
with naming convention.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I8200c2f916ff45e03fb097c5f78eff0782b96c86

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474248
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-28 12:14:50 +00:00
Maciej Szwed
b56d8100b6 bdev/nvme: Move bdev_nvme_ctrlr_destruct function to common.c
This is a part of changes required by upcoming patch.
This will also require moving bdev_nvme_unregister_cb
function to common.c.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Icc14534db4aec903542a94588d22b0ea9d43f47a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470439
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-28 12:14:50 +00:00
Jim Harris
6a13d85778 bdev/nvme: add per-ns-type populate/depopulate func ptrs
The OCSSD ones are just nops for now.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iab87bd8110dac2ba2f81d056f0034a53818e2b17

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475799
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-28 12:14:50 +00:00
Jim Harris
d1f8893968 bdev/nvme: reuse nvme_ctrlr_depopulate_namespace
Let's reuse this function in the remove path, to avoid
some code duplication.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I33519e093dafc71e7ccb6aad40638d33a820a0a5

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475798
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-28 12:14:50 +00:00
Jim Harris
922fc42418 bdev/nvme: rename nvme_ctrlr_deactivate_namespace
Now call it nvme_ctrlr_depopulate_namespace, to match
some of the recent renaming.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3953530e3322925ca0b4a5c72bfba4a90cecf35c

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475797
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-28 12:14:50 +00:00
Jim Harris
7501235a35 bdev/nvme: rename 'active' flag to 'populated'
This will better match the recent renaming to the
functions associated with this flag.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia7a0f3a50ae59b1d76d66443c91a98dc576f4d09

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475796
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-11-28 12:14:50 +00:00
Jim Harris
62db72caaf bdev/nvme: add namespace types
Eventually these may be defined by the NVMe spec, but
for now add something local to the bdev/nvme module.
These will currently only differentiate "standard"
namespaces from ocssd namespaces.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7853c97f3d3c28fd9f2fcd2440c57dc262954b46

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475795
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-28 12:14:50 +00:00
Jim Harris
9fa0006912 bdev/nvme: merge update/populate namespaces functions
These basically do the same thing.  We'll basically
keep the populate function name, but apply it to the
existing update function.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I005e983c86f2f714a240b3ba77bd2ca9463687ee

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475794
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-28 12:14:50 +00:00
Jim Harris
85a7f53e69 bdev/nvme: remove NOTICELOGS in update ns path
We're going to reuse this code in a more common path
which would raise the visibility of these noticelogs
significantly.  These aren't exceptional conditions,
so there's no need to print them when they happen.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1b56e3a4e5603e223bae07dc1c9e1ada03ba5901

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475793
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-28 12:14:50 +00:00
Jim Harris
9a78ffbbc8 bdev/nvme: remove noticelog for no namespaces
A controller with no namespaces is perfectly valid.
So remove the noticelog when a controller with no
namespaces is found.  This helps reduce some complexity.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ica184f1209414185dd4df3531f3a1002a2899590

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475792
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-28 12:14:50 +00:00
Maciej Szwed
6f65c6c170 bdev/nvme: Change some bdev create functions names
It is done to allign with the new way of handling NVMe
bdevs vs namespaces.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ic541e3ef244e538dff3990bf2be003dcc0349721
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471703
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-28 12:14:50 +00:00
Ben Walker
f56f15cc28 sock/posix: Release socket memory even if close() fails
Close can't fail. And if it did, we still want to release
the sock memory.

Change-Id: I0e4f4d23d49f32132f4526fef8587823ace0a774
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475311
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>
2019-11-22 13:54:58 +00:00
Seth Howell
a816afaaaf bdev_nvme: check for admin queue failures.
This will allow us to reset the controller when we get disconnect events
from the underying transports.

Change-Id: I825985219f98ff65cfcf7581757bd26db5bd08ba
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473762
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>
2019-11-21 14:33:44 +00:00
Seth Howell
d786a7eccf bdev_nvme: always use bdev_nvme_reset.
When doing a controller reset on an nvme bdev, we should always use the
bdev_nvme_reset function which ensures that we destroy all of the I/O
qpairs before performing the reset. This prevents us from performing a
reset and leaving the I/O qpairs in a disabled state preventing I/O from
being processed.

Change-Id: I6309421322f6c884327ade4515fc9402b25c0c1a
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473743
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>
2019-11-21 14:33:44 +00:00
Seth Howell
f57b098e7c bdev_nvme: add synchronization to reset.
The generic bdev layer currently has a lot of snychronization built into
spdk_bdev_reset. However, in a couple patches I am going to introduce a
few instances where I call bdev_nvme_reset directly from this module.
The reason I call bdev_nvme_reset directly from this module is so that I
don't have to open a descriptor to the bdev in the module itself.

In order to be able to call bdev_nvme_reset from both this module and in
response to a bdev_io, we need to synchronize and queue reset requests.

Change-Id: I7ece41119cba705a7481d365d20a1eb746a80f64
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473754
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>
2019-11-21 14:33:44 +00:00
Shuhei Matsumoto
ed2a638e89 bdev/rpc: Add current ticks to bdev_get_iostat RPC
This is used to calculate more accurate interval between two
calls of bdev_get_iostat RPC.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib561b056bc8095aa23d04cb5f9ae6f558b157124
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475167
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: GangCao <gang.cao@intel.com>
2019-11-21 08:05:23 +00:00
Hailiang Wang
dd3632975d module/bdev: fix a inconsistent order of parameters
Two parameters' order in deference and definition are inconsistent.

Change-Id: I62c6ef81b8044a75646dd3279ad2e6861436ef41
Signed-off-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475192
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-21 08:04:53 +00:00
Tomasz Kulasek
b078bc8e42 bdev/nvme: fix handle error on rpc cuse register
Change-Id: Ie746af29026bb6f9fdbcb67fb454a6eb8b9bec11
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473711
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-11-21 08:01:57 +00:00
Yao Liu
c8ef5793e3 bdev/uring: add JSON config dump
Signed-off-by: Yao Liu <yotta.liu@ucloud.cn>
Change-Id: Ic060a62f20c97dcc0c52ad761f848074efaade3d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474180
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>
2019-11-20 10:01:07 +00:00
Yao Liu
bc7b39a5f0 bdev/uring: dump filename in driver_specific JSON
Signed-off-by: Yao Liu <yotta.liu@ucloud.cn>
Change-Id: I9a3bf72175d8bf9ede7149fb6ea14dc9931ce1f6
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474179
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-11-20 10:01:07 +00:00
Yao Liu
81b4f2fec2 bdev/uring: add support for bdev_uring_get_spdk_running_config()
Signed-off-by: Yao Liu <yotta.liu@ucloud.cn>
Change-Id: If86ef2dad60260b5261fc05d075625dfa2ed0340
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474178
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>
2019-11-20 10:01:07 +00:00
Seth Howell
d6034240f1 bdev_nvme: pass nvme_bdev_ctrlr to bdev_nvme_reset
This is the data structure we end up using here anyways, and it will
make this function a little bit more versatile.

Change-Id: I530cb5b1b94f57cad4bb3931fc4b7a6335b6a00e
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473742
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: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-19 09:09:40 +00:00
Seth Howell
5ad0db1cf2 bdev_nvme: allow bio to be null in resets.
Also, add a small callback function to display an error when reset
fails.

Change-Id: I74c9e9f6842cbd3b608eae2178bd3605cd642fbd
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473741
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-11-19 09:09:40 +00:00
Seth Howell
0cdf3f5189 bdev_nvme: rename _bdev_nvme_reset_done.
The new name, _bdev_nvme_reset_create_qpairs_done will help distinguish
it from a future function _bdev_nvme_reset_complete which will become
the new completion point for a reset.

Change-Id: I4f538a57e3c3de6c21afdd79febcdf01ad079342
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474606
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-11-19 09:09:40 +00:00
Maciej Szwed
c330fbe618 bdev/nvme: Correct variable name
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: If7d55636eed5e03d002ca6ea6a24d96b127ae705

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471621
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-18 12:53:17 +00:00
Maciej Szwed
c30609c9ea bdev/nvme: Allow multiple bdevs per namespace
Some future NVMe namespace types will be able to
create multiple bdevs per one namespace. This
patch makes it possible.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I47b4c1fc545c59dcc3171ab0960f1835b6aa6d24
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471620
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
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>
2019-11-18 12:53:17 +00:00
Maciej Szwed
77dcf4534b bdev/nvme: Use Namespace object for tracking bdevs
In future implementations it will be possible to create
different types of namespaces (standard, OCSSD, ...).
This patch introduces new nvme_namespace type which
will make possible to implement such cases.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I27747d3985915f45c0e0a28dd5f391cca06b13cc
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471273
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
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>
2019-11-18 12:53:17 +00:00
Mateusz Kozlowski
cabbe1b179 bdev/zone: Register/unregister zoned bdev
Add registration and unregistration of block zoned bdev. Attach it to the
underlying bdev during creation and unattach at deletion.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: I773aff6c7609952f28c02dd1794f0529a781b2e1
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468033
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-15 20:27:14 +00:00
Mateusz Kozlowski
195be29e9b bdev/zone: Rpc functions for zoned block bdev
Added rpc handling for creation and deletion of zoned block bdev

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: Ib7b6f3928511aa840cbe098472682c951e92e5ed
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468031
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-15 20:27:14 +00:00
Mateusz Kozlowski
76fb903a74 bdev/zone: Create and delete zoned block device vdev
Adding new bdev module - zoned block device virtual bdev. It should be
possible to build on top of a regular (ie. non-OCSSD) bdev and surface
a zoned device API instead.

Added create and deletion functions for this bdev.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: Ia383483007117d1c826298fd391467a51fa2fe4e
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468030
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-15 20:27:14 +00:00
Artur Paszkiewicz
0b4ca5225a module/raid: raid level specific start/stop callbacks
Add a function pointer to raid_bdev_module to be called before the bdev
is registered and a corresponding one to be called before the bdev is
unregistered. This allows setting up the bdev parameters and any custom
initialization/cleanup required for the raid module.

Change-Id: Ib9fe8f0365ca47f499a50630f582399e7bb9fd0f
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472714
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
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>
2019-11-14 16:25:55 +00:00
Artur Paszkiewicz
9d94e1f53e module/raid: don't declare variable inside 'for' statement
Fix all occurances in raid source files.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I1862b703e213ca133fb81e46dd9502b0b9d32d9f
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474071
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>
2019-11-14 16:25:55 +00:00
Artur Paszkiewicz
94ea87541e module/raid: add asserts in raid_bdev_configure()
This function should only be called for raid_bdev in 'configuring'
state, so convert the 'if' statement that checks that to an assert. Also
add an assert for the number of discovered base bdevs.

Suggested-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Ib2fdf2af64ff0e9b458af4070321d138508a3df8
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473966
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>
2019-11-14 16:25:55 +00:00
Artur Paszkiewicz
182278c093 module/raid: function pointers for submit_request in raid_bdev_module
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I3186ea3450b91a73fa976d3d1d9cc67326daa10d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471088
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>
2019-11-14 16:25:55 +00:00
Artur Paszkiewicz
6ba11b194e module/raid: function for raid bdev_io completion
Use a dedicated function to complete the raid bdev_io.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I2ef0d19b31064b56c63866713f18deccafaeb8f7
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471087
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>
2019-11-14 16:25:55 +00:00
Artur Paszkiewicz
ae70d6a4a6 module/raid: simplify raid_bdev_queue_io_wait()
Pass raid_io instead of bdev_io to raid_bdev_queue_io_wait() and its
callbacks to eliminate unnecessary type conversions. Pass bdev and
io_channel directly as parameters instead of passing a base device
index.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Iecbf351ec1598b29709e7ccff2efb1776faf11f9
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471086
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
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>
2019-11-14 16:25:55 +00:00
Artur Paszkiewicz
235cc2c956 module/raid: assign some values to variables to improve readability
These will also be used in the next commit.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Iffd1a6e7fda2fc1688f3923777c085dcacc8613d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473453
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>
2019-11-14 16:25:55 +00:00
Artur Paszkiewicz
d3a04643bf module/raid: move error code check out of raid_bdev_queue_io_wait()
Don't pass the error code to the function and instead move the -ENOMEM
check to the callers where it makes more sense.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Ib2fa92315dc2973d4023fd9509950589de946614
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473452
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>
2019-11-14 16:25:55 +00:00
Artur Paszkiewicz
cb8dbf17dc module/raid: add raid_bdev pointer to struct raid_io
This will make it easier to get to the raid_bdev when we only have the
raid_io.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I91df14f788a51ada10b0f8356de2162c1f34520c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471085
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>
2019-11-14 16:25:55 +00:00
Alexey Marchuk
3cf9ff7495 rdma/conf: Add parsing of no_srq parameter via conf file
Change-Id: I67e8e1f4ce1f3be9a4bb0d470eac4927a6c3fbbd
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473846
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-11-14 03:46:17 +00:00
Yao Liu
ec2ba7aade bdev/uring: add an argument to specify block size
The block size of non-disk files can't be automatically detected,
so add an argument to specify it.

Signed-off-by: Yao Liu <yotta.liu@ucloud.cn>
Change-Id: Ia11ab177b78c66ede4a09a997bba28827d83ec25
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473607
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-13 15:06:30 +00:00
paul luse
921c378d79 module/crypto: stop touching bdev internal status field
Add a status field to the IO context struct and use it to track
whether an indiivdual crypto op has failed or not so we know
how to complete the bdev IO.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: If93bc9938c578184c2db9e015eee50ab758c90f0
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471693
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
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>
2019-11-07 23:05:55 +00:00
Konrad Sztyber
933bf632d6 event/vmd: write_config_json support
This patch adds support for saving VMD subsystem's configuration to a
JSON formatted file.  It allows saving and then loading configuration
with VMD enabled without having to send the `enable_vmd` RPC.

Change-Id: I59b380ec1e1f25f60f45d2363724ed7ac78c365c
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473405
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
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>
2019-11-07 23:05:38 +00:00
Yao Liu
6f3ca0804e bdev/uring: try without O_DIRECT flag if non-disk file first open fails
Signed-off-by: Yao Liu <yotta.liu@ucloud.cn>
Change-Id: I74b5b146c23e5395d26f80ca4f950631bd4721cb
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473373
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-07 23:05:06 +00:00
Yao Liu
adf19fe6a3 bdev/uring: open bdev file with O_RDWR flag
Without this flag, write requests will lead to I/O errors.

Signed-off-by: Yao Liu <yotta.liu@ucloud.cn>
Change-Id: I39a453683f7b2cbcd49fb8e0b532bf09f9180a8c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473372
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.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>
2019-11-07 23:05:06 +00:00