Commit Graph

8867 Commits

Author SHA1 Message Date
Wojciech Malikowski
4a3d5418c5 lib/vmd: Replace spdk_vmd_probe(bdf) with spdk_vmd_init()
spdk_vmd_init() will attach all VMD devices that were
unbinded from system. There is not need to specify VMD
bdf in VMD public interface since it can be controlled
by setup.sh script.

Change-Id: Ifc45c32dc7e11b59429a41ddfdd596db30e27731
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456631
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-11 04:35:31 +00:00
Wojciech Malikowski
fa64709373 examples/vmd: VMD device usage example
This example enumarates NVMe disks behind VMD.

Change-Id: I2e38aa3b3b73db1cc3b3bc79128071800cbf5fa9
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Signed-off-by: Orden Smith <orden.e.smith@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455829
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-11 04:35:31 +00:00
JinYu
8fc9ac7b0e nvmf: complete all I/Os before changing sgroup to PAUSED
For the nvme device, I/Os are completed asynchronously. So we
need to check the outstanding I/Os before putting IO channel
when we hot remove the device. We should be sure that all the
I/Os have been completed when we change the sgroup->state to
PAUSED, so that we can update the subsystem.

Fix #615 #755

Change-Id: I0f727a7bd0734fa9be1193e1f574892ab3e68b55
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452038
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-11 01:51:56 +00:00
Darek Stojaczyk
17e0283db1 configure: use the external rte_vhost lib by default
It is supported with DPDK 19.05+, so `configure` will now
automatically fall back to the internal rte_vhost copy if
the external one is not available.

Change-Id: I83746154f07a907d361a7511478112082710174f
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456190
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>
2019-06-11 01:14:45 +00:00
Darek Stojaczyk
4fcec18d38 vhost: don't interrupt uninitialized virtqueues
rte_vhost_vring_call() from upstream DPDK can read some
unitialized memory and crash if it's called on invalid
queue ids. The implementation in our internal rte_vhost
fork ends up wiritng to a random descriptor number, which
doesn't cause any crashes but is a bug nevertheless.

To fix it, just check if the queue is initialized before
interrupting it during the session start. It's not a hot
I/O path and there's no performance impact.

Change-Id: I830c1be98ef00d4ece9a6bd88cf79b9dfe29d2a9
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457247
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-11 01:14:45 +00:00
Darek Stojaczyk
9c8937cfd8 test/json_config: disable vhost-nvme tests
We're about to make SPDK vhost work against the upstream
rte_vhost from DPDK 19.05+ and vhost-nvme tests currently
stay in the way. vhost-nvme is only supported in our
modified rte_vhost fork and while it could be implemented
entirely in SPDK against the latest upstream rte_vhost
APIs, there are just no plans to do that now.

For that reason we disable all vhost-nvme tests.

Change-Id: I2d43bbe75dcab7535e7b1254ca75cb78b6d446fa
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456960
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>
2019-06-11 01:14:45 +00:00
Chunyang Hui
dd26583316 Opal: Add opal_create_key function
Change-Id: Id1705636e25fe3ad90ff60a57aca7b1e4c2ef687
Signed-off-by: Chunyang Hui <chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453972
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>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-06-11 01:12:24 +00:00
Chunyang Hui
9f988238fc Opal: Refactor and clean functions
Delete opal_next, introduce opal_add_tokens.
Delete spdk_opal_cmd, seperate cmds to new APIs.

Change-Id: Ide56817eec7fde7b110818966ebf10e65a952fc9
Signed-off-by: Chunyang Hui <chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454433
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-06-11 01:12:24 +00:00
yidong0635
4913ed4dc5 bdev: add uring in bdev Makefile
We had "./configure --with-uring" , but actually, it wasn't compiled.
we need add uring to Makefile that code will add this.
then we can continue to verify this module.

Change-Id: I8b98825f6795eb9f9e7b4947d1c7c3a44a6f0f64
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457081
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-06-11 00:26:48 +00:00
Shuhei Matsumoto
3cfb1fe8dd iscsi: Schedule the connection only after completing login processing
Previously the connection was scheduled to another core just
after setting conn->full_feature to 1, but conn->state was still
ISCSI_CONN_STATE_INVALID. The connection started to run on another
core but could not run normally until conn->state became
ISCSI_CONN_STATE_RUNNING. conn->state was changed late to
ISCSI_CONN_STATE_RUNNING after sending the first login reponse.

This gap window had caused intermittent critical failures.

