Commit Graph

10205 Commits

Author SHA1 Message Date
Maciej Wawryk
1220a78c6e test: Shellcheck - correct rule: This loop will only ever run once
Correct shellcheck rule SC2043: This loop will only ever
run once for a constant value. Did you perhaps mean to
loop over dir/*, $var or $(cmd)?"

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: If8de0a81ea889a04b8fea646fedc0a2cfe49d5f7
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470737
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-11 18:46:07 +00:00
Maciej Wawryk
ee8299caa0 scripts: fixed failing ceph on fedora29
There was issue with failing rbd_autotest on vm fedora29.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ic8db722903d483d288b62c8b7c54671a4142be01
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470855
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-10-11 18:45:30 +00:00
Seth Howell
2575aaec5a nvme: make sure we queue requests in order.
My recent changes that introduced batching to queued request
resubmission also introduced a regression that can lead to reordering
requests before submitting them to the drive. This change prevents that.

We wait until inside the internal _nvme_qpair_submit_request function to
check for queued entries to avoid queueing a request that has children.

If a request that has children gets queued, when we process completions
and resubmit the parent, it will result in the children being submitted.
Since we only account for the number of requests we completed in the
last iteration, some of the child requests may be requeued out of order,
or worse, none of the child requests will end up being submitted to the
transport and they will all be queued behind previously queued requests.

Change-Id: I58e1c458c25fbf3f9f75364f05b1076b166a6212
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470890
Reviewed-by: Ziye Yang <ziye.yang@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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-11 18:45:13 +00:00
Alexey Marchuk
225c74e4e7 nvmf/ctrlr: Disable in-capsule data transfer for RDMA controllers when dif_insert_or_strip is enabled
In-capsule data transfer can only be supported by NVME drives with SGL memory layout
Add test to examine new behaviour

Change-Id: Iaef6564c8e5c96c1c5af16ab41d6e3827f6a82b6
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Evgenii Kochetov <evgeniik@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470469
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-10-11 15:36:19 +00:00
Alexey Marchuk
e1101529e5 rdma: Use nvmf_request dif structure
Change-Id: I1f8eb4300f892905f18ccb6327a5abc30dc44de3
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Evgenii Kochetov <evgeniik@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470468
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>
2019-10-11 15:36:19 +00:00
Alexey Marchuk
fcd652f5e3 tcp: Use nvmf_request dif structure
Change-Id: I215da84d9f27fbc2614ce70ae36ed024ce107a4d
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Evgenii Kochetov <evgeniik@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470467
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-10-11 15:36:19 +00:00
Alexey Marchuk
5de4274594 nvmf: Introduce common spdk_nvmf_dif_info structure per nvmf request
This structure will replace definitions in rdma and tcp request structures

Change-Id: I541ffb6bdf470a8eb9877f686fa566ad17f31749
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Evgenii Kochetov <evgeniik@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470466
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-10-11 15:36:19 +00:00
Shuhei Matsumoto
3deaf00580 bdev: Fix wrong IO split when child iovs run out
When we ran out of child_iov space, ensure the iovs to be aligned
with block size. However the calculation was wrong.

(to_next_boundary_bytes % blocklen) meant not to_last_block but to_next_block.
So calculate to_last_block_size by reducing to_last_block_size from blocklen.

The data was collected when the issue occured. So add unit test
by using the data.

    Fixes #979

Reported-by: Geoffrey McRae <geoff@hostfission.com>

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I62a50bada450288ea7c60aec0e557c2a53cd8916
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470806
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-10-11 00:35:34 +00:00
yidong0635
b0400403af vhost_rpc: Fix function typo error.
Compiling reports this issue.
Analyzer checks this with ASAN.

Change-Id: Ia01a700b6b3b77dc9e0657fc3d8b28089997a626
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470807
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-10 16:52:44 +00:00
yidong0635
729fa9743f test/nvme : Add test io_cmd_raw_no_payload_build to unittest.
This function has not been tested, add test in nvme_ctrlr_cmd_ut.c
to increase code coverage rate.

Change-Id: Ibe5c98924d9e2f3239d782e7a32b828caaddb04a
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470718
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-10-10 16:21:09 +00:00
Xiaodong Liu
7fa15e28e4 configure: add --with-fuse option
blobfs_bdev module may contain functions related to
FUSE which will utilize libfuse3.
By default, it is diabled to compile blobfs_bdev module
with FUSE related functions. Running './configure' with
option '--with-fuse' can enable it.

Change-Id: I6552a6c04cc3412c739691630a7a481e0ae6b59c
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470712
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: Changpeng Liu <changpeng.liu@intel.com>
2019-10-10 16:20:46 +00:00
Pawel Kaminski
d7c00c1725 rpc: Rename construct_vhost_blk_controller to vhost_create_blk_controller
Change-Id: I49e5a24f89566ecf95e2df15e43d589f7ef3badb
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469861
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-10-10 16:19:56 +00:00
GangCao
8fbf2b687f bdevperf: new parameter to send I/Os to each bdevs from all cores
Add a new parameter "-C" to allow to send I/Os to all specified
bdevs from all allocated cores. This means any bdev will get I/Os
from all specified cores. This is same logic together with the "-T"
parameter to specify one bdev.

Change-Id: I1e38d49824afe8084fcad72b18649657eb5c50cd
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470805
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-10 16:19:43 +00:00
GangCao
a424dcbcc6 bdevperf: enable multi-core running for less bdevs
If number of bdev is smaller than number of configured
cores, the bdevperf tool will exit abnormally.

Change-Id: I88e08d1bc71af8b927c701c80f6ddd2bf22c659c
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469669
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-10 16:19:43 +00:00
Pawel Kaminski
31e77a7331 rpc: Rename delete_nvme_controller to bdev_nvme_detach_controller
Change-Id: I1402fcb24a779e7af3d108c91a0abcc09082410b
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466144
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-10-10 16:19:33 +00:00
John Kariuki
f161e76dff scripts/perf/nvmf: remove hard-coded fio directory
Added Initiator configuration option to point to the
fio source directory used when compiling SPDK with the --with-fio
option and run SPDK test with the fio plugin.

Signed-off-by: John Kariuki <John.K.Kariuki@intel.com>
Change-Id: I097cb17691a72d7c2a0e198dccd12cf3d1c3474c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468890
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-10-10 16:19:23 +00:00
Ben Walker
6888292ba5 test/compress: Wait for bdevs to be created
This shouldn't be necessary - the RPCs shouldn't complete until the
bdevs are fully created. But testing a theory as to why another patch is
failing.

Change-Id: I72c471547a7dfbb57d695bf8a3a6fb8428a2ebcd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469624
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-10-09 14:39:26 +00:00
Chunyang Hui
b60a249bea bdev/part: add API to get name of bdev_part_base
Change-Id: I1545f5aaab67c3a56d37c712cafc932c089a0477
Signed-off-by: Chunyang Hui <chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468909
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-10-09 14:39:19 +00:00
paul luse
ae80025286 iscsi: minor grammar fixup
In a couple of docs and a .py file, saw while reviewing name changes.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I6a8b579ca692cdf6df1024e42eee76de5bde1227
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467715
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-10-09 14:38:59 +00:00
Pawel Kaminski
08278bf97f test: Shellcheck - apply rule SC1010.
Use semicolon or linefeed before 'done' (or quote to make it literal).

Change-Id: I90c01e643fae41dd9961f2314a076a0bac1e6aff
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466904
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
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>
2019-10-09 14:37:40 +00:00
Tomasz Zawadzki
54a493de32 test/vhost: Fix path to integrity_vm.sh
Patch b6af628 while addressing Shellcheck 2088,
broke the pathing to integrity_vm.sh within VM.

Originally tilde was used within quotes so it didn't expand,
since cmd was executed as root the path was correct on VM.

After the change the path was changed to $HOME, making it
actually expand on the host system (not VM). Path was made
incorrect.

Since we already scp to /root/, it shouldn't
be an issue to use that path in explicitly when executing.

This fixes recent nightly run failures.

Change-Id: I2e0ac767cbf77a71841db260e602b568b1f510a1
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470624
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-10-09 14:37:17 +00:00
Pawel Kaminski
2976fbd2a3 rpc: rename get_vhost_controllers to vhost_get_controllers
Change-Id: I597da89241c221e82f11cf843d1e726613b9a768
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469869
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-10-09 14:36:41 +00:00
fanyang
bb9d17a5c3 lib/log: passing va_list to user-provided log call
va_list is not passed in logfunc, so the user-provided log call can't
get the arguments corresponding to the format string.

This patch fixes it and replaces log func pointer in spdk_app_opts
with logfunc.

Change-Id: I7f7806f47c4fd8f36f3234aa5a8c877db0fc7140
Signed-off-by: Yang Fan <fanyang@smartx.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469828
Reviewed-by: Feng,Li <fengli@smartx.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.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-10-09 14:35:51 +00:00
Maciej Szwed
3a9b5f3cd2 bdev/nvme: Do not use the same pointer in rpc and bdev code
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>
2019-10-09 14:34:16 +00:00
Maciej Szwed
05e97101b2 bdev/nvme: Change nvme_async_probe_ctx->count type to uint32_t
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>
2019-10-09 14:34:16 +00:00
Maciej Szwed
a1b9707ceb bdev/nvme: Call bdev_nvme_create_bdevs only for non-OCSSD NVMe
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>
2019-10-09 14:34:16 +00:00
Maciej Szwed
e4f9509be5 bdev/nvme: Use probe context as an argument for bdev_nvme_create_bdevs
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ib7cbbe9858421761dfb608b04bd9490ddf65cd7f

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470123
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-10-09 14:34:16 +00:00
Maciej Szwed
dd710e6437 bdev/nvme: Move nvme_async_probe_ctx structure to common.h
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>
2019-10-09 14:34:16 +00:00
Maciej Szwed
cfaa742841 bdev/nvme: Extract create_ctrlr from bdev_nvme_create_and_get_bdev_names
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>
2019-10-09 14:34:16 +00:00
Seth Howell
d7d03bd36a nvme: store the probe destroy_cb in the ctrlr.
Making this structure available from the ctrlr allows us to call the
remove callback when the controller is failed/removed on transports
other than pcie.

Change-Id: I2c66dfef12b039c0d6daf7df83da745757818006
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469636
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>
2019-10-09 14:32:36 +00:00
Seth Howell
2476a74550 nvme: don't fail the ctrlr in nvme_ctrlr_reset
This paves the way for doing multiple reconnect attempts before failing
the controller.

Change-Id: I1ff4ee6d41a5ffb47dd186d76793d670287c4783
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469934
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
2019-10-09 14:32:36 +00:00
Seth Howell
4dd94a25a3 nvme: move spdk_nvme_ctrlr_reset.
By moving the contents of spdk_nvme_ctrlr_reset to a new internal
function, I am paving the way for providing two reset paths. One, which
can be used by the user as an external API function and which provides
the same legacy behavior. Specifically, that it will always fail the
ctrlr after an attempted reset, and a second, internal path, which will
be used by the qpair reconnect code which will defer failing the qpair
to the qpair code.

Change-Id: I9ec9df55c1fecc2f00476c175bcf988207c31257
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469933
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-10-09 14:32:36 +00:00
Darek Stojaczyk
f7ddfcf743 reactor: allow spdk_reactors_fini() to be called without prior init
spdk_reactors_fini() is unconditionally called in spdk_app_fini()
at the end of every application and it currently throws a ton
of warning messages if the reactors weren't initialized yet [1].

Let's silence those warnings.

[1] $ spdk_tgt -c invalid.conf
[...]
*WARNING*: Called spdk_reactor_get() while the g_reactors array was NULL!
*WARNING*: Called spdk_reactor_get() while the g_reactors array was NULL!
*WARNING*: Called spdk_reactor_get() while the g_reactors array was NULL!
*WARNING*: Called spdk_reactor_get() while the g_reactors array was NULL!
*WARNING*: Called spdk_reactor_get() while the g_reactors array was NULL!

(Apparently SPDK_ENV_FOREACH_CORE iterates through 128 cores
if the dpdk env framework wasn't initialized. SPDK calls
spdk_reactor_get() on each core and that's what generates the
warnings)

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Change-Id: Ic3a2355ef6d2e0d0e1cc125ba21cc6a802b355bc
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470736
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-10-09 14:29:22 +00:00
Darek Stojaczyk
c4ecc8b876 app: simplify app start error handling
In SPDK applications, spdk_app_start() is always followed
by spdk_app_fini(), so remove all global-state cleanup from
app_start() and let it be done by app_fini().

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Change-Id: Id9fda9fda92f16cc59565691489d4a5ab4c577a5
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470735
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-10-09 14:29:22 +00:00
Darek Stojaczyk
0cf0ee283b app: free config object on failed app start
Set g_spdk_app.config early in the app init function,
so that the subsequently called spdk_app_fini() will
free it. So far the dynamicaly allocated config object
would be just leaked.

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Change-Id: I19ffc8bc80858d954166649f825e573f83b4bf53
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470734
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-10-09 14:29:22 +00:00
Maciej Wawryk
cb061b8e2b test: Shellcheck - include check SC2039
Remove from shellcheck excluded SC2039: In POSIX sh, something is undefined.
This warning is not actually present in any of spdk/spdk scripts.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I473e9307d909695184969563ef082720fa593759
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470732
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-09 14:28:21 +00:00
Maciej Wawryk
b854d55806 test: Shellcheck - correct rule: Use ./*glob*
Correct shellcheck rule SC2035: Use ./*glob* or
-- *glob* so names with dashes won't become options.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: If41cc6c4571b78ab7533a8156239bc879fab0216
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470731
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-09 14:28:21 +00:00
Maciej Wawryk
f724ce0caa test: Shellcheck - include check SC2031
Remove from shellcheck excluded SC2031: var was modified in
a subshell. That change might be lost.
This warning is not actually present in any of spdk/spdk scripts.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I17ec872ee5571089bbe40e8d51b06d70be70feb2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470729
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-09 14:28:21 +00:00
Maciej Wawryk
e65518d1a0 test: Shellcheck - include check SC2030
Remove from shellcheck excluded SC2030: Modification
of var is local (to subshell caused by pipeline).
This warning is not actually present in any of spdk/spdk scripts.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I3bcf6857a9fa5edfcdfa1b7f13eb704ac552d3f7
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470645
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-09 14:28:21 +00:00
Maciej Wawryk
1db9e184e7 test: Shellcheck - correct rule: surrounding quotes actually unquote this
Correct shellcheck rule SC2027: The surrounding quotes actually
unquote this. Remove or escape them.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ib17ee98920790da6aa1c8e02abc58c9365bb0e91
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470634
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-10-09 14:28:21 +00:00
Xiaodong Liu
5583ee9d05 blobfs/mkfs: adopt func in module blobfs_bdev
Let test application "mkfs" adopt spdk_blobfs_bdev_create
function in module blobfs_bdev directly.

Change-Id: I7ba95df099d6e42a52b3399e5c8fdae1ccb2689d
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469081
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-10-09 05:02:00 +00:00
Xiaodong Liu
6433c1037d blobfs: add blobfs_create RPC as mkfs
Following test/blobfs/mkfs case, add it as one RPC
method to let build a new blobfs on given block
device.

Change-Id: I0ffbb1add95dfbc8655e0238ed6f3cd519dd945b
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466485
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-09 05:02:00 +00:00
Xiaodong Liu
3ce759a1d5 blobfs: add blobfs_detect RPC
Add module blobfs_bdev as a general module to simplify
the operations of blobfs on bdev. Then its functions
can be utilized by other libraries or apps.

blobfs_detect can be used to detect whether there is
one blobfs on given bdev.

Change-Id: Ib425574816061dc945fb652b539f791a44097a43
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466486
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-09 05:02:00 +00:00
Shuhei Matsumoto
e4e6c256b9 lib/iscsi: Flush PDUs only when connection state is RUNNING or less
In iscsi_conn_flush_pdus(), call iscsi_conn_flush_pdus_internal()
only when the connection state is RUNNING or INVALID.

Besides, we can remove the iscsi_conn_flush_pdus() call from
iscsi_conn_sock_cb() because the connection state is already EXITING.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9e1029ffa555e5e43aade53f61e942e98343006d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469801
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-09 02:45:17 +00:00
Shuhei Matsumoto
fe5611b79b lib/iscsi: Request logout to asynchronously to initiator
Request logout to the initiator asynchronously when exiting the
running connection from the target.

Based on this patch, the next patch will make flushing PDUs possible
only when the connection is RUNNING (or INVALID) and remove the
tight loop in iscsi_conn_flush_pdus().

Set timeout of logout request as 30 seconds. 30 seconds is as same as
NOP timeout and will be reasonable for now.

Add and use logout_request_timer to check the timeout.

When the connection gets internal a logout request, move the connection
to EXITING state if the connection is in INVALID state, request logout
to initiator and start 30 seconds timer if the connection is in RUNNING
state and logout is not requested yet, or do nothing otherwise.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I43192be9fd7112ad444152c0dd88f99a14aa8d30
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470705
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-09 02:45:17 +00:00
Shuhei Matsumoto
7814351539 lib/iscsi: Consolidate call spdk_iscsi_conn_destruct() in a single place
Change logout_timeout() not to call spdk_iscsi_conn_construct() but
to move conn->state to EXITING. Then spdk_iscsi_conn_destruct() will
be called by the poller of iSCSI poll group, iscsi_poll_group_poll()
soon.

This will improve the maitainability slightly.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I78046ae5ad7992ad6c7509884f964d2eff6ced76
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470704
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-09 02:45:17 +00:00
Shuhei Matsumoto
8703949c05 lib/iscsi: Replace ISCSI_CONN_STATE_LOGGED_OUT state by is_logged_out flag
The connection state is mainly for flushing PDUs. ISCSI_CONN_STATE_LOGGED_OUT
was as same as ISCSI_CONN_STATE_RUNNING for this point.

Replace ISCSI_CONN_STATE_LOGGED_OUT state by a is_logged_out flag
and use the latter to reject any incoming PDU after sending logout
response.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3426a3ecbd241db402b1a2f7b3914a18e3591591
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470703
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-09 02:45:17 +00:00
Shuhei Matsumoto
1e879636a2 lib/iscsi: Handle IN_LOGIN as the same way as RUNNING for flushing PDUs
Previously When the connection is in login processing, flushing PDUs
had been done by tight loop. Login processing will not fill out
send buffers but we can use poller to flush PDUs as same as when the
connection is running iscsi_conn_flush_pdus().

Hence change the check condition to include INVALID state to use
poller in iscsi_conn_flush_pdus().

This change is necessary because the subsequent patches will change
iscsi_conn_flush_pdus() not to flush PDUs when the connection is not
invalid or running.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I543a912bf1aa957df7033184ce5989ac92367e49
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470702
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-09 02:45:17 +00:00
Shuhei Matsumoto
26d6706bc5 lib/iscsi: Remove unnecessary declaration of iscsi_conn_stop()
We can remove the declaration of iscsi_conn_stop() by moving
the related functions before the caller to iscsi_conn_stop(),
_iscsi_conn_check_shutdown() and _iscsi_conn_destruct().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia86f6685c9e90692d8dae744495bd6f8fc310990
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470556
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-09 02:45:17 +00:00
Shuhei Matsumoto
0608e00173 lib/iscsi: Remove unnecessary declaration of iscsi_conn_full_feature_migrate()
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I724f1eb123b4477437ca098f2bbb2b69e6bff131
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470555
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-09 02:45:17 +00:00