Commit Graph

7957 Commits

Author SHA1 Message Date
Jim Harris
cdd64c1c8c ut/reduce: modify write_maps test to write full chunks
This test verifies that all of the io_unit_index[] entries
are written.  For that to really happen, the write for
the chunks must not be compressible.  Currently the compress
algorithm just copies the data and doesn't actually
compress - so writing a partial chunk works OK for this test.
But upcoming patches will add a 'real' compression unit test
algorithm - at which point, writing just part of a chunk
will be compressible since the non-written parts will be all
zero.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449566
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-02 21:40:21 +00:00
Jim Harris
d25f2db94a reduce: account for compressed buffers
When we decompress, pass the size of the compressed
data - not the size of the buffer itself.

We also need to remove an assert that's no longer
true since we can now handle compressed chunks.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449513
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-04-02 21:40:21 +00:00
Jim Harris
27631eb571 ut/reduce: move ut_compress/decompress functions
This just moves code to prepare for these functions
to be used earlier in the file without adding
extra function declarations.

Move ut_build_data_buffer as well for similar
reasons.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449512
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>
2019-04-02 21:40:21 +00:00
Jim Harris
fa0d54d431 reduce: write uncompressed data when compress returns error
Most typically, the error will be -ENOSPC, meaning the
destination buffer wasn't big enough to hold the compressed
data.  But even for other types of errors, just write the
uncompressed data rather than treating it as an I/O
failure.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449511
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>
2019-04-02 21:40:21 +00:00
Jim Harris
c1bab69c61 ut/reduce: add ut_build_data_buffer function
This function can be used to create data buffers
with varying levels of compression - we'll use
this in upcoming patches to test how lib/reduce
actually handles compressed buffers.

Modify the unit tests for the compression algorithm
to use this new function as well.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449500
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-02 21:40:21 +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
Changpeng Liu
790c47d479 iscsi: fix up segment fault due to failed initialization
My iSCSI target reported segment fault after memory allocation
failure, and add the addtional check here can fix the issue.

Change-Id: Iee3e497d7028fbface6d110c78e73965ef0f178b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449717
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-02 19:25:00 +00:00
Maciej Szwed
e87e8263df lvol: Fix for lvol failed deletion flow
lvol should not only be freed but also removed
from lvols list when deletion fails.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I3a047e1cc611e71b1544ca77c256a879dd2efdae
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446619
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@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-04-02 19:23:22 +00:00
Darek Stojaczyk
06ec27a54d jsonrpc.md: add cache param to construct_ftl_bdev
The new param was added in a0cb5e9d [1], but never
described in jsonrpc.md.

[1] a0cb5e9d (lib/ftl: retrieve caching bdev from configuration)

Change-Id: I735644ffcf47abdede13a96ffddef8d1ce48c815
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449736
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-02 18:12:18 +00:00
Jim Harris
ca44fd6955 nvmf: put \0 at end of default serial number
It's not standard to put a newline here - let's use a null
character instead.

Found while using nvme-cli - when creating a subsystem with
default serial number, the right justified callout text had
an extra newline in it.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449645
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-04-02 13:08:06 +00:00
Claire J. In
3be9febdf9 lib/ftl: check for null
Fixes #726.
This prevents a segmentation fault by checking the pointer
before accessing it.

Change-Id: I18a3776fbcd6242c6efd1b88044debaa88c7342f
Signed-off-by: Claire J. In <claire.in@circuitblvd.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449591
Reviewed-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-02 08:22:48 +00:00
Vitaliy Mysak
643af88f13 ocf: update OCF submodule
Update OCF submodule to get 2 new API functions:
* ocf_mngt_cache_trylock()
* ocf_cache_has_pending_requests()

Change-Id: I2a1fee104bfd55dfb2e99ec538ec180681bd0f30
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449555
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 00:09:22 +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
Wojciech Malikowski
dd54dff78b lib/ftl: Keep DMA buffer for metadata as part of ftl_md structure
This patch is starting point for metadata refactor
which is needed for efficient ANM events support.

Change-Id: I81d864605e69008d8e3922fb61adf504187447a1
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449328
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-02 00:04:58 +00:00
Pawel Wodkowski
9b025e17b3 rpc/client: return request ID from send and add_request methods
User should know the request ID that was issued.

Change-Id: If1191f73b31ebe04f23a88a9ca31fa157474056b
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449315
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@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-04-02 00:04:41 +00:00
Changpeng Liu
4cfd17a7ce examples/nvme: hot added drive cannot be attached
When test hotplug, the timeout callback will set the attach callback
to NULL, so it will not add the drive back to hotplug tool automatically
sometimes.

Change-Id: I91a7c29059a7f680b2a0b7b79cf0a62c5638dcda
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449519
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:03:40 +00:00
Darek Stojaczyk
27a23a33f9 blobfs: switch to spdk_*malloc()
spdk_dma_*malloc() is about to be deprecated.

Change-Id: Ib9fb94463a69ffd9660ab2c7fbe02826a7e06741
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449796
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:58 +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
Karol Latecki
ab1622aa35 autotest_common: delete ceph_raw.img after test
Recent change of ceph_raw.img size from 10G to 4G breaks
tests on patches which are not rebased or which use
previous SPKD releases.