Based on this analysis, this patch changes to call
spdk_iscsi_conn_schedule() just after sending the final login response.
Whether any login response is final or not can be known by checking
conn->full_feature is not zero.

    Fixes #785

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8ea55fef27e2f332fcd789d32daf479a24c0588d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457414
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-06-10 09:43:09 +00:00
Konrad Sztyber
fc3e1b6fb0 bdevperf: target bdev selection
Allow the user to select target bdev to be used by bdevperf. It's useful
when the config contains multiple bdevs, but only one is supposed to be
utilized by bdevperf directly.

Change-Id: I51aa645dcf60a4413057d86f68fe24442b280367
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456787
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-10 04:15:10 +00:00
Konrad Sztyber
5012fcc148 bdevperf: update target list in bdevperf_construct_target
The target list is now updated inside bdevperf_construct_target. That
way, if the target is successfully created, it'll already be on the
target list once this function finishes.

Change-Id: I364c45005c28deadae37615b6ac85f3860fc5080
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457089
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-10 04:15:10 +00:00
Karol Latecki
535654f826 scripts/rpc: add try-except around call_rpc_func
Missing try-except block around call_rpc_func().
If called function returned error there was an uncaught exception
which resulted in backtrace printed to screen.

Change-Id: Ifb37c29d70b93ef648a0503643a51cc1967ef8d0
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456956
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-08 11:16:07 +00:00
wanghonghui
77509767c0 bdev/uring: adjust to the latest io_uring API
Upstream liburing rename the io_uring_get_completion to
io_uring_peek_ceq

Signed-off-by: Honghui Wang <wanghonghui@ucloud.cn>
Change-Id: I8f207b7b1255b44304f4eca4101b939847767179
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456959
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-07 18:43:07 +00:00
Changpeng Liu
a8c32ed5fe blob: return error for write_zeroes and unmap requests
Actually write/writev/write_zeroes/unmap are never be called, and we add
the error code here to keep it same style with snapshot bs_bdev.

Change-Id: I32ad051c1902bd7080b894e36f7c89f1c8d27434
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456924
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-06-07 18:37:53 +00:00
yidong0635
fdb03395db nvmf_vhost: Check qemu before and in vhost/common.sh.
Normal return for qemu checking , this should check before vhost/common.sh.
For qemu not installed on this machine. It may be a VM. Skipping nvmf_vhost test.
Otherwise, code will exit 1 before this normal return.
And in vhost/common.sh should with qemu checking.

Change-Id: I2285fffa6fc4384b4b172e5c443019e9ab391fa0
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456123
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-06-07 18:35:12 +00:00
JinYu
2ec93bc316 unit/nvme: add wait for completion unit test
Add the completion and completion_timeout unit test.
Increase the code coverage of nvme.c

Change-Id: I89ff744955c83dc64a4678633a00c1bb166414d6
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455233
Reviewed-by: Changpeng Liu <changpeng.liu@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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-07 18:31:47 +00:00
Liang Yan
985169456b doc/vpp: update vpp document and configuration
Update the configure and doc for VPP.

Change-Id: I922c02de108abd4bd4ac0c853b49080e449539cd
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453758
Tested-by: SPDK CI Jenkins <sys_sgci@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>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-06-07 18:27:53 +00:00
Mateusz Kozlowski
42fe2e9b24 lib/ftl: Add config to construct_ftl rpc for dirty shutdown restore
Gives the ability to change behavior of restore after dirty shutdown
without recompiling ftl library. User can define if partial recovery
or error should be returned after such a scenario.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: I6dda40df7b92d6a377957e4a70a3eab91a6ac4a9
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456185
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2019-06-07 18:26:57 +00:00
Mateusz Kozlowski
a9ce7b8551 lib/ftl: Add ability to ignore endmeta errors on restore
If a band wasn't closed during shutdown (ie. after dirty shutdown),
the start md contains valid data, however end md does not (or it may
not be written at all).
The config gives the user the ability to specify if encountering
this case should result in an error, or if ftl should pad the band
with data and recover from closed bands only.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: If02f7ca8bc90bb61698fb710fee2274af6af01e4
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455513
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-07 18:26:57 +00:00
Mateusz Kozlowski
9939830608 lib/ftl: Add padding when open band is found on restore
If an open band is found during recovery (after dirty shutdown)
ftl will attempt to pad it, instead of returning a recovery error.
Any previously written data on that band is lost, as the line is
treated as being in free state after the pad.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: Ie48fa9fa37a3853f41921b9417c69301cf47e673
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455512
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-06-07 18:26:57 +00:00
Mateusz Kozlowski
4214803c16 lib/ftl: Add public get chunk info admin command
The patch also changes, so the command calculates the needed
chunk offset based on PPA, instead of relying on the user to
provide one.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: Ic4eec1b86ded4eb71de860015403294ed0c8c266
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455973
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2019-06-07 18:26:57 +00:00
Mateusz Kozlowski
baa06190d8 lib/ftl: Add direct wptr and IO
Direct wptr allows for writing to band with externally
provided PPA, rather than one assigned by the wptr. This
can be useful when padding open bands during recovery or
bdev creation, as ftl can find partially written end meta
with no way to close the band with valid data, that would
conform to an already written CRC value.

