Commit Graph

2202 Commits

Author SHA1 Message Date
Paul Luse
911c042df8 test: add mock and new function to test_env.c
Need to mock spdk_mempool_get() to test code path when it fails.
Also added spdk_mempool_get_bulk() to test env.

Change-Id: I7f64230c9841215a404149e9a48ad4bf8a63822c
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/420110
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-26 22:08:42 +00:00
Tomasz Zawadzki
43fe36672b bdev: add remove_virtio_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for virtio  bdev.
This is generic call for both - blk and scsi.
Scsi specific call has been removed.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3ed629942e9ef6067b488d94ca508b40e9e74f42
Reviewed-on: https://review.gerrithub.io/417008
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2018-07-26 22:07:50 +00:00
Tomasz Zawadzki
3a56fabce3 bdev: add delete_nvme_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for NVMe bdev.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib9a0475d735af2616a3005d04530ca825ece8a52
Reviewed-on: https://review.gerrithub.io/416546
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2018-07-26 22:07:50 +00:00
Tomasz Zawadzki
b36face57d lvol: remove destruct_req from lvol store
Since destroy_lvol_bdev was implemented, it is now more convinient
to call destroy/unload for lvol store explicitly.
Rather than using lvs struct to pass a request checked on each
lvol close/destroy.

Change-Id: I56ee626e96f8752909d1584a20fe3345c5607fdc
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/420285
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-26 21:55:36 +00:00
Tomasz Zawadzki
990d537e3d test/lvol: add destroy_lvol_bdev tests
Change-Id: I60a00cdb2de543633bd3bd7d2d70537328a2f1f1
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/420232
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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: Ben Walker <benjamin.walker@intel.com>
2018-07-26 21:55:36 +00:00
Jim Harris
911c12c657 test/event_perf: use less memory
There's no reason this test needs to use all of the
hugepage memory allocated in the system.

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

Reviewed-on: https://review.gerrithub.io/420456
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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-26 05:28:52 +00:00
Jim Harris
136c8c78b8 test/vtophys: reduce amount of memory requested
There is no reason for this test to consume all of
the huge pages on the system.  256MB is sufficient.

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

Reviewed-on: https://review.gerrithub.io/420309
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
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>
2018-07-26 05:28:52 +00:00
Ziye Yang
703d1f80a8 blobfs: change the return type of spdk_file_truncate
Change-Id: I29347d7b7be0237d7d604c7cd7363fa08a0cd025
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/420133
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-07-26 01:42:17 +00:00
Pawel Niedzwiecki
967ca457d0 test/nvmf remove unnecessary line from filesystem.sh
remove 'rm -f /tmp/nvmf.conf' as conf file is no longer used in
this test.

Change-Id: I4889f10df05acdbecea148907f258d5f2925fe7d
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/420364
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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-07-25 19:55:55 +00:00
Pawel Kaminski
39ad1e651a test/spdkcli: Test for rbd bdev
Change-Id: Ic27ee112511241d4d46d5b1d3eeb5ff4be19bee8
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/417919
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-25 19:09:58 +00:00
Karol Latecki
016b0df5bf test/iscsi: fix iscsi ext4test nightly
This test may timeout (if one is set) on systems
with large physical NVMe drives. Creating the filesystem
takes just too long and causes fails.

Change-Id: I961e56085ef5735d189c31bcba3f2a203dc366d2
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/420207
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@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-07-25 17:49:10 +00:00
Pawel Wodkowski
22637292ac blobstore: silence false error message if device is too small
It is not an error if bdev is smaller than cluster size so convert this
error to infolog. This fixes false error message dring examine process.

To return proper error message when creating blobstore using RPC the
_spdk_bs_alloc was adjusted to return errocode that is propagated up and
converted to "No space left on device".

Fixes #316

Change-Id: Ic9803720a55125fcfa34263346f2d9e1aae03a53
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/420054
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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-07-25 17:36:24 +00:00
Pawel Niedzwiecki
fbf057386d test/spdkcli: Add test for SPDK CLI
Change-Id: I640548858b5e2666c78ff5e1b2b2d0d8066a0ba6
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/416559
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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: Karol Latecki <karol.latecki@intel.com>
2018-07-25 17:35:56 +00:00
Pawel Kaminski
df214a0dd7 test/lvol: Add lvol bdev decouple parent tests.
Change-Id: I0dfc3aa1a3c445510bcb65f76587a58befe23c6c
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/418827
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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-07-25 17:06:45 +00:00
Tomasz Zawadzki
4219407a93 lvol: destroy_lvol_bdev implementation
This patch fixes lvol delete behaviour.
First, we look if there are any dependencies that disallow lvol deletion.
If there are any (i.e. dependent clones) we fail.
Otherwise we delete lvol and unregister associated bdev.

destroy_bdev no longer deletes lvol.

Fixes #345

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I99e6abded2ed3ae2742103f81fc7eb937ad1cab4
Reviewed-on: https://review.gerrithub.io/407402
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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-07-25 17:06:45 +00:00
Pawel Wodkowski
848daf274b log: add backtrace option
Add '--enable-log-bt=lvl' option to show simple backtrace in following
form:

thread.c: 346:spdk_io_device_register: *ERROR*: io_device 0xf2ef80
already registered
*ERROR*: === BACKTRACE START ===
*ERROR*:   1: spdk_io_device_register() at 0x6d64df
*ERROR*:   2:  spdk_copy_engine_initialize() at 0x71059c
*ERROR*:   3:   spdk_copy_engine_subsystem_initialize() at 0x572ed0
*ERROR*:   4:    spdk_subsystem_init_next() at 0x6ca756
*ERROR*:   5:     spdk_subsystem_verify() at 0x6caba7
*ERROR*:   6:      _spdk_event_queue_run_batch() at 0x6c1ffa
*ERROR*:   7:       _spdk_reactor_run() at 0x6c5349
*ERROR*:   8:        spdk_reactors_start() at 0x6c784f
*ERROR*:   9:         spdk_app_start() at 0x6bf18e
*ERROR*: === BACKTRACE END ===

This adds additional libunwind dependency so don't enable by default.

Change-Id: Ice93d7571a000d8a57d2fedda7670c9a0b6ff7b7
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/419726
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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: Jim Harris <james.r.harris@intel.com>
2018-07-25 15:48:25 +00:00
Dariusz Stojaczyk
943ceb4144 ut/memory: do not redefine dpdk typedefs
Freebsd complains:

`error: redefinition of typedef 'rte_mem_event_callback_t' is
a C11 feature [-Werror,-Wtypedef-redefinition]`

Those typedefs are already defined in rte_memory.h, we can use
them directly.

Change-Id: If87dd0ad93578bcb22a1d07e1c3433801e2bd5bc
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420276
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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-07-24 17:20:56 +00:00
Shuhei Matsumoto
d891b398a3 test/nbdjson: Fix solid/intermittent CI failure
In part_dev_by_gpt(), stop_nbd_disk is missing and it looks that
this has caused solid/intermittent CI failure in the nbdjson test.

Change-Id: I46b14fa3b7c91547b88f49b28d0cba252b00e8a2
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/420123
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-23 19:31:41 +00:00
Tomasz Zawadzki
70ec42ad6a ut/vbdev_lvol: create and destroy vbdev_lvs on lvol tests
Previously on all ut_lvol_* tests, creation of lvs was mocked.
There is no reason to keep it that way instead of creating
actual lvs using same code that is unit tested.

Change-Id: Id0a7816da0c195d596a6da516471b3f46bb4e475
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/419562
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-20 20:46:28 +00:00
Tomasz Zawadzki
63bd96d08d ut/vbdev_lvol: remove global bs_dev
This variable was unnecessary since one within lvs->bs_dev
can be used to verify functionality and within stubs.

Change-Id: I43e12236e08f70381e0da5730b760db4ec3c577b
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/419561
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-20 20:46:28 +00:00
Tomasz Zawadzki
1a742f53d3 ut/vbdev_lvol: remove unused data structs
Those did not affect the tests, thus can be removed.

Change-Id: Ic1a23d4a40a0b5af1a2aff770e6eb4f0614c8f04
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/419560
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-20 20:46:28 +00:00
Tomasz Zawadzki
501280b24e ut/vbdev_lvol: simplify checking lvs examine results
Change-Id: I0d20bf12a5abce89b7582df57e4e33a34cabb610
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/419559
Tested-by: SPDK CI Jenkins <sys_sgci@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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-20 20:46:28 +00:00
Tomasz Zawadzki
8ed35e417d bdev/lvol: fix examine error path
Added proper paths for examine:
- if lvs loaded, do spdk_lvs_unload
- if lvol created, call spdk_lvol_close instead of spdk_blob_close

Change-Id: I77a2905417d1c53f36b96da3fbea2679d9a2f56d
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/419558
Tested-by: SPDK CI Jenkins <sys_sgci@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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-20 20:46:28 +00:00
Pawel Niedzwiecki
4c0f590b5b test/vhost: Do not use nvmf.conf and fix vhost live migration
- Use rpc calls instead config file
- move spdk repo outside shared dir to fix permission issues

Change-Id: I8a19affab839c95fcd28a4cc00b4ce7a6546c80f
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/419424
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-07-20 20:44:34 +00:00
Pawel Kaminski
2e64c85069 test/doc: Move nested construct_lvol_bdev, delete_bdev
and construct_lvol_store_with_cluster_size
          test plan into script.

Change-Id: Ie1cebee093192c0fe0845b42f278b8a8f4cea5a3
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/419518
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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-07-20 20:44:15 +00:00
Pawel Niedzwiecki
6422837360 json/rpc: Tests for nbd subsystem
Change-Id: Ib5876cb238c37802b2418c594ab9a5f01bbdf637
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/417915
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2018-07-20 20:43:43 +00:00
Shuhei Matsumoto
051297114c test/iscsi_tgt: Delete temporary files when trap catches error
In iscsi_tgt tests, when error is caught by trap command, temporary
files are not deleted. By this patch, delete temporary files in trap
handlers.

Change-Id: I317a102db346b345c3d25a4977528c737b861748
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/419311
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-20 06:00:06 +00:00
Shuhei Matsumoto
64ac643aa5 test/iscsi: Re-enable hotremove tests
Change-Id: Id32d08a1f23c85ceb6855561ec4e51a220d80cf0
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/417200
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-07-20 05:58:54 +00:00
Paul Luse
4996d7b5c5 test: check for null before deref of g_head
Followup to earlier fix, didn't see this until after fixing bdev
the rest of the way...

Change-Id: Idc663ffe6a90e6cb3511e4e703f2e9c667a3eac4
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/419445
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
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: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-07-19 01:23:52 +00:00
Liu Xiaodong
8aaa707981 util/base64: add base64 lib and unit tests
RPC method (nvme-passthrough-cmd) needs base64 to
transfer binary buffer of nvme-cmd through Json text.

Change-Id: I50b9d0efca97da45d6d4fd2a1b53b74811947191
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/417805
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-07-19 00:50:54 +00:00
Pawel Kaminski
46412580ee test/doc: Remove snapshot and clone test plan.
Move logical volume tasting test plan into script.

Change-Id: I2da9ab9348a01df86489c81b6debea4f564cc318
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/419383
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: Karol Latecki <karol.latecki@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-17 20:57:27 +00:00
Tomasz Kulasek
d3c6335bc9 blobstore: no copy write in thin-provisioning
This patch prevents to copy cluster data when there is not
backing blob to improve cluster allocation performance
in thin provisioned blobs.

Change-Id: Ie766d2e5274daa74c2b13b2198a20205e3417467
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/417938
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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-07-17 17:44:13 +00:00
Tomasz Zawadzki
6fc44a7aea blob: fix unallocated clusters to run-length encode
Before this patch when serializing extents,
unallocated clusters were treated as separate lba.
This caused metadata to grow without need.

Change-Id: I5d66466dda5f5e6d4d53f4ed5bd0bac18c74be96
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/419180
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-07-17 17:43:57 +00:00
Shuhei Matsumoto
cefab5d647 iscsi: Support hot removal of LUN based on LUN open/close
When hot removal of a LUN is started, callback is called for each
iSCSI connection which accesses the LUN. Callback checks all transfer
tasks complete and then close the LUN.

If the connection clears all transfer tasks before getting all responses
to them from the initiator, the initiator continues to retry data write.
Hence the connection have to wait until all transfer tasks complete.

Change-Id: Iad9063673cfedbd78758890d55a4254512e4fca4
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/417199
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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-17 17:43:28 +00:00
Shuhei Matsumoto
fec7c88e45 scsi: Enforce to open LUN and then alloc IO channel by using descriptor
Use a descriptor got by opening the LUN to allocate IO channel of the LUN.
This requires opening the LUN is done before allocating IO channel of the
LUN.

