Commit Graph

9818 Commits

Author SHA1 Message Date
Shuhei Matsumoto
22cd4fe2ce nvmf: Check buffer array overflow in spdk_nvmf_request_get_buffers()
This patch makes multi SGL case possible to call spdk_nvmf_request_get_buffers()
per WR.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I977ebb0c6b2a67218c9b6fc20dc26a93a6ec770b
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468943
Tested-by: SPDK CI Jenkins <sys_sgci@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>
Reviewed-by: Seth Howell <seth.howell@intel.com>
2019-09-26 16:12:28 +00:00
Shuhei Matsumoto
79945ef0ed nvmf: Hold number of allocated buffers in struct spdk_nvmf_request
This patch makes multi SGL case possible to call spdk_nvmf_request_get_buffers()
per WR.

This patch has an unrelated fix to clear req->iovcnt in
reset_nvmf_rdma_request() in UT. We can do the fix in a separate patch
but include it in this patch because it is very small.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If6e5af0505fb199c95ef5d0522b579242a7cef29
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468942
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-09-26 16:12:28 +00:00
Shuhei Matsumoto
410455e40b nvmf/rdma: Reorder allocation of WRs and buffers in multi SGL case
This patch matches the ordering of single SGL case and multi SGL
case for parsing SGL.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iea026b48e8957e140b71db7afaf8aca88634dc33
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468941
Tested-by: SPDK CI Jenkins <sys_sgci@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>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-09-26 16:12:28 +00:00
Shuhei Matsumoto
5e298147b8 nvmf/rdma: Remove duplicated zeroing req->iovcnt
spdk_nvmf_request_get_buffers() doesn't access req->iovcnt and so
zeroing req->iovcnt before calling spdk_nvmf_request_get_buffers()
can be removed.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8c18bd7e6eaa7c89361bec9293dc4ff4057098a0
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469200
Tested-by: SPDK CI Jenkins <sys_sgci@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>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-09-26 16:12:28 +00:00
Shuhei Matsumoto
f0c212614a nvmf/rdma: Fix req->length was not cleared when nvmf_rdma_fill_buffers() fails
In nvmf_rdma_requst_fill_iovs_multi_sgl(), length of descriptors
are accumulated into req->length. However, req->length was not cleared
when nvmf_rdma_fill_buffers() fails in the middle. This patch fixes it.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I80a55d90d09c8af46d570e017d342afd69f41996
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469199
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: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-09-26 16:12:28 +00:00
Shuhei Matsumoto
d409da0c84 nvmf/rdma: Fix wrong clear of WR SGL when rdma_fill_buffers() fails
wr->num_sge has to be used in spdk_nvmf_rdma_request_fill_iovs(),
and memset() can be used instead of clearing each variable.

Besides, holding cached pointer to the current WR simplifies the
code a little and so is done together in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iebda158f85e3a0e3046686f76991217fa7297c24
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469198
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
2019-09-26 16:12:28 +00:00
Jim Harris
2d224c0d60 nvmf: simplify spdk_nvmf_subsystem_remove_ns
With this change we only check the subsystem state once.
Previously it did it twice, and with a different order
(once PAUSED || INACTIVE, the other INACTIVE || PAUSED).

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469285
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-09-26 15:23:04 +00:00
Jim Harris
dc6c3e08fb examples/sock: make hello_sock leverage net subsystem
hello_sock was taking responsibility for initializing
the net framework by calling spdk_net_framework_init
directly.  But since this application is already
using the spdk app framework, it's much easier to
just link in the event_net and net libraries which
will activate the "net" subsystem automatically.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466953
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-09-26 15:22:21 +00:00
Jim Harris
e8ecfe1711 examples/sock: remove default conf filename from hello_sock
This is not used anywhere.  If someone has a reason to specify
something via a config file in the future, they can use the
standard spdk_app command line arguments to do so.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466952
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-09-26 15:22:21 +00:00
Seth Howell
a01c6178d7 test/nvmf: test the new nvmf RPCs.
The example application doesn't really make use of these RPCs for the
time being, so add a simple test to make sure they get exercised.

