Commit Graph

10699 Commits

Author SHA1 Message Date
Kozlowski Mateusz
28d901c8d7 lib/thread: Update spdk_thread_send_msg description
Documentation mentions that the message may be processed asynchronously.
However, it's always handled that way - updated description to match the
behavior.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Change-Id: Ia284f18fa7ebbc0d4c1b9352572ffdc0260a4e84
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478592
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>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
2019-12-24 08:12:58 +00:00
dongx.yi
cb7da325bb lib/nvmf: Remove unnecessary return.
It's not wrong, just to keep consistency with other functions.
So remove these.

Signed-off-by: dongx.yi <dongx.yi@intel.com>
Change-Id: I833211ea8ee6c6b02c874ea340a3f936a0c4c00f
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478684
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-12-24 08:12:40 +00:00
Seth Howell
a27a377ac4 nvmf/rdma: make disconnect qp from cm event safe.
The call to update_ibv_state could result in a segfault if the other
thread had already freed the qp and was just spinning on handling the
rdma event. By not updating the qpair state here, I don't think that we
lose any information about the qpair state. Especiallyy since just a
little bit later we update the qpair state to be in error.
There is nothing in the man pages about the cm events changing the ib
state although I imagine they are closely related. I just say that
because I believe that's why the update was originally in that spot.

fixes: GitHub issue #1110

Change-Id: I3f87ff009bc2019464ed7c6920dd71e2b286b3fd
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477877
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-12-24 08:00:04 +00:00
Richael Zhuang
64bf0a6e8f test/env: fail to build mem_callbacks.c on non-x86
When building spdk on arm64 with --enable-werror, there are error:
"implicit declaration of function ‘rte_eal_init’ ". For X86,
mem_callbacks.c's dependency header file rte_rwlock.h includes
rte_spinlock.h(rte_spinlock.h->rte_lcore.h->rte_eal.h), but for
arm64 and ppc rte_spinlock.h isn't included. So I include ret_eal.h
explicitly here.

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Change-Id: If8859f5272aeb220dc448a312cb0d1c65e149742
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478570
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-23 08:44:22 +00:00
Jim Harris
506246b6f6 nvme: define SPDK_NVME_NQN_FIELD_SIZE
An NQN can only be a maximum of 223 bytes, but the
field containing the NQN in all of the NVMe data
structures is 256.  Specify that #define so it can
be used in data structures that need it.

Upcoming muser transport will also use this to
facilitate nqn handling.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478496
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-12-23 08:44:10 +00:00
dongx.yi
fe7f865315 perf: Unify the unit name of IOPS.
There's one left has not been changed.
That's be ignored ever.
Change IO/s to IOPS.

Signed-off-by: dongx.yi <dongx.yi@intel.com>
Change-Id: I1555cc02644b238e8d4fece31f932a480c20121d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478399
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-12-23 08:43:53 +00:00
Konrad Sztyber
926ea79ab8 bdev/ocssd: fixed leaking range buffer
The char* buffer storing parallel unit range was never freed in
bdev_ocssd_create RPC call.

Change-Id: Ic24f09c441fa8edba432425c9e2d969cacec8518
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478612
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-12-23 08:43:34 +00:00
Konrad Sztyber
6db4a00c58 bdev/nvme: depopulate namespaces in module_fini callback
Currently the namespaces are depopulated in two cases: if the controller
is detached (either due to its hot unplug or RPC call) or due to
"namespace attribute changed" asynchronous event.  It means that during
shutdown, when nvme_bdev_ctrlr is destroyed, the namespaces aren't
depopulated.

For regular NVMe namespaces it isn't a big issue, since their only
depopulate task is to unregister bdevs created on that namespace, which
is already done by the bdev layer.  However, it can be a problem for
other types of namespaces (e.g. Open Channel), as they might allocate
their own context in nvme_bdev_ns.type_ctx, which, unless the namespace
is depopulated, cannot be freed.

Change-Id: I91c7f2a50b206b45eb5bdcada278d6454c4cf144
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478190
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-23 08:43:34 +00:00
Tomasz Zawadzki
5e0fa7e9c2 dpdk: update submodule to DPDK 19.11
Change-Id: Iff16216150859f2401d59aae106f50dfb665f991
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478030
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-23 08:42:33 +00:00
Ziye Yang
8d51277046 nvmf/tcp: remove the unnecessary error info.
It will be the expected behavior when the error message will
printed if we use asynchrounous I/O. And the real
error message for not getting the tcp_req is located in
spdk_nvmf_tcp_capsule_cmd_hdr_handle.

