Commit Graph

8218 Commits

Author SHA1 Message Date
Seth Howell
b2e778b271 nvme_ns_cmd: fix bug in split_request_sgl
The while loop in this function was structured such that if the final
child request did not contain a full number of SGE elements, it would be
truncated. We need to not only check whether we have a full number of
SGEs, but also if the current child has consumed the end of the parent
request.

Change-Id: I7df6c224e9ab66033c92d2cf1af10452f5cdfd9b
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450684
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-04-19 17:29:45 +00:00
Pawel Kaminski
c459cb6e70 scripts/spdkcli: Throw exception if syntax of the 'create' portal group command is incorrect.
Fixes #751

Change-Id: I6c73c563d32cf930c295b7058492a2344b38883d
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451258
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-04-19 15:16:29 +00:00
Vitaliy Mysak
4d13903c58 ocf: update try-locks in env
Update try-lock's implementation to comply with new OCF trylock API

Change-Id: Idc318dcac370d16312ac854d3bcf91fd7084dc65
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447886
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-19 13:05:35 +00:00
Darek Stojaczyk
def2d0ac3e env/dpdk: detach pci devices from EAL interrupt thread
While detaching the device, DPDK may try to unregister
a VFIO interrupt callback which is currently "in use".
The unregister call may fail, but the error doesn't get
propagated to upper DPDK layers. Practically, detaching
the device may stop in the middle but still return 0 to
SPDK.

This effectively breaks hotremove as the device would
be neither usable or removable.

We work around it in SPDK by internally scheduling the
DPDK device detach on the DPDK interrupt thread. This
prevents any other interrupt callback to be "in use"
while the device is detached.

Since device detach in SPDK can be asynchronous now,
we add a few checks to prevent re-attaching devices
that are still being detached.

Change-Id: Ibb56a8017e34418db0304fe32774811427b056aa
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448928
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-04-18 22:49:30 +00:00
Darek Stojaczyk
81523d9dd2 env/dpdk: register VFIO hotremove callback
This is an attempt to fix device hotremove with VFIO.

A soft device hotremove request through sysfs [1] would
currently just block until the SPDK process manually
releases that device - e.g. upon an RPC request.

VFIO won't get unbound from the device untill userspace
releases all its resources. VFIO can signal a pending
hotremove request by kicking any file descriptor provided
by the userspace - and DPDK does provide such descriptor -
but SPDK does not listen on it.

DPDK does offer handy API to listen and in this patch
we make use of it inside our env/pci layer. Within
a DPDK callback we set an internal per-device hotremove
flag, which upper-layer SPDK drivers can poll with a new
env API - spdk_pci_device_is_removed().

The VFIO hotremove event will be sent to primary
processes only, so that's where we listen.

We make use of this new API in the NVMe hotplug poller,
which will process it just like any other supported
hotremove event.

Fixes #595
Fixes #690

[1] # echo 1 > /sys/bus/pci/devices/<bdf>/remove

Change-Id: I03d88271c2089c740e232056d9340e5a640d442c
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448927
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-04-18 22:49:30 +00:00
Changpeng Liu
468c6c18bd nvmf: enable get log page with reservation notification page
Reservation notification log page can be returned via the
get log page command with correct page number, users can
get zeored page buffer if the controller didn't have any
reservation notification log.

Change-Id: I99f5e4b8917a6919eb68359628efa1bead4b21b5
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/439934
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: GangCao <gang.cao@intel.com>
2019-04-18 22:33:26 +00:00
Changpeng Liu
6025375024 nvmf: generate reservation notice log on controller's thread
All the reservation commands are processed on subsystem's thread,
however the reservation notice log are controller related, and
the get log page command with reservation page will be processed
on controller's thread, so we use the same thread for generating
the log.

Change-Id: Ie000320d74242b979f6638d703523f063347ec29
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449852
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-04-18 22:33:26 +00:00
Changpeng Liu
c596ea4bd5 nvmf: update subsystem's poll group information for register command
Existing code only update the subsystem's poll group reservation
information when unregistering the key, however, new registrant
and update the key actions also need to be updated.