Change-Id: I9dd79756e3cc7949593cd1c16d4735542d1fb32d
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449469
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-04-01 23:59:44 +00:00
Wojciech Malikowski
afc4f91341 bdev/ftl: Add json config generation
Change-Id: I0baa6cfb4e4cb2a5ae68de730edb75011bd8e49d
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445254
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-01 23:59:39 +00:00
Seth Howell
51a65776ee doc: Add link to 19.01.1 NVMe-oF perf results.
Change-Id: I723ccf45248c2621592019be089ed56a7918b47b
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449596
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-04-01 23:59:27 +00:00
Shuhei Matsumoto
038b319dfb iscsi: Remove the prefix spdk_ from private functions missed in the previous patch
A few private functions had still the prefix spdk_ in their names.
This patch completes the effort to remove the prefix spdk_ from
private functions in iSCSI library.

Change-Id: Ic1a1e85220edb72296ca4881bdf7b550c4f6b6b8
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449716
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-01 23:59:15 +00:00
Karol Latecki
c1d59e0d0c test/vhost: do not unmap lvol for benchmarking
Make use of --clear-method for lvol store and lvol bdevs.
Lvols will not perform unmaps in this test.

Previously precoditioning in script was only allowed for lvol
bdevs, NVMe precond had to be done outside script.
Changing this to allow both bdev types to be preconditioned
as part of the script.

Change-Id: Ibcb4f2a084aaa60885d3e9e9c8a4f518c8ad2477
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448978
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-04-01 21:02:23 +00:00
Pawel Wodkowski
cdc8f83f26 rpc/client: move exception rising on error to client.call method
Client might wan't to handle error response on it's own. To keep
compatibility with legacy code we need to move exception rising to call
method.

Change-Id: I8a07e7556424e87ee10fa9332100a9a10abe05d8
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449314
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-04-01 21:01:06 +00:00
JinYu
3a5abc63b8 test/unit: Make sure the function runs correctly
1,add a judgement to ensure spdk_blob_close() runs correctly.
2,make sure the command has been completed before _spdk_bs_free()
which would avoid heap-use-after-free.

Change-Id: I698521d8d4d8e1d8a7374665d27d6eec6d0b85f5
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449517
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-01 09:11:06 +00:00
cranechu
6a67d5178e nvme: remove set_state after nvme_ctrlr_identify_id_desc_namespaces
Fixes #722. The state was set in nvme_ctrlr_identify_id_desc_async

Signed-off-by: cranechu <cranechu@gmail.com>
Change-Id: I232f0035e8c45d49eca2de7174c91860a299d804
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449527
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-04-01 09:09:07 +00:00
Vitaliy Mysak
6938032031 docs/ocf: update configure option
Update configuration option in OCF docs.
Since OCF became submodule, simpler `--with-ocf` option is preffered.

Change-Id: Ieb12d2e4d6c4062f574280461a138a6dafd9ed99
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449560
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-04-01 09:06:32 +00:00
Konrad Sztyber
67194e3ac7 lib/ftl: added band selection traces
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Iafe7021febd12f1f9b00890c357a5d3f26611c31
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449422
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-04-01 09:05:33 +00:00
Konrad Sztyber
9ed090d23d lib/ftl: traces refactor
Replaced tpoint_ids generated based on the properties of the IO with a
static list of tpoint_ids, to fit inside the per-group maximum tpoint
limit (64).

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ifb8b8637a1e6d8f0e7fd3f4363b97fdbedcdb8d5
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448067
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-04-01 09:05:33 +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
Shuhei Matsumoto
0ed66e7ef6 scsi: Remove the prefix spdk_ from names of private functions
This patch doesn't change any behavior too.

Change-Id: I67be498bfd4f1ae42e6239de4539e5e99f158279
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449397
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-04-01 00:52:56 +00:00
Shuhei Matsumoto
893e02a54f iscsi: Remove the prefix spdk_ from names of private functions
iSCSI library had used the prefix spdk_ for most functions regardless
of private or public. Using the prefix spdk_ only for public functions
will be helpful to distinguish private and public functions, and
will be helpful to investigate issues or do further improvement.

Besides in iscsi.c static variable spdk_arc4random_initialized had
the prefix spdk_, and change it to g_arc4random_initialized according
to the SPDK's good practice.

iSCSI library still have some issues but is more stable than before
and now will be the good time to adjust the naming rule to other
libraries.

This patch doesn't change any behavior.

Change-Id: Ia0b8585a7ce6662cabc0e6f57b7ccb8a40342297
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449396
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-04-01 00:52:56 +00:00
Shuhei Matsumoto
b7039655ce iscsi: Remove unnecessary function declarations
These function declarations are not used.

