Commit Graph

954 Commits

Author SHA1 Message Date
Ziye Yang
75dce8a25c iscsi, initiator: solve the use after issue.
In our current code, when we call the following statement:
spdk_bdev_destruct_done(&lun->bdev, 0);

Actually lun is already freed in bdev_iscsi_lun_cleanup function
(called by iscsi_free_lun). So this patch can be used to
prevent this issue by changing the order.

Change-Id: I5ec02319b8205fafc4d8074511f5a334b9bbb3ad
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/417630
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-03 17:44:39 +00:00
Ziye Yang
abc3bc4f8e bdev/rbd: change the poller to timer poller
Poll it every 50 microseconds.
Reason: Ceph's librbd service is not very fast.
So choose a timer period to poll it, instead of
use the syscall to poll it again and again, it
is unnecessary. And this is a default value,
which can be tuned by customers later.

Change-Id: I91c31442da5ddadf3bef43083bd789d01bb1c952
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/417442
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-03 16:40:18 +00:00
Maciej Szwed
e48f0bf17d bdev: add delete_passthru_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for passthru bdev.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I8ea20b3003dd6539d84123c3b5363bd8bdfd6f7f

Reviewed-on: https://review.gerrithub.io/416535
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-02 22:53:18 +00:00
Maciej Szwed
1a0ce4ded0 bdev: add delete_pmem_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for pmem bdev.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ic526e9ae462f595c4668c2b2612ad074208a7c4e
Reviewed-on: https://review.gerrithub.io/416520
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-02 22:53:18 +00:00
Maciej Szwed
4fd967b22a bdev: add delete_rbd_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for rbd bdev.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ia87459e0cc49a0c408de582bd1f5680c570d42d9
Reviewed-on: https://review.gerrithub.io/416529
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-02 22:53:18 +00:00
Maciej Szwed
2ce9836b17 bdev: add delete_null_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for null bdev.

Changes in spdkcli done accordingly.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I576322257e5cf70ec03d6b20f8ba43bfce222907
Reviewed-on: https://review.gerrithub.io/416505
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-07-02 22:53:18 +00:00
Dariusz Stojaczyk
03b12a98b2 bdev/virtio: support event index
This fixes intermittent failures with QEMU's virtio-scsi-pci
device.

Apparently, from time to time QEMU enters a broken state in
which it doesn't turn off the NO_NOTIFY flag. This flag should
be set only for the period of time virtqueues are being processed,
but QEMU makes it set all the time. This makes us not signal any
I/O submissions - SPDK thinks the device is currently processing
notifications so it will pick up our I/O automatically, but in
realitly it won't and we end up with a deadlock.

I believe kernel virtio driver doesn't hit this issue because of
event index feature. If negotiated, the NO_NOTIFY flag won't be
used at all. Initial tests show that the issue is indeed gone
with this patch.

Event index for SPDK virtio is not particularly useful when using
a poll-mode device, but it doesn't do any harm. It can be further
optimized in the future, but macro-benchmarks don't show any
performance difference compared with the legacy notification
handling so there's no hurry.

Change-Id: I46e8ab0da170780fcdc0dd239208670ee5ed6357
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/415591
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-02 19:17:13 +00:00
Chunyang Hui
8b38468db4 bdev/iscsi: Add unmap support for iscsi initiator
Change-Id: I6dc83322385ecd332f6898f182192773824375cf
Signed-off-by: Chunyang Hui <Chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/417086
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-28 18:19:52 +00:00
Ben Walker
a4d22f7bdc bdev: Make an internal version of spdk_bdev_io_type_supported
Within the bdev layer, we want to know specifically what I/O
types the module supports. However, the bdev module may elect
to emulate some commands and report additional support via
the public API.

The bdev layer already emulates WRITE_ZEROES, so correctly
report that fact.

Change-Id: I79bfb1aee1b3e6048f951bb1b2c7d4f7c9ef184d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/416464
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-28 18:17:02 +00:00
Seth Howell
dd7b90fac9 bdev: add null check to spdk_bdev_unregister:
Newer versions of scan-build complain about cb_fn potentially being null
in spdk_bdev_unregister.

Change-Id: Ib5607234557f2104ee30398a620fa595389a33e9
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/417064
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-28 17:47:08 +00:00
Changpeng Liu
4c4e2b4d80 bdev/nvme: update NS bdevs after NS attribute notice event
Change-Id: I7c42696c09a3a4d35e0339ecfdf68c256c935a76
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/415117
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-28 17:46:41 +00:00
Seth Howell
2c52691b48 bdev: encapsulate members of spdk_bdev_module
Change-Id: Id0f9ba665a7a7fb2ead299b7853074c2e994dbd4
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416462
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-26 20:04:07 +00:00
Seth Howell
86947c8917 bdev: encapsulate private members of spdk_bdev
Change-Id: Ica5abcfe5f9b73217e2d91c33c2cd418e061cf96
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416458
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-26 20:04:07 +00:00
Seth Howell
816c34cbce bdev: move error union to internal spdk_bdev_io struct
Change-Id: Iab755bb1473c404693f84f97c07bbb5c5fefbb49
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416266
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-26 20:04:07 +00:00
Seth Howell
e550391ddd bdev: move link to spdk_bdev_io internal struct
I missed this one in the initial series.

Change-Id: Id4dc7574a04cd964455852f1a00084b65ab989b3
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416253
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-26 20:04:07 +00:00
Tomasz Zawadzki
160850f0a6 rpc/bdev: construct RPC return a string instead array
Construct calls that create single new bdev,
now return a string instead of array with single element.

Change-Id: Iad841b8e5eab0265693efb6be472354ea616c562
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/416081
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@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>
2018-06-22 21:12:43 +00:00
Tomasz Zawadzki
6be654aad7 bdev: add delete_iscsi_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for iSCSI bdev.

No changes in spdkcli, since it is not implemented yet.
Tests unchanged, because test is only done by running
bdevperf and exiting. Without time to delete_iscsi_bdev.

Change-Id: I8341bfb65932a1deb1fb6463e11ef932d6f6d597
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/415678
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-06-22 17:24:18 +00:00
Tomasz Zawadzki
0847ad90fd bdev: add delete_error_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for error injection bdev.

Changes in tests and spdkcli done accordingly.

Change-Id: I7f0be09cfed582c4d1060871e40c41eff5af7129
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/415502
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-06-22 17:24:05 +00:00
Tomasz Zawadzki
59dee78bd6 bdev: add delete_malloc_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for malloc.

Changes in tests and spdkcli done accordingly.

Change-Id: I5296452f552ee6eaba4d012d47aea022f17b9d6e
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/415259
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-22 15:17:44 +00:00
Tomasz Kulasek
635a1aa8a9 blobstore: add decouple parent function
This patch adds an API to decouple blobs parent removing dependency
on it. Blob stays thin after this operation.