Change-Id: I1a608fbd3a04050eacb6cb68eafd50e5128925ab
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477872
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-12-23 08:42:11 +00:00
Evgeniy Kochetov
e749c115c6 nvme/rdma: Fix error return code in nvme_rdma_register_rsps
nvme_rdma_register_rsps returned ENOMEM for all failure cases. All of
them are not directly related to shortage of memory. Every point of
failure now sets relevant return code.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ia340f6c6fd3a68d8c34acfefc2c9224ffcdcad3f
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477302
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
2019-12-23 08:41:48 +00:00
Evgeniy Kochetov
731dca3d77 nvme/rdma: Add work requests batching to NVMe RDMA initiator
RDMA work requests generated between two calls to NVMe RDMA QP
processing function are chained into a list and then posted together
to a queue in next call to processing function.

Batching improves performance in scenarios with deep queues and heavy
load on CPU. But it may cause latency increase on smaller
loads. Batching is configurable with RPC methods and configuration file.

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I600bce78427eb7e8ed819bbbe523ad318e2da32b
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462585
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: 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-12-23 08:41:48 +00:00
Ben Walker
3d06a83fa4 nvme/rdma: Increase timeout when waiting for CM_EVENTS
In some real data center deployments, 100ms is not enough. Increase
the timeout to 1 second.