Use the descriptor to free IO channel of the LUN too.

Additionally, assert is added to the close LUN function to check if
IO channel is freed before the last close LUN function is called.

Change-Id: Iafb2f9ce790fff25801ea45b3286f3e26943807b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/417807
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: 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-07-17 17:43:28 +00:00
Pawel Niedzwiecki
767202e3ac test/json: Tests for iscsi subsystems.
Change-Id: I7053dca9cc6f2ef09566ba2bf8338f7f4c92ebf0
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/416745
Tested-by: SPDK CI Jenkins <sys_sgci@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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-17 17:42:06 +00:00
Ziye Yang
1e2b25ec20 bdevperf: fix the reset testing failure issue.
Root cause: we did not check the status of the bdev_io
in bdevperf_verify_write_complete function.

So the fix is that: if the status is failed, we should
not do the read check again, but just complete this I/O.

Change-Id: I3dc796abe47c3f2e7eeb2b6eb0ebc0338122479d
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/419338
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Chunyang Hui <chunyang.hui@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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-17 01:30:40 +00:00
Kunal Sablok
41586b0f1d bdev: add raid bdev module
Raid module:
============
- SPDK raid bdev module is a new bdev module which is
  responsible for striping various NVMe devices and expose the raid bdev
  to bdev layer which would enhance the performance and capacity.
- It can support theoretically 256 base devices (currently it is being
  tested max upto 8 base devices)
- Multiple strip sizes like 32KB, 64KB, 128KB, 256KB, 512KB etc is
  supported. Most of the current testing is focused on 64KB strip size.
- New RPC commands like "create raid bdev", "destroy raid bdev" and "get raid bdevs"
  are introduced to configure raid bdev dynamically in a running
SPDK system.
- Currently raid bdev configuration parameters are persisted in the
  current SPDK configuration file for across reboot support. DDF will be
introduced later.

High level testing done:
=======================
- Raid bdev is created with 8 base NVMe devices via configuration
  file and is exposed to initiator via existing methods. Initiator is
able to see a single NVMe namespace with capacity equal to sum of the
minimum capacities of 8 devices. Initiator was able to run raw
read/write workload, file system workload etc (tested with XFS file
system workload).
- Multiple raid bdevs are also created and exposed to initiator and
  tested with file system and other workloads for read/write IO.
- LVS / LVOL are created over raid bdev and exposed to initiator.
  Testing was done for raw read/write workloads and XFS file system
workloads.
- RPC testing is done where on the running SPDK system raid bdevs
  are created out of NVMe base devices. These raid bdevs (and LVOLs
over raid bdevs) are then exposed to initiator and IO workload was
tested for raw read/write and XFS file system workload.
- RPC testing is done for delete raid bdevs where all raid bdevs
  are deleted in running SPDK system.
- RPC testing is done for get raid bdevs where existing list of
  raid bdev names is printed (it can be all raid bdevs or only
online or only configuring or only offline).
- RPC testing is done where raid bdevs and underlying NVMe devices
  relationship was returned in JSON RPC commands

Change-Id: I10ae1266f8f2cca3c106e4df8c1c0993ddf435d8
Signed-off-by: Kunal Sablok <kunal.sablok@intel.com>
Reviewed-on: https://review.gerrithub.io/410484
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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-16 20:50:40 +00:00
Shuhei Matsumoto
c5b00933ce iscsi: Fix the issue that queued iSCSI tasks are not migrated when clearing tasks
When multiple LUNs are attached and spdk_clear_all_transfer_tasks() is called with
a LUN, all tasks whose target is the LUN are removed and there will be room to start
queued tasks for other LUNs. However currently no migration is done.

Add UT code to verify the fix too.

Change-Id: I082d370ab86a46e5b4a74a16293a572fae663add
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/418765
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2018-07-16 04:36:11 +00:00
Pawel Niedzwiecki
07926e1b55 test/nvmf: Do not use config files
Use rpc methods instead config file in nvmf tests

Change-Id: I75354cae95e1dd5d0e08f5c694b369fb270b92a4
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/419006
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-13 22:40:06 +00:00
Karol Latecki
f7d5bf0cef test/vhost: add script for performance benchmarking
Following script allows user to run tests which
follow test cases used in SPDK Vhost Benchamrk tests.

Change-Id: I4e69b13d86165fcf37c678b095c2a11817476465
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/416527
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-13 22:33:19 +00:00
Pawel Wodkowski
fdd6dbc902 vhost: add socket path in info dump
This also save CWD on init so socket path is no longer relative.

Change-Id: I303401fe0340f0bc2ea5e4ba468361f68ea84c3d
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/419067
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-12 23:54:34 +00:00
Paul Luse
459e899095 bdevperf: don't try to free targets if head is NULL
In the event that something went wrong earluer, we shouldn't
try and touch memory that was never allocated.

This is at least a partial fix for issue 363.

Change-Id: I5174c845fb89f6d386877758fdc99178704ff73c
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/419039
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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-12 22:09:27 +00:00
Shuhei Matsumoto
9166bb3c51 ut/iscsi: Add UT for clear_all_transfer_tasks (Delete all or LUN specific tasks)
Change-Id: I4694b2fdfafa64e7d2621e5b004f46a7072173e7
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/418761
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-07-11 21:00:41 +00:00
Shuhei Matsumoto
d02e91b34f ut/iscsi: Add UT for spdk_del_transfer_task (Delete task whose R2T matches task tag)
Change-Id: I6de3fc53d7a771c702f013bfaf7bd425f1ab01e5
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/418760
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-07-11 21:00:41 +00:00
Shuhei Matsumoto
fc01195e1c ut/iscsi: Add UT for spdk_get_transfer_task (Get task whose R2T matches TTT)
Change-Id: I7bc44aeffd4eeb1cc90babf0c6789a2bcee6bb59
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/418759
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-07-11 21:00:41 +00:00
Shuhei Matsumoto
9265e1ebbe ut/iscsi: Add UT for spdk_add_transfer_task (Sending R2Ts)
Currently R2Ts per connection are managed by an array
outstanding_r2t_tasks and two tailqs active_r2t_tasks and
queued_r2t_tasks.

These are complex but there is no UT code for them.
Added UTs are not perfect but it may be helpful to keep the
quality and understand the implementation.

Change-Id: I2a0d19d8888e7d3beb5918a1b82b657f4775e01a
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/418758
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: Ben Walker <benjamin.walker@intel.com>
2018-07-11 21:00:41 +00:00
Daniel Verkamp
fbb481c2c6 test: add SPDK_TEST_NVME_CLI autotest flag
As requested in GitHub issue #361, we should have a way to control
whether the SPDK-patched nvme-cli tests are executed.

Also add a report_test_completion call for the NVMe-oF nvme-cli test
so we can easily track whether it executed (the local PCIe nvme-cli
test already had a completion).

Change-Id: I70c26bcf2489ccfa563214a9723603aa705be7ab
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/418866
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: John Meneghini <johnm@netapp.com>
Reviewed-by: <ed.rodriguez@netapp.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-10 23:18:27 +00:00
Daniel Verkamp
56ad1cbea4 ut/lvol: remove bogus lvol_op_comp test
This is passing a struct lvol_task that is not nested inside a bdev_io
context, which is assumed by lvol_op_comp() in the actual lvol code.

There is no problem currently, since lvol_op_comp() happens to not
dereference the bdev_io except inside of mocked functions and inside a
SPDK_INFOLOG() that does not get executed in the unit tests right now,
but this would break if the lvol code ever actually used the bdev_io
pointer.

Change-Id: Ic3b67f4ecff47e5a98a5be8a83c2524573113aa9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/418735
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-07-10 22:48:54 +00:00
Ed Rodriguez
2e0df7813e test: vm_setup.sh localization
Change-Id: Ief3a1fbde5d8eabefa87c39feefe3d496e3a5369
Signed-off-by: Ed Rodriguez <ed.rodriguez@netapp.com>
Signed-off-by: John Meneghini <johnm@netapp.com>
Reviewed-on: https://review.gerrithub.io/418236
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
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-07-10 22:47:16 +00:00
John Meneghini
806f43b26d test: improvements to vm_setup.sh and pkgdep.sh
Change-Id: Ie433edd7c72f84b62c17bacebd31d61ffa6f30ab
Signed-off-by: Ed Rodriguez <ed.rodriguez@netapp.com>
Signed-off-by: John Meneghini <johnm@netapp.com>
Reviewed-on: https://review.gerrithub.io/416052
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-10 22:47:16 +00:00
Paul Luse
58d8a4564b test: add ability to mock spdk_dma_malloc()
Used in crypto unit tests.

Change-Id: I7d7e31e9030c238cb539b9fcf0936e588c1a4211
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/418320
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-07-10 21:31:39 +00:00
Pawel Niedzwiecki
b2fd5b25b2 json/rpc: Tests for nvmf subsystem
Change-Id: I70044bfc01c77a367cf4634d245a58546273f40b
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/412477
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-10 21:18:18 +00:00
Tomasz Zawadzki
f0ec7bc6e7 scsi/bdev: use spdk_bdev_queue_io_wait()
New function was added in bdev layer to allow
handling spdk_bdev_io buffer exhaustion.

This patch adds that functionality to scsi bdev.

Change-Id: Ia6a5be871ae09a4d1166991925f0a44f3b355bdd
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/417032
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-07-10 21:17:38 +00:00
Tomasz Zawadzki
d7a7ef613c scsi: spdk_bdev_scsi_reset() now returns void
SCSI reset function return code is not used,
so there is no need for it to have return code.

Change-Id: Ib647109c75b1546675d2601fa00004e1ef186024
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/418615
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-07-10 21:17:38 +00:00
Tomasz Zawadzki
6f9e81eea0 scsi/UT: add scsi_bdev IO operations UT
This patch adds UT for IO operations, as preparation for
next patch in series handling bdev_io buffer exhaustion.

Change-Id: I139cb8811453576efd1acddd15ad2a3672995f09
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/417452
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-07-10 21:17:38 +00:00
Chen Wang
87210c1391 test/nvme: add unit test cases for nvme_qpair.c
Add unit test for API function spdk_nvme_qpair_add_cmd_error_injection()
and spdk_nvme_qpair_remove_cmd_error_injection().

Change-Id: Ia1f0baf94c3ab1b9a03c6c2b4796346cbe120a62
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/416905
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>
2018-07-10 01:02:36 +00:00
Daniel Verkamp
1fcfc425bf test/nvmf: test InCapsuleDataSize 0 in filesystem.sh
Change-Id: I939aef31473b6a7acae879fb5b03a62154390cac
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/418729
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-07-09 22:24:40 +00:00
Seth Howell
df8cbd66c7 test/unit: remove more scan-build errors
Change-Id: Ia0f304c20d736cebd43b29337e7c6f8918cff7ef
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/418235
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-07-09 19:45:40 +00:00
Young Tack Jin
6d05186697 ocssd: add chunk info list as mptr of vector reset
This is verified on QEMU NVMe which merged the related patch.

Change-Id: I7c62d7a91350e0a877d1c3651796c38b55122f98
Signed-off-by: Young Tack Jin <youngtack.jin@circuitblvd.com>
Reviewed-on: https://review.gerrithub.io/417077
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Matias Bjørling <m@bjorling.me>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-09 18:54:22 +00:00
Seth Howell
09e3f4e3db nvmf: give qpair_disconnect an asynchronous api.
qpair_disconnect has previously presented an entirely synchronous API.
However, it relies on other asynchronous operations to complete its
task. By giving it an asynchronous API, we can avoid possible race
conditions. Patch 1 of several.

Change-Id: If9e26ee70ae5d6c0273750226b4408a8e4587e19
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/417345
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-07-06 22:49:39 +00:00
Pawel Kaminski
57bce7953f test/json: Add rbd bdev test
Change-Id: I8d8b252bf826e6339810ccf27a4c68ed6a726af9
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/417603
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-07-06 22:48:57 +00:00
Daniel Verkamp
49e24df51c test: remove leftover spdk_cunit declaration
The function itself was removed, but the declaration in the header was
left behind.

Change-Id: Idbff42c197ef56e65fa92c6795306d9326381cf9
Fixes: ca1de9eb75 ("test: remove spdk_cunit library")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/418231
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-07-06 22:47:56 +00:00
Daniel Verkamp
ad51b333e8 ut/json: add a few test cases to json_parse_ut
This brings the unit test line coverage from 94% to 97.2% for this file.

