Commit Graph

1597 Commits

Author SHA1 Message Date
Mateusz Kozlowski
7a867c4fdb lib/ftl: Pass ftl conf to write_config rpc function
Changed write_config to use the ftl configuration file instead of
allow_open_bands directly. This allows for easier expansion of saved
fields.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: Ie1d480983636f26840dba9a3a6c93b2883903bdb
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460519
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-24 18:21:07 +00:00
Mateusz Kozlowski
a4b3481242 lib/ftl: Remove buffer alignment requirements
Ftl should no longer require 4k alignment for I/O buffers for either
internal or external requests. The 4k alignment was needed due
to a bug in QEMU when handling internal SGL buffers in LNVM commands.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: Icafc14b7811c9c0ffa13789e341c453503cf2821
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460106
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@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-07-23 04:00:05 +00:00
yidong0635
c0d4f7145e crypto: Fix scanbuild issue on Fedora30.
Issue reports:
vbdev_crypto.c:695:12: warning: The left operand of '+' is a garbage value
                iv_ptr = rte_crypto_op_ctod_offset(crypto_ops[crypto_index], uint8_t *,

Change-Id: I1a4f89111e94a13d8daf38070aa69306783a83c5
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462576
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-07-23 00:38:27 +00:00
yidong0635
425b89a4ed compress: Fix scanbuild error about dereference of null pointer.
Issue reports:
vbdev_compress.c:468:34: warning: Dereference of null pointer
                 src_mbufs[iov_index]->userdata = reduce_cb_arg;
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
Add assert here is enough.

Change-Id: I8dccf107a89f7af46437a1f678adccf122beb4b2
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462592
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-23 00:17:25 +00:00
yidong0635
a1de2fe007 compress: Clear some simple scanbuild errors.
On Fedora30, GCC9+ reports errors:
Issues report:
vbdev_compress.c:482:17: warning: Assigned value is garbage or undefined
        comp_op->m_src = src_mbufs[0];
                       ^ ~~~~~~~~~~~~
vbdev_compress.c:502:17: warning: Assigned value is garbage or undefined
        comp_op->m_dst = dst_mbufs[0];
                       ^ ~~~~~~~~~~~~
vbdev_compress.c:491:3: warning: 1st function call argument is an uninitialized value
                rte_pktmbuf_attach_extbuf(dst_mbufs[iov_index],

compress_ut.c:826:2: warning: Attempt to free released memory
        free(g_mbuf_mp);
        ^~~~~~~~~~~~~~~
Should remove free(g_mbuf_mp), for pointer exchange.

Change-Id: I1a48b7c309a4e2aa0aa513f9be44ae3504d9e385
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462574
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-22 14:10:32 +00:00
Pawel Kaminski
de1d0f8fe9 jsonrpc: don't check returned value from spdk_jsonrpc_begin_result()
As spdk_jsonrpc_begin_result() is not allowed to return NULL we can
remove these checks. We didn't have any tests cases that goes this path
anyway.

Change-Id: I0894e76c0162591e550e70b172566b9060a6dd5f
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459199
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-22 05:13:30 +00:00
Tianyu Yang
96b759297f lib/bdev: fix coredump when bdev initialize failed.
If subsystem bdev module initialize failed, it will call
spdk_bdev_init_complete(-1) -> (subsystem bdev)->fini
_spdk_bdev_finish_unregister_bdevs_iter -> spdk_bdev_module_finish_iter

In abovt path, spdk_bdev_module_finish_iter will repeate to call
bdev_module->module_fini function. Some bdevs will call spdk_io_device_unregister
which never call spdk_io_device_register. It will coredump when assert false in
spdk_io_device_unregister dev is null.

To fix this, let's check whether g_bdev_mgr.module_init_complete is equals true
and then call the bdev_module->module_fini.

Change-Id: Ia9a13318720d954e40eb2d666574bcb86e5f49e3
Signed-off-by: Tianyu Yang <yangtianyu2@huawei.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462382
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@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-07-19 06:29:25 +00:00
Karol Latecki
ac8b488982 bdev/rbd: add more descriptive rpc error messages
Improve error messages where possible.
Modify spdk_bdev_rbd_create() to return instead instead
of pointer for better return code handling.

Change-Id: I5fcf90794f5fe44296422c654c5f8d404f3d5eef
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461884
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-07-19 02:21:53 +00:00
Karol Latecki
89003d5ca7 bdev/rpc: add more descriptive rpc error messages
Improve error messages where possible.

Change-Id: I6e5a50a1422f55aff0b0bad53493edc80f345ccb
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461600
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-07-18 07:52:07 +00:00
Karol Latecki
6d442665fd bdev/rpc: remove if checks for obligatory rpc arguments
These arguments are obligatory and spdk_json_decode_object will
fail even before we reach the if block.

Change-Id: I3c17faf570aefc7d96d009a595cf3a76994977e7
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462043
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-18 07:52:07 +00:00
Karol Latecki
46ebf1b1e9 bdev/virtio: add more descriptive rpc error messages
Improve error messages where possible.

Change-Id: I68b48fd448636412a2b26241c787e7b7826c9a34
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461873
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-07-18 05:34:52 +00:00
Karol Latecki
2805cad12f bdev/compress: add more descriptive rpc error messages
Improve error messages where possible.
Modify parts of the code so that it follows the same pattern
as in previousle changed bdev modules.

Change-Id: I6672a14900326029c670bfca99a6d085093861c3
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461553
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-07-18 04:25:44 +00:00
Karol Latecki
695ecf48bf bdev/delay: update rpc error messages
Consolidate rpc error handling with previous bdev rpc
changes.

Change-Id: I3f0ac3b3a0f09869e8ad7edb4bd4c8fd1e42f6b6
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461557
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-07-18 04:25:40 +00:00
Karol Latecki
b8c84b1a39 bdev/error: add more descriptive rpc error messages
Improve error messages where possible.

Change-Id: Ieaae6f2477d4a9f636cc861afbe5d80b3c74a46c
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461562
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: Vitaliy Mysak <vitaliy.mysak@intel.com>
2019-07-18 04:25:27 +00:00
Karol Latecki
955518d6fc bdev/iscsi: add more descriptive rpc error messages
Improve error messages where possible.

Change-Id: If08bad9f4fc88b51403b89c3f5bfc8894ef4300a
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461567
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-07-18 04:25:09 +00:00
Karol Latecki
c6f2b30918 bdev/raid: add more descriptive rpc error messages
Improve error messages where possible.
Unify returned error codes and messages with previous
changes done in other bdev modules.

Change-Id: Id35b61e8157fab9940e5811b71289978a6f23b05
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461591
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-07-18 04:24:45 +00:00
Karol Latecki
fd4d7fcb15 bdev/passthru: add more descriptive rpc error messages
Improve error messages where possible.

Change-Id: I778b4b49c1e54c0da77f6da7906df91d8aa95f9b
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461587
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-07-18 03:25:06 +00:00
Karol Latecki
c05355db23 bdev/lvol: add more descriptive rpc error messages
Improve error messages where possible.

Change-Id: I8f736fb6481d65b55e16e548fac0130cd152d3fa
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461575
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-07-18 03:24:26 +00:00
Karol Latecki
0965d63d3a bdev/lvol: remove optional flag for lvol_name in construct call
lvol_name is not an optional argument when creating a lvol bdev.
Also removing unnecessary if block.

Change-Id: I7d5790d648bce7f02bfed34bd714162d3ccb10ab
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461861
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-07-18 03:24:26 +00:00
Karol Latecki
75711828a9 bdev/lvol: remove if checks for obligatory rpc arguments
These arguments are obligatory and spdk_json_decode_object will
fail even before we reach the if block.

Change-Id: I295649629770ef062086308257da83a8bab44588
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461860
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-07-18 03:24:26 +00:00
Darek Stojaczyk
efef26e234 Revert "bdev: temporarily allow bdev descriptors to be closed from any thread"
Now that vhost closes bdev descriptors on the same thread
that opened them, we can reintroduce thread asserts into
the bdev layer.

This reverts commit 283abcb9a2.

Change-Id: I1acc455df0674b808ecf2fa58dffd183db6cf3c2
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459168
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-16 10:57:46 +00:00
Konrad Sztyber
78097953f7 lib/ftl: notify init/fini callbacks on proper threads
This patch makes sure we're on the thread that requested creation /
deletion of the device when calling the notification callback.

Change-Id: Ia11a8054692874f6b57d4ebe3e3cb290c58e83b6
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459618
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-07-12 12:39:38 +00:00
Vitaliy Mysak
6b654ab900 bdev: prevent early spdk_bdev_init_complete()
In case some module has `async_init = true` and
  some other module that comes after it fails to initialize,
  then callback from asynchronously initialized module
  may call `spdk_bdev_init_complete()` first, then failed module
  will call `spdk_bdev_init_complete()` later.
  This currently results in NULL dereference because
  first call to `spdk_bdev_init_complete()` sets `g_init_cb_fn = NULL`.

This change prevents first call to `spdk_bdev_init_complete()`
  by saying that failed module is not finished with initialization.

This patch fixes #847

Change-Id: Ib6b231d5ea27896ad88d7f11b8732921077b3d4d
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461230
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>
2019-07-12 04:14:58 +00:00
Shuhei Matsumoto
b860c8dbce bdev/gpt: call get buffer function before forwarding read I/O to the base bdev
iSCSI target does not allocate data buffer on read, and delegate
allocation to the bdev.

When the bdev is a split vbdev, the split vbdev does not allocate
data buffer and delegate allocation to the backend bdev.

In this case, iSCSI target expects the buffer is allocated until
notifying completion to the split vbdev. However, the split vbdev
notifies completion to the backend bdev when calling the callback
of iSCSI target. The backend bdev frees the buffer immediately,
but iSCSI target still uses the buffer. If the buffer is reused
by another I/O, data corruption will occur.

For this issue, vbdev_gpt_submti_request() calls
spdk_bdev_io_get_buf() when the I/O is read, and its callback
vbdev_gpt_get_buf_cb calls _vbdev_gpt_submit_request() then.

This will ensure the buffer is allocated before forwarding I/O
to the backed bdev.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifb2eac500276ab5012123b7d6f7eb033d87ad17c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461350
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-07-12 02:25:57 +00:00
Shuhei Matsumoto
25532d08f8 bdev/split: call get buffer function before forwarding read I/O to the base bdev
iSCSI target does not allocate data buffer on read, and delegate
allocation to the bdev.

When the bdev is a split vbdev, the split vbdev does not allocate
data buffer and delegate allocation to the backend bdev.

In this case, iSCSI target expects the buffer is allocated until
notifying completion to the split vbdev. However, the split vbdev
notifies completion to the backend bdev when calling the callback
of iSCSI target. The backend bdev frees the buffer immediately,
but iSCSI target still uses the buffer. If the buffer is reused
by another I/O, data corruption will occur.

For this issue, vbdev_split_submti_request() calls
spdk_bdev_io_get_buf() when the I/O is read, and its callback
vbdev_split_get_buf_cb calls _vbdev_split_submit_request() then.

This will ensure the buffer is allocated before forwarding I/O
to the backed bdev.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Icfd0663b548479ac0bf6b5b49420f144142e3300
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461348
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-07-12 02:25:57 +00:00
Shuhei Matsumoto
316d5c7c79 bdev/part: Remap DIF reference tag for read/write I/O
When using stacked virtual bdev (e.g. split virtual bdev), block
address space will be remapped during I/O processing and so
reference tag have to be remapped accordingly.

This patch adds an new helper function spdk_bdev_part_remap_dif
and call it before submitting write I/O or after completing read
I/O.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Idfc6081893861d412c19a9edfb348a7faa7e8c5b
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461106
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-11 11:14:22 +00:00
Shuhei Matsumoto
5a31186745 bdev/part: Consolidate getting remapped offset in spdk_bdev_part_submit_request
All IO types but reset have used the remapped offset to submit I/O
to the base bdev. Previously each IO type had got the remapped
offset by itself. Consolidating it into a place will improve
readability and will be helpful for the next patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I29465e92d8fb62e45cfc97c52fedaa661b2f0602
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461105
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-07-11 11:14:22 +00:00
Maciej Szwed
1b4c99a2ba bdev: Introduce new bdev mutex for accessing bdevs list
In future patch in new spdk_bdev_open_ext function we will call
spdk_bdev_get_by_name function and after that call and before
calling old spdk_bdev_open routine bdev can be removed.
We need to add mutex which will prevent that. Any future code
should use this mutex when accessing the bdevs list to get
a bdev and perform some operation on it.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I785a1791346aebdd394fc51ad0e7fbfbabf317c9
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458457
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-07-11 10:22:06 +00:00
Karol Latecki
a4b0a2b6fd bdev/crypto: add more descriptive rpc error messages
Improve error messages where possible

Change-Id: I2c75cea66dbd635d89e7f27aef59a38c5533b349
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460966
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
2019-07-10 08:29:21 +00:00
Karol Latecki
d9580c759e aio/rpc: Add more descriptive error messages for aio bdevs
Improve error messages where possible

Change-Id: I104998a666789c4e724d153c2cd14ee05c71b699
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460157
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-07-10 08:29:21 +00:00
Karol Latecki
c4a1c90a4c aio/rpc: make filename an obligatory argument
Filename should not be an optional argument.
Making it obligatory removes the need for further checks as it
should then be checked in json decode.

Change-Id: Ia779c2623db8d5cdde3983507e3b2b3cfb7e971f
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460958
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-07-10 08:29:21 +00:00
Karol Latecki
37c04b7be8 lib/bdev: do not allow bdev name to be an empty string
It looks like currently we only check bdev names for NULL, but
not for "empty" string.

For example this rpc command:
sudo scripts/rpc.py construct_aio_bdev aio_disk "" 512

Will result in construction of AIO bdev with empty name:
sudo scripts/rpc.py get_bdevs
[...]
    "name": "",
    "aliases": [],
[...]

Change-Id: I41204096c8cf210a4dc40a8225d1c9dad353f533
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460150
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
2019-07-10 08:29:21 +00:00
Karol Latecki
f155fedcdb null/rpc: Add more descriptive error messages for null bdevs
Improve error messages where possible.

Change-Id: I9d1e4dee106712ecd7a40cfd1eeaf74ccf6d0d1d
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460121
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-10 08:29:21 +00:00
Karol Latecki
5e28673bc5 bdev/rpc: Add descriptive error messages for malloc bdevs
Provide more error codes and/or messages then just a
generic "32602 invalid parameters" error.

Change-Id: I1777f454faef336b10af24dda50a2d5b5e73727f
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459948
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-10 08:29:21 +00:00
Ben Walker
75b4f332f4 bdev: All bdevs now have a UUID.
For devices that don't have a UUID, the UUID is generated at
registration time. That means that some devices will not have the same
UUID from run to run, but this seems no worse than having no UUID at
all.

Change-Id: Icf6b8517ffcffabafa2b73176dc03d896d0017fe
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459604
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-07-10 01:59:05 +00:00
yidong0635
16fdf46600 bdev: Fix warning about scanbuild error on fedora30.
In file included from bdev_ut.c:43:
/root/yidong/spdk/lib/bdev/bdev.c:4373:9: warning: Access to field 'bdev'
results in a dereference of a null pointer (loaded from variable 'desc')
        return desc->bdev;
               ^~~~~~~~~~

This is related to issue #822.

Change-Id: I8cd2bafadeff9846169bc9ca67b3c4110e9c0da8
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459529
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: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-07-09 00:38:22 +00:00
paul luse
06f6c90626 bdev/crypto: add IO queueing for out of mem condition via bdev layer
Also made on the prints a DEBUG message instead and noticed the really
name that was being registered by this component so updated it to
make it look like the rest of SPDK.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I747a846cb365e7db49be50db941e83fb1b265ea0
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460244
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-07-08 09:24:29 +00:00
Shuhei Matsumoto
457afd77b1 bdev/split: Fix orphan'ed config when removing the base bdev first
When we create a base bdev and then create a split vbdev on top of
the base bdev, if we delete the base bdev first, we have no way to
remove the configuration of the split vbdev. Hence even if we
create a base bdev again, we cannot create any split vbdev on top
of the base bdev again.

The meaning of flag, `removed` of `struct spdk_vbdev_split_config`
is not clear and there will be no issue even if the flag `removed`.

Hence remove the flag `removed` in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I053c95e647721004cecfe4fd8b0f1ff5bb9bf38a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460580
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-07-08 03:30:39 +00:00
Darek Stojaczyk
fcbbcf4905 bdev: cleanup child iov rewind code
When we run out of bdev_io's child iovs and we had
to round down I/O size to nearest block size boundary,
we used to decrease the existing child_iovcnt and
set a new "child_iov_run_out" flag to terminate the
uppermost splitting loop.

We can get rid of that new flag by just not decreasing
child_iovcnt when rewinding the last few iovs - it
will make the uppermost loop naturally terminate using
the existing checks.

Change-Id: Ie40c7ce135e7fb8fe284afdf7beeebd10af85cb7
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459911
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-07-05 12:11:46 +00:00
Hailiang Wang
5926236661 bdev/raid: fix a warning of freed memory
Compilation Warning on fedora30.
In file included from bdev_raid_ut.c:38:
spdk/lib/bdev/raid/bdev_raid.c:325:11: warning:
Use of memory after it is freed. raid_ch->base_channel[pd_idx],
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is related to issue #822.

Change-Id: I6432772fb38ca02bc4f0a02a36ed3fe61b8607c7
Signed-off-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460069
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-05 12:10:07 +00:00
Darek Stojaczyk
89021c6c6c nvme/rpc: switch to spdk_*malloc().
spdk_dma_*malloc() is about to be deprecated.

Change-Id: I6fd1106c2278c2ef8899c822e920252f62266547
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459550
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-07-05 03:48:51 +00:00
Shuhei Matsumoto
bcfb2b2b9c bdev/passthru: Pass-through metadata and DIF setting of base bdev
Allow I/O requests using metadata and DIF if base bdev supports them.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie1b4b301a3d72d3fbd6e459ee2ab7d1a85425162
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460394
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-07-04 09:23:07 +00:00
Mateusz Kozlowski
60c8845fd0 bdev/ftl: construct_ftl_bdev respects default ftl config
Changed initialization of the ftl lib when using an rpc call to
allow for usage of any default configuration parameters (currently
only allow_open_bands is exposed).

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: I73457dfcacc6b1adeffd13ecc6e98001749e00cf
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459741
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: 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-07-01 14:46:26 +00:00
Changpeng Liu
efd7b514d4 bdev: rewind child offset to last block size aligned iov
Here is the an example to describe existing issue:

There is a Write request with 64KiB data length, and this IO is cross the IO
boundary.  We assume that the parent IO will have 2 children requests, one is
33KiB length, the other one is 31KiB.  Here is the view of parent iovs, the
first 33KiB length data has 33 iovs:

iov.[0].iov_length = 1024;
.
.
iov.[31].iov_length = 256;
iov.[32].iov_length = 768;
.
.
iov.[64].iov_length = 1024;

In function _spdk_bdev_io_split(), then you can see that for the 33KiB length
child request, exiting code will run out of child child_iov space and return
error due to last one data buffer is not block size aligned.

Here we can rewind the existing offset to last block size aligned buffer to
avoid the error case, for backend which need aligned data buffer such as
AIO backend, the request will go through spdk_bdev_io_get_buf() again to
do the data copy, otherwise for those backend devices such as NVMe with
hardware SGL support, 256 data segment is fine for them.

Change-Id: I96ebdf29829d86f9b38fab28a7406eedc9fa44ef
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453604
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>
2019-07-01 04:20:21 +00:00
paul luse
bfda995be2 bdev/compress: add RPC to specify PMD
By default QAT will be selected if available however a new RPC
can be used to either auto-select (default) or specify either
ISAL or QAT.

Change-Id: I37cf7640bbd8cef455583e1eccb8adb59cc419d8
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456693
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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-26 07:57:09 +00:00
Changpeng Liu
5d718951a6 bdev: split requests first if the request has data buffer
There is one existing example usage case to describe the issue:
Users(e.g. Vhost-blk target with Windows Guest) call spdk_bdev_readv_blocks()
to submit a 128KiB length data READ request, and the data buffer
provides by vhost isn't aligned, but the backend block device
requires aligned data buffer, so existing function call trace:
spdk_bdev_readv_blocks()-->
    spdk_bdev_io_submit()-->
    spdk_bdev_io_get_buf()
spdk_bdev_io_get_buf() will allocate buffer from large data
buffer pool for 128KiB length, of course, it will return error
with existing logic.

So here, no matter what the data length is, we can go through
the split process first for both READ and WRITE.

However, there is one scenario that for iSCSI READ request,
the iSCSI layer will not allocate data buffer for the request,
so for this case if the IO boundary is required we should keep
the logic as before.

Change-Id: I67661f5fa4c3c7c561b45c86146759aa3477adbf
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453133
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>
2019-06-24 04:51:46 +00:00
paul luse
68fbb33b81 bdev/compress: add 2 recommended flags to the comp operation
Per docs.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I2b520ba9cce2e8914e5003095cdb0be61b417cb2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458836
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>
2019-06-21 08:20:01 +00:00
paul luse
8d2455caa3 bdev/compress: always use QAT if available
The next patch in this series introduces and RPC that makes the
selection more flexible.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I55617d3c37b51cf9474c358cb92f5218397c0c58
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457157
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>
2019-06-21 07:53:39 +00:00
paul luse
5d55704d66 bdev/compress: adjust vol parms
There were some TODO items in here that were incorrect if using
an underlying block device that had a 4K block size. The values
here will set the compress vol LBA size to match that of the
underlying lvol but the backing IO unit size, the min size that
reduce will use to perform backing device IO is set to 4K as
smaller than this makes little sense given chunk size is currently
at 16K.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ic6a9421a25d947ae7d4dce190d6599eec1d4a05a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458703
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>
2019-06-21 07:53:39 +00:00
paul luse
5cffa4a988 bdev/compress: check PMD shareable flag for transforms
Module only supports shareable transforms, also adjusted the number
to what we need, just 2.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ieb77b5f1221878ac7a4be5176ed459d5165f8430
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458698
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>
2019-06-21 07:53:39 +00:00
Konrad Sztyber
e2918289a1 lib/bdev: clear metadata when emulating write_zeroes
If bdev is configured to use separate buffers for metadata transfer,
but it doesn't support the write zeroes command, pass empty zeroed
buffer to make sure the metadata is cleared out as well.

Change-Id: If6f024266067e5764a28a276296f651d31da4792
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457628
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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-19 03:53:02 +00:00
Tomasz Zawadzki
5468acd898 bdev: directly use spdk_bdev_desc_get_bdev() where needed
The function spdk_bdev_desc_get_bdev() was added,
but remained unused. Couple places done the exact same thing,
so now they just use it directly.

Change-Id: I018f57b7b4bcfe22ec6a97cf5261b9a257ba93de
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456957
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>
2019-06-19 03:49:53 +00:00
Konrad Sztyber
6a75bb948e bdev/part: separate buffer metadata support
Allow requests using separate buffer for metadata IO if base bdev
supports it. Copy base bdev's metadata configuration (separate /
interleaved, size, DIF type and location).

Change-Id: I89996f89cad805e696cacf0bba486b4cc1f617e6
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458407
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>
2019-06-19 03:43:11 +00:00
Maciej Szwed
622127d7e1 blobstore: Make possible to remove snapshot if there is only one clone
Starting with this patch it is possible to remove a
snapshot if there is only a one clone created from it.

In such case snapshot can be removed without any data
copying. This is achieved with following steps (case
with only one clone):
1. Open snapshot (Snapshot1) that shall be removed
2. Check if the Snapshot1 has no more than 1 clone (Clone1)
3. Remove Clone1 entry from Snapshot1
4. If the Snapshot1 has a parent snapshot (Snapshot2):
 4a. Add Clone1 entry to the Snapshot2 clones list
 4b. Remove Snapshot1 entry from Snapshot2 clones list
5. Open Clone1 blob
6. Freeze I/O operations on Clone1
7. Temporarily override md_ro flag for Snapshot1 and Clone1
   for MD modification
8. Merge Snapshot1 and Clone1 clusters maps into Clone1
   clusters map
9a. If Snapshot2 is present switch parent ID and backing
    bs_dev on Clone1
9b. If Snapshot2 is not present set parent ID to
    SPDK_BLOBID_INVALID and backing bs_dev to zeroes_dev
10. Sync MD on Clone1
11. Sync MD on Snapshot1
12. Restore MD flags for Clone1 and Snapshot1
13. Unfreeze I/O on Clone1
14. Close Clone1 blob
15. Remove Snapshot1

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I800724b981af894e01e1912d0077c5b34a2ae634
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445576
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-18 13:19:32 +00:00
Changpeng Liu
a47e7de332 bdev: rename _spdk_bdev_io_split to spdk_bdev_io_split
_spdk_bdev_io_split() will be used to requests that have IO buffers.

Change-Id: I5ba0b83e47b84066e6c5032de2e02404155896d3
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457549
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-06-13 00:44:34 +00:00
Shuhei Matsumoto
73204fe2e5 dif: Add data offset to DIF context separately from start block address
Data offset are intended to correspond to DATAO in NVMe/TCP and
Buffer Offset in iSCSI.

Previously for iSCSI, buffer offset had been merged to start block
address, but passing buffer offset separately from start block address
clarifies the logic more.

On the other hand, for NVMe/TCP, passing DATAO separately from start
block address will be critically important because DATAO will bave any
alignment and will be necessary to use for not only reference tag
but also guard computation.

This patch adds data_offset to struct spdk_dif_ctx and adds it to the
parameters of spdk_dif_ctx_init(). ref_tag_offset is also added to struct
spdk_dif_ctx and it is computed by dividing data_offset by data_block_size
and is used to compute reference tag.

The next patch will use this change when getting DIF context in SCSI.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Id0e12ca9b1dc75d0589787520feb0c2ee0f844a5
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457540
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-11 18:53:58 +00:00
Mateusz Kozlowski
8cdb3d330e bdev/ftl: Add driver specific data to get_bdevs rpc
Added basic configuration details (transport type and address,
parallel units, cache info) as well as most important OCSSD geometry
data to get_bdevs driver_specific section.

Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Change-Id: I00c50706bd9203bcef1701be1b7d87e93c10e57f
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456790
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-11 06:25:36 +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
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
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
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
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
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
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
paul luse
d5d7c57043 bvdev/compress: move comp transform structs to static globals
Code cleanup.

Change-Id: I9f96a889ed39afbd14a42b50e2537b1c4844f514
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456517
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-06-05 16:48:36 +00:00
paul luse
5ef2b14e3c bdev/compress: rename function to avoid collision with bdev layer
Makes debug easier...

Change-Id: I3b975e0a494c3920387b2d1921ebf8089b935bf5
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456512
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-06-05 16:48:36 +00:00
Shuhei Matsumoto
1554a344c9 env: Add free_space parameter to spdk_ring_enqueue
DPDK rte_ring_enqueue_bulk() has free_space parameter to return
the amount of space in the ring after enqueue operation has finished.
This parameter can be used to wait when the ring is almost full and
wake up when there is enough space available in the ring.

Hence we add free_space to spdk_ring_enqueue() and spdk_ring_enqueue()
passes it to rte_ring_enqueue_bulk() simply.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9b9d6a5a097cf6dc4b97dfda7442f2c4b0aed4d3
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456734
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-05 05:23:58 +00:00
Tomasz Zawadzki
e5b7f59d9c bdev: directly use spdk_bdev_io_get_io_channel() where needed
The function spdk_bdev_io_get_io_channel() was added,
but remained unused. Couple places done the exact same thing,
so now they just use it directly.

Change-Id: Ifa332ce3a489256ccf2f5d0dd9c74a3215c544ce
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456435
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-06-04 00:08:53 +00:00
Tomasz Zawadzki
6b395277b2 bdev: directly use spdk_bdev_io_get_thread() where needed
The function spdk_bdev_io_get_thread() was added,
but remained unused. Couple places done the exact same thing,
so now they just use it directly.

Change-Id: Ia25abf57eb88c8df47c83e4edd761a9e02cc1618
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456436
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-06-04 00:08:05 +00:00
Konrad Sztyber
d69fe7b7b9 bdev/nvme: separate metadata buffer support
Handle IOs with metadata being transferred in a separate buffer if the
device underneath supports it.

Change-Id: I38887a24d2aad51f674a840367b5dcdeda2d5a8b
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451467
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-06-03 23:35:42 +00:00
Konrad Sztyber
8ba138e56e bdev/nvme: store bdev/bdev_io in separate variables
Change-Id: I6eb3ae54fc419f65e5bc718cc78150c99fea296b
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454742
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: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-03 23:35:42 +00:00
Konrad Sztyber
58663640d2 lib/bdev: separate metadata buffer IO functions
This patch adds *_with_md family of functions allowing for IO with
metadata being transferred in a separate buffer.

Change-Id: I842d5a00a532cf5d0b0f0738535ea46903674140
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451465
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-03 23:35:42 +00:00
Changpeng Liu
9da1c7384d bdev: don't call spdk_bdev_free_io() for the error case
Existing code in spdk_bdev_write_zeroes_blocks() will call spdk_bdev_free_io()
for the error case, which will cause assertion because the bdev_io isn't
submitted to the backend yet, so we will check the condtion first to
avoid the error case.

Change-Id: If27d78217f709a3315e74c00869d345abd6b9a69
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453491
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-05-31 18:53:48 +00:00
Seth Howell
3fb4a66d7d bdev: Create a new delay vbdev module
This module simply sits on another virtual bdev
and adds a simulated average and p99 latency to that drive.

Change-Id: Ie9fc91e27585fd0636cb7dc845cb41744bf24625
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453594
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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-05-31 14:37:26 +00:00
paul luse
831a2c5d1e bdev/compress: change inflight val to min required by QAT
QAT driver will not load with anything less than 128, may need to
adjust after performance testing.

Change-Id: I4949e6d97e7ed997d14b907dac00cc288dcc331b
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456069
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-05-30 17:56:54 +00:00
paul luse
112a8b682d bdev/compress: fix issue with freeing mbufs in compress error path
mbufs are freed with a single call to the first mbuf in the chain
unless we hit an error before we chain them. So free them correctly
when chained and loop through the array one at a time and free them
that way if not.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I80ebb86bc2147b42db89d24f8e985cacf7d4bceb
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455019
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-05-30 17:56:54 +00:00
Andrey Kuzmin
992ffd8071 bdev: drop extra assert on nomem io completion.
Addresses the issue https://github.com/spdk/spdk/issues/805.

Change-Id: I7b1cf9d8de0689a987b7a90c925b04076856f34f
Signed-off-by: Andrey Kuzmin <akuzmin@jetstreamsoft.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455985
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>
2019-05-29 02:41:27 +00:00
lorneli
493fb55e4c bdev: add _spdk_bdev_io_do_submit function
Move actual submission code to _spdk_bdev_io_do_submit, used by
both normal submission path and QoS path.

Previous patch(review.gerrithub.io/c/442127) adds the missing
bdev_io->internal.in_submit_request flag to QoS submission path.
But QoS submission path doesn't handle nomem_io yet.

This patch makes QoS submission path handle nomem_io in the same way
as the normal path and extracts actual submission code into do_submit
function, so that further modification of the submission logic will
apply to both paths automatically.

Change-Id: I41fa88d239c3a2bd9783d812826e32e7c887818d
Signed-off-by: lorneli <lorneli@163.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455252
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>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-05-28 18:08:26 +00:00
Vitaliy Mysak
fec9d4146b ocf: accept optional base in bottom adapter
Interpret volume->open() options as our vbdev_ocf_base struct.
This is used during metadata probe procedure, when there is no
  vbdev configurations created, so we need to pass base structure
  as option.

This patch is a prepartion for persistant metadata support,
  and it does not change current behavior.

Change-Id: I0b7435df1692d8b3028931c6c9fc50d2d84b2557
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455415
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-05-24 23:55:04 +00:00
Vitaliy Mysak
4003ebf73c ocf: serialize base bdev names in OCF UUID
Use OCF per-volume UUID field to serialize bdev names.
This is going to be used during cache load to find out
  which bdevs we want to attach.

Note that there is in fact "user_metadata" buffor that is
  also stored in cache metadata, but we cannot use it
  because its size is limited to 64 bytes.
  UUID in OCF terms is not standarized
  and is meant to be used to store custom immutable data.

This change preparation for persistent metadata support.
Functionality is not changed. (everything works the same way)

Change-Id: Ia9204fae29106f5b816d93a6771425a223d6c028
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455414
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-23 19:01:38 +00:00
Vitaliy Mysak
1292ef24e7 ocf: stop cache immediately at shutdown
Change shutdown behavior such that now first bdev destruct() call
  stops OCF cache instance.
Previusly, cache was stopped when single vbdev was referencing it.

This patch is related to persistent metadata support.
Without this change, every time a SPDK application is stopped,
  only the last core is remembered in metadata,
  because vbdevs detach by 1 by 1, each time updating the metadata.

Change-Id: I57db3f77db525177c024ee85e660a85aff2f8c31
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455413
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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-05-23 19:01:38 +00:00
Vitaliy Mysak
efe48d7ca9 ocf: fix vbdev_ocf_ctx_data_seek() function
Fix instance function for OCF ctx interface.
This function is used for persistent metadata only.

Change-Id: I9583ea8eb21f07a3e9072a9552bed1c077cb7114
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455412
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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-05-23 19:01:38 +00:00
Vitaliy Mysak
cca2eab10a ocf: allow loading cache without setting cache mode
Make init_vbdev() accept NULL as cache_mode if loadq flag
  is set.
This is needed for load path because we don't know cache mode
  before the actual load (happens later).

This change is related to persistant metadata support.
This patch does not change current behavior because loadq flag
  is always false.

Change-Id: I42727eb841d87903c81bd5e6d51b6d4869ed9be3
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455411
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-23 19:01:38 +00:00
Vitaliy Mysak
2b1c1e7031 ocf: implement cache load path
Implement load path for OCF cache.
During load OCF will read metadata from cache disk and restore its state.

management_channel initialization is moved before cache load/attach part
  because ocf_mngt_cache_load() needs it to read metadata.

This patch is a preparation for persistant metadata support.
Load path is never used yet because loadq flag is always false.

Change-Id: Iff6c1c52eae7b9f52812a8bd3d5ae6d6facedd60
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455410
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-23 19:01:38 +00:00
Vitaliy Mysak
242564a82c ocf: add loadq flag to construct path
Add new loadq flag that indicates if vbdev
  should load cache instance from disk or start a new one.

This change is a preparation for persistent metadata support.
Functionality is not changed in this patch as the loadq flag is always false.

Change-Id: I1baac7f988e6eeadb4f365ba7bfab8019d55a753
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455409
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-23 19:01:38 +00:00
Piotr Pelplinski
fca402b0f2 ocf: add metadata callbacks
This patch adds callback for serializing spdk metadata
stored in ocf cache devices.

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I856bac3d63c7172dd6c67361794159fa38812a78
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449300
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-23 19:01:38 +00:00
Vitaliy Mysak
40cac0ecad ocf: send flush during shutdown
Do management flush during OCF shutdown to write all dirty requests to cores.
Dirty requests are relevant to WriteBack mode only.

Change-Id: I778a73ed8ab5659921f192f638027d513c239814
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450683
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-23 19:01:38 +00:00
Piotr Pelplinski
a34f905a74 OCF: Update ocf submodule to version OCF v19.3.1
This patch updates submodule and appropiate functions.

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I8cd7707058745cdc3e91f7d821bf215ff9287c86
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451463
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-05-23 19:01:38 +00:00
Vitaliy Mysak
80a2ff01f3 ocf: implement OCF cleaner
Implement cleaner that is used in WriteBack mode.

Cleaner is a background agent that does synchronization
 of data between cache and its cores.
 Cleaner usually runs every ~20 seconds to perform cleaning.
 The synchronization is a simmilar operation to OCF management flushes.
We need cleaner for WriteBack because only WriteBack mode
 produces dirty data that cleaner needs to deal with.
Cleaner requires adopting trylock() because in current version
 cleaner uses management lock when performs cleaning,
 which may lead to deadlocks if cleaner runs on
 the same thread as management operations.

WriteBack mode is fully functional after this change,
  but persistent metadata support is required to use it for production.

Cleaner will run on management thread for now.
  We plan to implement functionality of
  chosing a CPU core where cleaner should run.
Cleaning policy is not configurable yet.
  The default is ALRU with 20 sec interval.

Change-Id: I35aa7e00c44e0d7a77e64e60df1f66f20be03f55
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448537
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-23 19:01:38 +00:00
Vitaliy Mysak
eb58ad5379 ocf: create management channel
Create new management channel and handle sharing between vbdevs.
This channel is going to be used for management operations
 that produce IOs (such as flush) and also for cleaner.

Change-Id: Ieeed8454a7ab7459c86ac06ec6c0ece038bc928e
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455272
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-23 19:01:38 +00:00
Vitaliy Mysak
54eeeac6e0 ocf: implement mngt_queue for asynchronous management
Implement management queue for asynchronous management that is provided
  in new OCF API. This is a neccessery step to be able to implement
  metadata support.

OCF submodule was updated to get management queue functionality
It has to be done in this patch because OCF module will not work
otherwise.

Change-Id: Id19c2e5bd6a5d26fee41752b62720e408dc082e8
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448619
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-22 17:57:31 +00:00
Vitaliy Mysak
244d6e3daa ocf: lock queue list during create/delete
OCF queue list needs to be managed synchronously.
This patch uses our own mutex to achieve that because we cannot rely on
  ocf_mngt_cache_lock() as it may produce deadlocks when using
  cleaner.

Alternative way would be to use trylock, but
  we need to register a poller for it and do locking concurently
  which doesn't seem to be possible in callbacks of io channel.

We agreed with OCF team that we are going to change this part
  when OCF will deliver safe ocf_mngt_cache_lock() function.

This patch fixes a very rare failure on our CI that looked like this:
```
04:33:02 vbdev_ocf.c: 134:stop_vbdev: *NOTICE*: Not stopping cache instance 'Malloc0' because it is referenced by other OCF bdev
04:33:03 MalCache1: Core core2 successfully removed
04:33:03 MalCache1: Stopping cache
04:33:03 MalCache1: Done saving cache state!
04:33:03 src/ocf/mngt/ocf_mngt_cache.c:1576:2: runtime error: pointer index expression with base 0x000000000000 overflowed to 0xffffffffffffffa8
04:33:03     #0 0x7f3c52d54c26 in _ocf_mngt_cache_stop src/ocf/mngt/ocf_mngt_cache.c:1576
04:33:03     #1 0x7f3c52d5579f in ocf_mngt_cache_stop src/ocf/mngt/ocf_mngt_cache.c:1657
04:33:03     #2 0x7f3c52cbe9f4 in stop_vbdev /var/jenkins/workspace/NVMe_tests/nvme_phy_autotest/spdk/lib/bdev/ocf/vbdev_ocf.c:147
04:33:03     #3 0x7f3c52cbf4a0 in vbdev_ocf_destruct /var/jenkins/workspace/NVMe_tests/nvme_phy_autotest/spdk/lib/bdev/ocf/vbdev_ocf.c:216
```

Change-Id: Id6fafb444958f3becdc480e44762074c6c081e1f
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450682
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-22 17:57:31 +00:00
Vitaliy Mysak
4e7fb25066 ocf: add shared cache instance context
Introduce cache context structure that is going to be used
  for sharing per cache info. For example: management queue,
  cleaner_channel, cleaner_thread.

Lifetime of this structure ends with last vbdev that gets unregistered
  and NOT when cache stops because cache does not have to be freed
  there.

Change-Id: I66252084d7efda92edd10fb737c8e9c8169b4f6d
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451403
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-22 17:57:31 +00:00
Vitaliy Mysak
f51d3b6dd7 ocf: adapt new asynchronous OCF API
Adapt to new async API which was changed recently
This is a neccessery step to be able to implement persistent metadata support

OCF submodule was updated to get new API

Change-Id: I6bf9941ab0557981235c5be27686594a1b8ac3a0
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448397
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-05-22 17:57:31 +00:00
Vitaliy Mysak
cac0e9d01c ocf: move register_finish() function up
Move last step of register chain to the top because it is arguably more readable.
This should not be done in previus patch because it spoils the gerrithub diff.

Change-Id: If51642a32c5cf2a757ca20485d2347410653ca2a
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454574
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-05-22 17:57:31 +00:00
Vitaliy Mysak
9000deb734 ocf: use trylock in vbdev_ocf.c
Use new trylock API to prevent lockups when using OCF cleaner.
Starting and stoping OCF bdev becomes asynchronous with this patch.

Using trylock means that we have to poll function that does locking each
  time we want to initiate some operation on cache instance.
  This is the reason why management functions become asynchronous.
Each management operation now has a _poll() operation associated with it.
  _poll() uses trylock and continues when cache is locked.

Change-Id: I83b9fbe87c27433e178583411b87a68b8efaf58e
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447888
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-05-22 17:57:31 +00:00
Vitaliy Mysak
c3d044cbd7 ocf: use vbdev_ocf_mngt_ interface in register path
This patch is a preparation for adopting ocf_cache_trylock() function.
Register OCF bdev path uses vbdev_ocf_mngt_ interface now
Register stays synchronous blocking operation in this patch,
 but with adoption of ocf_cache_trylock() function,
 register will be asynchronous, in which case we
 want to use mngt_ interface.

This series of OCF patches will enable WriteBack support for OCF bdev.
There is a lot of preparation before we will be able
 to actually implement WriteBack.
Dependencies look like this:
- WriteBack
  - Cleaner
    - trylock
  - Persistent metadata
    - asynchronous management API

Cleaner is a background agent that does synchronization
 of data between cache and its cores.
 Cleaner usually runs every ~30 seconds to perform cleaning.
 The synchronization is a simmilar operation to OCF management flushes.
We need cleaner for WriteBack because only WriteBack mode
 produces dirty data that cleaner needs to deal with.
Cleaner requires adopting trylock() because in current version
 cleaner uses management lock when performs cleaning,
 which may lead to deadlocks if cleaner runs on
 the same thread as management operations.

Peristent metadata is functionality of OCF
 that allows to restore cache state after shutdown
We need persistent metadata in context of shutdown
 with some data being dirty which may only happen
 when using WriteBack mode
Support for persistent metadata requieres
 asynchronous OCF API because in current version
 we will have a deadlock during metadata initialization
 because it is required to be done on different thread
 than cache initialization.

Change-Id: I45d84a5fa0c96581d522050dad186b06d489226e
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455225
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-22 17:57:31 +00:00
Tianyu yang
a8b8badb3c bdev/aio: An error code can be returned via the rpc interface.
When we create AIO using the RPC interface, we can use the error
message to return to determine what exceptions have occurred.

Change-Id: I537f1a7d1053dcc27960de004fd0b4aea49919e9
Signed-off-by: Tianyu yang <yangtianyu2@huawei.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452313
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-22 16:12:40 +00:00
paul luse
3d6305b9fd bdev/compress: fix issues with multi-thread
Submission logic was incorrect and completion logic was not
present yet.  This passes now with multi-thread bdevio test.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ia8ed1c123be511240d93503a2c5e501ccad445bf
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455018
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-05-22 15:36:48 +00:00
paul luse
4397e38782 bdev/compress: add UT for the poller
Adding these tests identified a small fix in the code under test
that is also included here.  The compressdev 'produced' field
is unsigned and reduce is expecting a negative errno in the
callback.

Change-Id: I28ab11ee3ef54768a9d6ccd26282cf7dd022be43
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454806
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-05-22 15:36:48 +00:00
paul luse
3cf1cd0b14 bdev/compress: use comp bdev assigned queue pair in poller
Previously hardcoded to 0 for iniital dev/test.

Change-Id: If3b98b0083ff52366eb4deaadb5ffb6a277f904c
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454681
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-05-22 15:36:48 +00:00
paul luse
96fe0fb199 bdev/compress: updates to the poller function
Two quick updates, support dequeueing more than 1 IO at a time which
is now more likely given that we can queue up compression operations
(others can come in qhile one is on the queue).

Dropped the max inflight value as it was in there as a palceholder
and now it makes sense to give it a sane value. Also updated the value
passed to reduce to signal an error.

UT for the poller will come in the next patch...

Change-Id: I14d6aeb98aa1e193c498e1549e37eca0e4c56c31
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454680
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-05-22 15:36:48 +00:00
Changpeng Liu
c55c85f807 bdev: complete parent IO only when all the children IO are finished
When parent IO was splitted into several children requests, SPDK
may return parent completion callback with error status before
all the children requests are finished.

Change-Id: I63221a0ae1a5925a7fcd9744b4f5d8079c641252
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453611
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-05-22 08:18:40 +00:00
Darek Stojaczyk
ca0cdbf269 bdev: increase QoS granularity
Fixes #791

Change-Id: Iaba31bdbbff6fa7996ca3e89ac4c9e3658a2cc94
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454669
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-21 05:09:41 +00:00
paul luse
02064419e2 bdev/passthru: add error check in get buffer read callback
Was simply missing.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ia8ff3825e5d78c8814c3c57b779608ebe6be34ac
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454467
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-05-20 17:02:27 +00:00
paul luse
634af37b46 bdev/compress: use the queue pair for the current device
Had 0 hardcoded early on, this just uses the queue pair that
was pre-assigned to the compression bdev to use when interacting
with the cryptodev API.

Multi-threaded testing is coming later.

Change-Id: Iab8ea4e59169980933e9c81715baf4d41803b572
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453921
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-05-20 16:59:43 +00:00
paul luse
70165cedeb bdev/compress: queue up compression operations if we can't submit
The compressdev enqueue call will return the number of ops that
it was able to accept.  By design this will always be 1 for our
implementation so check that to make sure.

If it is 0 then we queue the compression operation up and try
again after something is dequeued in the poller.

We will also queue if we can't get an mbuf or op from our pools.

Change-Id: I7285749b4a599d1ee265e3c3e16073f25c4d7469
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451686
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-05-20 16:59:43 +00:00
Konrad Sztyber
2fac8bc76b lib/bdev: merge buffer allocation in get_buf/put_buf
These two paths do the same thing, only spdk_bdev_io_get_buf tries to
allocate the buffer directly, while spdk_bdev_io_put_buf reuses the
returned buffer for one of the waiting requests.

Change-Id: I341a011f3a16a99de399c8b56fa73ccd9c7fe4fa
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451466
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-05-20 16:54:13 +00:00
Piotr Pelplinski
c4d9daeb7b Makefile: Add possibility to uninstall spdk.
Add uninstall target to makefiles to be able to perform
reverse of install target.
Fixes #464

This patch adds 'uninstall' target to makefile.
'make uninstall' will remove spdk_tgt app, headers, libraries
and shared libraries from system directories defined by $DESTDIR.
Additionaly, if there will be any empty directories left after
this operation, they will be removed as well.

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I7b07fb4b81081d3914ff09165991fbe3a26b9067
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/431471
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-05-16 20:56:18 +00:00
Tomasz Zawadzki
2bbd1eb444 bdev: move marking bdev module as async to init path
Previously whenever bdev module went through init>fini>init,
the async modules would trigger assert in spdk_bdev_module_action_done().

This was because starting value for action_in_progress was being
set only once - during registration of the modules.
With this change, modules are set as async just before their init start.

Change-Id: If177a8dc97812b1b264cb61d5ad202ce47fca3b5
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454614
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>
2019-05-16 08:29:19 +00:00
Vitaliy Mysak
c967d539d8 ocf: add timeout functionality for vbdev_ocf_mngt_ interface
Allow user to set timeout for poller in management operations.
Now also all management pollers have 5 sec default timeout.

Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Change-Id: Ic75f2b150ef21ccd673b80aa84f16c9a24f90e32
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453655
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-05-15 20:34:13 +00:00
Vitaliy Mysak
bbbe9e1ce6 ocf: add vbdev_ocf_mngt_stop() function
Add stop function to management interface.
It is needed for error handling when execution has to be aborted early.

Example flow:
```
rc = op();
if (rc) {
   handle();
   vbdev_ocf_mngt_stop();
} else {
   vbdev_ocf_mngt_continue();
}
```

This can be improved in the future, because currently, error
  handling cannot be a management operation on its own (but should be).

Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Change-Id: I9ba528db8a9957ee561e5c1b5528b16bd143d5d8
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453654
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-05-15 20:34:13 +00:00
Vitaliy Mysak
27ddbb7393 ocf: split remove_base() function
Replace remove_base() function by smaller ones:
  detach_cache(), remove_cache_bdev(),
  detach_core(), remove_core_bdev()

This change is necessary for implementing asynchronous unregister using
  trylock API.

Also introduce stop status variable because unregister path has changed.

Change-Id: I62599cafacdba685848bd7d32d3d5245907ee4a1
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452416
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-05-15 14:32:58 +00:00
Vitaliy Mysak
b29ec8a261 ocf: reorder management functions
Reorder function for register and unregister path to make code more
  readable.

Change-Id: I3479b231de1f6a4f84f9538f345e62eb73e6847c
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452415
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-15 14:32:58 +00:00
Vitaliy Mysak
1ddc8cb53a ocf: make stop_vbdev() function a step of unregister_path[]
stop_vbdev() is management a function so it should be one of the steps
  of unregister_path[]. It will have to be when stoping is asynchronous,
  but right now it is not a hard requirement.

remove_base() no longer calls stop_vbdev() because that was actually a
  dead code.

Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Change-Id: Ie2d87da0fbe7807efea084181ea386b323e6b9d8
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453653
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-15 14:32:58 +00:00
Shuhei Matsumoto
48a490d48f bdev/raid: Fix more than a space between struct and name struct
This is just for readability.

Change-Id: Ic2a62ded78146c5b8736b6b7daebda1f3d5e3c47
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454414
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-05-14 22:36:04 +00:00
Shuhei Matsumoto
1014591d57 bdev/raid: Use static initializer for global linked lists
Change-Id: I16aff84c393bf899ab52412f187f60e185750119
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454413
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-05-14 22:36:04 +00:00
Shuhei Matsumoto
f34b81a283 bdev/raid: Remove unnecessary zero clear to to-be-freed data
Some data is freed but is cleared to zero just before the free.
They are not necessary and can be removed.

Change-Id: Ia4d789ef77c22059c412ee3c974ab0cf068d6c67
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454412
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-05-14 22:36:04 +00:00
paul luse
0d99245c13 bdev/compress: move poller function
In prep for next patch where queueing a comp op requires
the poller to call a func that was previously below it.

Change-Id: I0ba8a00e958e0766f866a0cd49d7b288ea4cbe73
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453029
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-05-13 15:41:35 +00:00
paul luse
7b641c757d bdev/compress: change how we manage mbufs
In working on a future patch to queue compress operations, I found
some corruptions in our mbuf pool stemming from an inconsistency
in using mbuf macros when constructing a compress operation and
how we allocated and freed both the pool and the mbufs.

This also fixes an issue that I hadn't addressed yet with freeing
chained mbufs.  Use of the mbuf macro to free them instead of the
generic spdk functions takes care of that for us.

Change-Id: I7b29a0d740ab745574698c721d575d8a735ad5cb
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453028
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-05-13 15:41:35 +00:00
paul luse
168738298b bdev/compress: fix issues with delete
I didn't test delete after making a bunch of channel changes so there
were some bugs in that path.  Also as a drive-by I NULL out the
base_desc in vbdev_reduce_load_cb() to be consistent with other places
where I'm closing the base desc.

Change-Id: Iddd5dc704cde8eb7a6a5a3a8481e064a5c6c6d4e
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452267
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-05-13 15:41:35 +00:00
paul luse
024e89afb3 bdev/compress: Populate params structure on load
On init, we pass reducelib the address of our params structure
so that the volume size is updated accordingly.  On load however,
there was nothing to set the volume size so any load of a previously
created compress volume would result in a 0 length bdev.

Change-Id: I7643c79fa2e664115fd25df064ff1c74d82e358b
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452906
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-05-13 15:41:35 +00:00
Shuhei Matsumoto
cd02f1cda5 bdev/passthru: call spdk_bdev_module_release_bdev in the error path of registration
Change-Id: Ibdea7a34fff5cea7a9861a3172835429aef7e992
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453955
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-05-13 08:05:23 +00:00
Jim Harris
915270db68 bdev: make bdevs array for get_bdevs_iostat RPC
Fixes issue #775.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452477
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-05-08 22:43:00 +00:00
Vitaliy Mysak
ac2b06c809 ocf: adopt examine to asynchronous construct
Make examine work with asynchronous bdev startup.

We need to count references of bdevs that are being examined,
  for the case when single cache bdev is referenced by multiple OCF
  vbdevs.

The construct function is not in fact asynchronous yet,
  but will be after adopting "trylock" API. Adopting trylock
  requires a lot of changes, so this patch is really to split
  implementation.

Change-Id: I6ac091f2dd48462e74aa89cf54acb0306c30673b
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450033
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-05-07 19:29:41 +00:00
wuzhouhui
0acc20ab10 misc/rpc: rename some C functions of rpc methods
Traditionally, The C function name of rpc method "method_name" will be
"spdk_rpc_method_name", so make these function names consistent with
others. No behaviours changed.

Change-Id: Iac5396d4860bdbd78cba9031b4b6358161ec779b
Signed-off-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453197
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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-05-07 05:30:16 +00:00
Shuhei Matsumoto
bc49bbe232 bdev/raid: Make destroy_raid_bdev RPC wait for completion by callback
This is the end of the patch series.

Make destroy_raid_bdev RPC Wait for completion of spdk_bdev_unregister
to the raid bdev by using callback function.

Change-Id: I3ed157ee71e3b8e6dc14b5b66732baba516eacce
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450573
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-05-07 05:01:54 +00:00
Shuhei Matsumoto
0d9a2b504a bdev/raid: Process only the first call of destroy_raid_bdev RPC
We have to process only the first call of destroy_raid_bdev RPC
for the same RAID bdev.

The existing flag destruct_called cannot be used for that purpose
because of the following reason.

destruct_called is set to true in both of
- destroy_raid_bdev RPC
- hot removal of any base bdev.
If destruct_called is set in destroy_raid_bdev RPC, destroy_raid_bdev
RPC must return immediately, but if destruct_called is set in hot
removal of any base bdev, destroy_raid_bdev RPC must go forward
with the current logic.

Hence add another flag destroy_started to struct raid_bdev and
use it.

Change-Id: Ifeefcaa1d289499342d8bb9bc162ded65e0368dd
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450885
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-05-07 05:01:54 +00:00
Jim Harris
3837f0d0f5 bdev: don't allow NVME_IO types for partitioned bdevs
Typically we just pass the bdevs supported IO types
for each of its partitions.  But that doesn't work
for partitions with non-zero offsets since we can't
decode/modify the NVMe command in the bdev layer
to account for that offset.  So just don't allow it.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452930
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-05-06 05:46:12 +00:00
Jim Harris
d58732d75e bdev: remove old "split" from ERRLOG
This was bdev-specific code that has been made generic
but we missed removing this "split" name when moving
the code.

We don't need a name here really - SPDK_ERRLOG will
tell us the file and line number of the error which is
sufficient.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452929
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-05-06 05:46:12 +00:00
Ziye Yang
8b119b2964 bdev/crypto: cleanup the vbdev_crypto_examine
Change-Id: I8917487d1ff261d5b31dda4ee8a6276a8463769a
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451908
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-05-02 09:10:38 +00:00
Mike Carlin
a6524cd1f8 raid bdev: Change product_name to "Raid Volume"
The product_name for raid bdevs was "Pooled Device" which was a legacy
naming convention that hadn't been cleaned up yet. This changes the
naming to be up to date with the current naming scheme.

Signed-off-by: Mike Carlin <mikefcarlin@protonmail.com>
Change-Id: I9092a2b793e48bb9ec0349087a31fdcde17ed9cd
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452269
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-02 09:02:52 +00:00
Jim Harris
617184be3b trace: remove short_name
This was not used by any of the trace register descriptions.
Let's remove it rather keeping it around if we don't need it.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452734
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>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-05-02 08:41:56 +00:00
Jim Harris
af25204404 bdev/nvme: always enable FTL
FTL doesn't have any kind of special package requirements.
It is getting pretty good traction in the community, so
let's enable it by default.

Note that we will disable FTL on FreeBSD.  FTL uses
CIRCLEQ which is not available on FreeBSD.  Let's not
spend time trying to get FTL to work on FreeBSD until
there's a demand to do so.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452752
Tested-by: SPDK CI Jenkins <sys_sgci@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>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-05-02 08:41:56 +00:00
Ziye Yang
5f1e468117 bdev/crypto: clean up _complete_internal_read
Also remove an unnecessary empty line and fix typos

Change-Id: I54e63e39dda23063c3fcbdd709cafec4278b130a
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451921
Tested-by: SPDK CI Jenkins <sys_sgci@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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-01 17:46:46 +00:00
Seth Howell
33f60621af lib: resize key mempools
Mempools are based off of a ring structure which allocates its elements
as a power of two. It also only exposes n-1 elements to the user. So
when we create a mempool with 2^n elements in it, we have to allocate a
ring with 2^n+1 entries. By decreasing the number of elements in these
key mempools by 1, we can save a decent amount of memory.

Change-Id: I942c9dd4cf59096969bc2559fb46fd2084a07f09
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448875
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-01 17:45:29 +00:00
Vitaliy Mysak
31b367ba97 ocf: add callback argument to vbdev_ocf_construct()
Add callback for construct function.
It is not asynchronous yet, but will be after
  adopting asynchronous OCF API

Also adopt RPC construct call for this change.
This is done in this patch because (1) change is small (2) leaving
  implementation as TODO still requires implementing a mock because we
  decided that callback should be required rather than optional.

Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Change-Id: Ib6a78e2caf34ac057d4da53ad5dda47163e8a089
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452146
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-05-01 17:44:03 +00:00
Vitaliy Mysak
8d3d32b982 ocf: pass vbdev in callback of mngt_ interface
Add vbdev as another argument in callback of vbdev management operations.
This is nice for async version of vbdev_ocf_construct() which uses mngt_
  interface and creates vbdev structure.

Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Change-Id: I8c88e0a881855b9f22fcf1f8174c888f3cfd6828
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452145
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-05-01 17:44:03 +00:00
paul luse
600341b6c5 bdev/compress: replace RPC parm name with pm_path
We decided to name compress bdevs with COMP_ and then the name of
the underlying bdev so the RPC parm name was stale.  Previously
hardcoded the path to PM for early dev so replaced name with pm_path.

Note that a sample create looks like this now:

rpc.py construct_compress_bdev -b NVMe0n1 -p ~/pm_files -d compress_isal

And that devs need to pay attention for the pathname they provide, its
easy to leave orphaned pm files around and they can get big.

Change-Id: Ifb5245c922461bbecec4bef266bdeb25e8b87f31
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452235
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-26 20:07:19 +00:00
paul luse
7bffdb2db9 bdev/compress: fix size of compressed bdev
Needs to be based on the compressed vol size which is smaller
than the backing io device.

Fixes issue 763

Change-Id: I917c98e86a0755e503d5ba3d4b6c02e42f9ed709
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452158
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-26 20:07:19 +00:00
yangtianyu 00383654
1dd07870e3 bdev/null : Clean up module resources that failed to initialize.
Currently, if the Bdev subsystem initialization fails, the initialization failed
module does not call the fini function cleanup resource.

However, null module use the 'spdk_io_device_register' and spdk_zmalloc to request
resources. In failed path, it will cause resource leak when exiting the app.

To avoid this, it will cleanup resources when module initialization fails.

Change-Id: Ib1a89e5238252d69b6e64ea02a0bd826661349a5
Signed-off-by: Tianyu Yang <yangtianyu2@huawei.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450105
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-24 22:25:47 +00:00
paul luse
933270eafd bdev/crypto: add new uninit call needed for dpdk 19.02
This patch won't fix issues related to the need for the latest
ipsec with 19.02 but it is needed for that patch to pass.

Change-Id: I8e2d984d85b355d88edfb9c90c159c8aa0a5362d
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451788
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-04-24 22:00:10 +00:00
paul luse
a50100900d bdev/compress: return error to reducelib if comp/decomp fails
Change-Id: Ibdea83543069e80d73358e95fa43f7b27c351d1a
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451064
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-24 15:07:37 +00:00
Ben Walker
946ef1dc47 bdev: Emulate zero copy support when necessary
For bdevs that don't support zero copy, emulate the
API using regular read and write operations.

Change-Id: Iabd7ff474bf740b096f38bd47196987cbd89e915
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/416465
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-23 18:38:39 +00:00
Ben Walker
7e4911c922 bdev: Make malloc bdev use the new zero copy mechanism
Change-Id: I8aea5dee3ad30814ffd061c4afa7729ad8d47cdf
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/386167
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-23 18:38:39 +00:00
Ben Walker
84850dacd7 bdev: Add a zero copy I/O path
Add a ZCOPY operation to obtain buffers that represent
data regions on the backing block device.

Change-Id: Ie941c16ee051d0009e3888b52b8f41773bba47b3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/386166
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-04-23 18:38:39 +00:00
Darek Stojaczyk
283abcb9a2 bdev: temporarily allow bdev descriptors to be closed from any thread
Bdev descriptors could be closed only from the same thread
that opened them. This restriction was suddenly introduced
at one point without making sure all the SPDK code respects
it. Vhost can still close descriptors from any arbitrary
thread and fixing that would require some more effort.

With this patch we remove the thread-specific assert from
spdk_bdev_close() and hence allow vhost to work properly
in debug builds. Vhost can still have a possible data
race with bdev hotremove notification, but let's get rid
of the abort() from the usual code path first.

Change-Id: I6fac66a5ebc907b1c5418fff618f0b64cd9b69f4
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451561
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-23 17:06:37 +00:00
Darek Stojaczyk
f93b6fb0a4 bdev: defer unregister untill *all* descriptors are closed
We used to wait only for those descriptors which
specified the hotremove notification callback. The
bdev could've been removed before the descriptor
was closed and the subsequent spdk_bdev_close would
simply segfault.

This patch modifies spdk_bdev_unregister to always
wait for all descriptors to be closed before actually
unregistering the bdev. This consolidates the bdev
unregister behavior for descriptors with and without
the hotremove callback.

Change-Id: I9b358209c6abd301b6fe8660e27bc6fa4ef485d6
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450175
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-23 17:06:37 +00:00
yidong0635
c97e564531 bdev/nvme: fix issue about coredump which caused by assert error.
Here assert(nvme_bdev->id == nsid) ,there's inactive case about nvme_bdev,
 that code will continue. So need to skip the same case in remove_cb.

Change-Id: Idd3bd16d32e75f6d0e448b838676eb6f2ca5cfad
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451445
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-22 15:23:11 +00:00
Vitaliy Mysak
4d13903c58 ocf: update try-locks in env
Update try-lock's implementation to comply with new OCF trylock API

Change-Id: Idc318dcac370d16312ac854d3bcf91fd7084dc65
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447886
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-19 13:05:35 +00:00
Jim Harris
e1112c7a49 bdev: fix order of generated RPCs
set_bdev_qos_limit RPCs must come after the RPCs that
create its bdev.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451414
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-18 16:09:57 +00:00
Shuhei Matsumoto
5f51f0aff6 bdev/raid: Add callback parameters to remove_base_devices()
This is a preparation to add completion callback to the
destroy_raid_bdev RPC.

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

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

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

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

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

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

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

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

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

Change-Id: Idd43b13eb342d9cd21ba55943bdcd1f564b3760e
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450568
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-10 19:38:10 +00:00
Shuhei Matsumoto
0839680db3 bdev/raid: Factor out removing base bdevs into a function
This is a preparation to add completion callback to the
destroy_raid_bdev RPC.

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

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

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

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

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

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

Change-Id: Idb18f7ef44634deaf63139f0f872881c9cdaefac
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450256
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-09 06:30:42 +00:00
Darek Stojaczyk
5ac7440af1 bdev/malloc: allocate bdev struct using regular calloc
spdk_dma_malloc() is not required here, as the bdev
struct is neither DMA-able nor shared between processes.

While here, also allocate mdisk->malloc_buf using
spdk_zmalloc() instead of spdk_dma_zmalloc(), as
spdk_dma_*malloc() is about to be deprecated.

Change-Id: If835216764a565ade09180159fbbc92411b5c78f
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450255
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-09 06:30:42 +00:00
Darek Stojaczyk
d6afc7f33c ocf: switch to spdk_*malloc().
spdk_dma_*malloc() is about to be deprecated.

Change-Id: Id49d700116bdd977893c6b89470764d97d9293bd
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449799
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-09 06:30:42 +00:00
Vitaliy Mysak
e862b6434a ocf: wait for pendings reqs in unregister
Unregister OCF bdev using poller that checks if
  cache has pending requests.

This prevents ocf_mngt_cache_stop causing
  deadlock on reads in WT mode.

Submodule commit was updated to get new function ocf_cache_has_pending_requests().

Change-Id: Iee4cb09bc2bb859a6dcce89994c686f64924c942
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446604
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: Jim Harris <james.r.harris@intel.com>
2019-04-05 16:22:32 +00:00
Vitaliy Mysak
25df73f5d2 ocf: Add management context
Add structure vbdev_ocf_mngt_ctx that is going to be used
  for asynchronous management operations.
Using such context, dynamic memory allocations are no longer required
  (except for one time poller registration)

This patch also adds functions to modify context in a predictable way.
They are very important for complex flow of management operations in OCF bdev
  especially after whole OCF API gets changed to asynchronous.

Change-Id: Ia402d51665330a553f7f3d74000e3636f0d6a598
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449556
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-05 16:22:32 +00:00
Darek Stojaczyk
43e136dfcc crypto: switch to spdk_*malloc().
spdk_dma_*malloc() is about to be deprecated.

Change-Id: I683ea366da7bb186f16a8084a9c43276ed4fce04
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449798
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-04 20:59:36 +00:00
Jim Harris
bfd1e46e6e bdev: deprecate spdk_vbdev_register
This API had good intentions, but as more complicated
use cases came up where base bdevs could come and go,
we've realized that the bdev layer will need another
mechanism to query bdev modules on these types of
relationships between a virtual bdev and its base
bdevs.  We removed all code related to tracking
the array of base bdevs a long time ago.

Change all existing callers to use spdk_bdev_register.
Document spdk_vbdev_register as deprecated for now,
and change its implementation to just call
spdk_bdev_register for simplicity sake.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450076
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-04-04 08:28:31 +00:00
Vitaliy Mysak
4fad4b86dd ocf: finish OCF reqs after put_io_channel
Relaunch queue poller on put_io_channel callback of OCF bdev
  to delay thread shutdown. New poller will finish all pending
  OCF requests as there might be some even after all SPDK IOs
  completed.

This solves the issue of OCF not being able to
  complete all its work because of queue poller getting
  unregistered in callback of put_io_channel.

This patch also changes unregister procedure:
  we call ocf_cache_stop in callback of io_device_unregister
  instead of in callback of bdev_unregister.

Change-Id: Ib7e41fc25e71029a73bb76a62e39e6bf4b8189ce
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/444276
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-03 00:00:20 +00:00
Vitaliy Mysak
9977424df1 ocf: make vbdev_ocf_delete function asynchronous
vbdev_ocf_delete function accepts callback now.
RPC delete_ocf_bdev is also updated to adopt this change.

Change-Id: I1d357a5e37015268e28c07fd81dc35f48ec80ab8
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449777
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-03 00:00:20 +00:00
paul luse
1e6cdc190d bdev/compress: misc comment and log message cleanup
Change-Id: I65ac14f1bcb506b211d129e5e6aa1c8872f3a2f2
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449803
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-02 23:25:27 +00:00
paul luse
a827d07c2b bdev/compress: integrate with DPDK compressdev
Change-Id: I0729f688c72651790ac05f4991c04deebca2af39
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448081
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-02 23:25:27 +00:00
paul luse
b95d25975d bdev/compress: add unit test mocks and empty functions
Test functions to  be added later in series

Change-Id: I96286b6214b4577df334d180e7c3d641e8ce8f68
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445371
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-02 19:25:28 +00:00
paul luse
cd4de753af bdev/compress: prepare to add some unit tests
Misc cleanup from earlier patches, some naming issues and other
minor things that are needed before adding UT.

Change-Id: Ic76f0e2fd12e48782b048fb8785902b1098cf352
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436227
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-02 00:06:34 +00:00
paul luse
aa3fdd01bd bdev/compress: insert vol unload into base bdev hotremove path
Change-Id: I0c23746fb210a8c209e98276fe0830185ee81407
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447372
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-02 00:06:34 +00:00
Pawel Wodkowski
076ebfadfa bdev: add register and unregister notification
When bdev is registered it will send "bdev_register" notification and
"bdev_unregister" when unregister is complete.

Change-Id: I3b37a4cb766a473f3da63a571036add366e78fa5
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448839
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-02 00:02:12 +00:00
Li Feng
80c87083ce bdev/iscsi: fix iscsi bdev wrong lun id
When you connect a iscsi lun as a bdev, and the lun id is not 0,
all IOs will fail.
We should use the correct lun id in libiscsi.

Reproduces like this:
./scripts/rpc.py construct_iscsi_bdev -b iSCSI0 -i
iqn.2016-06.io.spdk:init --url
iscsi://127.0.0.1:3261/iqn.2016-02.com.smartx:system:fl-iscsi/1

Signed-off-by: Li Feng <fengli@smartx.com>
Change-Id: I2480e866fdda17426362aca3cb30b7e90c927547
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449318
Reviewed-by: Kyle Zhang <kyle@smartx.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-01 01:16:51 +00:00
Konrad Sztyber
1d98208176 bdev/ftl: defer bdev initialization
Defer the initialization when cache bdev mentioned in the config doesn't
exist when the FTL bdev is being created.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I084502ae38c9ae5e385e5566550ec3cb8b6f9d2e
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448630
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-29 04:42:48 +00:00
Konrad Sztyber
a0cb5e9d77 lib/ftl: retrieve caching bdev from configuration
Added means to configure libftl to use (optionally) another bdev as
persistent write buffer cache.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I97028a681be168d9386eac8a226631ff772f803b
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448629
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-03-29 04:42:48 +00:00
Konrad Sztyber
6a7c9763e1 bdev/ftl: reduce the number of bdev_ftl_create's params
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Id9edced3670f7de1cd08cd8e3481cc5288103458
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449405
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-03-29 04:42:48 +00:00
paul luse
29b446a1bc bdev/compress: insert vol unload into destruct path
Change-Id: I10c7dff267ce469c0b01db9d6a1dbf89d2fad877
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447368
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-03-29 04:41:32 +00:00
paul luse
8944bb469f bdev/comrpess: add/fix bdev delete
Was partially present but not complete. Fits here in the series as
it requires read/write operations.

Change-Id: I552896c934bf60256625a83951a95d58d2719646
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447358
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-03-29 04:41:32 +00:00
paul luse
e2a2b637c9 bdev/compress: incorporate reducelib read and write
Change-Id: I280e9d51bf23ef101b8a3ba8a68a0c1eb10cb65c
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/438274
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-03-29 04:41:32 +00:00
yidong0635
0d076e264e bdev/raid: remove unnecessary assert.
Assert(raid_bdev->base_bdev_info) at here is unnecessary.
So remove it.

Change-Id: I7d87fbc95d8c1434ab346fd11179433547b74798
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449379
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-03-28 14:14:38 +00:00
Darek Stojaczyk
6e9eca7874 virtio: switch to spdk_*malloc().
spdk_dma_*malloc() is about to be deprecated.

Change-Id: Iacf9f6536ba5baca7b245e639d0d42a89720ba58
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448173
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-03-28 07:39:31 +00:00
Paul Luse
1717b5d580 bdev/compress: add reduce integration
Basic integration, init and load sequences

Change-Id: I12595a251f38168aad15e95275651cb4ce40ea7d
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/435764
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-03-27 19:17:46 +00:00
JinYu
2f3147c0b2 bdev: fix potential segmentation fault bug
As the bdev_io maybe NULL, so put the assignment after assert(bdev_io != NULL).

Change-Id: I58d6fcf97931b2f431ad5680b87b098e0c9a5e9b
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449296
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-03-27 18:38:52 +00:00
Paul Luse
db541f8eb3 bdev/compress: add compression vbdev module
Just the starting point, base functions and structs.

Change-Id: I2ff2b672aa675a19b89e4449f1cc4aa664007f6f
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/435747
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-03-27 14:51:22 +00:00
Vitaliy Mysak
2c651f101c ocf: batched request processing in queue poller
Process 32 OCF requests during poller invocation.
This will result in more flat events distribution.

This patch uses new API function: ocf_queue_run_single().

Change-Id: I0bc2ef783018fdbcf6f6e938fd7ca136ade61599
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446635
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-03-26 23:30:31 +00:00
Vitaliy Mysak
bef0c6edd2 ocf: rpc: extend get_ocf_bdevs for multicore cases
Extend existing get_ocf_bdevs call to make it easier
  to get information about attached cores.

Implementation is based adding additional optional argument "name"
  to existing call. Based on "name" bdevs are filtered.
  Backward compatability of RPC interface is preserved.

This patch also adds tests for the case when name is given.

Change-Id: I4300ebe37e936bc5cca8e066b5f09db462a87cf7
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/444841
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-03-26 23:30:31 +00:00
Michal Mielewczyk
b949f1318e ocf: Added zeroing memory returned from mempool
OCF requires memory retrived from mempool to be filled with zeros.

When mempool is created, information about element size is stored to be used
when new memory is retrived.

This is fix for issue #671

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Change-Id: Ieb533e3bdae0665dae18e7b3a379da0ed843c35a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449155
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-26 22:53:09 +00:00
Konrad Sztyber
02b0230296 bdev/ftl: treat null UUID as no UUID
Check if the UUID in the configuration is null (all zeroes) and treat it
as if no UUID has been supplied.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ic91c77591528a8aaa4cf5c0241e6bde51b3757f1
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448628
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-03-26 12:01:48 +00:00
Konrad Sztyber
9674a7b6cb bdev/ftl: better config errors logging
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ie3814a905efa6122d56a5f2dfc9710d016e8449e
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448713
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@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-03-26 12:01:48 +00:00
Changpeng Liu
add76a3515 bdev/nvme: change hotplug poller with asynchronous probe API
Change-Id: Id198e8ec79c84743ef5025e1552c4ce45ca30445
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445078
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-25 13:50:23 +00:00
Changpeng Liu
8129ede1c8 bdev/nvme: use asynchronous API to probe user specified controller
NVMe controller can be attached via asynchronous API now,
we added the RPC 'construct_nvme_bdev' with asynchronous
probe support so that the initialization can be processed
later.

Change-Id: Ic60fdde6af9c4ba9a07b874852cfba044acb06c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Change-Id: Ic60fdde6af9c4ba9a07b874852cfba044acb06c8
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445054
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-03-25 13:50:23 +00:00
Vishal Verma
dfb60590c9 bdev: Add io_uring bdev module
This adds bdev io_uring module.

Change-Id: I9a8171d7c871673b189bff59a89d06679da4e191
Signed-off-by: Vishal Verma <vishal4.verma@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445334
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-22 18:51:48 +00:00
Piotr Pelplinski
0497ae8ea3 bdev: Allow bdev module to finish start asynchronously
Currently if module claims a bdev in examine_config,
it cannot start asynchronously. This patch changes this
behaviour by calling examine_disk on modules which previously
claimed bdev trough examine_config.

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I85b603590c6dab50e59ef7e68f292cb9abc47d98

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448132
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-20 15:05:09 +00:00
Darek Stojaczyk
5118004b1d bdev/null: allocate bdev struct using regular calloc
spdk_dma_malloc() is not required here, as the bdev
struct is neither DMA-able nor shared between processes.

While here, also allocate g_null_read_buf using
spdk_zmalloc() instead of spdk_dma_zmalloc(),
as spdk_dma_*malloc() is about to be deprecated.

Change-Id: I0dc344bc84932607c2e22a124e2093e87714ec5e
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448170
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-03-20 11:12:59 +00:00
Ben Walker
a741e34180 bdev/nvme: Add configuration parameter to slow down polling
For NVMe devices, in conjunction with the new batching options,
it can be advantageous to artificially delay between polling
for completions. Add an option to slow this rate down.

Change-Id: I0fc92709ff45ead0beb388dda60694bf1ed8b258
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447716
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-03-19 07:27:44 +00:00