Change-Id: I8ae4c7b769428b76200f71c771ae98f85ede4640
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468523
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-09-26 15:21:44 +00:00
Seth Howell
3ed64fa9c2 nvmf: fix name comparisons for nvmf_tgt objs
The previous version of this function precluded one target name from
being a leading substring of another. i.e. if "nvmf_tgt_1" was already
used as a name "nvmf_tgt_11" could not be used subsequently.

Just an odd quirk that shouldn't be the case.

Change-Id: Iea59b6757512f01070e48074e35a11d942e399bb
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468522
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>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-09-26 15:21:44 +00:00
Seth Howell
208e089a21 lib/nvmf: add the nvmf_get_targets rpc.
Also update the changelog for the previous few changes.

Change-Id: I79ac330b4992ccc3e41fd1643b09128c6de6c86d
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468391
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-09-26 15:21:44 +00:00
Seth Howell
b7fce0a3d4 nvmf/rpc: remove the target rpcs from rpc.py
Since the in tree applications don't really support these RPCs, keep
them out of rpc.py. We can add them in after the applications have been
modified to support that functionality.

Change-Id: I7aae2c623b6da48374fe53f8b9471b08e5f0af7a
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469324
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-09-26 15:21:44 +00:00
Pawel Kaminski
6b6dfea6c7 rpc: Rename get_spdk_version to spdk_get_version
Change-Id: I4695c79760d176907ee1424babdc506f75ac17cf
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468903
Tested-by: SPDK CI Jenkins <sys_sgci@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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-09-26 15:20:46 +00:00
Pawel Kaminski
3402bfbd7c rpc: Rename kill_instance to spdk_kill_instance
Change-Id: Iebd24cc1be4665f179975f6fc14e0d4c3849d506
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468901
Tested-by: SPDK CI Jenkins <sys_sgci@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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-09-26 15:20:46 +00:00
Maciej Wawryk
0772af4de9 RPC: rename get_nvmf_transports to nvmf_get_transports
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I088070d130f46113efe4f89baae2508060ef33b3
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469114
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-09-26 15:19:43 +00:00
Maciej Wawryk
93d6b7bef4 RPC: rename set_nvmf_target_config to nvmf_set_config
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Id928d48283224ea30760d2cbfcf5b2a3452b3add
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469113
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-09-26 15:19:43 +00:00
Maciej Wawryk
a1a8585c5c RPC: rename set_nvmf_target_max_subsystems to nvmf_set_max_subsystems
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I318070b843dddfaa79cf37f1a5d0356fee38e81c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469112
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-09-26 15:19:43 +00:00
Pawel Kaminski
16a47c39be test: Shellcheck - remove rule SC2195 from exception list.
This rule doesn't appear in scripts.

SC2195: This pattern will never match the case statement's word.
        Double check them.

Change-Id: Ie3cabd58639ca733b750fdbc3ae3d476f083b792
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469187
Reviewed-by: Karol Latecki <karol.latecki@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-09-26 15:18:54 +00:00
Pawel Kaminski
9a7c72e819 test: Shellcheck - apply rule SC2192.
SC2192: This array element has no value.
        Remove spaces after = or use "" for empty string.

Change-Id: I5228df2ac292786a3a62aa06ffb6cd31b7d3b6c4
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467861
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@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-09-26 15:18:54 +00:00
Pawel Kaminski
cbce06fb92 test: Shellcheck - apply rule SC2199
Arrays implicitly concatenate in [[ ]].
Use a loop (or explicit * instead of @).