Change-Id: I8195a1c1e987b7eff2d8541509f79381be32ed4b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478638
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-12-23 08:41:29 +00:00
dongx.yi
0edc874f85 test/nvme: fix wrong exit commands.
Issue reports:
	return: can only `return' from a function or sourced script.
Use "exit 1" instead, and ignore changes to json.power_on_time.hours.

Issue link: https://github.com/spdk/spdk/issues/1111
This is to fix issue #1111

Signed-off-by: dongx.yi <dongx.yi@intel.com>
Change-Id: I90198e8237cb587fbeb7777f6b2da783fd15ba04
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478014
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-12-20 10:07:39 +00:00
Vitaliy Mysak
dda7375177 vhost: set supported features based on backend
In vhost-blk, choose supported features based on what
 backend bdev supports instead of disabling not supported features.
This will prevent from enabling not supported feature in runtime.

Change-Id: Ie9453c7c02eb6d0a0ff0f1887048f4092cb7b14f
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476617
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-12-20 10:07:16 +00:00
Vitaliy Mysak
5ffe337846 vhost: change features initialization for vhost-blk
Replace usage of rte_vhost_driver_enable_features() by
 setting disabled_features field dynamically.

This patch doesn't change functionality, but simplifies
 initialization and removes usage of socket operation.
Call to drive_enable_features() had to be done when
 features field was static, but now it is mutable so
 the call became redundant.

Change-Id: I6efc63883773e4ba6d931efd057a38a705c53217
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476616
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
2019-12-20 10:07:16 +00:00
Vitaliy Mysak
576dba8835 vhost: move feature fields from backend to vdev structure
This will enable us to make features dynamic, dependent on underlying
backend device, and to remove usage of rte_vhost functions in
vhost-blk implementation which will improve encapsulation
and enable us to write tests that use vhost-blk functions directly.

Dynamic features are used in vhost_blk, but backend structure is
assumed to be static, so we had to call
rte_vhost_driver_enable_features() after registering it with
some features initially disabled.
This patch moves feature fields to vdev structure where it
can be set dynamically.

Change-Id: Icd76bdd76a3d67ec74e0ac992d8da639beead593
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470460
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
2019-12-20 10:07:16 +00:00
Seth Howell
26a02f72e8 bdev/crypto: remove asserts around vtophys calls
The IOVA is only needed by the QAT PMD. In order to allow the other PMDs
to support the alignment requirements of the underlying bdev, we need to
remove the asserts that assume a specific alignment for buffers.

Change-Id: Id659cd833cf827d42c400e577afe140a0af26233
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478375
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: Paul Luse <paul.e.luse@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-12-20 10:06:47 +00:00
Seth Howell
1384ad007c module/bdev: add zcopy abilities to virtual bdevs.
These bdevs claim native support for zcopy operations. They should
actually support them when running on top of a bdev that claims zcopy
support.

For example, if you were to build a part or passthru bdev on top of a
malloc_bdev (which is just for testing primarily) and then try to run
bdevperf on top of that, you will currently get errors. This patch fixes
that problem.

Change-Id: I023557a3a5b1baf177cc29f1cbc1cd391cc67a8a
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478243
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-12-20 10:06:47 +00:00
Changpeng Liu
912ad8e3aa nvme: use macro defintion instead of magic number for queue priority setting
Change-Id: I7f37478a459db1652a12262a29ca95d88ede1045
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478261
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-12-20 10:06:22 +00:00
Changpeng Liu
3f2660d73f nvme: add queue priority mask and maximum arbitration burst macro defintion
Change-Id: I864fed43fa1519d5bdd07222313a3ba148fab6b2
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478260
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-20 10:06:22 +00:00
Changpeng Liu
d7b9a14c8d example/nvme: use the union cdw11 structure for arbitration feature bits
Change-Id: I7a28c9f649c26ba8f7c8e166fa1196842a2a3b86
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478259
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-20 10:06:22 +00:00
Shuhei Matsumoto
46e52a0bcb test/common: Set invalid value to CPU core API stubs
This change verifies that all existing unit tests don't care about
CPU core configuration.  The subsequent patches will mock CPU
core operations.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I44cc56908cf8609870625ff19d6100e21036c00f
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478152
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-12-20 10:05:38 +00:00
Shuhei Matsumoto
b2927bedea ut/event: Add unit test for reactor.c
Add framework and a simple test case to test creating reactor.
Subsequent patches will add more test cases.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie0eb0e49bfe40469b351b21e40558a1bf5584cce
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478151
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-12-20 10:05:38 +00:00
Shuhei Matsumoto
ae4360f050 lib/event: Allocate cpumask statically for reactor
struct spdk_cpuset has been declared in the header file and
so we can allocate struct spdk_cpuset statically.  This change will
avoid potential out of memory failure for reactor too.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic5f4fdb493d73b4ae11cddd2638eeb84ebbb792e
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478150
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-12-20 10:05:38 +00:00
Shuhei Matsumoto
2597480328 lib/event: Remove checking return code of spdk_thread_poll in _spdk_reactor_run
spdk_thread_poll returns only non-negative value now, and the return
code check is not reasonable now.  For just in case we may want to add
assert(rc >= 0) but compiler gives warning because rc is not used anywhere.
So just remove checking return code check here.

We noticed first that spdk_thread_destroy was called without spdk_thread
exit but this change removes spdk_thread_destroy.  So the issue is also
fixed together.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4e7f5c09faf5eda68ea8d42320dbefdca88bbd21
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478237
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-12-20 10:05:38 +00:00
Changpeng Liu
ff9516bdcc nvme: call the callback for the queued requests when there is submission failure
For the requests which don't have children requests, SPDK may queue them to
the queued_req list due to limited resources, in the completion path, we
may resubmit them to the controller.  When the controller was removed
the submission path will return -ENXIO and we will free the requests directly,
so the callback will not be trigerred for these requests.  Here we added a
flag to indicate the request is from queued_req list or not, so for the failure
submission, we can triger user's callback.

Fix issue #1097

Change-Id: I901ac81733c2319e540d24baf5b8faa1c649eb35
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477754
Community-CI: SPDK CI Jenkins <sys_sgci@intel.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>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
2019-12-20 10:04:57 +00:00
Changpeng Liu
10cd9e86b9 UT/nvme: use STUB macro for the empty function APIs
Change-Id: Id037a0cdc1e054dad0454e0897b04629b78e7d50
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478018
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.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-12-20 10:04:57 +00:00
Jin Yu
e9a7831110 vhost: update virtion_config.h and virtio_ring.h
Update the virtio_config.h to kernel version 5.0.
It supports more virtio flags which may be used in future
for example packed ring. Also it changed the
VIRTIO_TRANSPORT_F_END value 34 to 38.

Add the virtio_ring.h which will be used in packed ring
support.

Change-Id: If3fba1db400865eb8e09f6d2aa992b3893b65719
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477562
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-12-20 10:04:27 +00:00
Jin Yu
1c53379bdf nvmf_example: initlize the bdev layer
Change-Id: I92f6c03f944ef51b2a325b64055861d8376e5134
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475414
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-12-20 10:03:34 +00:00
JinYu
ebad2567ac nvmf_example: initlize the thread layer
Change-Id: Ic00e7f5b557b657f18b0b510987c682363be1da8
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468656
Reviewed-by: GangCao <gang.cao@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-12-20 10:03:34 +00:00
JinYu
b9793e6809 nvmf_example: add an nvmf example
use the nvmf lib to add an nvmf example which
doesn't use the spdk app framework. It can show
how to use the nvmf lib to build your own nvmf target.

We encouage you to use the RPC cmds so this example will
not supply the configuration file. You can read the
README.md to get the steps how to build your nvmf target
and test the IO status.

Change-Id: I8d175934f7364d40fb44d36e85c31d8ea5063654
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468457
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
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: GangCao <gang.cao@intel.com>
2019-12-20 10:03:34 +00:00
Shuhei Matsumoto
83bcd693b0 lib/iscsi: Assert if PDU ref count goes negative
Error log had been collected if PDU ref count went negative. However,
error log is not easy to notice.  SPDK iSCSI target is more stable
than before and SPDK iSCSI task has such assert.  Hence replace
error log by assert for PDU.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I28c4f5e29f0dfd72436b0131e09f9707822165fc
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477630
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-12-20 10:03:00 +00:00
Shuhei Matsumoto
f29c728980 lib/iscsi: Move iscsi_conn_abort_queued_datain_task() from iscsi.c to conn.c
Followin the last patch, move iscsi_conn_abort_queued_datain_task()
and iscsi_conn_abort_queued_datain_tasks() from iscsi.c to conn.c.

Refine unit tests to check more accurately. Adding more test cases
will be done later.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I30530e6871a78a58d9fb472f62168862298884a0
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477417
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-12-20 10:03:00 +00:00
Konrad Sztyber
ff001eb93f lib/thread: account for busy work for unregistered active pollers
Treat active pollers similarly to timed ones and don't discard
unregistered poller's rc.  This patch is basically a copy of 7d3d2b62e
but for active pollers.

Change-Id: Ia85e73a6736b2924601150f8e61995eb56009c15
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477252
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-20 10:02:15 +00:00
Konrad Sztyber
01f356ab70 bdev/ocssd: pause / resume pending_poller
Pause and resume pending_poller instead of registering it each time a
request needs to be dealyed.  This should improve performance for
workloads during which the poller is constantly paused / resumed.

Change-Id: I951bf0a3e4bf7e0fda2d485958f2f40ff47bf8d6
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477921
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>
2019-12-20 10:02:15 +00:00
Konrad Sztyber
9ec598d115 lib/thread: poller pause / resume
Added spdk_poller_(pause|resume) that allow a poller to be paused and
then resumed at a later point.  These functions come in handy in cases
when a poller is known to be idle until a certain event occurs.

Change-Id: I7f21c80eb9ac4e8e1cf24d66f99da5687aafe358
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477920
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-12-20 10:02:15 +00:00
Konrad Sztyber
f4576dec88 bdev/ocssd: media management events
This patch adds the logic for retrieving chunk notification log and
translating it into media management events to be sent to appropriate
Open Channel bdev.

Change-Id: I7e4860eda23e61d6208fc5f5861e8fd2b75685d3
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471461
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-12-20 10:02:15 +00:00
Konrad Sztyber
a69f90ddd8 lib/bdev: media management events
Media management event was introduced.  It's sent out to notify that
some portion of the data needs to be rewritten (e.g. due to data
refresh, wear leveling, high error rate, etc.).  This type of
notification is only utilized by devices exposing raw access to the
physical medium (e.g. Open Channel SSDs).

Change-Id: Ia30faa5866d71fd597009b441f69c609de974161
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471460
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-12-20 10:02:15 +00:00
Konrad Sztyber
64fe514efa bdev/ocssd: parallel unit ranges
This patch adds the ability to create bdevs on specified parallel unit
ranges on one OCSSD controller.  It allows the user to create multiple
isolated bdevs, each operating on a separate set of parallel units.

To create a bdev on a specified range, a new parameter -r|--range was
added. For example:
 rpc.py bdev_ocssd_create -c nvme0 -b nvme0n1 -r 0-4

will create a bdev on parallel units 0 through 4 (inclusive).  If the
parameter is ommited, the bdev will span across all available units.

Change-Id: Icd94cf1e22fcc72806ef1ce1efd2d7031010009f
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469898
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>
2019-12-20 10:02:15 +00:00
Alexey Marchuk
d23f3a85f7 nvme/pcie: Refactor nvme_pcie_qpair_submit_request
Use a lookup table with function pointers to build
the request depending on the payload type and SGL support.
This change helps to remove several if/else branches

Change-Id: I506e4290efc218be68fc8cfda4835b242a99aa77
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478191
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-12-20 08:56:23 +00:00
Alexey Marchuk
71159819b0 nvme/pcie: Don't use contig SGL commands for admin qpair
Command with cns SPDK_NVME_IDENTIFY_ACTIVE_NS_LIST is issued during
controller initialization and if the controller supports SGL,
this command will be built as a contig SGL. This leads
to a failed completion with the following status:
INVALID FIELD (00/02) sqid:0 cid:95 cdw0:0 sqhd:0004 p:1 m:0 dnr:0
The first identify command SPDK_NVME_IDENTIFY_CTRLR passed since
it was built as a PRP command - we didn't know that the controller
supported SGL at that time. Fix - do not build SGL requests
for admin qpair

Change-Id: I72ab7fe33c03e60ea9f20a9c8afd7c79c40843aa
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478320
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-12-20 08:56:23 +00:00
Ziye Yang
0e3dbd9a60 nvme/tcp: Add a timeout for construct connection.
Purpose: To avoid the hang if there is no response
from the target.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: Ib68a9e4c1a28436af2b2ae65891de04067e3dc7d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477121
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-12-19 11:06:23 +00:00
Seth Howell
d0ff231e36 lib/reduce: move _alloc_zero_buf earlier in init stage.
In the reduce_dev_destroy case, we were not calling
alloc_zero_buf in the load path because of a built in short circuit.
This resulted in us decrementing the g_vol_count variable past 0 in
cases where we were destroying a reduce volume that we had already
freed. This resulted in us failing to allocate the g_zero_buf the next
time we loaded a reduce volume.

Change-Id: I429cbac1454bdcda502038af659d5302627ecab2
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478127
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-12-19 11:04:57 +00:00
Seth Howell
d4e15650aa lib/reduce: make the zero_buf a fixed size.
Instead of arbitrarily selecting the chunk size of the first device we
attach, we should make it an arbitrarily large value that can fit larger
chunks.

Change-Id: I4e8b54cbae62607e352402025ca3dae01ebfbb51
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478126
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-12-19 11:04:57 +00:00
Seth Howell
4328a67ea7 lib/reduce: add array bounds checking for iovs.
We also need to make sure that the deconm_iov is large enough to handle
all of the iovs we claim to support plus 2, one for offset into the
chunk when doing writes and one for the remainder.
Plus a unittest to demonstrate the possible out of bounds error in the
library.

Change-Id: I7747ad39f76e50f25ecf5168b01e046f71fa0ea8
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478125
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-12-19 11:04:57 +00:00
dongx.yi
c3fe5e4adc bdevperf: Unify the units with perf.
Other tools have already changed these units to IOPS and MiB.

Unify the units, that makes the result comparing more clear
with bdevperf and perf.

Signed-off-by: dongx.yi <dongx.yi@intel.com>
Change-Id: Iedc47f5757839e1abbcbaf5d97179c90ab130773
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478280
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
2019-12-19 11:04:39 +00:00
Jim Harris
7d3d2b62e8 lib/thread: account for busy work for unregistered timers
When a timed poller unregisters itself during execution,
we were continuing the loop without updating the timer_rc.
This would result in spdk_thread_poll() indicating that
the poll execution was idle rather than busy.

Note that the DEBUG print would have still been OK where it
was, since the poller variable itself was valid, even though
it had been freed.  But it looked a bit awkward there, so I
moved it right after we capture timer_rc.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478120
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-12-18 10:09:45 +00:00
Jim Harris
1d94a0b0e1 ut/bdev: fix histogram buffer parameters
These buffers weren't actually used, but "buf" is an array,
so we should just pass buf, not &buf.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478119
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-12-18 10:09:45 +00:00
Jim Harris
96abfe63ef bdev: simplify bdev_io_submit
Create a local variable for the spdk_bdev_channel
pointer.  This will be used again later in this patch
series.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477870
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-12-18 10:09:45 +00:00