Change-Id: If525f4157e3fa9e5d718e6c7aa77db8584edd14c
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449395
Reviewed-by: Jim Harris <james.r.harris@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-04-01 00:52:56 +00:00
Piotr Pelplinski
1d83a09d4b notify: add basic unit tests for notifications
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Change-Id: Ia6cc45c1c539cdc7d25fbe1a562afb21783dde4c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/432308
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-03-29 21:15:14 +00:00
Piotr Pelplinski
de5f53220c notify: add notification library
This patch adds library that will provide ability to notify about
events. On one side each spdk library can specify what kind of
notification it can produce and on the other side libraries can fetch
those notifications.

Example is bdev module, which lib notify about added or removed bdev.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Change-Id: Ia95e564a8a43400b2745d9de8217b9cc84cd1b16
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/431920
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-29 21:15:14 +00:00
Changpeng Liu
851829c4ea nvme: don't poll the CQ after CQ is deleted
Change-Id: I7985907298ca714df82426f240c8b32b0139be6f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449518
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-03-29 21:14:50 +00:00
Ziye Yang
bdb1d5713f blobfs: Add trace info for request allocation.
Our blobfs allocates fixed number of reqs on three different channels
(the default size is 512), if the req cannot be allocated, our blobfs
related function will do nothing.

With this debug info added, we can easily know the issues.
If the fixed number of requests are not enough, we need to change the
design, using malloc/free together with the fixed number of requests.

During high presure test, I think that if the reqs are not allocated,
it will cause the sync, flush related issues.

Change-Id: Ied8cd5197c4f87b861bd7dc09edd5a095fdcc802
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448596
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-03-29 21:14:29 +00:00
Darek Stojaczyk
4a51888953 vhost/scsi: don't hotplug targets to stopped sessions
This is just a cleanup. There's no need to hotplug
or hotremove SCSI targets from stopped sessions, because
those sessions can't access any targets anyway. When
session is started, it already inherits all SCSI targets
from the vhost device. When it's stopped, it releases
resources of all targets. Intermediate changes have
no effect whatsoever, so don't do them.

Change-Id: Ibf283bcf8260e71dec8d9ea39a9461a978031ab3
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449392
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-29 20:19:12 +00:00
Darek Stojaczyk
1188bdd70d vhost/scsi: forbid removing targets that are still being added
It is theoretically possible for an asynchronous
hotremove request to be finished before the hotplug
request that was started first. This is obviously
not expected and will most likely result in a resource
leak.

For SCSI target hotplug, we immediately update the
whole vhost device object and then asynchronously
ask each vhost session to poll the changes.
For hotremove, we see the device attached in the
whole vhost device object, so we immediately mark
it as "still being removed" and proceed aynchronously
asking the sessions to hotremove. When session
receives the hotremove event first, it will either
fail an assertion (when debug is on), or do nothing.
The subsequent hotplug event will attach the target
again - and that target won't be ever freed.

Change-Id: I784c979fb47127a4238038ad9fb5ed1cac3ced04
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449391
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-29 20:19:12 +00:00
Pawel Wodkowski
346b59bd40 vhost-scsi: separatate scsi device state from scsi session state
For session context we need only a few fields from
spdk_scsi_dev_vhost_state structure, so introduce
its stripped variant as a separate structure.

Change-Id: I1be4e77447443d156f86033450892cb7cb464cb9
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447072
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-29 20:19:12 +00:00
Darek Stojaczyk
3fd405c54a vhost/scsi: remove hotremoved scsi targets on device stop
In cases where initiator closes the connection as soon
as it receives a hotremove event, there is a possibility
of SPDK vhost stopping the session before finishing up
the asynchronous target hotremoval. The target would be
either hotremoved once the session is started again
(and it registers its management poller again) or it
could cause a potential memory leak if that session is
destroyed. Even though the SCSI target itself is always
freed, the hotremoval completion callback is only called
from the management poller. At least in our RPC case,
not calling that callback results in leaking the context
structure and some json data.

We fix the above by calling all hotremove callbacks just
before stopping the device.

Change-Id: Ibfd773e1ab82b63643c57d7a9d37304e3007e38b
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/439445
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-29 20:19:12 +00:00
Seth Howell
934775db43 rdma: make semantic changes to fill_buffers func
Changing i to iovcnt in all references to the req->iov structure will be
important when we start processing multi-sgl requests.

Change-Id: I90a9b6d872b94f846ae7d29a45dd2703eafa6175
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449201
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-03-29 19:02:22 +00:00
Seth Howell
e70a759489 rdma: pull buffer assignment out of fill_iovs
This will be used by the multi-sgl version of this function as well.

Change-Id: Iafeba4836a77482fa2a158f86f1c17fe7fdeb510
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449104
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-03-29 19:02:22 +00:00
Seth Howell
33197a1bbd doc: update links to the performance reports.
The changes I made to the doc directory in spdk.github.io got
overwritten.

Change-Id: I468c7eeb8c36ccd969909e179c216d5def812602
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449360
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: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
2019-03-29 18:54:37 +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
Ben Walker
c04332d494 rocksdb: Add an SpdkFinalizeThread function
This is just a placeholder. The real implementation comes later.

Change-Id: I657b240977ba09fd6f24e9e36e97e293e73b5801
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449471
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:42:24 +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