Change-Id: Ib3ac2c65207dfc30aad6117cc4996cdc105f5079
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467858
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-09-26 15:18:54 +00:00
Karol Latecki
9ee2e35865 test/nvme: ignore ssh known_hosts when connecting to hotplug VM
Completely ignore known_hosts file in case there's already an
entry for localhost in ~/.ssh/known_hosts.

If the entry is already in place ssh will create a warning:
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
and exit code will be non-zero, thus terminating the test.

Change-Id: I2cc830f5e1242df68726b9e48ab4cbe4dceed5ed
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469236
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-09-25 21:50:26 +00:00
Alexey Marchuk
94bb0d5456 rdma: add tests for spdk_nvmf_rdma_get_optimal_poll_group
Change-Id: I79997c84288fdef9f9389bf87396bce03edc4726
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/+/468994
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-09-25 21:08:15 +00:00
Alexey Marchuk
73e87ed244 rdma: Add balanced connection scheduling
The current connection scheduling mechanism (RoundRobin) doesn't take into account the qpair type and assigns each new qpair to the next poll group. As a side effect there might occur a disbalance when some poll group handles more IO qpairs than others. In RDMA transport it is possible to get the qpair type before the controller creation using a private data from the rdma_cm event, this allows to schedule admin and IO qpairs in the balanced way.

Change-Id: I90c368a41c4cd0f5347a83cab7511e4494f05b29
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/+/468993
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-09-25 21:08:15 +00:00
Alexey Marchuk
645d5944f2 rdma: Store poll groups in RDMA transport.
Operations with poll groups list must be protected by rtransport->lock.
Make rtranposrt->lock recursive to avoid unnecessary mutex operations when
the poll group is being destroyed within spdk_nvmf_rdma_poll_group_create

Change-Id: If0856429c10ad3bfcc9942da613796cc86d68d8d
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/+/468992
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-09-25 21:08:15 +00:00
Mateusz Kozlowski
44cf09c33b sock/posix: Remove potential usage of uninitialized variable
Fixed valgrind issue found when running unit tests.

Fixes issue #969

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: I50ffa478e16487121c6c3148b15e15162506187b
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469132
Reviewed-by: Maciej Szwed <maciej.szwed@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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-09-25 15:08:16 +00:00
Shuhei Matsumoto
34a0d851f6 nvmf/tcp: Return DIF error to initiator instead of severe disconnection
On a DIF verification error, fail the read command with a status code
of APPLICATION_TAG_CHECK_ERROR, GUARD_CHECK_ERROR, or
REFERENCE_TAG_CHECK_ERROR and a status code type of SCT_MEDIA_ERROR.

The state of the request is TCP_REQUEST_STATE_TRANSFERRING_CONTROLLER_TO_HOST
when a DIF verification error is detected. So dequeue the request
from C2H data queue, return the response PDU, and then send the command
response.

This was an item on the TODO list. RDMA transport do this right
behavior from the start and so TCP transport follows it by this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I102bbd253cc8c1379d0937c9536bf2bfe04cbf6a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468911
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-09-24 17:04:28 +00:00
Shuhei Matsumoto
ddd97a8b3b nvmf/tcp: Move setting orig_length to the location the value is fixed at
tcp_req->orig_length had been set just before I/O submission but
the value is already fixed in spdk_nvmf_tcp_req_parse_sgl().
Hence move setting tcp_req->orig_length accordingly.

This follows the good practice of RDMA transport.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I99f6e266d8f7027bce810864314f3ee24a1af10c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468910
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-09-24 17:04:28 +00:00
Richael Zhuang
a41fb6e65a util: optimize base64 with Arm NEON
Algorithm and some code from: https://github.com/aklomp/base64