Change-Id: Ib8db9eb457977757251403edb92eda073b846e59
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451274
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-18 22:33:26 +00:00
Changpeng Liu
328c500001 blobfs: remove unused parameter in spdk_fs_cb_args
For now all the spdk_fs_cb_args used in blobfs are in the
spdk_fs_request context, so the field 'from_request' in
spdk_fs_cb_args can be removed.

Change-Id: I9b40cffeac8a673a87406ee89ad248939593806b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450721
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-04-18 22:09:32 +00:00
Changpeng Liu
0d4735eaf3 blobfs: change read to use spdk_fs_request as input parameter
Change-Id: I778f054c82e786c8010d5fa9d4082af739855337
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450720
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: Jim Harris <james.r.harris@intel.com>
2019-04-18 22:09:32 +00:00
Changpeng Liu
824cda201d blobfs: change readahead to take spdk_fs_request as input parameter
Change-Id: I00639a711a4f1637d24d58afb087e9d667d34c95
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450719
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>
2019-04-18 22:09:32 +00:00
Changpeng Liu
125797e07e blobfs: take the spdk_fs_request parameter for flush
Data structure spdk_fs_request has internal spdk_fs_cb_args
for each request, and for some APIs such as truncate they
all use spdk_fs_request as the parameter, so here we also
change flush to use the request parameter too.

Change-Id: Ic70b98cafe53d42c234f74b3703dc7797f210569
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450718
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-04-18 22:09:32 +00:00
Changpeng Liu
3732429c00 blobfs: allocate flush request before appending to cache buffer
After the write data has been appended to cache buffer, the
allocation of flush request can return error, so we move this
allocation before appending to the cache buffer.

Change-Id: Ia8baae8f3d88596561633bd8a5c4f83e554c72d7
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450981
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-04-18 22:09:32 +00:00
JinYu
dd90ff7a21 nvmf/rdma: fix bugs in spdk_nvmf_rdma_qpair_destroy
Rqpair qp and resources maybe not be created, if rqpair fail to
initialise. For example, in function new_qpair, the code run to
spdk_nvmf_qpair_disconnect, but rqpair is initialised in
poll_group_add.

Fix #557 segmentaion fault(core dump)

Change-Id: I1892e6d13e2d53dd5a7c4856d775f9b3b85da961
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450986
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-18 21:47:57 +00:00
Jim Harris
e1112c7a49 bdev: fix order of generated RPCs
set_bdev_qos_limit RPCs must come after the RPCs that
create its bdev.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451414
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-18 16:09:57 +00:00
Jim Harris
07ec3d4789 scsi: don't zero entire vpd_ext_inquiry structure
This case was zeroing the entire structure - overwriting
the peripheral and page_code data already set.  Don't
bother zeroing the alloc_len either - we'll set that
later in this case statement.

Fixes issue #750.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450922
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-18 16:09:57 +00:00
Darek Stojaczyk
01103b2e4d virtio: allocate virtqueue structs using regular calloc
The DMA-able vrings are allocated separately, so
the general virtqueue object can be allocated with
regular malloc - it only contains some local PMD
context.

While here, also allocate those DMA-able vrings using
spdk_zmalloc() instead of spdk_dma_zmalloc(), as
spdk_dma_*malloc() is about to be deprecated.

Change-Id: I06b9e0256c14c21747c253f05b63ef2361f465c7
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450550
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-04-17 22:53:05 +00:00
Chunyang Hui
34fb79b15b Opal: Avoid misalignment for undefined behaviour
Change-Id: I2370a320144dccc931e64de0933d6bb97cba48d3
Signed-off-by: Chunyang Hui <chunyang.hui@intel.com>
Signed-off-by: Yi Dong <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450613
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-17 17:37:42 +00:00
Chunyang Hui
63b540f5a7 opal: add response parsing functions
Change-Id: I1d4156d71d937d94e9abdf39610f9299e8073224
Signed-off-by: Chunyang Hui <chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/444141
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-17 17:34:27 +00:00
JinYu
c7395a1171 nvmf: fix the rqpair->current_send_depth
If rsp->status.sc != SUCCESS and xfer == DATA_CONTROLLER_TO_HOST,
We would not send the data WR, so clean the num_outstanding_data_wr.