Change-Id: I257fdb0187f7cae256d6fccabbdaa6df9ce4e83b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/417369
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-06 22:47:18 +00:00
Daniel Verkamp
7d24e2a4cd env_dpdk: fix mem_map translation for sizes >2MB
Add a check to prevent spdk_mem_map_set_translation() or
spdk_mem_map_clear_translation() calls that start within the valid
address range but specify a size that would access parts of the mem map
outside of the valid region.

spdk_mem_map_translate() is safe without any extra checks since it only
accesses the first entry regardless of size, and the MASK_256TB check
catches out-of-range accesses to that entry.

Change-Id: Ie1437e57b5158363bb98a6b42a26fb41a089bbad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/418106
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-07-06 22:36:22 +00:00
Daniel Verkamp
7ac8b609b0 env_dpdk: fix mem map array sizes
The arrays for both the map_256tb and map_1gb structures were twice
as large as necessary; fix the sizes and add unit tests for the boundary
conditions to verify that the fix works.

Change-Id: I66bce463f234f54e69cf2a697db9f806d398ca1e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/418105
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-06 22:36:22 +00:00
Seth Howell
88e26908fa test/unit: fix several scan-build errors.
These errors occur when scan-build is used with clang 6.0 as a backend.

Change-Id: I751a0fd3649ae500887a4dbda1d361104acb7c12
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/418233
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-07-06 22:15:24 +00:00
Seth Howell
5b072d3739 test/config: add some comments to vm_setup
Just clarifying why and where some packages are used.

Change-Id: I36f17856a76ed1eb3d88054da2692beee9e569f2
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/418230
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-07-06 22:15:24 +00:00
Tomasz Zawadzki
bcfd6d0fb4 scsi: only set SPDK_SCSI_STATUS_GOOD on bdev callback
Previously when IO was sent to bdev, even without callback yet,
status for task was set to SPDK_SCSI_STATUS_GOOD.

This patch changes it so that it is only set when callback actually
comesback from bdev via spdk_bdev_io_get_scsi_status().

Change-Id: I4a36ec345608257123e1036d31540f5f1090a23b
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/417708
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-07-06 21:22:43 +00:00
Shuhei Matsumoto
c3b82474e0 ut/iscsi: Add unit test for residual count of SCSI Check Condition
Residual count must be ignored and sense data must be set instead
when Check Condition occurs.

Add test code to keep current implementation.

Change-Id: I8919a28481c81606e8803269d5ff8a4e3fcbf8c2
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/418176
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-07-06 21:17:29 +00:00
Shuhei Matsumoto
3e66e72651 ut/iscsi: Add unit test for residual count of SCSI Request Sense
Current SPDK implements SCSI Request Sense command so that a SCSI
Data-In PDU and a SCSI Response PDU are returned and underflow are
set to both of them.

On the other hand, some implementation return only a SCSI Data-In
PDU and some implementation return only a SCSI Response PDU.

Adding test code will be helpful for every implementation.

Change-Id: Icccc2d6e334146f558f8d75215bab1362b2b68f0
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/418175
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: Ben Walker <benjamin.walker@intel.com>
2018-07-06 21:17:29 +00:00
Shuhei Matsumoto
a02ab95ebb iscsi: Bug fix for residual count when length of data transfer from SCSI was 0
This bug was caused by the following two changes:

iscsi: Remove duplication of the variable for write completion to bdev
https://review.gerrithub.io/#/c/393582/

iscsi: restore data_transferred accumulation for read
https://review.gerrithub.io/#/c/393713/

For write, bytes_completed is always equal to data_transferred. However,
for read, bytes_completed is based on expected data transfer length and
data_transferred is actual read size. Hence bytes_completed cannot be
used to calculate residual counts.

One of the reason why this bug cannot be found was that there was not any
test case when task->scsi.data_transferred is 0 and task->scsi.length is
not 0. Hence UT code is also added.

Same bug will occur for read sense data. Hence UT code for read sense data
is added in the next patch.

Change-Id: Ib1a283b769e5af0c2d05acb69f90948c5d658087
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/417960
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: Ben Walker <benjamin.walker@intel.com>
2018-07-06 21:17:29 +00:00
Piotr Pelplinski
9d258c75af bdev: split examine into two parts
During spdk_bdev_init, examine_config is called.
This call can claim bdev synchronously, based on
configuration. On spdk_bdev_start if none module
claimed bdev, examine_disk is called and can
perform I/O before claiming bdev.

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I1448dd368cf3a24a5daccab387d7af7c3d231127
Reviewed-on: https://review.gerrithub.io/413913
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-06 21:12:53 +00:00
Seth Howell
1196deb504 test: fix scan-build errors in bdev unittests.
Specifically, the errors that occur in scan-build that uses clang-6.0 as
a backend.

Change-Id: I3922a4f65134cbd866fcb27ad9b7a75b6b7803bb
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/418229
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-07-06 20:34:01 +00:00
Daniel Verkamp
f1acfee360 test: make unittest.sh work from any directory
test/unit/unittest.sh would normally have to be invoked from the root of
the SPDK repository; tweak it slightly so that it can be executed from
any working directory (e.g. within test/unit).

Change-Id: I8fdbb7c0d618e2bb1490236212e54cbd43cccf6f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/418217
Reviewed-by: Paul Luse <paul.e.luse@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-07-06 18:43:10 +00:00
Jim Harris
ca1de9eb75 test: remove spdk_cunit library
There was a plan a long time ago to try to output all
unit test results in JSON format for post-processing.
It is used by only one unit test file currently, but the
results aren't used and there are no plans to use it in
the future or extend it to other unit tests.

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

Reviewed-on: https://review.gerrithub.io/418112
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>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-06 18:35:03 +00:00
Jim Harris
56d35c5d13 test: forbid use of CU_ASSERT_FATAL
Static analyzers don't see CU_ASSERT_FATAL as truly fatal,
and will complain that code later in the function may try
to dereference a NULL pointer.  So we added SPDK_CU_ASSERT_FATAL
which should be used instead.

This still trips people up sometimes though - the static analyzer
complains and then the developer will add other checks that
pointers are not NULL.

So instead, forbid use of CU_ASSERT_FATAL through check_format.sh
and explain why.  While here, fix up all of the existing CU_ASSERT_FATAL
usages to either CU_ASSERT or SPDK_CU_ASSERT_FATAL.

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

Reviewed-on: https://review.gerrithub.io/418111
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: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-06 18:35:03 +00:00
Jim Harris
140eaaa084 bdev: submit queued IO after disabling QoS
There's no reason to abort IO that have been queued
due to QoS limits, when QoS is switched from enabled
to disabled.  Submit them to the bdev instead.

Fixes issue #357.

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

Reviewed-on: https://review.gerrithub.io/418128
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-07-06 18:34:45 +00:00
Pawel Kaminski
9aff546b7f test/json: Test for vhost subsystem.
Change-Id: I913d378fe3f324043e8e86c1df209ad19680c60b
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/410789
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-05 20:28:24 +00:00
Seth Howell
5d5243e0d3 bdev: make pointers to part_base opaque.
Change-Id: Ic2111641d7cd0c637f76c2b2595da156503bc149
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416469
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-05 19:12:53 +00:00
Pawel Kaminski
4a9583f7fe test/json: Add pmem bdev test
Change-Id: I50a99f029f10f334370013627b75f61e7eecdcf5
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/417557
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-05 19:09:56 +00:00
Piotr Pelplinski
32f35c169e blob_ut: fix bs_dev_common for dev blocklen != SPDK_BS_PAGE SIZE
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I396d5a7c3d2d736b5763d4c79284ed7483e2dce1

Reviewed-on: https://review.gerrithub.io/417704
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-07-03 22:51:04 +00:00
Dariusz Stojaczyk
889ee6194a ut/vhost: remove backend-specific tests
They were initially developed to bump code coverage,
but now with upcoming vhost changes they are too much
of a wart to keep updating. They heavily rely on vhost
internals and are not particularly useful for testing.

Right now these tests allocate a vhost target struct,
hack its internals and try to call *_unregister() on it,
hoping to trigger some expected error.

One way to properly test the Vhost library would be to
mock rte_vhost_* functions and use the spdk/vhost.h API
to manage targets/devices. However, this is a greater
refactor and would more likely fit in a multi-threaded
unit test environment.

Change-Id: Ia6cb0e1f7d0d57aef35050427396f895fb3bd7e1
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/407390
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-07-03 22:18:57 +00:00
Tomasz Zawadzki
97154b1f82 scsi/ut: initialize task with invalid values to assert change later
Originally task was memset to 0, meaning that some asserts might have
incorrectly asserted values that were set to 0 beforehand.

Now ut_init_task() sets task to 0xFF, with only couple required fields set to
appropriate values.

Change-Id: I47fbb03daf6ab7cbf60abc58f63315a151e49890
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/417686
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-07-03 17:45:37 +00:00
Tomasz Zawadzki
a8656d66db scsi/ut: stub out IO callback for scsi UT
Callbacks were never called in UT for scsi_bdev.

Change-Id: I54a9d75af3161cd4dd4f0c153c7808b13e818576
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/417551
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-07-03 17:45:37 +00:00
Tomasz Zawadzki
d5471e299f scsi/ut: rename helper *_task functions
To make it clear that spdk_put_task() and spdk_init_task()
are not part of public API, chaged prefix to ut_.

Change-Id: I76a6efc3835f0ee71953029cad1dabf5a68013a4
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/417685
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-07-03 17:45:37 +00:00
Pawel Kaminski
2d7cfda2d4 test/json: Tests for virtio bdevs
Change-Id: Ibb94abdfc6881aa3e8e6dceaf70e494f0146e385
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/406561
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>
2018-07-03 17:40:42 +00:00
Dariusz Stojaczyk
893f26e84b ut/ioat: drop legacy mocks
Change-Id: Ie4f32f58101fc4211f379c905b7a269c983ce241
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/416996
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-07-03 16:29:42 +00:00
Tomasz Kulasek
71098fd489 blobstore: blob_operation_split_rw unit tests
This patch adds more intensive unit tests for reading and
writing splitted operations.

Change-Id: I64921fa31689e660281674e8b2ad4253faa7cf04
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/410031
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-07-02 23:22:32 +00:00
Seth Howell
b3d61e5d01 test/config: add command line args to vm_setup.sh
Change-Id: Iae7a2206d3d64834da03226ebeba5e91c635703d
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416885
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-07-02 23:09:23 +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
Shuhei Matsumoto
546a114847 test/iscsi: Change the order of delete_bdev to fix nightly test failure.
By the following change, delete bdev operation will wait until all
related iSCSI connections exit.

    scsi: Don't free IO channel at LUN removal not by allocator

Hence delete bdev must be called after iscsicleanup in test code.

The following patch tried to do that. However nightly test code was
missed to change.

    test/iscsi: Change the order of delete_bdev that hides uncorrect
    hotplug implementation.

This patch fixes the failure of nightly test. By this patch passing
iSCSI nightly test was verified.

Change-Id: Ia3ac234db6d569212de9234b7201b132236b5993
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/417376
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-07-02 22:34:20 +00:00
John Meneghini
f04277f0bf test: remove more sys_sgsw dependencies from test scripts
- To override the default /home/sys_sgsw dependency
   add DEPENDENCY_DIR to ~/autorun-spdk.conf

  E.g.: DEPENDENCY_DIR=/home/vagrant

 - To override the default HUGEPAGES use
   add HUGEMEM to ~/autorun-spdk.conf

  E.g.: HUGEMEM=1024

Change-Id: Ib8db9d7d053ae319fe4c725159742875468d47f0
Signed-off-by: John Meneghini <johnm@netapp.com>
Signed-off-by: Ed Rodriguez <ed.rodriguez@netapp.com>
Reviewed-on: https://review.gerrithub.io/415907
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-07-02 21:32:39 +00:00
Pawel Kaminski
c8b03c762f test/json: Fix. Clear most dependent subsytems first.
Change-Id: Id190684a658fdb15214a741ba290fe6cf520501d
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/417526
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-07-02 19:28:54 +00:00
Pawel Niedzwiecki
f2da539dbc test/virtio: bring back QEMU's emulated virtio-scsi-pci tests
This reverts commit 8cf4bc42e7

Change-Id: I6a161d191ea38b859a69eadd2eb831894011988a
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/408481
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-07-02 19:17:28 +00:00
Pawel Niedzwiecki
3f2acfcd0e test/virtio: bring back test for support of kernel vhost-scsi device.
This reverts commit 4ecb2e1d33.