Get ~2.3x speedup for encoding and ~1.7x speedup for decoding on
AArch64.

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Change-Id: Ifce07299aea722337b0b4886117d1f616c5c03ef
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465733
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-09-24 17:03:36 +00:00
Pawel Kaminski
6635453ee6 rpc: Add alias for rpc_get_methods and fix documentation
Change-Id: I244e40c49c25b4a3346c36b75a658b7fbe25faa1
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468488
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-09-24 16:59:49 +00:00
Karol Latecki
8bc67f2db3 test/json_config: kill spdk target outside of "if" instruction
In case there is an error while killing the process we won't
be able to fail the test, because non-zero return codes
are not respected by set -e option if they originate from
inside "if" instruction".

Change-Id: I2da2a00df52ae3530152a514cf86036079d61430
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466412
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-09-24 16:58:53 +00:00
Maciej Wawryk
19baaa9a0e RPC: rename delete_nvmf_subsystem to nvmf_delete_subsystem
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I4654f254cae78b0def789b13754af7c70c73dabb
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469111
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-09-24 16:42:41 +00:00
Maciej Wawryk
7538af7034 RPC: rename nvmf_subsystem_create to nvmf_create_subsystem
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ic3aa9f168b2e612e461c450ef1e5e1ae81fa5635
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468963
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-09-24 16:42:41 +00:00
Maciej Wawryk
80a0c5be99 RPC: rename get_nvmf_subsystems to nvmf_get_subsystems
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ief52fefa547535b23f2a191b1dbc9b9659893c09
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468955
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-09-24 16:42:41 +00:00
Maciej Wawryk
8e052bf41b RPC: rename set_bdev_options to bdev_set_options
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I02cd87c9e13db6f237db15ccb15c19a63ad4568d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468948
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-09-24 16:42:41 +00:00
Maciej Wawryk
85ab05d32b RPC: rename get_notifications to notify_get_notifications
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ie050a22d31903414496e536ca97aeed3db5d2b22
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468936
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-09-24 16:42:41 +00:00
Maciej Wawryk
c7174d9e07 RPC: rename get_notification_types to notify_get_types
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I564678a0cff1cf63b2287713b163138bfb17d9ac
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468934
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-09-24 16:42:41 +00:00
Maciej Wawryk
416310d543 RPC: rename get_log_flags to log_get_flags
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ic960543ca82c02b677e0059367ee1e63c4ca8611
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468731
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-09-24 16:42:41 +00:00
Pawel Kaminski
a25f9bf94a rpc: Rename delete_secret_from_iscsi_auth_group to iscsi_auth_group_remove_secret
Change-Id: I914c930914931f1356cd1ae9fb6a8eb4ff6a85b1
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468487
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-09-24 16:40:47 +00:00
Pawel Kaminski
61f4433c20 rpc: Rename get_iscsi_global_params to iscsi_get_options
Change-Id: Id0567077dc01c5c259a239c3faa99bdde9e89ae3
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468096
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-09-24 16:40:26 +00:00
Pawel Kaminski
7eedb271a7 rpc: Rename delete_initiator_group to iscsi_delete_initiator_group
Change-Id: I4ab2ee03699456ecf7d75e8b4259ca83d4e51750
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467225
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-09-24 16:40:01 +00:00
Pawel Kaminski
94dd4b9a40 rpc: Rename add_initiator_group to iscsi_create_initiator_group
Change-Id: I5ea7daff795340818251aeac2cc21b4b8a7457c6
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467222
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-09-24 16:40:01 +00:00
Wojciech Malikowski
2b16dcc740 lib/bdev: Added spdk_bdev_zone_management()
spdk_bdev_zone_management() allows to perform
management action on a zone. Zone is specified
by start logical block address. Available zone
actions: open, close, reset and finish.

Change-Id: Ie7eaed3e2cc7b9b49dd51ee2d6c28b4ef2f23eb9
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460647
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.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-09-24 16:39:27 +00:00
Wojciech Malikowski
02cabd9eb8 lib/bdev: Added spdk_bdev_get_zone_info() command
spdk_bdev_get_zone_info() is used for retriving
information about zones inside zoned namespace.