Also unit tests for blobstore inflate are improved and reused with
decouple parent functionality.

Change-Id: I96dfee467c78cf4f4d929ec7bc05263f7a23a8aa
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/410829
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-21 22:50:03 +00:00
Ben Walker
d733654b5c bdev/nvme: Add a HostNQN parameter to NVMe bdev creation
Change-Id: I3ec1603d1d73f67773fcb7f43d63b1db55d4d6af
Reviewed-on: https://review.gerrithub.io/416055
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-20 22:43:46 +00:00
Ben Walker
b99dd2af4a bdev/nvme: Use spdk_nvme_connect for non-PCI devices
Change-Id: Ibd472e0deda621c4a103b4ddf988e4994181b3c8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/415542
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-20 22:43:46 +00:00
Seth Howell
b55efd2ac7 bdev: finish encapsulating members of spdk_bdev_io
Change-Id: Ic3e1c535d8d6323990bc353305d617b3fd0fa471
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416233
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-20 19:24:39 +00:00
Seth Howell
a32e9c354f bdev: encapsulate spdk_bdev_io callback function
This should be set from bdev.c and does not need to be accessed further
from bdev modules.

Change-Id: I2174ed2378d986cec291e7f29e64fe13a5f7df6d
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416060
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-20 19:24:39 +00:00
Seth Howell
6e456969ab bdev: encapsulate more members of spdk_bdev_io
These submission related variables are not accessed from any of our
current bdev modules.

Change-Id: I69e21eea736273183dfeb48922890a4dc9a244cc
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416058
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-20 19:24:39 +00:00
Seth Howell
90906933ac bdev: further encapsulate spdk_bdev_io struct
Move the status field into the internal structure.

Change-Id: Icf96436925dd829ee89d2491ef55e337823be6fb
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416057
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-20 19:24:39 +00:00
Seth Howell
30dbeae891 bdev: encapsulate buffer members of spdk_bdev_io
The members of spdk_bdev_io which are associated with the data buffer
should only be modified by calling functions in bdev.c

Change-Id: Icacb7f7387d626cf6834480b572e2f31b48666e1
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416054
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-20 19:24:39 +00:00
Ben Walker
c5b861fcec bdev/nvme: Refactor code to create a controller
This new function will get used from elsewhere.

Change-Id: I53d3fa1e7eb9ab322a794dd2728aba287017b36a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/415541
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-06-20 17:50:09 +00:00
Jim Harris
32d7c91cbc bdev: add spdk_bdev_queue_io_wait()
This function is intended to be used when an spdk_bdev
I/O operation (such as spdk_bdev_write or spdk_bdev_write_blocks)
fails due to spdk_bdev_io buffer exhaustion.  The caller
can queue an spdk_bdev_io_wait structure on the calling thread
which will be invoked when an spdk_bdev_io buffer is available.

While here, turn off error messages in bdev.c related to
spdk_bdev_io pool exhaustion, since we now have an API designed
to gracefully recover from it.

Also modify bdevperf as an example of how to use this new API.

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

Reviewed-on: https://review.gerrithub.io/415074
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-20 17:41:47 +00:00
Tomasz Zawadzki
96e93bd8d5 bdev: add delete_aio_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for AIO.

Changes in tests and spdkcli done accordingly.

Change-Id: Ib732953a2c138dc25915ba97ce3a8acf771ad74f
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/415462
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-19 20:43:12 +00:00
Jim Harris
ddc63f077a bdev: change spdk_bdev_free_io return type to void
Change the checks to asserts instead.  No callers ever
checked the return codes, and if they did, there's
nothing they can do to recover from an error status.

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

Reviewed-on: https://review.gerrithub.io/415539
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-19 07:28:20 +00:00
Changpeng Liu
bad7601c8e bdev/nvme: factor out NS bdev creation function
Change-Id: I3504aa0251c35f641b40b5b3b1d64b2bb7337981
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/415116
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-18 22:23:06 +00:00
Changpeng Liu
e0b1704ae0 bdev/nvme: use arrayed bdevs structure for each NVMe controller
Since the number of Namespaces for each NVMe controller will
not change during the lifetime, and each Namespace will only
construct one block device, For the purpose to support NS
attribute event in bdev_nvme module, using arrayed data
structure makes the implementation much easier.

Change-Id: Ia3a64cd1e8d59937f0c91daaee9c5bd28708402b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/415115
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-18 22:23:06 +00:00
Jim Harris
2255533973 bdev: remove shared_resource from TAILQ before putting io channel
Normally, the put_io_channel is deferred - but for unit tests
messages are called inline and not as events.  This results
in spdk_bdev_mgmt_channel_destroy() complaining that
the shared_resource list isn't empty.

So just remove it from the TAILQ before putting the io_channel -
that's more correct anyways.

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

Reviewed-on: https://review.gerrithub.io/415529
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-15 20:57:08 +00:00
Jim Harris
7717cfcacc bdev/iscsi: fix double spdk_bdev_module_finish_done() call
bdev_iscsi_lun_cleanup() was not accounting for LUNs
getting cleaned up before the module_finish function
was called.  This resulted in the bdev/iscsi module
calling spdk_bdev_module_finish_done twice which
resulted in io_device_unregister not found errors and
possible seg faults.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I42c3e0af250e0abcea1cd88ffd3c041ebdaeea49
Reviewed-on: https://review.gerrithub.io/415372
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-15 20:57:08 +00:00
Andrey Kuzmin
9abd8becc5 Avoid scheduling removal of the same bdev descriptor multiple times.
Deferred descriptor removal invocation under bdev_unregister() does
not account for the possibility of bdev_unregister being entered
multiple times for the same bdev (which is possible thanks to multiple
paths to unregistration - consider bdev hotremove callback and
_spdk_bdev_finish_unregister_bdevs_iter iterator - being present).
Therefore, currently nothing prevents _remove_notify for the same bdev
descriptor from being scheduled multiple times.

This commit adds boolean remove_scheduled field to struct spdk_bdev_desc.
The value is set when remove_notify for the descriptor is being
scheduled for the first time, and checked on subsequent attempts.

Change-Id: If2c5a365c05c4123c50edf5a2db164be9dd26f8e
Signed-off-by: Andrey Kuzmin <andrey.v.kuzmin@gmail.com>
Reviewed-on: https://review.gerrithub.io/415319
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-15 17:47:05 +00:00
Jim Harris
f22755cfad bdev/rbd: destroy ioctx in bdev_rbd_init
This fixes issue #301.

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

Reviewed-on: https://review.gerrithub.io/415282
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
2018-06-14 21:31:06 +00:00
Jim Harris
ed6827edbf bdev: prepopulate per-thread bdev_io cache
This helps prevent starvation in the case where a thread
is started but remains idle, while other threads consume
all of the spdk_bdev_io buffers in the global pool.

