Commit Graph

223 Commits

Author SHA1 Message Date
paul luse
487eb66e24 module/crypto: enhance recent session optimization
When we moved to shared session a limitation of one crypto
volume was accidnetally introduced. Add a limit to keep the
session pool size down and print debug message when its hit.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ic55efd554f37c4f44149edfbfe037420d8d61ce6
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474264
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-12-06 14:49:40 +00:00
Konrad Sztyber
860a075094 bdev/ocssd: read / write support
The patch adds zone address to Open Channel LBA translation as well as
initial support for read  and write commands.  Each IO command is
currently limited to a single zone (chunk).

Change-Id: I3ee6d58323871f0651ac1d5e8dda28eb6d687a95
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467149
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-12-06 14:45:05 +00:00
Konrad Sztyber
b9635c2f16 bdev/nvme: move nvme_io_channel to common.h
Other NVMe bdev modules (e.g. OCSSD) need the definition of the
nvme_io_channel to be able to send IO requests, so this structure has to
be defined in the common header.

Change-Id: I550d15d091078588c6c7ab824d883e049ec5a72c
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470019
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-12-06 14:45:05 +00:00
Konrad Sztyber
6bda87b324 bdev/ocssd: create / delete calls
Added a way to create and delete OCSSD bdevs on top of OC NVMe
controller.  The controller can be created using the regular NVMe bdev
RPC call.  For instance, the following (assuming 0000:00:04.0 is an
OC device):

 rpc.py bdev_nvme_attach_controller -b nvme0 -a 0000:00:04.0 -t pcie
 rpc.py bdev_ocssd_create -c nvme0 -b nvme0n1

creates Open Channel controller nvme0 and OCSSD bdev nvme0n1 on top of
it.  The bdevs can be deleted either by the bdev_ocssd_delete call or by
deleting whole NVMe controller, in which case all bdevs are destroyed.

Change-Id: I9f2f02103fc5570a53bd26479c8690be206829c3
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468984
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-12-06 14:45:05 +00:00
Konrad Sztyber
a116324c88 bdev/ocssd: initial Open Channel bdev implementation
This patch adds initial Open Channel zoned bdev implementation.  The
bdev will allow to use the zoned API on top of OCSSD devices.

Added the ability to create the OCSSD NVMe controller.  The controller
is created using the regular NVMe's RPC when the controller is detected
to be Open Channel.

Change-Id: I31d271126dba4369ac2eaebd4cc7bdd460e5f808
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467147
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-12-06 14:45:05 +00:00
paul luse
dc8788d150 module/crypto: handle enqueue errors
A recent change in the CryptoDev API means that failure to enqueue
all attempted submissions does not automtically mean busy. We need
to check the status of the last submitted op and only retry if
busy, otherwise fail the IO.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I0873d07a430a08f5aee25581e47187ef60ba8542
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472400
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-12-05 13:06:35 +00:00
paul luse
c602bd81f6 module/crypto: change how we handle crypto device full condition
Previously we would sit in the submission routine and spin on the
poller and then retry in the event that we could not get CryptoDev
to take all of the ops that we had available.

The implementation was fine however a recent CryptoDev change
requires us to now check the status of attempted submissions
instead of assuming that the device was busy. If there was
another reason for the failure we don't want to retry or we'll
be stuck in an endless retry loop.

Changing the current device full handling to match what was
done in the compression vbdev makes it easier to handle the
new condition and also makes the two vbdevs more consistent
with regards to how they manage the DPDK framework API.

This patch only changes how we handle full conditions to put
the ops on a linked list and resubmit them the next tie the
poller runs naturally. A following patch will handle the
CryptoDev API change that instigated this change.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Idcb6e06b6826045f23e59b64eca051f3eee2b850
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472309
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-12-05 13:06:35 +00:00
Jim Harris
2389caa4f5 bdev/nvme: explain the "populated" flag with a comment
This was previously named "active" as in "active
namespace".  But we're really using this flag to keep
track of whether the namespace structure is currently
populated with data structures, bdevs, etc. for the
associated namespace.  If we find an active namespace
on an SSD that is not populated with bdevs in the
bdev/nvme module, then we need to populate it.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475933
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-12-02 11:20:05 +00:00
Jim Harris
b7d00f19e6 bdev/nvme: add type_ctx to nvme_bdev_ns
This gives per-type ns handlers a way to associate
the generic nvme_bdev_ns structure to any type-specific
context.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475926
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-12-02 11:20:05 +00:00
Jim Harris
ed35ca1de1 bdev/nvme: remove bdev_nvme_populate_namespaces
This function can now be easily moved inline to
its single caller.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475925
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-12-02 11:20:05 +00:00
Jim Harris
0cdcf62a65 bdev/nvme: make nvme_ctrlr_populate_namespaces asynchronous
Some namespace types such as OCSSD need to do some additional
operations before being ready to populate bdevs for a namespace.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475924
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>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-12-02 11:20:05 +00:00
Jim Harris
169e19c320 bdev/nvme: add nvme_ctrlr_populate_namespace_done()
This is in preparation for making this code path
asynchronous.  For now we will just call this function
immediately after calling the per-ns-type populate
namespace function.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475923
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>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-12-02 11:20:05 +00:00
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