This does mean that I/O sender is responsible for calculating
and obeying per-chunk write pointer arithmetics.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: Ifcbc4e8ffb69c829469a571bed8e27b148d7a651
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455511
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-07 18:26:57 +00:00
Mateusz Kozlowski
e49ae312b1 lib/ftl: Add ftl_io argument to internal I/O callbacks
Almost all I/O callbacks in ftl utilize data in ftl_io, which is
initialized as callback argument in ftl_io_init_internal. This patch
changes the behavior to always returning the ftl_io struct in addition
to an extra opaque buffer.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: I611ab1b33575f599798a2bb65c231a724c852c7f
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455831
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-07 18:26:57 +00:00
Vitaliy Mysak
5875bb0e3b test/ocf: disable norandommap flag
disable FIO norandommap flag because it is incompatible with
  verify which in context of async IO could cause verification errors.
More on norandommap:
  https://fio.readthedocs.io/en/latest/fio_doc.html#cmdoption-arg-norandommap

Change-Id: I94392495a1f9f06360e3791fca31b88908d19dcb
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457001
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-07 18:18:42 +00:00
Vitaliy Mysak
7b7590f838 ocf: Improve handling of partial IOs
Improve handling of partial IOs for case when iovcnt == 1.
This case is pretty frqeuent because all data allocated by OCF
  have iovcnt == 1 (see ctx->data->alloc() or vbdev_ocf_ctx_data_alloc())

Change-Id: I8d38ca9e9d2bd3e6ce298bf788ce6ed782b56594
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456202
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: Ben Walker <benjamin.walker@intel.com>
2019-06-07 18:18:42 +00:00
Vitaliy Mysak
2bfa860dfe ocf: fix offset check
This patch fixes submission of partial IOs in bottom adapter

Existing check (if offset > 0) was not sufficient to detect partial IOs
  because there could be an IO with offset = 0 but length < total size of iovs.
This patch changes the check, but also free operation on completion
  because now the old free does not cover all situations when we allocate iovs.

`Partial IOs` are the IOs handled by bottom adapter
  which specify only part of the internal iovs vector.
So their length is less that the length of internal iovs vector.
They exist because sometimes parts of single IO from top adapter
  need to be sent to different locations.
Also, in general, IOs initiated by OCF (such as cleaner IOs) are represented
  as single big iov that is submitted by parts in form of 'Partial IOs'.

Change-Id: I8ae47659fb34904c593a696d74d683a418ac9962
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455821
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: Ben Walker <benjamin.walker@intel.com>
2019-06-07 18:18:42 +00:00
Vitaliy Mysak
e0edd0a205 test/ocf: add persistent metadata tests
We check if get_ocf_bdevs after shutdown is the same as before,
  which shows that state for all vbdevs wes correctly restored from metadata.

Change-Id: I9089642aeb840fc940b07908aa39c8193887432f
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455424
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-07 18:18:42 +00:00
Vitaliy Mysak
1e0e0ea1fc ocf: RPC add WriteBack to allowed cache modes
Make construct_ocf_bdev call accept 'wb'
  as allowed cache mode.
Previusly user could only create OCF bdevs
  in WriteThrough or PassThrough modes.

Change-Id: Ic2e1c8d2905cb51fc13c080aa7b7a4dfd7d9387f
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455628
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-06-07 18:18:42 +00:00
Vitaliy Mysak
9686948334 ocf: implement metadata probe
Implement metadata probe functionality to load cache state
  from disk.
During metadata probe, we inspect UUIDs of core devices
  and create vbdev configurations based on them.
  Then, to start vbdev, we use load path (loadq = true).

After this change persistent metadata is officially supported,
  we can save and restore cache state from persistant storage.

WriteBack mode is now safe to use in respect to unexpected shutdowns,
  because all information about dirty data is also restored during cache load.