Fix #728

Change-Id: I32259788e495ed76f8f02a9d871bd56356d93dc4
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450726
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-16 14:42:03 +00:00
Changpeng Liu
b62dca9308 UT/nvmf: add nvmf reservation notification unit tests
Change-Id: I7bceb437a6e68e8a933587f71f35a6a66fccce9b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/439932
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-04-12 01:25:39 +00:00
Changpeng Liu
78bfb2a1d0 nvmf: generate reservation notification log pages
A host can use the Asynchronous Event Command to be notified of
the presense of one or more avaiable reservation notification
log pages.  A reservation notificaton log page should be created
whenever an unmasked reservation notification occurs.

Change-Id: I8b83e5319725286dd0a5efc1b22d8ac4673e31e1
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/439931
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-04-12 01:25:39 +00:00
Shuhei Matsumoto
8cc7b0bc4d lib/iscsi: Set destructed at the start of target node destruction
Add the flag destructed to struct spdk_iscsi_tgt_node and
iscsi_op_login_check_target() refers it and returns
ISCSI_LOGIN_TARGET_REMOVED if it is true.

When destructing iSCSI target node, it will be nice if iSCSI library
can stop further connections are created but, connections are not
associated with any target node until processing login. Hence stop
creating sessions instead.

Additionally, when destructing iSCSI target node, if the flag destructed
is already set, return immediately, and the flag destructed does not
affect discovery session.

Change-Id: Ic73bdd93f2ca7d5ca1d2f897d5046cbc51650d5f
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450881
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-11 18:33:18 +00:00
Shuhei Matsumoto
d09eff6a0f lib/iscsi: Make two helper functions from private to public in iSCSI library
These change will be used in the next patch.

Change-Id: Ifdb4ccf20049b46e850122a4021cbbe7441e1270
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450736
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-11 18:33:18 +00:00
Shuhei Matsumoto
d72f73b26e lib/iscsi: Add target to get_active_conns() as an argument
Subsequent patches will exit only connections belonging to the
specific target node. So add target to get_active_conns() as
an argument.

Change-Id: If0d9cad46614310e0fe17e69e75c1185146730f4
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450735
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-11 18:33:18 +00:00
Shuhei Matsumoto
13935275fb lib/iscsi: Add target to iscsi_conns_start_exit() as an argument
When target is specified, the function starts exiting any
connection that belongs to the target. When target is not
specified, the function starts exiting all connections.

Change-Id: I0dfb56ceac5ee36d10547a9ab9a0f768ca8e02ec
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450734
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-11 18:33:18 +00:00
Shuhei Matsumoto
170d18f0d4 lib/iscsi: Factor out the operation to start exiting connections
Factor out the operation to start exiting connections into a
function. This patch doesn't change any behavior.

Change-Id: I8f48961bcc95c480636e0e0d8fbb8ef029818d9e
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450733
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-11 18:33:18 +00:00
Shuhei Matsumoto
adbae38935 lib/iscsi: Set target node to the created session in create_iscsi_sess()
target had been set to the created session after returning from
create_iscsi_sess(). But create_iscsi_sess() has been used only in
a place and target has been already included in the arguments in
it. So set target to the created session in create_iscsi_sess().

Change-Id: Id65e6c5a1f76b995a7d0e9939ff3a2fce5daeb3f
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450732
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-11 18:33:18 +00:00
Shuhei Matsumoto
da98b92b92 lib/iscsi: Reduce critical region during target node shutdown
iSCSI mutex had guarded both unregister operation and destruct
operation in a single critical region in spdk_iscsi_shutdown_tgt_nodes
and spdk_iscsi_shutdown_tgt_node_by_name.

Subsequent patches will separate unregister operation and
destruct operation, and so this patch separates critical region of
unregister operation and destruct operation.

Change-Id: I847915f8277c4475c034ca64fd07ccdd47659590
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450583
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-11 18:33:18 +00:00
Shuhei Matsumoto
907ef2555f lib/iscsi: Delete SCSI device before deleting iSCSI target node
Subsequent patches will make iSCSI target possible to wait for
completion of SCSI device destruction by using callback.