Change-Id: Ic15ae84bff7e93d9cf674f63b51f5ca038ead2f6
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/408480
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-07-02 19:17:28 +00:00
Dariusz Stojaczyk
8681eecd9a env: introduce spdk_memzone_reserve_aligned
This is an spdk_memzone_reserve variant with additional
alignment parameter. Now that memzones must be used for
physically contiguous memory, it will become extremely useful.

Change-Id: Ie48d682217e0e2f5c859a1603bb8a81fd2a7d7df
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/416978
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: Ben Walker <benjamin.walker@intel.com>
2018-07-02 19:13:23 +00:00
Ben Walker
5dcd6f6318 test: Move poller test to the thread unit test
This is the more appropriate location for this test

Change-Id: If556b365975f5658a55924aeb7122186961972bd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/417365
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-02 19:12:45 +00:00
Ben Walker
2fac05e919 test: Fix inaccurate mock of poller behavior
This exposes that one of the tests was not expecting
the correct behavior, so also fix that.

Change-Id: Idb73b3ea74950b2e6f959a40e5740375cb76b8c7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/417364
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-02 19:12:45 +00:00
Ben Walker
f443bd40e4 test: Add spdk_mempool_put_bulk to test_env.c
Change-Id: Id5d22fb9c9e70c432b120676cbbf040b0c8e6c49
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/417363
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-02 19:12:45 +00:00
Ben Walker
ef8dfe1111 test: Mock spdk_ring operations in test_env.c
Change-Id: I1ef5cc1c58d536ccd6774c31cb633af494103e24
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/417361
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-02 19:12:45 +00:00
Tomasz Zawadzki
89f5d8b72e scsi/ut: remove unused spdk_bdev_read()
spdk_bdev_read() bdev function is not used
in scsi library. No need to stub it.

Change-Id: I7c142c59c5e64ae9ecfabaf0c73a9b0e68fffd04
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/417550
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-07-02 19:06:24 +00:00
Pawel Wodkowski
69a762ca52 app: add missing spdk_app_fini call
Change-Id: Iad400c03b66f5382846cd62f815bcb4f920795e4
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/417288
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>
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>
2018-07-02 03:28:11 +00:00
Pawel Kaminski
93fca0e79f test/json: Base bdevs test for bdev subsystem.
- load spdk_tgt with bdevs
   - check if json config is properly saved and loaded
   - check if all bdevs are properly loaded
   - check if configuration of spdk_tgt is properly set

Change-Id: I89226bc9c05880e73523fb189116e7433a513244
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/406326
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-06-29 16:27:57 +00:00
Piotr Pelplinski
2c91e91907 blobstore: Save the original size of the disk.
Save the original size of the disk to metadata when it is first created.
On load verify that the disk did not change size.

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

Reviewed-on: https://review.gerrithub.io/410896
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 17:58:31 +00:00
Piotr Pelplinski
cf930a450b blobstore: postpone all superblock writes to first metadata sync
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I49d23d2af40ff909757a5fd15b80a7a8cbbff399

Reviewed-on: https://review.gerrithub.io/416922
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-28 17:58:31 +00:00
Seth Howell
a33a7b44a3 test/config: minor error fixes to vm_setup.sh
The name of the rpm source for open-iscsi changes between fedora
releases. Also, there was a typo on the tsocks check.

Change-Id: I0f9810c51c35c3efd5616fad303d08b02d9e2218
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416882
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:38:48 +00:00
Karol Latecki
dfe497c27b test/vhost: change spdk and qemu masks to decimal format
Change-Id: Ia3122d7680e34b2270218a96770b2a2662b732ad
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/416526
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-28 16:30:48 +00:00
Karol Latecki
17777bcad7 test/vhost: allow FIO to output JSON
Add option in test/vhost/common.sh to run FIO
with --output-format=json

Change-Id: I3115cf35d48a15a539d91e21f8f128970f150467
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/416525
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-28 16:30:48 +00:00
Shuhei Matsumoto
0a43fe282a test/iscsi: Change the order of delete_bdev that hides uncorrect hotplug implementation
Change-Id: I1d24e842e3ebfff84bda10dfd9c05d3b7d94a967
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/416276
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: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-26 23:31:17 +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
Jakub Radtke
c182da27b5 ocssd: vector commands
This patch adds support for following Open-Channel vector commands:
* Vector Chunk Reset
* Vector Chunk Write
* Vector Chunk Read
* Vector Chunk Copy

Implementation is consistent with Open-Channel specification (rev. 2.0)

This patch provides unit tests for new public NVMe
Open-Channel namespace commands.

Change-Id: Ic71be9357c61c5de82ca672e82a71aa933bd1875
Signed-off-by: Jakub Radtke <jakub.radtke@intel.com>
Reviewed-on: https://review.gerrithub.io/414969
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: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Young Tack Jin <youngtack.jin@circuitblvd.com>
2018-06-22 21:34:49 +00:00
Tomasz Zawadzki
19dd8ea576 test/iscsi: allow choosing net framework for iSCSI tests
Type of net framework is now passed throughout the iSCSI tests.

This is in preparation for running VPP tests alongside the ones
on posix.

Change-Id: Ifb25a9e4b04512de882883278b8bb465de579828
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/408879
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-22 21:09:50 +00:00
Tomasz Zawadzki
7a02938bac iscsi/test: verify connectivity after interface creation
This was done only to help with determining cause of failure
in tests early on.
Both sides of veth interface are pinged.

While here, moved up the trap just in case any of interface
setup commands fail.

Change-Id: I9990b2320055ff74a6c542eb06b18c0106067728
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/416555
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-22 21:09:50 +00:00
John Meneghini
b7322649db pkgdep: support pycodestyle in check_format.sh
- install py27-pycodestyle on Freebsd
 - conditionally use pycodestyle in check_format.sh
 - fix various E722 do not use bare except errors caught by pycodestyle
 - see: https://github.com/PyCQA/pycodestyle/issues/466

Change-Id: I64ecf3f204a456134d891d1339f3aa1db281965a
Signed-off-by: John Meneghini <johnm@netapp.com>
Signed-off-by: Ed Rodriguez <ed.rodriguez@netapp.com>
Reviewed-on: https://review.gerrithub.io/416460
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-22 18:03:31 +00:00
Changpeng Liu
c391fed3e1 nvme: add nvme error injection support
Users can set specified Admin commands or IO commands with
error status, when submitting new commands which are already
set with error status, the commands will return to the caller
with specified error code. So that users can emulate some error
status for their error condition code path.

Change-Id: I4b93c7e4f2b15a659da73b39e26bfa162eb5214e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/410870
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-06-22 17:26:34 +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
Daniel Verkamp
9539edca02 build: add sock dependency for all NVMe lib users
This will be necessary when the NVMe/TCP transport is added, which will
use the sock abstraction library.

Change-Id: I6561ccdad1ff575db2afa418eab2f2cd24806cb9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/416477
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-22 17:09:57 +00:00
Daniel Verkamp
ea3c58ea77 net: split sock abstraction into lib/sock
This separates the network interface management code (interface.c and
net_rpc.c) from the socket abstraction layer, which allows users that
only want the socket abstraction to avoid pulling in the JSON RPC
libraries.

Change-Id: I9b00285a70bac0c74c73353cfa900d4f3b2e465f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/416475
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-22 17:09:57 +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
Tomasz Kulasek
826aac635e blobstore: fix parent for snapshot of clone
When snapshot is created from a clone, clones parent is not
inherited.

This patch also updates unit tests covering this case.

Change-Id: I42eb00fe2f33504c5b5c5beded20c4ea65eaff67
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/414804
Reviewed-by: Jim Harris <james.r.harris@intel.com>
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-21 22:50:03 +00:00
Jim Harris
9d04d0efd5 env_dpdk: pick base-virtaddr that ASAN won't override
ASAN has some memory address regions that it will not
allow applications to use for mappings (including mmap).
So when specifying --base-virtaddr to DPDK for
shared/mutli-process mappings, pick an address that
ASAN will allow the application to map.

Ref: https://github.com/google/sanitizers/wiki/AddressSanitizerAlgorithm

We will still disable ASLR while using the test stub for now.
Maybe we can eliminate this too in the future, but for now just
modify the autotest_common.sh comment since we've figured out
how to keep ASAN from messing with the mmap hint.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie24fd35bd22aa3ceab6271e8936775b157e5c330
Reviewed-on: https://review.gerrithub.io/416420
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: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-06-21 22:49:40 +00:00
Ziye Yang
8f26b74e02 examples: make debug flag option consistent
Will change -t to -L

Change-Id: Ie04edf1fd3877b36fde1bae66a84de29f6617bbf
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/415947
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: Changpeng Liu <changpeng.liu@intel.com>
2018-06-21 05:18:53 +00:00
Jim Harris
696d9eaed0 autotest: reduce HUGEMEM allocation to 2GB on FreeBSD
The FreeBSD contigmem driver has problems allocating
contiguous memory after a large number of unloads/reloads.
Since we run a very limited subset of SPDK tests on
FreeBSD, reduce the HUGEMEM allocation from 8GB to 2GB
to help alleviate the problem and reduce the frequency
of test failures due to contigmem panics.

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

Reviewed-on: https://review.gerrithub.io/416214
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-20 22:48:30 +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
65aa57b007 nvmf: Keep a list of qpairs per poll group
Remove the list of qpairs per controller.

Change-Id: I6aaeed43c64b38b60c5a609123b3542bb7130a90
Reviewed-on: https://review.gerrithub.io/415317
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:07:24 +00:00
Ben Walker
84523c0439 nvmf: Remove abort implementation
This will be re-added later in the series, implemented
in a different way.

Change-Id: I1f9df22025eb37f7f58ce1547862f61906ea557c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/415315
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-20 22:07:24 +00:00
Daniel Verkamp
fdf5c1d7d2 build: add -lcrypto (OpenSSL) to SYS_LIBS
This is already required to build the shared library and iSCSI
components; simplify these Makefiles by adding -lcrypto to the central
SYS_LIBS in mk/spdk.common.mk.

Change-Id: I8fdaffbccc1294e24e32559387b0ed99d1deb0ce
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/415351
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 20:16:31 +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
Ben Walker
cd82151eba nvme: Allow calling spdk_nvme_ctrlr_set_default_opts prior to connect
Change-Id: Id0408e571362527e7c2d4759223946a0b4d7c675
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/415896
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-20 17:50:09 +00:00
Ziye Yang
1c3c50a6cb bdevperf: Enable the debug -L option
Purpose: Help for the debug.

To use the spdk_app_parse_args may be the next patch
(I just checked the spdk_app_parse_args, there are many
conflict args).

Change-Id: I6e601ba62cfdb4d381520b4eab0f6f85ed862bb9
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/415107
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-06-20 17:42:59 +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
Seth Howell
714776c028 test/config: Call pkgdep.sh from vm_setup
vm_setup.sh now calls pkgdep.sh to ensure that the basic packages needed
to compile SPDK are installed. Pkgdep remains a separate script because
it is supposed to contain the minimal set of packages for building SPDK.
while vm_setup is used to configure a complete testing environment.

Change-Id: I4038f522c66ad5b2c55ed73b1170f796b2c94e27
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/415895
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-20 00:18:40 +00:00
Daniel Verkamp
5df15facd2 nvme: add path status codes (TP 4028)
Change-Id: Ifac14f74f6b7681fccbf463f744d145ae8299240
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/415892
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-19 23:34:06 +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
Jim Harris
69679c8033 thread: assert if io_device_unregister cannot find device
The bdev iscsi initiator had a bug which resulted in
an io_device getting unregistered twice.  An error message
got printed but it didn't immediately result in any kind
of failure detected by any tests.  Really this should be
considered a fatal error, so add an assert() so it's found
more readily should these kinds of bugs occur again in the
future.

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

Reviewed-on: https://review.gerrithub.io/415375
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-18 17:51:40 +00:00
Jim Harris
7699cdeed4 bdevperf: add bdevperf_submit_task helper function
This will be needed when we need to re-attempt an IO submission
when the bdev_io pool is exhausted.

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

Reviewed-on: https://review.gerrithub.io/415301
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
Jim Harris
89de425ed4 bdevperf: break out prep work from bdevperf_submit_single
This prepares for upcoming patches which handle -ENOMEM
from the SPDK bdev io submit function.  When we retry
submitting the I/O, we do not want to "re-prepare" the
I/O - i.e. we don't want to calculate a new offset or
memset the buffer again for verify workloads.

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