Change-Id: I6cf86aabd68177b88638a68ea6a5b78a1068a4d0
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455417
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-07 18:18:42 +00:00
Vitaliy Mysak
73224f880e test/ocf: enable serialize_overlap flag for FIO
Set serialize_overlap=1 to prevent data races.
This solves the issue of fio --verify fails in OCF tests
  when persistent metadata is enabled.
  Example:
     https://dqtibwqq6s6ux.cloudfront.net/public_build/autotest-per-patch_33325.html

The serialize_overlap flag prevents from
  creating undefined regions by doing simultaneus writes
  (occurs on certain storages).
  More on that:
     https://fio.readthedocs.io/en/latest/fio_doc.html#cmdoption-arg-serialize-overlap

We should probably use this flag for all FIO --verify tests.

Change-Id: Ia4f73f9900835faf4f94018f1d148fb64f06dc8a
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456991
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-07 18:18:42 +00:00
Vitaliy Mysak
5983f92cfc ocf: Update ocf submodule to version OCF v19.3.2
This patch updates submodule and appropriate functions.
Cleaner poller is now registered only when needed.

Change-Id: Ic4ca7ce6f77b71ac12c19462f62ae7cd96c59006
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455408
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-06-07 18:18:42 +00:00
Shuhei Matsumoto
1c21756a1e dif: Fix wrong block size info to test dif_generate_stream.
Data block size was specified by mistake, and this patch changes
to use block size instead.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Icfb1df40438ef82211279b0b7c79036283744361
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456292
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>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-06-07 05:11:00 +00:00
Shuhei Matsumoto
3894a7bc68 dif: Rename parameters of dif_generate_stream to match related APIs
using data_offset and data_len is consistent with related APIs,
and is done in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic9d216e25880f7b5ab33b764f45d332c090fa88c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456291
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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-06-07 05:11:00 +00:00
Shuhei Matsumoto
6d156d5b7d iscsi: Dump PDU contents to know what PDU was sent in illegal state
In some test cases, unknown iSCSI PDU other than the login request
has been sent to the iSCSI target when the iSCSI target is not in
runnable state, and it has caused failure in iSCSI target.

To know what PDU was received by the iSCSI target, this patch changes
the iSCSI taget to collect dump of the PDU.

SPDK has already the SPDK_LOGDUMP macro but the SPDK_ERRLOGDUMP macro
will be appropriate in this use case and added. Then the SPDK_ERRLOGDUMP
is used in iSCSI library.

We can decode PDU and output any format easy to read by human, but
creating good format is not easy task and error prone. So this patch
uses simple dump.

Dump outputs like:

PDU
00000000  40 80 00 00 00 00 00 00  00 00 00 00 00 00 00 00  @...............
00000010  0b 06 00 10 ff ff ff ff  00 00 00 5a 00 00 00 03  ...........Z....
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3ed2fca7fec24ccff17b89ba749a58c397b72c13
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456952
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-06-07 05:11:00 +00:00
Changpeng Liu
cf680fe47e vhost_blk: set the maximum supported data segment based on bdev
AIO backend requires aligned data buffers, and the maximum
IOVs supported in bdev module is defined to 32, there are
cases for Windows Guest which will send data segments more
than 32, SPDK can't process such cases, so here we can set
the 'seg_max' parameter based on bdev module capability.
Also set the maximum segment size for those requests.

Fix issue #625.

Change-Id: I0ff61e55872af17115c0b6b28425e70cb8769790
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452378
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-06-07 05:05:22 +00:00
Changpeng Liu
69db40f677 bdev/raid: add additional NULL check for data iovec
iSCSI application may set the data iovec to NULL for READ requests.

Change-Id: Ic6b73f62f75dc2d927c18219fa1c2cb242f0528e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457079
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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-07 05:05:22 +00:00
Wojciech Malikowski
95ace66f8d lib/ftl: Remove ftl_md struct from band
Keep lba map related fields in separate struct directly
in the band. Cleanup interfaces depended on ftl_md.

Lba map structure will be extended in next commit.

Change-Id: I1cfc2f2ff0c0e90bb63f39808780845673002e70
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453370
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-07 04:39:14 +00:00
Konrad Sztyber
d87493378d env: added spdk_mempool_obj_iter
As the name suggests, this function iterates through all elements of the
mempool invoking a callback function on each one. It's particularly
useful when deinitializing mempool that requires freeing resources tied
to each element (e.g. allocated through spdk_mempool_create_ctor).

Change-Id: I3da1fee527a36bf99f0b0e2dd3d6f9297422ff25
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455971
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-07 04:39:14 +00:00
Konrad Sztyber
819545ae7e lib/ftl: split IOs based on the number of iovecs
Split the IO in case io->iov_cnt exceeds the FTL_IO_MAX_IOVEC. It allows
the user to pass any number of iovecs. Each IO request is now split if
necessary and submitted via ftl_io_call_foreach_child submitting each
child individually. Any resubmissions need to be handled on a child
level, as parent request doesn't track its children submission status.