This starvation issue is fairly theoretical at this point,
but future patches will be adding the ability for callers
to be notified when an spdk_bdev_io becomes available if
the pool is exhausted.  We will add tests to stress
pool exhaustion at which point this patch will become
much more important.

While here, increase the minimum bdev_io_pool_size to
account for the mgmt_ch getting destroyed and then
immediately created again on the master core.  In this
case there is a window where both channels exist at
once - the one being destroyed won't free its cached
spdk_bdev_ios until the deferred spdk_put_io_channel
event executes.

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

Reviewed-on: https://review.gerrithub.io/415039
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-14 14:57:11 +00:00
Jim Harris
7fe2855651 bdev: check desc->write in spdk_bdev_write_zeores_blocks
We should not allow write_zeroes commands if the descriptor
was not opened for writing.

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

Reviewed-on: https://review.gerrithub.io/414896
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-14 14:57:11 +00:00
Jim Harris
a6e3c8e90b bdev: remove ERANGE check from spdk_bdev_write_zeroes_blocks()
spdk_bdev_io_valid_blocks() already takes care of this.

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

Reviewed-on: https://review.gerrithub.io/414895
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-14 14:57:11 +00:00
Jim Harris
3090f4012e bdev: add set_bdev_options RPC
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I060679165bd4215d010e74407aedd1aedc20fb9a

Reviewed-on: https://review.gerrithub.io/414713
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-06-14 14:57:11 +00:00
Jim Harris
9f583911fd bdev: add INI config file options for bdev_io parameters
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I10bd5cab8789b8cf4d8fd9cb848cede8372be45e

Reviewed-on: https://review.gerrithub.io/414712
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-06-14 14:57:11 +00:00
Ziye Yang
4f47c066c9 iscsi initiator: remove the deleted variable.
I do not think that this variable is needed.
The rpc system will be always executed in the first
call, so there is no sync issue, add a deleted variable
and put the free in the loop sounds not very clear.

For the ASAN issue (use req after free), I think
that the correct solution is that: we should store
the context first instead of defer the free of req.

Change-Id: I49ca2708ddc2c5533bb3a0aee4622ae23bfe47c6
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/414726
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-14 02:54:27 +00:00
Jim Harris
503cddac70 bdev: add global structure for bdev_io options
Currently this just includes the overall size of the
spdk_bdev_io pool and the size of the per-thread
spdk_bdev_io caches.

Later patches will allow configuring these via
INI config file and JSON-RPC.

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

Reviewed-on: https://review.gerrithub.io/414710
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-06-13 00:38:41 +00:00
Jim Harris
e30535fecf thread: add spdk_thread_get_count()
This will return the number of currently allocated threads.

Modify the bdev_io caching code to use this new API since these
caches are really per-thread, not per-core.  SPDK does not support
dynamic threading yet, but once it does, we will want callers to be
using functions from the thread API - not counting the number of cores
allocated to the application.

spdk_env_get_core_count may still be useful as a helper function, so
it is still kept and not deprecated.  For example, app.c uses it to
print the number of cores allocated to the application.  bdevperf should
eventually be modified to use spdk_thread_get_count, but holding off on
that for now until spdk_event_allocate() uses threads instead of a reactor
lcore to specify where the event should be executed.

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

Reviewed-on: https://review.gerrithub.io/414709
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Madhu Pai <mpai@netapp.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-13 00:38:41 +00:00
Vishal Verma
9380f06bdc iscsi: Correct return code values of bdev iscsi pollers
This corrects return code value of the bdev iscsi pollers. It was
needed to ensure all the pollers output consistent return code
values. This will further help in measuring consistent poller busy,
idle or unknown tsc stats.

Change-Id: I19c678bee9079f6aa453a4b925819a5ea1086534
Signed-off-by: Vishal Verma <vishal4.verma@intel.com>
Reviewed-on: https://review.gerrithub.io/414722
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-12 20:52:45 +00:00
Changpeng Liu
a52b35069a bdev/nvme: remove redundant check for active NS
Change-Id: I5ee5d296b6c831447e2af6c4cb4c24b6c676a92b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/414743
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-12 19:37:04 +00:00
Pawel Wodkowski
bd52bfecb5 bdev/iscsi: add poller when there is no master channel
Target might want to send Asynchronous Message that we need to handle.
Of course this need further work but at least we can respond to NOP

This patch also open a way to remove bdev_iscsi_conn_req structure as it
make more troubles than need when managing connections request.

Change-Id: Ib5bc8ae3bc5f90219bb4e13aee1b2e637b458236
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/410891
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-06-12 18:01:03 +00:00
Chunyang Hui
c739083169 bdev/iscsi: Add bdev_iscsi_flush
Change-Id: I6afb19f205be983206ce33c5c79718eb32ff5467
Signed-off-by: Chunyang Hui <Chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/413715
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-12 17:44:57 +00:00
GangCao
7191c4bdfb bdev/qos: add the bandwidth rate limit control
This patch is to add the core control policy for the
bandwidth rate limit (max bytes per second). Change
the existing functions for a common name and specially
handle the case when IOPS and bandwidth rate limiting
are both enabled.

Change-Id: I9f4565958d472559ef6d8bea52b1fe2a5f3c8969
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/413821
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-12 16:38:14 +00:00
GangCao
8da7772a7d bdev/qos: add the configuration parse of bandwidth rate limiting
To support the bandwidth rate limiting besides the IOPS rate
limiting, this patch is to add the support of the configuration
parse. The format will be as following to have a 10 (10M)
on the Malloc0 bdev. The default unit is in MB.

Limit_BWPS Malloc0 10

Change-Id: I62d70391ccad7804e6673ec56a3ed1cb0a4fbbd4
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/413652
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-06-12 16:38:14 +00:00
Ben Walker
a83f91c29a thread: Replace #include of io_channel.h with thread.h
Change-Id: I6babd4cf990bf19b510db88bdfb0ca81e29d9252
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/414700
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Madhu Pai <mpai@netapp.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-12 15:24:07 +00:00
Daniel Verkamp
f9117f050e Remove executable permissions on source files
A couple of files were accidentally marked as executable.

Change-Id: I89ff0bc037fba1b5d073ceea55c78fb5d9cb19b2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/414675
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-11 20:35:02 +00:00
Jim Harris
8cb3341e83 bdev/nvme: print error message when PCIe SSD not found
This includes when the SSD's BDF is valid, but not attached to UIO/VFIO.

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

Reviewed-on: https://review.gerrithub.io/414063
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-06-07 17:46:02 +00:00
Jim Harris
c796b90747 bdev/iscsi: break out common code for completing a conn_req
Suggested-by: Ziye Yang
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6ca7f08aed2e12c59518269c7b277895b4817bd8