Reviewed-on: https://review.gerrithub.io/415300
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
Jim Harris
67bc354c37 bdevperf: save bdev io type in bdevperf_task
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia32bd2655a4cc1c082ce5fd5420f6abaabe40133

Reviewed-on: https://review.gerrithub.io/415299
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
Ben Walker
878185cf0e nvmf: Rename spdk_nvmf_ctrlr_disconnect to spdk_nvmf_qpair_disconnect
Change-Id: I0c6c410d120bec830ec17105de43ca62bf202b7b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/415313
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-15 19:11:29 +00:00
Ben Walker
64d75fe2a6 test/nvmf: Use the real io_channel implementation
Previously spdk_thread_send_msg was being defined in the
test, but util is also linked in. Instead, use the real
io_channel abstraction in the tests.

Change-Id: I5c9ce1d0675c43e3ea5b4c88d2dd8282a86a0545
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/414074
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>
2018-06-14 16:25:16 +00:00
Jim Harris
529d9b0dec bdevperf: simplify bdevperf_submit_single
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I93987ed25779f016e8056f6cd472ec3da99b7d94

Reviewed-on: https://review.gerrithub.io/415073
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@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
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
Daniel Verkamp
ca88f46a2d test/nvmf: connect kernel host in shutdown test
ATtempt to reproduce GitHub issue #233

Change-Id: I6df334606e6db6c182eccac1f7a3d294dad990a9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/398251
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-06-14 05:10:40 +00:00
Daniel Verkamp
42b6dd9399 pkgdep: add nasm in preparation for intel-ipsec-mb
A nasm or yasm compatible assembler will be required to build the
intel-ipsec-mb library needed for the DPDK crypto framework.