This patch moves spdk_scsi_dev_destruct() before starting to
free iSCSI target node resource as a preparation.

Change-Id: I9cfe7662a05b1211292a5cc448bbba60a929f356
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450582
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-11 18:33:18 +00:00
Pawel Kaminski
29ca9d63b8 test/vhost: Remove ramdisk and vhost disk from targetcli if script fails
Fixes #694

Change-Id: I8c3a34923ece8e11f1f3fefc3e642a00dd83a735
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450022
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-11 18:23:43 +00:00
Darek Stojaczyk
d011196380 test/ocf: wait for spdk app to finish at the end
A termination signal was being sent, but we didn't
wait for the spdk app to actually exit. This was
actually causing an intermittent failure on our CI,
as the application could exit during our setup.sh
cleanup call, giving the following error:

```
Removing:    /dev/shm/iscsi_trace.pid284533
rm: cannot remove '/dev/shm/iscsi_trace.pid284533': No
such file or directory
```

Change-Id: Ic6ff0130b6264fa506c367d589853e5f3132c1d2
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450032
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-11 18:23:08 +00:00
yidong0635
4626e2b5a5 scripts: Add a package which was used in ISA-L module in pkgdep.sh.
It seems that need to add help2man in pkgdep.sh , it was used in ISA-L module.

Change-Id: I9d69e2cba270b1802c333941160ca714b85c21d2
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450562
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: Changpeng Liu <changpeng.liu@intel.com>
2019-04-11 07:03:57 +00:00
Changpeng Liu
58d923e6cc nvmf: add parameter check for Reservation Acquire command
Nvmecli tool doesn't add parameter check when submitting
to NVMf target, so we add additional check in NVMf target
to prevent such cases.

Change-Id: Ieb2b3b3c22d71913f2743a0f9cdad4aba184c320
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450574
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-11 01:13:59 +00:00
Changpeng Liu
7c331adfeb nvmf: update the subsystem poll group's reservation information correctly
Existing condition for updating subsystem poll group's reservation
information is wrong, when received the RELEASE command, the
reservation type may be changed to none, but it will not be
saved to the subsystem's poll group.

Change-Id: Idc177a0f03fb9611d6eda1e25a5b90caaa73d1be
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450727
Reviewed-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-11 01:13:59 +00:00
Ben Walker
d02950e6f5 nvme: Cache the cb_fn and cb_arg in the tracker
This avoids a data dependent load to find which
callback to call in the completion path.

Change-Id: Ifa20790a7af3332a74bc45037e589668744af797
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450558
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-04-10 21:29:03 +00:00
Ben Walker
f7d3dd9bd6 nvme: Eliminate tracker's active flag
The same information can be obtained by checking the req
field for NULL.

Change-Id: I9689ee0be33537fd6d3f35d8c3710fabab5e1928
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450557
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: Changpeng Liu <changpeng.liu@intel.com>
2019-04-10 21:29:03 +00:00
Karol Latecki
4b8405685a scripts/vhost: Modify parameters for vhost benchmark job.
Add missing parameter numjobs. It is used in one of the cases.
Remove unnecessary arguments:
- cpumask: we do not want to restrict that
- percentile list: we do not want to restrict that, all
  percentule buckets can be generated.

Change-Id: I6a4431af0defe92920f16d26091d67161e56dc5a
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450519
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-10 21:05:43 +00:00
Xiaodong Liu
9baab97fab jsonrpc.md: document NBD RPC methods
Change-Id: Ia4ea6986c2282b3a56ec48ca4f9b0ad05e95e7f1
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450578
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-10 20:49:11 +00:00
Shuhei Matsumoto
5f51f0aff6 bdev/raid: Add callback parameters to remove_base_devices()
This is a preparation to add completion callback to the
destroy_raid_bdev RPC.

Newly added callback parameters are passed to spdk_bdev_unregister()
in the end. This patch adds just parameters and the next patch will
utilize them.