Reviewed-on: https://review.gerrithub.io/413844
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-06 16:05:57 +00:00
Chunyang Hui
3f4c54a7c7 bdev/aio: bdev_aio_flush remove redundant parameters
Change-Id: I3f458fbf7758d912344c21026d672e7bdcf60e8e
Signed-off-by: Chunyang Hui <Chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/413724
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-05 18:45:42 +00:00
Pawel Wodkowski
fba68d61e1 bdev/iscsi: add RPC support and cofnig dump
Also, as we are here, switch to new spdk_json_write_named_* API in
bdev_iscsi_dump_info_json()

Change-Id: Ib29466eb5c6d6496dd1d8efc1f2064577bf56272
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/406635
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-05 17:52:06 +00:00
Pawel Wodkowski
06fdb62b3b bdev/iscsi: make connection poll time 0.5ms
Change-Id: Ib8d77b44ef10b03d6554c32f78e92f197f6c7e7f
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/412839
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-06-05 17:52:06 +00:00
Pawel Wodkowski
a76cc7ce61 bdev/iscsi: add create callback
Also convert bdev_iscsi_set_module_init() into new callback.

Change-Id: I439369180e1e10eab5dee6aba27ffb0489ea2550
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/410095
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-05 17:52:06 +00:00
Ben Walker
a94accabff bdev: Begin encapsulating spdk_bdev_io
This begins the process of hiding data members in
spdk_bdev_io that don't need to be accessed from
within bdev modules.

One strategy would be to implement accessors for
every data member in the structure. However, that
may have negative performance effects. Instead,
create a new internal structure within the old
structure. This new structure will still be visible
for now, but at least makes clear which members
are accessible and which are not.

This patch shifts one data member to the new structure
as an example.

Change-Id: I68525db995325732fe9f5fc3f45b06920948309b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/412298
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-04 17:14:22 +00:00
GangCao
c5f3ab7a73 bdev/qos: queue and submit directly on same thread
There is some overhead notified for the message processing,
instead to always send a message to the QoS thread, check
whether the current thread is QoS thread or not. If yes,
queue the IO immediately base on the QoS logic.

Change-Id: I9c1f93aeaf68c9b1a0282c3b690614413949d901
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/413028
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-05-31 05:53:01 +00:00
Liu Xiaodong
47c7470dbf spdk_ioctl: define nvme_ctrlr/bdev in internal .h
Prepare to insert ioctl related struct and funcs
into lib/bdev/nvme.
This is the start of one set of patches for nvme
ioctl. More details will be put in Trello:
https://trello.com/c/UYL5vhTN/50-nvme-userioctl

Change-Id: I5fc97230400ecab79f19dac4fb2badfd2d337f6c
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/412781
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-05-30 05:57:48 +00:00
Dariusz Stojaczyk
a3c9b23b84 bdev/virtio/rpc: fix memleak in construct_virtio_pci_blk_bdev RPC
Fixes #311