Change-Id: I3e1822069452208aa796caf84ddd9995fcac2cd6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/415065
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-13 23:32:31 +00:00
Daniel Verkamp
eb387189c2 nvmf: don't change NN while ctrlrs exist
This was partially fixed in commit 1e481d0438 ("nvmf: Do not allow NN
to change while connections present"), but we did not handle the case
where the user asked to add a NS with a NSID outside the current NN.

This patch reworks the logic (again) to be more straightforward and
hopefully more obviously correct.

Some confusion between max_allowed_nsid and max_nsid is also clarified;
if max_allowed_nsid is set, then max_nsid == max_allowed_nsid at all
times, so we don't need the extra logic when calculating NN in
spdk_nvmf_ctrlr_identify_ctrlr().

Change-Id: If531baf1114e03441ff3e1e1be098071702d9056
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/414894
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-06-13 21:52:38 +00:00
Jim Harris
34de1542eb test/bdev: use DEFINE_STUB for spdk_conf_* stubs
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2165bdb1c2dc08d790aa6dc63a8367c7a1a3bc4d

Reviewed-on: https://review.gerrithub.io/414711
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
Daniel Verkamp
9c577fe7c0 Add copy module dependencies to Makefiles
Several apps link against $(COPY_MODULES_LINKER_ARGS) without adding
$(COPY_MODULES_FILES) to the dependency list.  This means that those
apps would not get rebuilt if the copy modules were modified without a
'make clean'.

The blobfs example apps were also missing other dependencies; add those
while we're here.

Change-Id: Iac6606b650d32bf21f7f31bd2727f9e92c0da748
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/414888
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-12 23:15:25 +00:00
Jakub Radtke
b3497d5da7 nvme: add Get/Set Feature wrappers with NSID
Some features are per namespace and require a namespace ID; the existing
get/set feature functions do not allow passing NSID, so add new API
functions that do:
* spdk_nvme_ctrlr_cmd_get_feature_ns
* spdk_nvme_ctrlr_cmd_set_feature_ns

Change-Id: Ia7dc96e57badf1a56489785fb288493592b58b80
Signed-off-by: Jakub Radtke <jakub.radtke@intel.com>
Reviewed-on: https://review.gerrithub.io/414706
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-06-12 17:59:33 +00:00
Jakub Radtke
caac0ed9e8 ocssd: nvme driver public API extension for Open-Channel
This patch adds to nvme driver new public API dedicated for
Open-Channel:
* spdk_nvme_ocssd_ctrlr_cmd_geometry

Change-Id: I69592618d9bcc280346258e771195683d5b33893
Signed-off-by: Jakub Radtke <jakub.radtke@intel.com>
Reviewed-on: https://review.gerrithub.io/412816
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-12 17:59:33 +00:00
Shuhei Matsumoto
239e63be7d copy/ioat: Change the default of IOAT from Enabled to Disabled
This patch changes the default setting of IOAT copy engine from
Enabled to Disabled. Accordingly this patch changes the config file
specification for IOAT copy engine from "Disable Yes/No" to
"Enable No/Yes".

Subsequent patches will add a new JSON RPC to configure IOAT
copy engine dynamically.

Change-Id: I754990cbb6ecc096953dd2fb9d34366b91111bf8
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/410757
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-12 17:41:29 +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
Jim Harris
5f0c61a589 test/rocksdb: run blobcli -D after test is complete
We especially want to do this when a test fails, but
running it in passing cases too ensures spdk_bs_dump at
least gets run on every patch through the test pool.

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

Reviewed-on: https://review.gerrithub.io/414482
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 16:36:04 +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
Ben Walker
02d75f6237 thread: Move threading abstraction code out of util
This makes more sense as a first class library.

Change-Id: Ibd5c578f8708bd8c7d83fe1629e97c9a3316b56b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/414698
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: Madhu Pai <mpai@netapp.com>
2018-06-12 15:24:07 +00:00
Jim Harris
f007d46c5a test: disable RBD and PMDK tests if not installed
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id3152f911a9a1fb4b3ac9d8be56570a665c079f1
Reviewed-on: https://review.gerrithub.io/414281
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: Ben Walker <benjamin.walker@intel.com>
2018-06-11 23:25:55 +00:00
Shuhei Matsumoto
03a52d0d32 iscsi: Factor out copy scsi status when it is not good
Change-Id: I5042df8c25a2d2f6591a2a922e22407904b04bab
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/414561
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: Jim Harris <james.r.harris@intel.com>
2018-06-11 22:23:55 +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
Karol Latecki
0af5182e19 test/vhost: move negative tests to separate file
fiotest/autotest.sh is a I/O integrity test, so negative cases
should belond to a separate script file

Change-Id: Ie0728ce1eadba9687d1f40b3fdfb26c50ab34055
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/413643
Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
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-08 19:32:07 +00:00
Changpeng Liu
967339f3e5 nvme: factor out qpair destruction function
Factor qpair destruction function so that we can put common
resource release together in future.

Change-Id: I44139947820c2a384b745ae2673799f1b736369c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/412604
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-08 00:26:05 +00:00
Jim Harris
1fd0107026 bdevperf: print error message and exit when no bdevs found
While here, don't print out empty performance data if the
test run failed (for example, if no bdevs were found).  Also
remove superfluous "done" message at the end of main - it
really serves no purpose and looks silly especially if the
test failed.

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

Reviewed-on: https://review.gerrithub.io/414064
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-07 17:46:02 +00:00
Ben Walker
f4f839ecd3 nvmf: Eliminate num_qpairs counter in controller struct
The qpair mask can be used instead.

Change-Id: I9063e656c7c44663dc96adfd5ef52a5a1065d2ba
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/413860
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 16:07:38 +00:00
Ben Walker
f08cea7169 nvmf: Perform QID validation using a bit mask
Instead of scanning a list of all qpairs, use a bit
mask to determine if the requested QID is unique.

This is not for performance reasons, but because
eventually the ctrlr's list of qpairs is going to
need to go away.

Change-Id: Ic25ee60e4f9cd9d596815719760d5be892f29d0c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/413286
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-07 16:07:38 +00:00
Daniel Verkamp
8b158aaacd nvme: factor out request timeout checking
This will be used in other transports as well.

Change-Id: I05026b0dfea2647d61a173379aca368ca48a2f52
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413864
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-06-07 15:46:50 +00:00
Chunyang Hui
3d9b3e972a bdevperf: Add flush io type
Change-Id: Ia954418cdf9423a015358d793a34722169c087ed
Signed-off-by: Chunyang Hui <Chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/414082
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-06-07 15:43:59 +00:00
Piotr Pelplinski
8c45ed3822 blobstore: freeze I/O during snapshoting.
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I6182eb3a77d23db7088703492d71349e3a4b6460
Reviewed-on: https://review.gerrithub.io/399366
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-06 22:26:04 +00:00
Daniel Verkamp
0dc36fe97d test/nvmf: move multiconnection out of NIGHTLY_FAILING
This test is now working reliably after commit 392f3ef589 ("test/nvmf:
fix waitforblk usage in multiconnection").

Change-Id: I15c790b01df8c8204b6c389cf8d381e10ee54fc9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413857
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-06 19:32:15 +00:00
Karol Latecki
161eb083ae test/vhost: remove config-ro Qemu option from config
Vhost-blk readonly "config-ro" option was
removed from Qemu arguments after merging
pull request f67c9b693a into Qemu master.

"config-ro" Qemu option needs to be removed
from scripts in order for tests to pass.

Nightly test for read-only feature has to be
commented out until Qemu is updated on test
servers.

Change-Id: I0cdc9c2fd3b23ef77a63b54e280e1bb9500229ee
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/413745
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-06-06 17:20:30 +00:00
Ben Walker
b95fc6fc64 nvmf: Return the correct error for out-of-range QID
This one is actually a bit tough to deduce in the specification.
The NVMe-oF spec says that QID errors detected in the RDMA
transport shall return an RDMA-specific error indicating
the problem. However, our code doesn't detect the error in
RDMA-specific code, and it isn't clear if the language is
a "must" or a "should".

The NVMe specification does clearly indicate what error
to return on invalid QID in response to a Create
I/O Queue Pair command. For now, return that while
we game plan whether we need to call into the RDMA
transport to correctly report this error.

Change-Id: I7faf37bad9b9202bc50a906214a51c17e4808fc0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/413858
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-06-06 17:10:57 +00:00
Shuhei Matsumoto
f2554ee973 scsi: Change spdk_scsi_task_alloc/free_data() from public to private
This patch does a little cleanup of SPDK SCSI layer APIs.

spdk_scsi_task_alloc_data() is only used in spdk_scsi_task_scatter_data().
spck_scsi_task_free_data() is only used in spdk_scsi_task_put().

The latter was called in UT code but this can be removed without any
degradation.

SPDK SCSI layer is relatively matured and these will not be used
out of lib/scsi/task.c.

Additionally memory leak detected by ASAN is fixed in this patch.

Change-Id: I8eff7b4dbfc307c211087734649a9b9b10555f8d
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/413872
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-06 17:09:22 +00:00
Shuhei Matsumoto
6f872f5ab9 json: Add spdk_json_decode_uint16
int16_t is not used in SPDK yet. Hence add decode function only
for uint16_t.

Change-Id: I86f86a6768d95896d1840370f2d176c770c41418
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/413711
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: Ben Walker <benjamin.walker@intel.com>
2018-06-05 21:30:02 +00:00
zkhatami88
0cdb08b0e0 env: add size parameter to spdk_mem_map_translate
Change-Id: I808101edaf4d75613baf19a950915f1d8e75b1af
Signed-off-by: zkhatami88 <z.khatami88@gmail.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413154
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Zahra Khatami <zahra.k.khatami@oracle.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-05 18:36:00 +00:00
chenlo2x
1559a7cdaa autotest: Adding qos test case under the spdk/test/iscsi_tgt directory.
Change-Id: Iee25dc904d65a83c6149d607aca99b8cf9d2f0dc
Signed-off-by: chenlo2x <longx.o.chen@intel.com>
Reviewed-on: https://review.gerrithub.io/410322
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-04 19:09:21 +00:00
Pawel Niedzwiecki
c25adb8444 test/vhost: Add no-pci option and fix vhost live migration tc2 & tc3
Adds option to disable pci access in spdk_vhost_run function.
This is particularly required in vhost live migration tc2 & tc3

Change-Id: I5ec215d316b97dbabd1297856d8f2dfbf7b9d3cb
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/413658
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-04 19:08:46 +00:00
Daniel Verkamp
a1c7c58f71 util/bit_array: add functions to count 0/1 bits
Change-Id: I7c1ad078982a19c4093e787731974986011f535b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413295
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-04 17:24:48 +00:00
Srikanth kaligotla
8580daa1ac nvmf: SGL support for NVMF RDMA Driver.
Change-Id: I447754c69de432b5a65dc8c1d9ae690926e88c51
Signed-off-by: John Meneghini <johnm@netapp.com>
Signed-off-by: Srikanth kaligotla <kalis@netapp.com>
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/410302
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-04 17:15:49 +00:00
Jim Harris
269a479064 nvme/overhead: fix segfault when no SSD found
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I862a7eb89d6357c85285d2a6cd90ad9f633d2435

Reviewed-on: https://review.gerrithub.io/413285
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-04 03:28:19 +00:00
Jim Harris
13ed998697 nvme: make basic request functions static inline
This reduces submission+completion time by 10-15
core clocks per IO on an Intel Xeon Platinum
processor.  Similar improvements should be seen
on other processors as well.

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

Reviewed-on: https://review.gerrithub.io/413284
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-06-04 03:28:19 +00:00
xuhuagen
392f3ef589 test/nvmf: fix waitforblk usage in multiconnection
The subsystems created in this test only have one namespace, not 10;
wait for just nvme0n1, nvme1n1, etc. instead of trying to wait for
nvme0n1, nvme0n2, nvme0n3..., which will time out and fail.

Change-Id: I2d131e9b92c9c89a5dc8fe0cf9138b980f810233
Signed-off-by: xuhuagen <huagenx.xu@intel.com>
Reviewed-on: https://review.gerrithub.io/413056
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-01 23:25:37 +00:00
Daniel Verkamp
7dff719f7e nvme: optimize layout of struct nvme_payload
Rather than storing nvme_payload::type explicitly, use the SGL reset
function pointer as an indicator: if reset_sgl_fn is non-NULL, then the
payload is an SGL type; otherwise it is a contiguous buffer type.

This eliminates the one-byte type member from struct nvme_payload,
making it an even 32 bytes instead of 33, allowing the removal of the
awkward packing inside struct nvme_request.

Change-Id: If2a32437a23fe14eb5287e096ac060067296f1dd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413175
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-01 21:01:42 +00:00
Daniel Verkamp
caf85d8f23 nvme: add macros to populate nvme_payload
The definitions of these macros will change in an upcoming patch that
modifies the way nvme_payload is laid out.

Change-Id: Ic6edc18928542b07be7519a72bdbf6babbeb0131
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413174
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-01 21:01:42 +00:00
Daniel Verkamp
5c2ccd0628 nvme: add helper function to get payload type
This will simplify upcoming patches that change the way nvme_payload
stores its type.

Change-Id: Idf0a5b8dfd7d66a10f89254d2c5c54fee2968a43
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413173
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-01 21:01:42 +00:00
Jim Harris
cf6ee25359 nvme/overhead: remove extra spdk_get_ticks()
The check_io function always calls spdk_get_ticks() -
so return that value to the work_fn for checking
when the test is complete, rather than have work_fn
call spdk_get_ticks() again.  This eliminates an
extra rdtsc call that counts against the completion
path.

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

Reviewed-on: https://review.gerrithub.io/413152
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-01 21:01:42 +00:00
Jim Harris
58bcd554b5 bdevperf: add unmap IO workload
There is an existing unmap "workload" but it is not a
real workload - it's just used as a type of verify
function to check if an unmapped region later returns
zeroes.  This has typically been true for Intel NVMe SSDs
but is not universal, so this functionality is not really
useful.  It's not used anywhere in any of the tests in the
SPDK tree either.

So replace it with a real "unmap" workload that will
do sequential unmap operations on the underlying
bdev.  A future enhancement could make these unmap
operations random across the bdev - but that can be
added later.

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

Reviewed-on: https://review.gerrithub.io/413151
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-01 21:01:42 +00:00
Jim Harris
95e9846781 nvme/overhead: relax ordering around spdk_get_ticks
The Intel SDM clearly states that only an lfence (not
an mfence) is needed to ensure rdtsc is executed before
subsequent instructions.  So change spdk_mb calls
to spdk_rmb to avoid overhead related to the unneeded
part of the fencing operation.  This provides a more
accurate view of the overhead of both the SPDK and
kernel NVMe drivers.

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

Reviewed-on: https://review.gerrithub.io/413148
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-01 21:01:42 +00:00
Jim Harris
4f0c061d08 nvme/overhead: fix typo
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia7ecef4c68815259f412be9f45c631833fb5790f

Reviewed-on: https://review.gerrithub.io/413147
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: Ben Walker <benjamin.walker@intel.com>
2018-06-01 21:01:42 +00:00
Pawel Niedzwiecki
3dab6c9570 test/vhost: Remove vhost configuration file from integrity test
Change-Id: Id5a6401f5f7b1e6cb404c25a6f017e51dad4a679
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/411681
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-30 23:58:26 +00:00
Daniel Verkamp
9e9cd51f55 test/nvme_ns_cmd: zero-initialize ctrlr options
A recently-added test now uses a controller option value that was
previously uninitialized.  Set them to all zeroes to avoid a Valgrind
warning about using uninitialized data.

Change-Id: I4454b781b7aec27e6d4f4dd8ff5cb059270551e9
Fixes: fbf06aca1a ("nvme: fail when request is too long")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/413017
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-30 23:43:53 +00:00
Pawel Kaminski
d34bd0a60b test/json: Fix: Add missing function declaration
to clear nvmf subsystem.

Change-Id: I0bc33a3edf62b8248b9b6b33fa33be59ea400868
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/412941
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-30 17:28:57 +00:00
Pawel Niedzwiecki
89236d8fc8 test/vhost:Remove vhost configuration file from live migration test.
Change-Id: I78d6ddf008a9f1e3fefdaa3de4a47a46d0c654d7
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/411715
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-30 17:23:33 +00:00
Piotr Pelplinski
fbf06aca1a nvme: fail when request is too long
Fail when number of child requests is >= NVME_MAX_CHILD_REQUESTS.

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

Reviewed-on: https://review.gerrithub.io/408850
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-30 17:22:11 +00:00
Daniel Verkamp
a35b1eb6ab nvmf: fix Identify Namespace for inactive NSIDs
The NVMe spec says that Identify Namespace should return a zero filled
data structure for namespaces that aren't active, rather than failing
the command with a status code of Invalid Namespace or Format.

Change-Id: Ia9156477d8701694f8b295a67e1669fd09e2cb62
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412872
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>
2018-05-30 15:14:04 +00:00
Pawel Kaminski
5627cfd000 test/json: Add rpc calls needed for tests
Change-Id: Iae631fd26fbbb23f83f20766a2268d74c159f122
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/407126
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: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-30 01:26:11 +00:00
Pawel Niedzwiecki
0687215884 test/vhost: Remove vhost configuration file from lvol test
Change-Id: Ic0ada18980a0ca4794ee101950353bd301d80b88
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/411683
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-30 01:03:23 +00:00
Pawel Niedzwiecki
c2b1de2ea6 test/vhost: Remove vhost configuration file from initiator test
Use RPC instead

Change-Id: Iaab3d989b7efa687dd8aa1f9fea3ba720499b658
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/411463
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-30 01:02:46 +00:00
Pawel Niedzwiecki
14edf49a70 test/vhost: Remove vhost configuration file from readonly test
Change-Id: I9a70ffb8a252dddfef8f984669ba5e62bdbde848
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/411558
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-30 01:01:59 +00:00
Pawel Niedzwiecki
035f490d65 test/vhost: Use json configuration file in vhost fiotest.
Change-Id: I0c032913eff08571ed275f939dc191496fa241ec
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/411677
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-05-30 00:53:12 +00:00
Pawel Niedzwiecki
43c5429d6f test/vhost: load json configuration to vhost in spdk_vhost_run.
Json configuration can be loaded by adding parameter --json-path=PATH.
Also spdk_vhost_run can be launched without initial config file.
New JSON RPC call "load_subsystem_config" for loading subsystem
config.

Change-Id: I4e71da99ea574484cba7e0d29b87cbc0b41e5ce6
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/411460
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-30 00:53:12 +00:00
Piotr Pelplinski
bc8f2cd90f blobstore: Change behaviour of dirty bit
The patch disables writing dirty bit during blobstore loading.
Instead, dirty bit is written prior to the first metadata update.

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

Reviewed-on: https://review.gerrithub.io/410884
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
2018-05-30 00:37:54 +00:00
Pawel Niedzwiecki
dcbcac40be test/migration: fix migration tc3
- Removed hardcoded IP addresses, now passing IPs as parameters.
- Modified sshfs command

Change-Id: I98e837746d35ed5ab903a6d6327b84158ca0dd94
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/410466
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
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-30 00:36:53 +00:00
Dariusz Stojaczyk
b6fce1912d env/dpdk: add support for DPDK 18.05 dynamic memory allocation
This brings DPDK 18.05 support and introduces
dynamic hugepage memory allocation.

The following is now possible:
    ./spdk_tgt -s 32
    rpc.py construct_malloc_bdev 128 512

or even:
    ./spdk_tgt -s 0

Note that if no -s param is given, DPDK will still
allocate all available hugepage memory.

This has been tested with DPDK 18.05-rc6.

Fixes #281

Change-Id: Ic9521484c2871eb5b2a56445f1177f305b147707
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/410540
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-29 20:34:11 +00:00
Pawel Kaminski
2db633af80 test/lvol: Snapshot and clone consistency test
Change-Id: If1d9cf21816f009b236963672954a15942697e3a
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/408661
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-05-29 16:28:40 +00:00
Daniel Verkamp
4c91e7bf3b test/nvmf: disable identify_kernel test
This test has been causing intermittent failures for some time:

  nvme_rdma.c: 221:nvme_rdma_get_event: *ERROR*: Expected
  RDMA_CM_EVENT_ESTABLISHED but received RDMA_CM_EVENT_UNREACHABLE (7)
  from CM event channel (status = -110)

Disable it until we find a reliable way to avoid this issue.

Change-Id: Id8f767bfa26a6a14f94cf4f7ff69b3ac0f11d88d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410489
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-29 07:52:35 +00:00
Daniel Verkamp
c4bb0ea600 nvme: add helper to wait for internal commands
Factor out the common pattern of waiting for an internally-submitted
command to complete.  This will give us a convenient central place to
add error checking.

Change-Id: I65334d654d294cfb208fc86d16fa387ac5432254
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412545
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>
2018-05-28 01:43:55 +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
Daniel Verkamp
5a1eb0dcf8 Fix up a few remaining "NVML" references
The upstream project has been renamed to PMDK.

Change-Id: I9bb0200d2cbf1e94c464017587b7bf0847ac0bfa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412421
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-24 22:53:06 +00:00
Pawel Kaminski
f54106e771 test/vhost: Add proper path for BASE_DIR variable in common.sh library.
Fix in scripts that use BASE_DIR variable
            that is redefined in common.sh.

Change-Id: Ie4ad9fb85f0042d274738f19b0d4696b2056efda
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/411833
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-24 22:52:27 +00:00
Daniel Verkamp
35efde744a nvmf: send abort request to the qpair group thread
Abort is not currently implemented, since spdk_nvmf_qpair_get_request()
always returns NULL, but this will allow it to be implemented in a
thread-safe way.

Change-Id: I6dfd1ee50848deed0f4a2667aad5a811d8dd4ca7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410723
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-05-24 22:39:23 +00:00
Daniel Verkamp
24c7c4975e test/env: split out env_dpdk-specific tests
Change-Id: Icc8aeb642d31b5c031c90855b33913bf886cefe8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/412406
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-24 21:27:06 +00:00
Changpeng Liu
65e56caa17 nvme: wrapper request completion callback into a function
When IO is finished SPDK will trigger callback at controller layer,
while here, wrapper the completion callback into a function so
that we can add error injection at this function in following patch.

Change-Id: I7b7a6d278d87fd09a05f51f688398fdf2e9c4e05
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/411630
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-24 18:03:25 +00:00
Piotr Pelplinski
3ca9cd762b blob_ut: separate scheduler for blobstore unit tests
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I26e9d1e86c93f0b96b5bff7c9af5a453199c3e29
Reviewed-on: https://review.gerrithub.io/408138
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-24 17:48:19 +00:00
Pawel Kaminski
a34a1aa255 test/lvol: Inflate test.
Change-Id: Icd0c08b5e95fded65394838e1c2e5e0abb8d3c75
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/408675
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-23 18:12:52 +00:00
Maciej Szwed
6ce7a73912 lvol: add lvol inflate function
Change-Id: Ib999d3f082f5d632cb1aaf089504d0cd48e77539
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/408696
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>
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
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
Daniel Verkamp
700477897a test/vm_setup.sh: update nvml-tools -> pmempool
This package has been renamed to reflect the new upstream project name.

Change-Id: I71f6bfaf36fb1fe7dc4cb050e3d7faad1097994e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/411781
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-22 21:04:10 +00:00
Liang Yan
04ad0ad9f1 test/rpc: add multiple NVMe bdev support in the rpc_config.py
Change-Id: I923c808affabdb97a5237b76f9f5534d6fb41601
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/411048
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-22 16:52:02 +00:00
Daniel Verkamp
cbd9c241dc nvme: factor out process lookup into a function
Change-Id: I7598222db5d76c1a1578fbb5935d4348f7c62f54
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410951
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-05-21 18:22:50 +00:00
Seth Howell
27d7bac9a0 test/common: Make common pmap call more generic
This is to support older versions of pmap (specifically procps v 3.2.8
which ships with centOS 6) which don't support the -p and -X options.

Change-Id: Ic8d4b94985c165e8bf224204af48b5d856aa2403
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/411755
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-21 17:09:23 +00:00
Seth Howell
3c2044e9aa test/iscsi_tgt: make rpc config.py python3 compatible
Change print statement syntax and subprocess calls as well as some list
comprehension syntax.

Change-Id: Iebdea5f06be963e7f04af4df352aacef9b31a8eb
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/410957
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-18 22:12:19 +00:00
Chen Wang
d6d097a18d test/vhost: add vhost_nvme.c unit test framework
Add a simple example for spdk_vhost_nvme_controller_construct
and spdk_vhost_nvme_dev_construct functions.

Change-Id: I38415a7f4b28faf071a74e9b87d141da78e43368
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/410532
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-05-17 23:07:58 +00:00
Shuhei Matsumoto
718440bc6b iscsi: Fix two bugs of JSON config dump
Missed to add object_begin to dump for portal group.
key of lun in luns is different between dump and load.

Change-Id: I16b95596478e0e4430c7186aa077bd107e375a93
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/410863
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-05-17 23:06:11 +00:00
Seth Howell
61770b52e3 test/lvol: Remove python2 syntax from test cases
Python3 does not support the "except Exception, name:" syntax used in
test_cases.py

Change-Id: Ie90888d715c97c94c7686b797d955df2ead61915
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/410937
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-05-17 17:10:42 +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
Piotr Pelplinski
ede6d97e3c blobstore: add inflate call
Inflate call can be used on thin provisioned blob or clones.

Function allocates all unallocated clusters on specified blob and:
 - For clones, copies data from backing blob.
 - For thin provisioned blobs, clusters are zeroed.

After this call all dependency from specified blob is removed
what allows deletion i.e. snapshots.

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Change-Id: Ibff569e45b12068b2fb46557156be348b36c252b
Reviewed-on: https://review.gerrithub.io/399367
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-11 17:22:00 +00:00
John Kariuki
8b75f85f2d examples/bdev: add hello world example
This commit adds a simple hello world example that writes the string
"Hello World!" to a bdev. The example can be used on a block device
such as Malloc or virtual bdev such as the passthru vbdev. The
sample bdev.conf configuration file includes a configuration for 2
malloc bdevs and one passthru bdev on top of Malloc0.

Change-Id: I1414183e3ddfac988ef61f24b8271653ac57e7c1
Signed-off-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-on: https://review.gerrithub.io/407220
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: Jim Harris <james.r.harris@intel.com>
2018-05-11 15:22:22 +00:00
Shuhei Matsumoto
29c29ff9b6 iscsi: Add JSON config/info dump for portal group.
Support JSON config/info dump for portal group. These are added to
portal_grp.c. Text config dump is moved to portal_grp.c.

Add accesses to g_spdk_iscsi.pg_head are consolidated into
portal_grp.c to extract pg_head from g_spdk_iscsi.

Change-Id: I8c551b067c68a785eb0c7d83d695bde5f7219c2b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407850
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-10 19:38:26 +00:00
Shuhei Matsumoto
8107d04bfb iscsi: Add JSON config/info dump for initiator group.
Support JSON config/info dump for initiator group. These are added
to init_grp.c. Text config dump is moved to init_grp.c too.

Add accesses to g_spdk_iscsi.ig_head are consolidated into
init_grp.c to extract ig_head from g_spdk_iscsi.

Change-Id: I88131d248ed13e42e4da56aed8ae0edc01a65715
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407849
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-10 19:38:26 +00:00
Ben Walker
16d0fbd0d6 nvmf: Statically size the subsystems arrays
The realloc breaks TAILQs inside the structures, which causes
subtle bugs. Instead, statically allocate all of the subsystem
arrays. This sets up the maximum number of subsystems to be
configurable, but does not actually expose it through the
config file yet.

Change-Id: I7347b6002b6babc0678ce59cd218a454fe3a6f88
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/410521
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-09 23:31:54 +00:00
Dariusz Stojaczyk
bfb73837de ut/bdev_mt: add test case for ENOMEM handling with multiple io targets
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 `issue` has been fixed just now, but to prevent
it coming back again lets add a unit test for it.

This test case creates two bdevs using two separate
io_devices and checks if ENOMEM handling is somehow common
for these two. It must not be.

Change-Id: Ic32ef4b4347b8856d4b9f91107e6f188ad67978e
Suggested-by: Ben Walker <benjamin.walker@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/409997
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>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-05-09 18:19:06 +00:00
Dariusz Stojaczyk
331887f7e2 test/iscsi: disable hotremove tests
iSCSI hotremove is broken. It relies on C undefined
behavior. Some bdev_io may be put after their bdev_channel
has been put (freed) and spdk_bdev_put_io may be reading
freed bdev_channel memory.

iSCSI tasks targetting hotremoved devices are finished
immediately. That's usually fine, but these tasks might
be subtasks of an r2t chain. Once subtasks are freed, their
parent task may be eventually freed as well. If the parent
has finished before the hotremoval, its bdev_io has been
assigned, so freeing the task will put that bdev_io and that's
where undefined behavior hits.

There's an ongoing work towards deferring iSCSI hotremove
if r2t tasks are present, so this test should be reenabled
once that's done.

Change-Id: I7fa741b8749d542bcabb211a0969da5d7742eda3
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/410176
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-09 18:19:06 +00:00
Daniel Verkamp
60232f67e4 test/nvmf: add semicolons to avoid astyle 3.1 bug
The DEFINE_STUB macro doesn't actually need a trailing semicolon, but
adding one avoids a new astyle 3.1 bug that otherwise causes these stubs
to get reformatted incorrectly.

Change-Id: Idc281d08ba8e1ca0593442b6e4d25add25bea2d7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/410068
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:58:38 +00:00
Chen Wang
885160c08b test/vhost: fix the test suite name
Change-Id: Id87ace1d8f875f294252874c644572b0993ffc94
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/410533
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-09 16:53:03 +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
Seth Howell
142221987e test/lvol: make tests python3 compatible
There needed to ba a couple of changes made with respect to integer
rounding and handling raw binary strings from subprocess calls that were
handled by default in the last version.

Change-Id: Ie0e664a577e0b0fb690058842c5dbe95b2794a26
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/409776
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-04 22:18:55 +00:00
Jim Harris
e8ddb060f8 blob: don't try to claim cluster 0 in recovery code
Thin provisioned blobs mark unallocated clusters with
cluster ID 0.  During recovery from a dirty shutdown,
we must not try to claim cluster 0 - we should ignore
them instead.

Fixes issue #291.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If0dd42416f5de8d9972073bf6ed44eb8bc655415
Reviewed-on: https://review.gerrithub.io/410065
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:18:03 +00:00
Chen Wang
1c02d2a8b5 test/vhost: update the method of function defined
Change-Id: I02b857cdbeec936c7e4502fe3e72f9156b8abdd8
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/409799
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-05-04 19:19:12 +00:00
Shuhei Matsumoto
9114e3a22e iscsi: Add JSON config/info dump for target node.
Support JSON config/info dump for target node. These are added
to tgt_node.c Text config dump is moved to tgt_node.c too.

All accesses to g_spdk_iscsi.target_head are consolidated into
tgt_node.c to extract target_head from g_spdk_iscsi.

Change-Id: Ibdf57c6ec9457d762c5640483b5810c9a74604ef
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407848
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-04 17:45:48 +00:00
Seth Howell
86ee572b79 autobuild: On FreeBSD, install the contigmem driver
The contigmem driver is built with dpdk and frequently updated. We
should copy this driver each time we build dpdk in order to maintain
support for FreeBSD

kldload checks the sysctl variable kern.module_path when deciding which
modules to load. Since the values stored in this variable are not
determined by our program, I chose to copy the module to both common
directories for kernel modules in FreeBSD.

Change-Id: I2d439a9cbac5bebb79e6ee48bec47409bb215be9
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/409250
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-03 19:49:53 +00:00
Jim Harris
9f872d2040 bdev_svc: do not unaffinitize thread if core mask specified
This keeps original behavior, allowing scheduler to move
the thread if no core mask was specified - something the
in-tree test scripts do now.  This original behavior made it
easier to just start bdev_svc as a dumb background process to
speed up nvme test programs running as secondary processes.

But if the user wants to specify a core mask to use bdev_svc
for other purposes, we shouldn't unaffinitize the thread.

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

Reviewed-on: https://review.gerrithub.io/409774
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: Daniel Verkamp <daniel.verkamp@intel.com>
2018-05-03 19:46:48 +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
Daniel Verkamp
8e17d9f21f test/vhost: remove unused virt-manager config file
Nothing uses this anymore - the whole directory was renamed except for
this file.

Change-Id: If2568564371a21772d7daa24d09bea3eecb6564a
Fixes: 0488fd84b8 ("vhost_test: update vhost ext4test for spdk vhost")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/409246
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-01 18:14:54 +00:00
Daniel Verkamp
f7b58aea2b nvme: capture VS register at init time
This will be used later instead of retrieving VS (potentially via a Get
property command for Fabrics) multiple times.

The Active NS List code was previously depending on the VER field of the
Identify Controller data, but this was only added with NVMe 1.2, so we
can't rely on it to detect NVMe 1.1 controllers; it is changed to use
the new cache VS value instead.

Change-Id: Iba9ed5ecbc82b4654973438d119daba0c4cf0724
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408895
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: Ben Walker <benjamin.walker@intel.com>
2018-04-30 17:19:07 +00:00
Daniel Verkamp
d08917d89e ioat: remove ioat kperf kernel driver test harness
This driver was added to allow benchmarking of the SPDK user-mode I/OAT
driver vs. the Linux kernel I/OAT driver; however, this isn't a
particularly interesting test, since the kernel I/OAT driver is totally
inaccessible from user-mode code (it is only exposed to the in-kernel
dmaengine framework).

Maintaining an out-of-tree kernel driver for the sole purpose of
benchmarking is out of scope for the SPDK project, so remove the kperf
driver and test harness.

This can always be retrieved from git history if needed later.

Change-Id: I0ced6e8a88de2cf09a6c0970dfef0ae8f357f193
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408900
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: Jim Harris <james.r.harris@intel.com>
2018-04-30 17:11:53 +00:00
Tomasz Zawadzki
5bafc240e5 test/iscsi: utilize network namespaces in iSCSI tests
Network namespaces are used to assure that kernel
is not routing packets within host stack,
but they go through veth interfaces.

This patch serves as a base for future VPP test changes,
where namespaces are used as well.

Change-Id: Ic7b82b0a0837bca2e16774fde244348a691fe056
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/405641
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-26 17:10:36 +00:00
Dariusz Stojaczyk
d69ccc823a rpc.py: remove references of "debug" trace flag
It has been removed long ago.
Also enabled "log" traces for log_ut, so that
SPDK_LOG_LOG messages are now displayed.

Fixes #284

Change-Id: I815f2a3301524540201adf060e3114143c258c4b
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408945
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@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-25 17:31:28 +00:00
Daniel Verkamp
0368077d70 test/vhost: convert vhost-nvme stubs to DEFINE_STUB
Change-Id: I182e3fd47c28468184d1a60dec3d114df2d5e5ae
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408763
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
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-25 02:38:30 +00:00
Seth Howell
9acb995ede test/common: Don't override autorun-spdk.conf
Change-Id: I1b75ffaccdf909ce1ce11f4464efdd539a7754a7
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/408410
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-24 21:53:51 +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
Changpeng Liu
d08a33f5a3 test/vhost-blk: enable read only test for vhost-blk
The QEMU vhost-user-blk-pci host driver will not negotiate
VIRTIO_BLK_F_RO feature bit by default, users must append
`config-ro=true` to enable it if the backend device can
support read only feature.

Fix the issue #254.

Change-Id: I17dcc1b80bde094dd4873221b681d0c4049abb39
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/408266
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>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-04-23 20:40:26 +00:00
Seth Howell
2679d88a25 test/pmem: add timing markers to pmem test
Change-Id: I128bc1600b8f5727ef47187d260e31f911a954d6
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/408397
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:10:22 +00:00
Dariusz Stojaczyk
364e0fa94d vhost: switch to the new rte_vhost API for GPA translation
DPDK will deprecate the old API soon.

Change-Id: I0522d47d9cc0b80fb0e2ceb9cc47c45ff51a5077
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408722
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-23 18:29:42 +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
Seth Howell
fc0dc65adc test/common: Fix flamegraph typo in vm_setup
Change-Id: I27b9e118fe760bc5e7425fad3731f54b618fb347
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/408409
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-20 17:49:36 -04:00
Pawel Niedzwiecki
cb2d8466dc test/rocksdb: move nightly test case to RUN_NIGHTLY_FAILING.
rocksdb has been frequently failing in nightly tests:
https://ci.spdk.io/spdk/nightly_status.html

Change-Id: I53d812dfb6146bd973fff3c40fe3490c0fba9fc8
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/406975
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
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: Ben Walker <benjamin.walker@intel.com>
2018-04-20 17:24:45 -04: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
Tomasz Kulasek
0893ad54c6 blobstore: clone-snapshot relations unit tests
Change-Id: I3f9e54774951e691378e0659dcf15cecacd77e2c
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/405026
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
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-20 15:22:53 -04:00
Tomasz Kulasek
d7e065be93 blobstore: clone-snapshot blobstore relations
This commit provides an API to obtain an information about
snapshot and clone relations.

The main objective is:

 1) Determinate if we can delete snapshot (if have some created
    clones),

 2) Provide an information about parent/children nodes to the upper
    layer (e.g. lvol)