Change-Id: If54249d54225b34191216a366c227f79215abc90
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455527
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-06 18:07:41 +00:00
Konrad Sztyber
8f9aed50c2 lib/ftl: added ftl_io_call_foreach_child
As the name suggests, the function calls a function passed as the
argument for all children IOs.

Change-Id: Idd7b6013e68fdd188db6e682bb9ba9ec2e6f52f1
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455526
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-06 18:07:41 +00:00
Wojciech Malikowski
2646670781 lib/ftl: Added assert checks to ftl_band_set_state()
Change-Id: I142ea5be2e5d03b29dc17896fe590a1af798b11f
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451873
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2019-06-06 11:54:24 +00:00
Wojciech Malikowski
fcd2364c6a lib/ftl: Metadata read/write interfaces refactor
Extended ftl_band_read_lba_map() interface to provide
range of lba map to read.

Added ftl_xfer_offset_from_ppa() function for
calculating offset of read portion of lba map
based on ppa address from IO. This offset is
used for coping read lba map portion  to internal
ftl buffer.

Change-Id: I1c72a18c79eda8c33cd0b20ea36a5d9521a09d06
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449435
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-06 07:26:35 +00:00
Darek Stojaczyk
0dd5f32ebe doc/compression: fix diagrams
They were not interpreted as "code" blocks and looked
really broken on spdk.io. Fix it by explicitly wrapping
them with code tags (```).

Change-Id: Ia880f67124dda6f8c0cb24d7e2e138d9f297958f
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456299
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@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-06-06 05:35:25 +00:00
Tomasz Zawadzki
9fda9814b7 test/asan: move LSAN_OPTIONS to autotest_common.sh
Further patches in series will modify the suppression file,
so this patch now creates such file in /var/tmp/.
Meanwhile adding the known false positive to the list.

Any known false positives or leaks in external libs/execs
should be added by adding further entries to the suppression
file.

Change-Id: I7b78d900a86c6eca0b41240fb34dc4f7ad597079
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456622
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-06-06 05:17:16 +00:00
Tomasz Zawadzki
37b5912545 fio_plugin: fix io completion queue leak in nvme plugin
fio_thread->iocq allocated on line 403 was leaked when
fio finished its run.

Change-Id: I740dcaa1e0037283d099ddf4bc125cec57cfdbcc
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456623
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-06-06 05:17:16 +00:00
Tomasz Zawadzki
3b9db6c403 test/fio: export single variable for running fio_plugins
This patch adds functions in autotest_common.sh,
fio_bdev() and fio_nvme() for their respective plugins.
It simplifies its usage throughout the scripts.

Additionally will help with expanding the fio cmd
line with nessecary changes only in single place.

This will be used in next patch in series to
LD_PRELOAD ASAN before fio_plugin.

Note: Did not implement changes for perf scripts,
since they are usualy run separately and didn't want
to affect those.
Similarly didn't change vhost initiator tests,
because the exported directories do not work for
inside the VM. Will need to think of a way to change it
there as well.

Change-Id: Idf750ee7aa9d5e30efc0ce430d15fa45ceccb203
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456314
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-06 05:17:16 +00:00
Shuhei Matsumoto
2761079168 iscsi: Remove SPDK_SUCCESS and use 0 instead
SPDK_SUCCESS is a remnant and all other SPDK libraries have used
just 0. So this patch removes SPDK_SUCCESS from iSCSI library and
uses 0 instead.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie33fd26238411e994ea9ea0c898da1abb502cad6
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456928
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-06-06 02:08:15 +00:00
Shuhei Matsumoto
872d8d8ea7 iscsi: correct data digest computation for extended LBA payload
This patch uses the newly added API spdk_dif_update_crc32c() when
DIF insert/strip is enabled.

Change-Id: Icf32a0ddef6cf92b0887b38495457e7fcac30987
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456172
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-06-06 02:08:15 +00:00
Shuhei Matsumoto
a7d832f28c iscsi: Correct iovec increment when data digest is enabled
iscsi_sgl_append_with_md had not increment _iscsi_sgl::iov
by appended count of iovecs. Hence if data digest is enabled,
data segment will be overwritten by data digest.

This patch fixes the bug.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibcdacb883b2b97ad86cfc39a035c76264090401d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456451
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-06-06 02:08:15 +00:00