Change-Id: I9fff0dd3b0a1a564355af7fbc0f700f680602ac5
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/412548
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-29 19:45:22 +00:00
Daniel Verkamp
7f51e8e5e2 bdev/rpc: make get_bdevs_iostat name param optional
Similar to commit 75896c2510 ("bdev/rpc: make get_bdevs/config "name"
params optional"), make "name" fully optional so that specifying an
empty params object works.

Change-Id: Id4703544a32cd3e383a86debf50df1015b58e457
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412295
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-25 23:26:59 +00:00
Ben Walker
bcff4c89b8 bdev: Rename spdk_internal/bdev.h to spdk/bdev_module.h
This will become the public interface for implementing
bdev modules. Right now the file exposes too much of
the guts of the bdev layer to modules, so it needs
to be stripped down.

Change-Id: Ie8b8c3271d51fdb8d0c24a80244b3f3e510c8790
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/412297
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-25 16:02:22 +00:00
Pawel Wodkowski
9a7d4d53b3 bdev/iscsi: set user/password if provided in URL
Change-Id: I30748b4f53a966750cdcbd890a2d5bae72e8bf54
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/411434
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-25 16:01:40 +00:00
Daniel Verkamp
2ee95af0fd bdev: stop zeroing data in spdk_bdev_get_io_stat()
This will allow multiple independent callers to request I/O statistics
without stepping on each other (previously the stats would be reset on
each request, which only works with a single caller).

This also means that we can now allow requesting stats while the VTune
integration is enabled.

Change-Id: Ia9d4d6fd37fa66b3671cd33b3183c90524f955bd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412257
Tested-by: SPDK Automated Test System <sys_sgsw@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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-24 22:05:48 +00:00
Maciej Szwed
fda8596e0d lvol: add lvol inflate RPC call
Change-Id: I15d6d89bc6fabd87b458113c777a66e3bf1dcecc
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/408699
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-23 18:12:52 +00:00
Yanbo Zhou
64ccd4b95b bdev: a new public function to get the I/O statistics of bdev
Add a new function and its RPC caller. By using it, we can
get the statistics of all the bdevs or the specified bdev.

Meanwhile, with this patch, the open source tool 'sysstat/iostat'
can support for SPDK. The 'iostat' tool can call this function to
get the statistics of all the SPDK managed devices via the rpc
interface.

Change-Id: I135a7bbd49d923014bdf93720f78dd5a588d7afa
Signed-off-by: Yanbo Zhou <yanbo.zhou@intel.com>
Reviewed-on: https://review.gerrithub.io/393130
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-23 17:49:21 +00:00
Dariusz Stojaczyk
3949140b2e bdev/virtio_blk: fix double free on init failure
virtio_blk bdevs inherit the name string from their virtio
devices. The string is always freed on virtio device destroy, so
trying to free it as a part of bdev cleanup would always result
in a double free.

Change-Id: I47d20748ec12d9be201b9cd4f72bf89a61e80170
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/412073
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-22 23:08:40 +00:00
Daniel Verkamp
475165dffe bdev/lvol: inherit need_aligned_buffer of base bdev
Logical volume store bdevs should report the same buffer alignment
requirements as the base bdev of the logical volume store.  For example,
a lvolstore on a Linux AIO bdev should require aligned buffers.

Fixes #307.

Change-Id: I8e40dd428db882d18546caf678d1d4ef4462e2b4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412064
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-22 23:08:11 +00:00
Daniel Verkamp
75896c2510 bdev/rpc: make get_bdevs/config "name" params optional
The whole params object is already optional, but making the parameter
optional as well allows the specification of an empty object for params
to work.

Some JSON-RPC clients make it more difficult to omit the params object
entirely; see issue #303.

Change-Id: If0ac4ebfba33fd2c85f729d2f1109e4d0e47aa3b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/411740
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-22 23:03:30 +00:00
Ben Walker
aac1f5f934 bdev: Make the QoS channel use a regular channel
This makes a number of things much simpler and eliminates
the need for upcoming proposed reset handling.

Change-Id: I23a6badd0873f6dcf38ba1e55bf18d846c2843df
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407357
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-22 21:54:46 +00:00
Dariusz Stojaczyk
267318d671 bdev/virtio: fix memleak in construct_virtio_user_blk_bdev
Fixes #305

Change-Id: I70843e63c74761e71cbe39369249cfa1123a4275
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/411959
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-05-22 17:00:00 +00:00
Daniel Verkamp
571a4615c3 bdev/passthru: remove trailing space in config dump
Change-Id: I1b9a4aa5d71009ca9ca14748c520a8a492bfc039
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410944
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-21 19:44:30 +00:00
Daniel Verkamp
2ecf7fdbf4 bdev/passthru: clarify hot remove callback name
The hot remove callback is registered when we open the bdev in the
examine callback, but it's not used just during examine; change the name
of the callback to more accurately reflect what it is for.

Change-Id: Ie3e425e2e512f212d0dea40be12186c00e7a1091
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410943
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-21 19:44:30 +00:00
Pawel Wodkowski
4e012722ef bdev/split: free req in destruct_split_vbdev RPC call
Change-Id: Ia322d630481adab7dc9fdb28a8c90cd869a8f300
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/411085
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-17 17:38:02 +00:00
Pawel Wodkowski
c099f120cc bdev/iscsi: save initiator iqn name
This was omitted in one of previous commits.

Change-Id: I93ed4bae671bb36bf2b714ff6649b1f33a692647
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/410094
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-17 17:11:59 +00:00
Pawel Wodkowski
19e207dbcc bdev/iscsi: set target name during connection
Change-Id: I6143bc32331d2eea6d9b524816c9a7f0041e00aa
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/410093
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-17 17:11:59 +00:00
Pawel Wodkowski
5f2ad2620b bdev/iscsi: save string url rather than struct iscsi_url
iscsi_url is not need after bdev creation. Also implementing get_config
RPC call in next patches is quite problematic as information how bdev is
created using iSCSI URL is lost (eg username).

Change-Id: I8b097617c09bd4636c28531ca20a59919b2b4f84
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/407769
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
2018-05-17 17:11:59 +00:00
Pawel Wodkowski
81866c26d8 bdev/iscsi: move libiscsi code from initialize to create function
Change-Id: I75876cca6a35b366ce7d52cbd0eda0df4b6d9817
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/410890
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-17 17:11:59 +00:00
Pawel Wodkowski
d2bd0a77a3 bdev/iscsi: add ERRLOG in iscsi_connect_cb
Change-Id: I05ea1cb5c3b331338623dea1c6d113f2bb7388ca
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/410092
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-17 17:11:59 +00:00
Dariusz Stojaczyk
cc8bb51b24 bdev: rename bdev_module_channel to bdev_shared_resource
It doesn't represent an io_channel, so lets
rename it to something less confusing.

Change-Id: I730eb0ff0eb7737a59c190812a25b327ccd8fc14
Suggested-by: Ben Walker <benjamin.walker@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/409998
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-11 17:32:30 +00:00
Dariusz Stojaczyk
7ac765e66b bdev: create one module channel per io_device
Bdev layer has been recently refactored to share
internal module channels for *all* bdevs of the
same bdev module. This makes us return ENOMEM for I/O
of one bdev if another bdev of the same module (nvme, split, etc)
is entirely saturated. This is not the behavior we want,
as these bdevs may not have anything in common.

This partially reverts commit
e433001 (bdev: Put 3 types of channels in a hierarchy)

Change-Id: Ice0570f92fcaffa6301a282c53eeec8215f354fe
Reported-by: Ben Walker <benjamin.walker@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/409996
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-09 18:19:06 +00:00
Daniel Verkamp
2aced8c74c bdev/nvme: check passthru cmd size against MDTS
We can't split passthru commands, since we don't know how they behave,
so make sure they do not exceed the NVMe controller's declared maximum
data transfer size.

Change-Id: I27845dcb04d98e5d64a93f66731e6ed9db5fbbe7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410519
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-09 17:20:11 +00:00
Daniel Verkamp
87295c3c2c bdev/iscsi: silence clang enum conversion warning
This assignment is converting from the libiscsi sense key enumerated
type to the SPDK one, and clang issues a warning for this case.  We know
that these enums are equivalent, so just add a cast to avoid the
warning.

Change-Id: Ie2619b3ddeda46419df1a37755125bfeb6ddf636
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/409963
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-09 16:57:12 +00:00
Ben Walker
6cd524d87c bdev/qos: Break out code to destroy the qos into a separate function
Minimizes a future diff.

Change-Id: Ibc68588f3da2a169863d61a3aa20f384fa33e3dc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/409747
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-08 16:57:06 +00:00
Ben Walker
fa68a0fdbd bdev: Make QoS structure a separate allocation
Future changes will rely on the ability to atomically
swap this data structure out.

Change-Id: I77b93252df63155692271b5665cc040cb83a33d0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/409224
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-08 16:57:06 +00:00
Ed Rodriguez
7af03370b0 bdev: Replace fprintf with log message
Change-Id: Ic980f3f2f04db61e3ff7ce305817eede7a09cb5a
Signed-off-by: John Meneghini <johnm@netapp.com>
Signed-off-by: Ed rodriguez <edwinr@netapp.com>
Reviewed-on: https://review.gerrithub.io/410056
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-04 22:16:53 +00:00
Aneesh Pachilangottil
696c6bc27e bdev/nvme: Increase the number of namespaces supported per NVMe device from 32 to 128
When executing construct_nvme_bdev RPC method, if the NVMe SSD has
more than 32 namespace in it, then the response is displayed as invalid.
Increased the maximum number of namespaces supported per NVMe device from
32 to 128.

Change-Id: I79491af662b8d2059ad3e0920040a44a82d50064
Signed-off-by: Aneesh Pachilangottil <aneesh.pachilangottil@wdc.com>
Reviewed-on: https://review.gerrithub.io/409926
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-04 22:16:21 +00:00
Shuhei Matsumoto
e008db08e7 rpc: Add state_mask to each RPC method to make sets of RPCs
Add state_mask to each RPC method and state to RPC server, respectively.
State mask of RPC method is set at registration. State of RPC server
is changed according to the state of the SPDK.

When any RPC method is recieved, if the bit of the RPC server is on in
the state mask of the RPC method, it is allowed. Otherwise, it is
rejected.

When any RPC is rejected by state_mask control, the new error code
is returned to describe the error clearly.

Change-Id: I84e52b8725a286e9329d61c56f498aa2c8664ec1
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407397
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-03 19:48:15 +00:00
Dariusz Stojaczyk
14cf1ad3ac bdev/virtio/scsi: validate bs and num_blocks before creating a bdev
This becomes especially useful when accidentally
trying to use vhost-blk socket as a vhost-scsi one.
There's no SCSI/Block identification within the protocol,
so blk messages can be interpreted as scsi ones.
This usually results in a bdev being created with
bs==0 && blocksize==0 and leads to a crash.

Nevertheless, this extra check should be here to protect
against malicious/incomplete vhost-scsi targets crashing
entire initiator apps.

Change-Id: I06cfe3852c35fbd3e6a9f9a337a5abe5febaddf2
Signed-off-by: Dariusz Stojaczyk <darek.stojaczyk@gmail.com>
Reviewed-on: https://review.gerrithub.io/409671
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-02 22:10:39 +00:00
Ben Walker
e18d2b7687 bdev/qos: Add unit tests for spdk_bdev_set_qos_limit_iops
These won't cover race conditions across threads, but
at least we have something to test the behavior.

Change-Id: I8e620d2076fe7a3d95df668fda4bee49b6d0afa7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/409343
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-02 16:25:13 +00:00
GangCao
409353a23e bdev/qos: No operation for zero QoS setting on not enabled bdev
In below case that bdev is not QoS iops rate limiting enabled,
just report an error and return.

set_bdev_qos_limit_iops Malloc0 0

Change-Id: I1514dfd80f417a94d8c5147d7c4e891fc91a29fd
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/409243
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-26 23:40:05 +00:00
GangCao
2f94b4d4e3 bdev/qos: free the QoS channel when disabling
The related QoS channel resource needs to be freed
after disabling the QoS through the RPC call.

Change-Id: If757b5febdb909367c9b940de6e6b5e9528c0103
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/409125
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-26 16:41:18 +00:00
Ziye Yang
9df6188781 iscsi_initiator: Make the disconnect in async mode.
Change-Id: I06335ea1c552afba4025eb0c52abdd3488b02262
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/407236
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-25 20:20:34 +00:00
GangCao
804ebf9985 bdev/qos: set the enabled flag through the RPC method
Change-Id: I4a86ba226870eef67a30634c9f5ad592eb41cd52
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/408937
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-25 17:52:19 +00:00
Daniel Verkamp
f9d52c9ebd lvol: add destroy_lvol_bdev RPC method
This is the first step toward fixing the behavior of the lvol bdev
module so that it handles spdk_bdev_unregister() correctly.

Currently, when an lvol bdev is unregistered, this causes the associated
lvol to be deleted; this isn't the desired behavior, since
spdk_bdev_unregister() is just meant to drop the currently-exposed bdev,
as in a hot-unplug event, not destroy the backing storage.

The current implementation of the new destroy_lvol_bdev method still
calls into the exsting (broken) spdk_bdev_unregister() path, but this at
least lets us fix the existing delete_bdev RPC callers that really
intended to destroy the lvol.

The next step is to make vbdev_lvol_destroy() call spdk_lvol_destroy()
instead of unregistering the bdev, which will require cleanup in the
generic lvol layer to remove the close_only flag.

Change-Id: Ic4cb51305d31f6d7366a82ba7bf7b19ebbcd3e9c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408084
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-24 21:33:56 +00:00
Daniel Verkamp
b7060cb21a bdev/gpt: allocate buffer with correct alignment
Use spdk_bdev_get_buf_align() to determine the necessary memory
alignment for I/O buffers for the base bdev.

Change-Id: I6000c5b1117329d1a4618b19b6c6f3b919b7555a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408753
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-24 16:19:04 +00:00
GangCao
9c7d842cc4 bdev/qos: update the RPC method to make 0 iops mean unlimited
Unlimited I/O per second is equivalent to disabling QoS.

Change-Id: I03a489dd18b5d1a9a42f7853248911e97b7a211e
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/408291
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-23 23:23:42 +00:00
Dariusz Stojaczyk
0587e970e5 bdev/gpt: fix gpt scan for block sizes > 32KB
32KB spdk_bdev_read was failing straight away
on bdevs with block size bigger than that.

Change-Id: I83efe4284a3b82b83db0f678abb134c5daa36a84
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/383499
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-23 20:58:38 +00:00
Andrey Kuzmin
55eb9617cf bdev/aio: Fix EAGAIN handling.
To test, build and run bdevperf against an arbitrary aio device with
queue depth of 512 or more.

Change-Id: I800a9ea529af9de22fddf50e1dafeefa2244122d
Signed-off-by: Andrey Kuzmin <andrey.v.kuzmin@gmail.com>
Reviewed-on: https://review.gerrithub.io/408709
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-23 20:16:44 +00:00
Ben Walker
41d94136e6 bdev: I/O stats are now kept on the io_submit_ch
For bdev I/O that gets passed to another thread for handling,
such as in the QoS case, make sure the I/O stats are tracked
on the original submitting thread.

Change-Id: Ieaba168dde5eb24314e5cf64bb063faaca2b5be7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408399
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-23 17:49:08 +00:00
Ben Walker
7a8c30959c bdev: Move QoS parameters into separate struct
The QoS parameters are only used from the QoS thread,
so gather them together in a struct pointed to by the
bdev.

Change-Id: I91005f1d00205217a189d1ebacdb55782814f247
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407356
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-23 17:49:08 +00:00
Ben Walker
2fa8447f2f bdev: Handle calls to spdk_bdev_unregister from non-SPDK threads
Change-Id: Ic20993bdf5ae4e5ed7fbed7d630a0024462f7fc6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408534
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-23 16:14:32 +00:00
Ben Walker
106684ff45 bdev/nvme: Validate adrfam when printing out config file
Change-Id: Ibca68074005655f034d71f51b403e746525e922f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408532
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-23 16:14:32 +00:00
Ben Walker
a1bcc450f0 bdev/virtio: Validate maximum number of queues specified in config file
Change-Id: I372565a1d3388fc5f4da79e4eb2799572144ed83
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408531
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-23 16:14:32 +00:00
Ben Walker
3a5452d65d bdev/lvol: Validate lvs_bdev during dump info json
Change-Id: I16021ccd1fc6638dae977d0089f85895e60ceced
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408530
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-23 16:14:32 +00:00
Tomasz Kulasek
7fb0f7467c lvol: raport not supported io types on ro lvol
Change-Id: I07dac4bbf06a85659ae5d31e3f8d037d87825694
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/408483
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-20 15:22:53 -04:00
Tomasz Kulasek
887ecc2d82 lvol: display clone/snapshot status in get_bdevs
--------------+------------------+-------------------------------------------
Name          | Type             | Description
--------------+------------------+-------------------------------------------
snapshot      | boolean          | true if lvol is a snapshot
clone         | boolean          | true if lvol is a clone
base_snapshot | string           | name of base snapshot if lvol is a clone
clones        | array of strings | array of clones names created from snapshot
--------------+------------------+--------------------------------------------

Change-Id: I5df06798f3bd34bba89743aba896d129a0915d00
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/404638
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-20 15:22:53 -04:00
Paul Luse
cbb8f46575 bdev: fix timing of init_complete callback
Recently added a new call to bdev modules to inform them of when
bdev subsystem init is complete. The intention is for modules like
RAID or crypto that need to take some action after the initial bdev
subsystem init such as 'build whatever RAID volumes you can, all
initial examine callbacks are done' or in the case of crypto 'OK,
construct all of your crypto structures for HW and SW PMDs and
associate each to configured vbdevs.'

Now that I've implemented the crypto case I see that the call was
misplaced and will execute following any examine_done call including
subsequent bdev registrations.  Those cases, for both RAID and crypto,
need to follow a different path (examine) since all of the activities
associated with the new init_complete() callback are intended just for
the very first initialization of SPDK.

So, long story short, moving this call so that it's only executed once
when subsystem init is done and not on subsequent bdev registrations.

Change-Id: I952b90e33fc67d48d86c0a7de2ad47c74a98e839
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/408209
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-20 15:16:09 -04:00
GangCao
cb1c88d19f vbdev/passthru: add the construct_passthru_bdev RPC method
Add the RPC method to construct a passthru bdev.

The usage as following:

usage:
rpc.py construct_passthru_bdev [-h] -b BASE_BDEV_NAME -p PASSTHRU_BDEV_NAME

Change-Id: I87bcfde499a9f0c2f5758e36e6772e0fc2928d20
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/406891
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-20 14:58:13 -04:00
GangCao
92577c92b0 vbdev/passthru: introduce the public create_passthru_disk function
The patch here is to have two utility functions that can be
called in the examine path and also through the newly created
create_passthru_disk() public function.

This is also a preparation work to add the RPC method to construct
the passthru vbdev at runtime.

Change-Id: I6cf7ec61ace8b021de19d35ddbd5441618938739
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/406888
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2018-04-20 13:39:21 -04:00
GangCao
b8681aa659 bdev/qos: add the QoS information on RPC get_bdevs interface
Change-Id: I515a08ce95ffd6fea4d5f4fab42e6d09bcdd11f7
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/393278
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-20 13:34:44 -04:00
Ben Walker
7540c61a21 lvol: Make snapshot_lvol_bdev RPC's arguments required
Progress cannot be made without these values.

Change-Id: I40e346f8598dcca8a4028c1c05cfdebdc5a8e4c1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408245
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-19 15:48:36 -04:00
GangCao
ffba4fdbc3 bdev/qos: add RPC method to set QoS at runtime
This patch adds a new RPC method to configure QoS on bdev
at runtime.

For example:

set_bdev_qos_limit_iops Malloc0 20000 --> Enable QoS on this
block device with 20000 IOPS rate limiting.

Change-Id: I1ee8b313b769fb5a664820f4ba827e0230be4b5d
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/393255
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-19 13:47:54 -04:00
Ben Walker
87211463a2 bdev: Fix data type mismatch for io_per_sec
Change-Id: I6bf491bd9661d247a70d7ee323c14397cd577636
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407367
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-18 16:48:56 -04:00
Ben Walker
2931d638e7 bdev: Configure max_ios_per_timeslice when QoS is initialized
This value was recalculated on each time slice. Instead, just
set it up right away.

Right now QoS is statically configured at creation time for bdevs,
which means we can get away with this. Once dynamic
configuration is added, events will need to be sent to the QoS
thread.

Change-Id: I8bde4170f2d882d2c0f5e57a6aa7713d045beb7d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407355
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-18 16:48:56 -04:00
Ben Walker
880e3b153e lvol: Make lvol rename RPC arguments required
The RPC can't make progress if the old name and new name
are not specified.

Change-Id: I1a74fb264142fc2ff17cc5b3a2837840509827b5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408221
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-18 15:35:12 -04:00
Ziye Yang
ec5cf8a221 bdev/iSCSI: Make the connection connect in async mode.
Change-Id: I9d3b56ed908273c6853014241a28237f8d077cfa
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/405537
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-18 12:31:31 -04:00
Dariusz Stojaczyk
6c0078300b bdev: defer freeing bdev_io mempool
There might be a couple of mgmt channels still
trying to use the mempool from their destroy
callback (spdk_bdev_mgmt_channel_destroy).

Change-Id: I59247bfa283dc0481923fdd4eaf8e1726e1267ce
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408192
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-18 12:00:16 -04:00
Ben Walker
2e1dbc4587 bdev: Fix race condition when testing whether QoS is enabled
When testing whether QoS is enabled, the code previously
checked mutable values in the bdev itself. Instead, it needs
to check the flag in the channel.

Right now, QoS can only be configured statically when the
bdev is created. This means that no channels will exist
prior to QoS being turned on, which simplifies setting
the per-channel flag (only need to set it when a channel
is created).

Change-Id: I59e56c64c18c262cc2a7f71a6dde8329edb35db7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407354
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-17 21:47:12 -04:00
Pawel Wodkowski
1a6dac405b bdev/virito: add JSON config dump and generic create RPC
The new construct_virtio_dev allow creating virtio SCSI and blk for both
PCI and user transports.

Change-Id: Ibd79c4fb75e3cbd993b46227d86e915c1b740a18
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/405419
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-17 17:16:06 -04:00
Pawel Wodkowski
f34fae94fe bdev/lvol: add dump config mock
Change-Id: I0e081b17071bb5d906676c1b509bf8e0fc528b8e
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/407745
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-17 13:30:32 -04:00
Ben Walker
ade146b966 bdev: Wait for io device to unregister in bdev_part
Change-Id: I6627fd4253094548816c50bd97e13b22dc245df1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407838
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-17 11:47:09 -04:00
Pawel Wodkowski
5f6c428dbc bdev/iscsi: initialize g_iscsi_lun_head staticly and make iqn per bdev
Change-Id: I3cdf920a937209fd03cf3998c7927e505504b5f9
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/407767
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-16 19:14:54 -04:00
paul luse
a4a497d5b0 bdev: add new optional bdev i/f entry point
Add new optional bdev module interface function, init_complete, to notify bdev modules
when the bdev subsystem initialization is complete. Useful for virtual bdevs that require
notification that the set of initialization examine() calls is complete.

Change-Id: I0997fb5749d430f2fd3a40172ec8a1d5caa96964
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/407222
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-13 17:46:33 -04:00
Daniel Verkamp
3b62b84f41 lvol: use uint64_t to represent lvol sizes
Replace the few existing uses of size_t as lvol size with uint64_t for
consistency.  size_t is meant to represent the size of an object in
memory, and it may be smaller than uint64_t (e.g. on 32-bit platforms).

Change-Id: Ifed8959625e18be67e98070f7fea1f2a09e4e791
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407008
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-12 11:42:06 -04:00
Slawomir Mrozowicz
7552707ef1 bdev: Enable lvol resize RPC
Enable test functions for lvol resize.

Change-Id: Ia4583af211350054797d2d8441083e582e6e2ab7
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Reviewed-on: https://review.gerrithub.io/395043
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-10 19:24:04 -04:00
Slawomir Mrozowicz
f3e13c95d9 bdev: Change vbdev lvol resize function
Change vbdev_lvol_resize() char name argument
to struct spdk_lvol lvol.
Add spdk_bdev_notify_blockcnt_change() after
succesfull spdk_lvol_resize().
Some code clean up and refactoring.

Change-Id: Idaa5bd4707e2479dfee50459a9844319b8c35d3a
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Reviewed-on: https://review.gerrithub.io/394521
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-10 19:24:04 -04:00
Ben Walker
e433001a47 bdev: Put 3 types of channels in a hierarchy
The bdev layer has three types of channels:

* bdev channels - one per bdev per thread
* module channels - one per bdev module per thread
* management channels - one per thread

Arrange this in a hierarchy where bdev channesl point to
module channels which point to management channels. Rely
on the channel mechanism to reference count and release
resources at the correct time.

Change-Id: I9341068f95ec2a3897c5a1d897895a4f5cc49299
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406854
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-10 19:12:15 -04:00
Ben Walker
150a5898cb bdev: Reorder functions in the spdk_bdev_module_finish path
This is code movement only. This minimizes an upcoming
diff.

Change-Id: If2af99fdd86ca3c8ce672b9d8f5bc44a2f30cc8e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407218
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-10 19:12:15 -04:00
GangCao
9bad29c18c bdev: update the name of Passthru section
Change-Id: I28fa033378649f9cf02bf216698b9d2058f77c9d
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/406883
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-10 15:44:54 -04:00
Tomasz Zawadzki
97934c5291 lvol: add snapshots and clones
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Change-Id: Ibc43e3ee65d85a83d78d6e15457ae57992a1188a
Reviewed-on: https://review.gerrithub.io/395059
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-10 13:46:09 -04:00
Ben Walker
7b822323e8 bdev: Remove all uses of strncpy
strncpy is going to be added to the list of banned
functions because it does not guarantee strings are
null terminated.

Change-Id: I6657471f5771489b5004e48d08e79cebb860b069
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407019
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-10 12:58:34 -04:00
Ben Walker
a615ae7e26 bdev/nvme: Fix descriptor leak in apply firmware RPC
Change-Id: I1a82e1c248d573f3a99e661bc7fef0871cfcc7f4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406993
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-10 12:58:34 -04:00
Ben Walker
a28294b0b4 bdev/nvme: Fix use after free in apply firmware RPC
Change-Id: I7ffe73e803ef416ce698df2d8403e32fa94ebccd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406988
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-09 16:33:19 -04:00
Ben Walker
7eac6d9b3e bdev: Remove _spdk_bdev_finish_unregister_bdevs
This is a one line static function called from one place.

Change-Id: Ie00bbedfabf54d40a2f571bbc8d30f0ac8cbbdd6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406853
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-04-09 12:41:44 -04:00
Ben Walker
fe53e5330c bdev: Move definition for spdk_bdev_module_channel up
Move this definition between the management channel and
the bdev channel struct since that's where it fits in
the logical hierarchy.

This is just code movement. No other changes.

Change-Id: I80b9909b14cad473a7768780ac9ab74a2f1309e5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406852
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-09 12:41:44 -04:00
Ben Walker
03717822c5 bdev: Change spdk_bdev_get_io to take a bdev channel
We'll need the bdev channel inside this function in
an upcoming change.

Change-Id: Iadb07700ba57b23d37b7c373d0e9c5063aaed57b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406851
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-04-09 12:41:44 -04:00
Ben Walker
ddde2c74f2 bdev/nvme: Fix memory leak of command in apply firmware RPC
The command can be allocated on the stack safely instead.

Change-Id: Iab412e91c1a06f80f1d86d7f9a6d88be2a759b09
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406859
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-09 11:39:18 -04:00
Jim Harris
218dcd840a bdev/pmem: change all NVML strings to PMDK
NVML (Non Volatile Memory Library) changed its name to
PMDK (Persistent Memory Development Kit), so make the
necessary changes to the SPDK repository.

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

Reviewed-on: https://review.gerrithub.io/406256
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-07 00:07:57 -04:00
Daniel Verkamp
72509206dd bdev/malloc: num_blocks parameter should be uint64_t
Change-Id: Ib88b797da168290ac07564cae46e544cb037f575
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406672
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-06 18:22:22 -04:00
Daniel Verkamp
415933c879 bdev/null: fix RPC string memory leak
The uuid string was not freed.  Factor out the free() calls into a
helper function and add a free of uuid.

Change-Id: I2f5f794e240fcdb07f346b892ea4dec46dc9bdb6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406665
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-06 18:22:22 -04:00
Daniel Verkamp
aa3345346c bdev/null: num_blocks parameter should be uint64_t
Change-Id: Ie60989f157d20119dd24488688d527f607b585f1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406660
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-06 18:22:22 -04:00
Ben Walker
0b5fb0921f bdev: Consistently refer to the module channel as module_ch
It was called module_ch and shared_ch throughout the code.
The name module_ch is better, so use that everywhere.

Change-Id: Id030f72c878f44ea4dc8ca14b936719e26e891e3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406825
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-06 16:30:49 -04:00
Paul Luse
8988543dbf bdev: cleanup passthru vbdev
A few small changes for readability and one changed examine
error returns to breaks to assure examine_done() is called
in those cases.

Change-Id: If21ecdfa9ce1d6dbeeff4ced4e73425cec5940e1
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/406818
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-06 16:29:54 -04:00
Jim Harris
463925ff0f blob: make spdk_blob_resize an async operation
To support resize operations during I/O, we will need
to send messages to each thread to quiesce I/O while
the resize operation is in progress to guard against
the cluster map memory changing while another thread
is accessing the cluster map.

Therefore, spdk_blob_resize needs to be asynchronous.

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

Reviewed-on: https://review.gerrithub.io/404616
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-05 18:43:11 -04:00
Pawel Wodkowski
33aad6ee8d bdev/nvme: add JSON config dump
Change-Id: I0f22e6051e291b3eac8589fe0f686f7db445d71c
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/406587
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-05 18:26:16 -04:00
Dariusz Stojaczyk
20d8fec039 bdev/virtio/scsi: fix bdev->name memory leak
This must have been overlooked before.

Change-Id: I631c7b926970d045e9e91cada535acd605e05b6e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/406334
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-05 15:56:21 -04:00