Realization:

 1) Structure parent-children is stored in the blob store object
    and updated on:

     a) blob store load,

     b) blob create/delete,

 2) Full information about parent-children is provided via new API:
    spdk_blob_get_parent() and spdk_blob_get_children(),

Note:

    While we don't store an information about these relations in the
    blob store, we need to open all blobs on blob store load to create
    it. It should be considered that it have an impact on the blobstore
    loading performance.

Change-Id: Ie0237fa5b93af01aa73d1f68ac1694e653fb75e5
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/405025
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-20 15:22:53 -04:00
Jim Harris
4ecb2e1d33 Revert "test/virtio: test support for kernel vhost-scsi device"
Recent patches to the vhost initiator tests have resulted in
some fairly regular test pool failures (at least 9 in the last
24 hours).  Revert while this is debugged further.

This reverts commit 0b34e88c2d.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I427d46b10d30bf21b3b29bebc6583403e031f2fb
Reviewed-on: https://review.gerrithub.io/408389
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-19 20:05:53 -04:00
Jim Harris
8cf4bc42e7 Revert "test/virtio: enable qemu virtio-scsi-pci device"
Recent patches to the vhost initiator tests have resulted in
some fairly regular test pool failures (at least 9 in the last
24 hours).  Revert while this is debugged further.