Change-Id: Ic239c55872c0c69f3d1625eaccdb91a32a9d4d30
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450572
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-04-10 20:41:57 +00:00
Shuhei Matsumoto
b2dd6e7ec2 bdev/raid: Consolidate error paths in rpc_destroy/construct_raid_bdev()
This is a preparation to add completion callback to the
destroy_raid_bdev RPC.

Change-Id: Ib58b7e6d8531c84ab5e4fce7a838e409e77a0de5
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450571
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-10 19:38:10 +00:00
Shuhei Matsumoto
8c969cf018 bdev/raid: Consolidate spdk_io_device_unregister() calls in destruction paths
This is a preparation to add completion callback to the
destroy_raid_bdev RPC.

spdk_io_device_unregister should be called after spdk_bdev_unregister
because IO channel should be terminated after all open descriptors
are closed. This patch follows the practices of other bdev modules.

Change-Id: I6003edf0a6f6b2b235bf66f4b81bb0c2b855ae14
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450570
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-10 19:38:10 +00:00
Shuhei Matsumoto
9d30b0d346 bdev/raid: Call deconfigure() once at the end of remove_base_devices()
This is a preparation to add completion callback to the
destroy_raid_bdev RPC.

Move the call raid_bdev_deconfigure() to the end of the function.
This will make us to add the callback to raid_bdev_deconfigure()
and remove_base_devices().

Change-Id: Ic8ce847068f5a3682003707c87c364ed4b68e587
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450569
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-10 19:38:10 +00:00
Shuhei Matsumoto
ca34df9807 bdev/raid: Get base bdevs from its raid bdev simply in remove_base_devices()
This is a preparation to add completion callback to the
destroy_raid_bdev RPC.

Getting raid bdev from its config and processing base bdevs by using
it throughout is much more natural.

Checking if base bdev is active can be done by checking if the pointer
to the base bdev in base_bdev_info is not NULL.

Change-Id: Idd43b13eb342d9cd21ba55943bdcd1f564b3760e
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450568
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-04-10 19:38:10 +00:00
Pawel Wodkowski
2cccea55ed rpc/notifications: add notification support to RPC client and SPDK host.
Two new RPC calls get_notification_types and get_notifications added.

Change-Id: Ia5288d83cc5e9f18ef1622d3f15b9fe3bbf640ed
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436530
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@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-04-09 23:01:52 +00:00
Shuhei Matsumoto
0839680db3 bdev/raid: Factor out removing base bdevs into a function
This is a preparation to add completion callback to the
destroy_raid_bdev RPC.

This patch doesn't change any behavior. This patch just factors out
code into a function and move it to raid_bdev.c.

Change-Id: Ia86741ec686ffd85e4d826caf4442292963922ec
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450567
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-04-09 18:20:40 +00:00
Shuhei Matsumoto
e1c9791225 bdev/raid: Factor out finding raid bdev from base bdev into a function
This patch tries to clarify the logic of the operation to
deconfigure the corresponding raid bdev when a base bdev
is removed.

Change-Id: Id601049dfa59cd919321d833c2867f40c3ba031b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450566
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-04-09 18:20:40 +00:00
Shuhei Matsumoto
00b13a7207 bdev/raid: Change raid_bdev_free_base_bdev_resource() from public to private
raid_bdev_free_base_bdev_resource() has been referenced only in
bdev_raid.c.

Change-Id: I4be9ed5b7a93b950b16e57323cdf1f4bdf89841f
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450565
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-09 18:20:40 +00:00
Shuhei Matsumoto
596d7a0fb6 bdev/raid: Change raid_bdev_cleanup() from public to private
raid_bdev_cleanup() has been used only in raid_bdev.c.

Change-Id: I4dcc4979eda2fd872fda23e3433b120ab6aaaad2
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450564
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-04-09 18:20:40 +00:00
Shuhei Matsumoto
1ba9859353 bdev/raid: Change the prefix of names of lists from g_spdk_ to g_
Configuration lists in RAID bdev are unlikely to be exposed outside
of the RAID bdev module. Hence simply the prefix g_ will be enough
to clarify they are global data structure in RAID bdev module.

Change-Id: I9df88db8fa651d5af7d771d88ff04bb5997079c9
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450563
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-04-09 18:20:40 +00:00