Change-Id: I8f931505245e984c0b1ee35ed6592c978ee47544
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460643
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-09-24 16:39:27 +00:00
Wojciech Malikowski
ec63516af5 lib/bdev: Move some bdev.c static functions to internal header
Some internal bdev.c static function will be shared
with new zoned bdev module.

Change-Id: Ifbb8bf443f67b2daf97858b15d474ecce98a9efb
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469100
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: Maciej Szwed <maciej.szwed@intel.com>
2019-09-24 16:39:27 +00:00
Wojciech Malikowski
aa35048d15 lib/bdev: Zoned bdev public header
Added new public header for zoned bdev. Zoned bdev is an
extension of the bdev interface. Generic concept comes
from ATA/SCSI and is also being worked as an NVMe TP.

Zoned device logical blocks space is divided into fixed-sized
zones. Each zone is described by its start logical block address
and capacity. Writes to a single zone need to be sequential.
After zone is fully written it need to be reset to write to it
again. Such writing schema could be very beneficial in terms of
write amplification factor for NAND based devices.
SPDK Flash Translation Layer library will be consuming this
interface in the future.

Extending SPDK bdev interface will allow to use existing bdev
infrastructure for this new type of devices.

Zoned device have several properties defined in spdk_bdev
structure:
 - zone_size: default size of each zone
 - max_open_zone: maximum number of open zones
 - optimal_open_zones: optimal number of open zones to get
		       best performance on writes

Single zone properties are defined in spdk_bdev_zone_info
structure:
 - start_lba: first logical block of z zone
 - write_pointer: logical block address in the zone at
		  which next write shall occur.
 - capacity: maximum number of logical blocks that may
	     be written in the zone when zone is empty.
 - state: zone state

Several zone states are defined: Empty, Open, Full, Closed,
Read Only and Offline.

To change zone state zone actions are defined: Close, Finish,
Open and Reset.

Change-Id: I5fcc22d548c15743329344cae96f5ff73e268504
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460642
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: Maciej Szwed <maciej.szwed@intel.com>
2019-09-24 16:39:27 +00:00
Wojciech Malikowski
9b3ae37f33 lib/bdev: Added spdk_bdev_is_zoned() to bdev interface
This patch is entry point for extending bdev
interface to support devices with zoned namespace
semantics.

spdk_bdev_is_zoned() will allow user to check if
bdev is zoned bdev.

Change-Id: Id9ea9898d406d1d942bf3081b00ebcb574ac2b5e
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460641
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: Maciej Szwed <maciej.szwed@intel.com>
2019-09-24 16:39:27 +00:00
Seth Howell
099489b207 lib/nvmf: Add nvmf_destroy_target rpc
Change-Id: I048793d32dcd19a5723dedec96fade9e7a889e3b
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468390
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-09-24 16:35:42 +00:00
Seth Howell
c9b89ef128 lib/nvmf: nvmf_create_target rpc
used for creating a new spdk_nvmf_tgt structure in the application.

Change-Id: Ib0182ea6d935b84b4fe4fcad79e173cb46859669
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468387
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-09-24 16:35:42 +00:00
Seth Howell
a52cb577b7 lib/nvmf: add helper functions for future RPCs.
Functions added in this patch:
spdk_nvmf_tgt_get_name - get human readable name from target.
spdk_nvmf_get_first_tgt - start iterating over global list of targets
spdk_nvmf_get_next_tgt - get next target in iteration

These functions will facilitate the following RPC

nvmf_get_targets - get the names of all active NVMe-oF targets.

In this series, I will also add two more RPCs, nvmf_create_target, and
nvmf_destroy_target, as wrappers around the create and destroy
functions. Since all of these changes are pretty minor and closely
related, I will just do one big changelog entry at the end.

Change-Id: Ia9f1248fbf9726fa3889998a169211fb25e724f2
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468386
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@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>
2019-09-24 16:35:42 +00:00