This reverts commit 4988e48294.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I427d46b10d30bf21b3b29bebc6583403e031f2fc
Reviewed-on: https://review.gerrithub.io/408388
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-19 20:05:53 -04:00
Daniel Verkamp
3fa7c33ac1 nvme: require trid to be valid in nvme_ctrlr_probe
This is an internal NVMe driver function, so we don't need to allow for
the case where trid is NULL.  All callers already passed an address of a
local variable except the unit tests, which can be trivially fixed.

Fixes a static analyzer warning about trid being dereferenced in
nvme_transport_ctrlr_construct() before being checked for NULL in the
caller.

Change-Id: I2bfeb5c92a302093b7c7f2949adcd18baa11855a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408395
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-19 17:51:14 -04:00
Seth Howell
4ca87a01b4 nvmf: make spdk_nvmf_subsystem_remove_ns asynchronous
Update the thread-local caches with new namespace data during each call
to spdk_nvmf_subsystem_remove_ns to handle the case where the user
requested to remove a namespace and then immediately add a different
one at the same namespace id. This makes the call asynchronous.

Change-Id: I8fd1968f7da78966386de18506b98d403b82d80e
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/408220
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-18 15:41:00 -04:00
Pawel Niedzwiecki
4988e48294 test/virtio: enable qemu virtio-scsi-pci device
This test was disabled because older version of fio was crashing
during virtio-pci tests. This issue was fixed by copying fio
from host to guest vm.

Change-Id: I2e60d275372f0ed3baf3da7e3a5c87c7f2e771a6
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/406950
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-18 15:34:34 -04:00
Pawel Niedzwiecki
0b34e88c2d test/virtio: test support for kernel vhost-scsi device
Adds kernel vhost-scsi device to virtio pci test.

Change-Id: Icb014b6036b37afc6072c8875c157aadf7de730e
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/398915
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: Ben Walker <benjamin.walker@intel.com>
2018-04-18 15:34:34 -04:00
Daniel Verkamp
37039565d0 io_channel: add asserts in spdk_io_device_register
spdk_io_device_register() doesn't have a return value, but we can at
least catch trivial mistakes like neglecting to pass a valid io_device
or create/delete callback in debug builds.

One invalid unit test case that passed NULL for all parameters is
removed, since there's no way to make that work without adding a return
value instead of asserts.

Change-Id: I3dd4c850bdb14957d2dc03209ea9ea44bbe4e616
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408117
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: Ben Walker <benjamin.walker@intel.com>
2018-04-18 12:33:25 -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
Ben Walker
d859e3cc8d bdev: Remove implementation assumptions from QoS unit test
This will allow a bit of internal refactoring to occur
without breaking the unit test.

Change-Id: Id7da6b14e9cd4cab5fc4dc004b5858dbbb34bc3a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407366
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: GangCao <gang.cao@intel.com>
2018-04-17 21:47:12 -04:00
Daniel Verkamp
0a162815d6 Revert "subsystem.c: make subsystem_remove_ns asynchronous"
This reverts commit 498f9add11.

Making the subsystem removal asynchronous seems to be triggering an
intermittent failure in the NVMe AER test.  Let's revert this for now
until we can diagnose the issue.

Change-Id: Ie1d598f0d5cce07e6869d87cd8388848caa78e46
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408118
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-17 20:17:27 -04:00
Seth Howell
498f9add11 subsystem.c: make subsystem_remove_ns asynchronous
Performing a subsystem update on each poll group after the addition or
removal of a namespace allows us to avoid the case where we pause a
subsystem, perform a removal, then an addition, resume the subsystem and
don't update the channel for that subsystem. This, however requires that
spdk_nvmf_subsystem_remove_ns be asynchronous.

Change-Id: I856572c02e6267f708da3a956accbbedae7260fb
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/407012
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-17 18:23:19 -04:00
Karol Latecki
8ebaed2eb5 test/vhost: live migration test case 3
To be run only manually as test pool does not
have DUTs connected in pairs.

Change-Id: If3ab3e671156b583adb35d5b23ee90003a6de732
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/400988
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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-17 17:10:29 -04:00
Liang Yan
aa749442cb test/iscsi_tgt: merge the two steps of running fio_remote_nvme.sh
Change-Id: Icb98e4628962591da32d169853d0ff14400e1e50
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/406922
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-17 14:27:25 -04:00
Maciej Szwed
208748b423 lvol: Creating 2 lvols simultaneously with same name
This patch fixes issue where user creates 2 lvols
with the same name simultaneously. New solution
builds list of names of lvols that are currently
being created and when new request comes it compares
name against existing lvols and lvols that are in the
process of creation.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I31b59ee13b5b9bae531866925dd409b143f08ad4
Reviewed-on: https://review.gerrithub.io/407408
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-17 14:03:22 -04:00
Tomasz Zawadzki
0629b01d21 test/rbd: add configurable monitoring IP address for ceph
Ceph monitor IP address was always 127.0.0.1, with this change
it can be configured at setup time.

Since each test might prefer to specify different addresses
or ones that do not exist at start of autotest.sh. rbd_setup was
moved to begining of each test respectively.

Change-Id: I5626f7ea979d0db921208355ba23314cf48e971f
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/407910
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-17 13:55:44 -04:00
Jim Harris
18f3a22b20 test: disable ASLR for multi-process tests
Multi-process tests should work fine using the DPDK
-base-virtaddr parameter.  But we run tests with ASAN
enabled and ASAN instrumentation results in mmap
address hints getting ignored.

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

Reviewed-on: https://review.gerrithub.io/407843
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-17 13:26:24 -04:00
Jim Harris
dba0f6e0a8 test: run pmap on stub process after it starts
This will be a debugging aid to root cause some intermittent
test failures seen due to ASLR in the test pool.

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

Reviewed-on: https://review.gerrithub.io/407842
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-17 13:26:24 -04:00
Pawel Wodkowski
a3f8876777 vhost: add JSON config dump
Change-Id: If6c9ea6f9959b6c34ef90b8e382ceba9889040ee
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/404373
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>
2018-04-16 19:27:33 -04:00
Seth Howell
e3263286d3 test/nvmf: confirm kernel finds NVMe-oF namespaces
In Fedora 27 the nvme program returns before the kernel has loaded the
namespces associated with the subsystem. This patch ensures that those
namespaces can be enumerated by the kernel before we run any tests on
them.

Change-Id: I77505ed5cd5b1118a841650851fa5ecaf76f5619
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/407829
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-16 19:25:37 -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
Ben Walker
931b7d1f85 test: 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: I73adb5d3eea5c95ea705c67de4fc967e926eb6ce
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407025
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-13 16:15:52 -04:00
Tomasz Kulasek
ebf079362b test/lvol: Snapshot and clone test cases for lvol feature.
Also move snapshot and clone test plan into implementation.

Change-Id: Ifa1f2da651305747ae24c50921deebd0266c5888
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/392371
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-12 19:29:00 -04:00
Pawel Kaminski
9b5fd19225 test/lvol: Praparation for snapshot and clone test cases
Refactor run_fio_test method and create compare_two_disk method.

Change-Id: I0228ad68d2b28057dc64f4f997a93edd90b6a324
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/406697
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
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-12 19:29:00 -04:00
Ben Walker
9611db82a3 lvol: 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: Iabd65cc703f56e8bc561344893aaeb6dc5f25fb8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407022
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-12 13:45:04 -04:00
Pawel Wodkowski
6ebfbf7351 test/vhost: add live migration test case 2
Change-Id: I114c11d9f7c1e9a5a8c0a989541a41b8747cc125
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/398753
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
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-12 13:43:18 -04:00
Tomasz Zawadzki
b7f049070d test/nvmf: update test scripts from ifconfig to iproute2
iproute2 tools are more up to date and offer broader capabilites,
thus should be used whenever possible.

This change was prompted by "ifconfig -s" cutting interface names,
not allowing for ones that are longer than 8 letters.

Change-Id: I38462f8498207aa0b0d24d1c0b1769c1ba59f0ea
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/407395
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-12 13:19:39 -04:00
Tomasz Zawadzki
5ee127aa2c test/nvmf: fix new line when searching for soft roce interfaces
When combining two lists with of rmda_nics and all_nics,
last entry of rdma_nic and first from all_nics were
combined into one.

Change-Id: I809bdb6c8cc4dcc3aec2c0964598c35fccbba8ae
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/407394
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-12 13:19:39 -04:00
Dariusz Stojaczyk
ffb4d54a79 vhost: unaffinitize rte_vhost thread
rte_vhost_driver_start() can start a new posix thread
that polls for incoming socket connections and calls
backend->start/stop_device. Soon we're going to put
more work on this thread, so we need to make sure it
doesn't collide with SPDK reactors.

This patch also fixes vdev memory leaks in case the
rte_vhost_driver_start() fails.

Change-Id: I16fdff228176a245c478251b39aa244a49bd124b
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/406959
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: Ben Walker <benjamin.walker@intel.com>
2018-04-11 16:49:57 -04:00
Changpeng Liu
e9ee09f153 test/nvme/aer: add changed namespace list log test
Change-Id: I2cc6c494bacbeec1ba725b4b3d78a1f4a2ed39d1
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/406166
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-11 16:05:09 -04:00
Jim Harris
bb5f94f838 blobfs/fuse: account for leading slash in filenames
The RocksDB plugin no longer strips the leading slash
from filenames - so update the fuse plugin accordingly.

If and when BlobFS supports a real directory structure,
we'll need to avoid the leading slashes, but for now let's
just make the fuse plugin usable.

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

Reviewed-on: https://review.gerrithub.io/407231
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-11 16:03:14 -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