Commit Graph

1572 Commits

Author SHA1 Message Date
Pawel Kaminski
0616b2a506 test/vhost: Preparation for hotremove tests
Code refactoring to accommodate for coming hot-remove tests.

Change-Id: I41cfb04b467bf21a5a991712791ee6bfc87c241c
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/391957
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-26 14:55:55 -05:00
Slawomir Mrozowicz
d4822a7db5 bdev: Add bdev resize function
Add api and unit test functions for
change number of blocks for provided block device.

Change-Id: I55d67c99375cb88bdaa79ce1a36d4298223beddc
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Reviewed-on: https://review.gerrithub.io/390802
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-01-26 14:45:08 -05:00
Pawel Kaminski
4ab8589ba3 test/lvol: Test plan for provisioning
Change-Id: Ia1ccf8091fb2dbbb97a7acecc230d9f6cb7c1002
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/391257
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@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-01-26 14:43:14 -05:00
Pawel Niedzwiecki
db739e1594 test/virtio: Add vhost initiator tests for pci mode
New tests are performed on guest vm where vhost scsi
controllers are presented as a virtual pci device.
Some changes in common.sh had to be made to allow to build
spdk on vm and to set queue number.

Change-Id: I8289d6aede6020e958c9e5aae893591d844cdbcf
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/394248
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@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-01-26 12:59:07 -05:00
Seth Howell
4667c5cbd7 vm_setup: add required packages
I missed the libelf-devel and flex in my initial version.

Change-Id: I892c4e15c3704f0ca51ff0fac4e375c456258e83
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/396475
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-01-26 12:57:40 -05:00
Tomasz Kulasek
601bcbcf66 util: extend cpumask to hold more than 64 cpus
Fixes github issue #218.

This patch introduces spdk_cpuset object to store and manipulate
the set of individual CPUs. The main objective of this object is
to replace cpumask declared as uint64_t and extend the limitation
of supported CPUs (lcores) above 64 CPUs.

spdk_cpuset is always allocated dynamically and accessed by opaque
pointer, what makes it easier to extend in the future without
breaking API/ABI.

This patch also extends parsing function allowing to set cpumask
using a list of cpus e.g. "[0-4,10,12]" sets mask of 0,1,2,3,4,10,12
as well as hexadecimal string with and without "0x" prefix.

Change-Id: I475c3ba7fab629021a22e03176e57e400dd24a49
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/390794
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-01-25 18:51:50 -05:00
Karol Latecki
0ff878d02e test/vhost: live migration test plan
Change-Id: I25f62d221c251a2ce455bfca7f686bb5817aa7d6
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/394199
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>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-01-25 17:59:04 -05:00
Chen Wang
b1a8455ac8 autotest: vhost_fio_test (porting from nightly to autotest)
Add vhost-scsi and vhost-blk fio test cases which used more cores
and controllers in nightly

Change-Id: I51b47f6272c1b29dff890384087014627238dc68
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/389072
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-01-25 14:42:42 -05:00
paul luse
74b3dc9a2d test: minor updates to vm_setup script
Added execute permissions and -p to a few mkdir locations to
make re-running after an unrelated failure a little cleaner.

Change-Id: I67592fc4dd91839979fdb8eeda38dcdbcd4b7700
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/395865
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@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-01-25 14:35:28 -05:00
Karol Latecki
f6f434b4b4 test/vhost: Update vhost test plan
Also move the test plan file to a more appropiate location.

Change-Id: I462058279d4d2dc03790657b82b3cfeb00c8a93a
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/394180
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-01-25 13:59:47 -05:00
wenzhong wu
52c773ce64 autotest:Add fio_plugin with nvmf lvol backend(Porting from DTS)
To cover fio_plugin as host with nvmf lvol backend.

Change-Id: I5c602d95421f1ab6d2dde660c1833c953c2e5c75
Signed-off-by: wenzhong wu <wenzhongx.wu@intel.com>
Reviewed-on: https://review.gerrithub.io/390381
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-01-25 13:44:18 -05:00
Jim Harris
29be88fab6 test/blob: always use SPDK_BS_PAGE_SIZE instead of PAGE_SIZE
PAGE_SIZE just happens to resolve to same value as SPDK_BS_PAGE_SIZE
on x86-64, but at least some ARM systems do not define PAGE_SIZE
in headers included by blob unit tests, which is only reason this
discrepency was not identified until now.

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

Reviewed-on: https://review.gerrithub.io/396320
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-01-25 11:05:59 -05:00
Pawel Niedzwiecki
3d28498af9 test/virtio: Perform unmap tests on unmap supporting devices
-perform rw tests on all devices
-perform unmap tests + rw tests to match number of jobs and queues

Change-Id: Ica59ea3667c1c3a639ec9cded0fd43ea9d83ef03
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/394074
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-01-24 19:35:36 -05:00
Pawel Niedzwiecki
d66b1e1c91 test/virtio: Move all nightly test cases to per-patch
With multiqueue all jobs run in parallel so
test execution time will not be extended

Change-Id: I6187ee0acf6958b137ba74dd34706538197ce966
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/394389
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@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-01-24 18:28:49 -05:00
Hailiang Wang
835e5bc225 autotest: blobstore_test (porting from nightly to autotest)
This patch is used to test blobstore automatically
which based on examples/blob/cli/blobcli.

Change-Id: I0309cf01d1561f309574a37aeaff8bfbc395f65c
Signed-off-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/386186
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-01-24 17:12:47 -05:00
Xiaodong Liu
24c7f62fed test/iscsi: check and avoid setting DataDigest
iscsiadm installed by some Fedora releases, like Fedora 27,
loses DataDigest parameter unintelligibly.

Change-Id: I6664146c6e0cb8933188b29166bedd087f4d38e1
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/396076
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-01-24 16:52:30 -05:00
Seth Howell
4151703690 test/nvmf: add null pointer check to subsystem test
Fedora 27 ships with Clang 5 which throws an erroneous error in the
add_ns subsystem test. It believes that subsystem.ns is a null pointer.
In order to circumvent this error, I add an assert to bail out of the
test if the pointer really is null and then only execute the final
assert if the pointer is not null. This way our tests will still pass
Scan-build tests on Fedora27.

Change-Id: I54d3fae485d56033ba5eb23b0aa323480ae6a6e4
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/396051
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-24 16:50:42 -05:00
Piotr Pelplinski
074f4d7627 blob: set md_ro and data_ro fields only after persisting data
Currently, there is no possibility to save read only blob to disk.
This patch modifies behaviour so that read only flags are applied after syncing blob.
This is analogy to resize, set xattr and remove xattr operations.

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: Iffed601c78cb83231bb20e7ef05b73847dc3c95a
Reviewed-on: https://review.gerrithub.io/394243
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-01-24 15:56:15 -05:00
Chen Wang
9e8415c688 autotest: vhost_filesystem_test (porting from nightly to autotest)
Add vhost-scsi and vhost-blk filesystem test cases with
lvol and nvme back-end in nightly test

Change-Id: Id2cccd9a45aaa995bef90415855835b93447f2e9
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/390923
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-24 15:51:03 -05:00
Tomasz Zawadzki
b6aaba0852 bdev: remove vbdevs during spdk_bdev_unregister()
spdk_vbdev_unregister() is part of internal bdev API,
yet bdev module that uses spdk_vbdev_register() directly
will not be removed correctly when using delete_bdev RPC.
spdk_vbdev_unregister() is now consolidated with
spdk_bdev_unregister().

This comes up when deleting lvol bdev, as it does not use
spdk_bdev_part_* functions.
base_bdev->vbdevs entry was not removed for bdev that lvs
is created on.

Additionally patch expands test to create lvol bdev,
after removing it using delete_bdev RPC.
With ASAN enabled this would report accessing
already freed memory previously.

Change-Id: I9547e83862e2daa50355d56a1c9f453aaa6cfdb8
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/395711
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-01-24 15:50:04 -05:00
Seth Howell
68b96260ed test/unit: replace sprintf call with snprintf call.
This fixes a Klocwork bug.

Change-Id: Ia42bf0f246c8e1b9aa211095a00b9d1ab8e7a085
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/396059
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-01-24 15:38:05 -05:00
Jim Harris
f570aa654a vhost: only split on 2MB boundaries when necessary
vhost I/O only need to be split on 2MB boundaries if
there is a break in the VM's memtable at that 2MB
boundary.

This should drastically reduce (if not eliminate)
the intermittent test pool failures seen recently.
virtio limits number of segments to 128, but this
2MB splitting could introduce additional segment
breaks which we do not allocate IOVs for.  In almost
all cases, there are no memtable breaks except at
low 2MB, so most of the extra segment breaks we are
adding are unnecessary.

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

Reviewed-on: https://review.gerrithub.io/396058
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-01-24 10:33:43 -05:00
Jim Harris
4d48d87a7f iscsi: remove idle connection handling
Some upcoming changes will effectively render this moot
anyways by adding an epoll/kqueue descriptor to poll
on in all cases (not just connections that have been
idle for 5ms).

The epoll/kqueue code was just ifdef'd out instead
of removed - some of this code will be useful
and reusable with minimal changes in the upcoming
patches.

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

Reviewed-on: https://review.gerrithub.io/395553
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
2018-01-22 23:22:17 -05:00
Jim Harris
8c2b8ca7d7 iscsi: put spdk_iscsi_conn_write_pdu() in lib/iscsi/conn.c
This function was originally named spdk_iscsi_write_pdu()
in lib/iscsi/iscsi.c.  Since this is an operation on a
connection, add "conn" to the name and move it to conn.c.

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

Reviewed-on: https://review.gerrithub.io/395522
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-01-22 23:22:17 -05:00
Shuhei Matsumoto
632f0ced75 iscsi/rpc: Set processor affinity of connection through JSON-RPC
Currently setting cpumask to portal is possible only through
iSCSI.conf. This patch makes possible for any user to set cpumask
through JSON-RPC too.

The following are done in this patch:
- To keep compatibility, cpumask parameter handled as optional.
- Python test code is added.
- Current python script for JSON-RPC does not work correctly for
  IPv6 and the issue is fixed.

Change-Id: I42ef397ce95040a36db4430417a35e9e97527477
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/391728
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-01-22 15:54:48 -05:00
xuhuagen
4041ab04fb Test: fix the syntax error issue in the nvme.sh
The nvme.sh will report error If more than one NVMe devices in the system.
Update the nvme.sh to fix this issue.

Change-Id: I9685394ec53eb036f7580a383619bca559f95c60
Signed-off-by: xuhuagen <huagenx.xu@intel.com>
Reviewed-on: https://review.gerrithub.io/394870
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-01-19 15:52:05 -05:00
Shuhei Matsumoto
f587197d21 iscsi&iscsi/ut: Unify cpumask decode between iSCSI.conf and JSON-RPC
Currently cpumask cannot be specified for each portal when it is
created by JSON-RPC and portal group creation is not unified
between iSCSI.conf and JSON-RPC.

This patch does the following:
 - cpumask string is decoded in spdk_iscsi_portal_create() which
   is common between iSCSI.conf and JSON-RPC.
 - parsing configline of portal is difficult to understand and
   hence it is refactored.
 - UT code is added.

 JSON-RPC will be added by the next patch.

Change-Id: I13b9989263fae5facff260de32a55ec99f5d5a06
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/392447
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-01-19 15:47:57 -05:00
Seth Howell
52bd445367 fio_jobs: add fsync_on_close to fio args
This is to help facilitate the update of the fio_ubuntu binary to fio-3.3

Change-Id: I4c896dc60255f821a5cf66af818396f210304f07
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/395394
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-01-19 15:37:08 -05:00
Seth Howell
16386d7b6d vm_setup: add branch checkout
Change-Id: If1855da6017aa1886186953da79139235c54ad75
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/395399
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-01-19 15:36:37 -05:00
Dariusz Stojaczyk
583a24a489 bdev: share nomem_io data between bdevs built on the same device
When there are two bdevs built on the same io_device,
it is possible that one bdev entirely saturates
underlying queue, not letting the second bdev issue
a single I/O. The second bdev will silently fail any
subsequent I/O and append it to the nomem_io list.
However, since we resend I/O only from I/O completion
callback and there's no outstanding I/O for that bdev
(io_outstanding==0), the I/O will never be resent.
It'll be stuck in nomem_io forever.

This patch makes nomem_io list to be shared between
bdevs built on the same device. It is now possible
that I/O completion callback from one bdev will retry
sending I/O from other bdev.

The shared bdev data is based on thread-local
bdev_mgmt_channel, so doesn't need any external
synchronization.

Change-Id: Ia5ac3a1627ce3de4087e43907c329aa7d07ed7c7
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/394658
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: Ziye Yang <optimistyzy@gmail.com>
2018-01-18 00:29:46 -05:00
Dariusz Stojaczyk
5e799ff470 ut/bdev/mt: prepare for multi-bdev tests
See subsequent patches for details

Change-Id: I17dd842cb6df0b1a6ee3e2745a265cbef321336e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/395165
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-18 00:29:46 -05:00
Chen Wang
8fdea55ef2 test/vhost: fix typo and increase the sleep time
Fix the nightly vhost readonly test case issue
in physical machine.

Change-Id: Ie0799f06268bcef4a230b162bc70266ce4aae8cd
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/395014
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-01-17 17:49:31 -05:00
Jim Harris
e3d083f8d5 test/scsi: fix dev.c unit tests
These broke due to a conflicting merge that wasn't
found until both were committed to master.

Fixes 3b3c6002c9.

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

Reviewed-on: https://review.gerrithub.io/395173
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-01-17 16:16:09 -05:00
Shuhei Matsumoto
afc97ddcf7 iscsi/rpc: Configure Header/Data digest through JSON-RPC
This patch makes possible to set and get Header Digest and Data
Digest of target.

Change-Id: I1d1b892f9dfb747c0f5ad8fc4fddef40929b4143
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/394482
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-01-17 12:41:29 -05:00
Shuhei Matsumoto
de70d712fb iscsi: Check CHAP params when a target is created by JSON-RPC
When a target is created by iSCSI.conf, only valid CHAP params
are passed to spdk_iscsi_tgt_node_construct().

When a target is created by JSON-RPC, help information encourages
users to specify valid CHAP params but
spdk_iscsi_tgt_node_construct() does not check CHAP params and
users can create targets whose CHAP params are invalid.

Change-Id: I7e9057a982f21f04782481cda74208a139c1fdad
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/394481
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-01-17 12:41:29 -05:00
Shuhei Matsumoto
f04569140c rpc/iscsi: Adding an LUN to an existing target
Add JSON-RPC to add an LUN to an existing target. The parameter
lun_id is optinal and if skipped, the lowest free LUN ID will be
assigned.

This JSON-RPC is tested in iscsi_tgt/rpc_config.

Change-Id: I010619f2d4ccec89c589bb0618466b4d15949ebb
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/385181
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-01-17 12:41:29 -05:00
Shuhei Matsumoto
3b3c6002c9 iscsi: Add LUN to an existing target (not runtime)
Removing an LUN from an existing iSCSI target is possible by
removing the corresponding BDEV. However adding an LUN to an
existing iSCSI target is not possible yet.

Add a new function spdk_iscsi_tgt_node_add_lun() and related
functions first toward supporting this function.

JSON-RPC for this operation will be submitted an another patch.

Informing the newly added LUN to the initiator is not included
in this patch. Hence this operation is possible only for any
inactive target.

Change-Id: I3a28f4d75a17126e49c9d12ce64c3ad68f231840
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/385180
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-01-17 12:41:29 -05:00
Maciej Szwed
bd4c63b317 blob: add missing callback in spdk_blob_sync_md function
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Iadb29a8ce8dcebfea68d4feeb5f3de1bb3124f16

Reviewed-on: https://review.gerrithub.io/392286
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-01-17 07:58:57 -05:00
Maciej Szwed
65fe29f8dd blob: cluster allocation/deallocation for thin provisioned blob
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ib3470fbac49e92308ed14e20ccde6655354f2580
Reviewed-on: https://review.gerrithub.io/389577
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-01-17 07:58:57 -05:00
Pawel Wodkowski
85a61ea6f0 scsi: fix LUN removal/hotremoval path
bdev hotremove event is send directly to hotremove callback given
during spdk_scsi_dev_construct() call. So any bdev hotremove might be
promoted to whole SCSI device removal (like in vhost) wich will trigger
LUN removal. But after returning from hotremove callback LUN and device
might be still referenced (eg to register poller or by outstanding IO).

Even worse: spdk_scsi_dev object is not dynamicaly allocated but
returned from static array which mean there is no way to detect
use-after-free error on spdk_scsi_dev by any tool. This might lead to
using SCSI device that is freed or assigned to different device.

To fix this:
- always delete LUN using hotremove path
- defer spdk_scsi_dev delete/removal after all LUNS are really
deleted.

Change-Id: I65598bf42cd507f620095dff5d32509a0424d060
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/393674
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-01-16 19:14:00 -05:00
Jim Harris
d1c4502b19 test/vhost: remove extra quote in readonly.sh
This was causing failures in the test pool.

Test run shows there are still issues with this script
that need to be debugged.

Fixes e6e2fc5b07 (test/vhost: don't call vm_setup.sh helper script to setup VM)

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

Reviewed-on: https://review.gerrithub.io/394592
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-01-16 19:09:19 -05:00
Xiaodong Liu
bef23a925c test/iscsi: add digests enabled test
iscsi_tgt tests with different header and data
digests configuration.

Change-Id: I6e444eacccebccd66c099ea349be4bdeb063ba67
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/393717
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-16 10:57:04 -05:00
Shuhei Matsumoto
583e969922 scsi: remove lun name
There is no need to keep a lun name anymore - we always
use the bdev name as the lun name so it is not providing any
additional value. This also keeps us from associating
the same bdev with different LUNs on different iSCSI target
nodes or vhost-scsi controllers.

Side effect of this change is:

1) Use "bdev_name" across the APIs to make it more clear
   what these names refer to.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3d42fde22087352ce1d5dc80178bd8c5cac8cb7c
Reviewed-on: https://review.gerrithub.io/390843
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-01-11 18:37:34 -05:00
Shuhei Matsumoto
c3e890e92b iscsi/ut: Test for read task splitting
Splitting an iSCSI task into primary and sub tasks is complex
operation and a degradation was caused for it.

Hence adding test codes is required but there is no UT code for
it yet.

primary->bytes_completed is for read completion from bdev and
it is tested by this patch.

Additional test codes will follow:
- primary->bytes_completed is tested when read tasks do not
  complete in order.
- primary->task.data_transferred is for write completion to
  initiator through network.
- primary->task.data_transferred is tested by another patch
  because primary->bytes_completed is used in iscsi/conn.c but
  primary->task.data_transferred is used in iscsi/iscsi.c.

Change-Id: I94b47048111a3d3b249b84d5c54941b0a89ccd40
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/394143
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-01-11 18:37:34 -05:00
Cunyin Chang
6951b97964 blobfs: make the cluster size of blobfs configurable.
Change-Id: I26738d71316b8509cf8e98fee549a0745bb09bfa
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/393715
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-01-11 15:50:01 -05:00
Piotr Pelplinski
b9252b1272 blob: check if resize failed
This patch provides logic for returning errors instead of
assert when size is larger than blobstore size.

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

Reviewed-on: https://review.gerrithub.io/392749
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-01-11 15:05:47 -05:00
Pawel Niedzwiecki
9a723c1a48 test/virtio: Add vhost initiator tests for multiqueue
We define 'size' and 'offset' parameter as % of device so on nvme
devices the tests are run with big files and small on malloc so we
can remove the 4G test case

Change-Id: I4840e859732696dd981ab0ab11e5270c025ff248
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/391838
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-11 14:28:42 -05:00
Pawel Niedzwiecki
37fd86f0f7 test/virtio: Add vhost initiator tests for multitarget.
test virtio devices created from scsi controller with multiple targets

Change-Id: Ibef135c4dc6fdb324bec6b42c9e532add92e656a
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/391836
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-01-11 14:28:42 -05:00
Pawel Niedzwiecki
8d57f4da2a test/virtio: Add vhost initiator tests for multisocket
test multiple devices simultaneously instead each device
individually

Change-Id: I514ee080a2a585a87c7bcfc2a10da89456b285a4
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/393944
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-01-11 14:28:42 -05:00
Pawel Niedzwiecki
b251ebdd9d test/virtio: Refactor existing code
- replace generating job files with pre-existent fio job file
- construct vhost scsi controllers with rpc
- replace generating path to vhost socket in bdev.conf with
static path
- add function usage

Change-Id: I44dedb7fd9a3d96e3d348450c4351cfae6d20116
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/391827
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-01-11 14:28:42 -05:00
Maciej Szwed
2a8d46cece blob: fix bs recovery
Recovery code did not claim clusters taken by metadata.

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

Reviewed-on: https://review.gerrithub.io/394173
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-01-11 12:54:58 -05:00
Hailiang Wang
ebdb06bcb8 stub: fix a io_queue_size limitation
io_queue_size is 256(default) in stub.c, it probably be a limitation
for some performance testing.

Change-Id: Iaf4a15966e7b814323bd8bf134d8f657635aca8e
Signed-off-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/394168
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-01-11 11:48:06 -05:00
Dariusz Stojaczyk
3ef8dc1074 scsi/lun: simplify task submission path
Removed task `pending` queue. All tasks were
temporarily put in this queue just to be moved
out of it yet within the same reactor cycle.

Change-Id: I32d402f7abd3cfa21c263f41149425abdc71992f
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/393911
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-11 11:47:08 -05:00
Seth Howell
a1a47b5592 nvmf/subsystem.c: add checks for valid utf-8 chars:
The NVMe spec states that nqn names are to be encoded in utf-8. The
prefixes of all nqn's are already required to be ascii by virtue of
their structure so they are already valid utf-8, but the user specified
strings should be checked for valid utf-8 strings.

Change-Id: I20090d366e93e98af4932eaa120d4edb6e512206
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/394118
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-01-11 10:57:38 -05:00
Lance Hartmann
095f4254f1 lib: Return instead of exit/abort in env_dpdk
Modifies spdk_env_init() and spdk_mem_map_init() such that
they return on failure instead of terminating with exit()
or abort().

Change-Id: I054c1d9b2e46516ff53d845328ab9547f54bdbc4
Signed-off-by: Lance Hartmann <lance.hartmann@oracle.com>
Reviewed-on: https://review.gerrithub.io/393987
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>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-01-10 16:20:15 -05:00
Jim Harris
6361254c3d bdevperf: reuse tasks more efficiently
Instead of inserting a task into the TAILQ and then
immediately taking it back off, just pass the task
to bdevperf_submit_single instead.

This reduces overhead of bdevperf compared to nvme/perf.
nvme/perf does not use a TAILQ at all, and does something
similar by passing the just completed task so it can be
reused by its submit function.

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

Reviewed-on: https://review.gerrithub.io/393833
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-01-10 09:51:31 -05:00
Pawel Wodkowski
29e017f406 test/vhost: silence some very noisy loops and better checking for ssh
key file

When using '-x' option some loops produce huge amount of useless debug
logs. It would be good to have different log levels but for now let
silence those places.

Use 'readlink -e' while checking default ssh keyfile path. This ensure
to fail if keyfile is invalid link.

Change-Id: I1e24fe02a3e1a1646b710e5e3d8c2ee2c1abf2a4
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/393799
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>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-01-09 19:30:21 -05:00
Piotr Pelplinski
489ea86e6e blob: add thin_provision opt for spdk_bs_create_blob_ext
This only adds the option and metadata flags.
Actual functionality will be added in an upcoming commit

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I66015f48f34d4c7c64fce1831ebaed134098407c
Reviewed-on: https://review.gerrithub.io/390196
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-01-09 14:57:04 -05:00
Piotr Pelplinski
4bfe81b676 blobstore: fix serializing flags
This patch fixes issue when blobstore doesn't serialize flags
when there is also at least one extent or xattr. 

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

Reviewed-on: https://review.gerrithub.io/393770
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-01-09 14:57:04 -05:00
Pawel Wodkowski
db6d5f0e7b test/vhost: don't forward http/https in VM
Forwarding http/https might increase boot time in some distros (like
Ubuntu). Test don't use it so might be removed.

Change-Id: Ia9f07bbae03c37888bcf06fec480577ae79e78cd
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/393176
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-01-09 14:56:37 -05:00
Pawel Wodkowski
e6e2fc5b07 test/vhost: don't call vm_setup.sh helper script to setup VM
vm_setup.sh is a proxy script for vm_setup function which should
be called directly.

Change-Id: If9cd70a9bf67a743144142ea75887dfbd539b38a
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/393160
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-01-09 14:56:37 -05:00
Jim Harris
97cbd304db test/nvmf: use correct names for spdk_nvmf_subsystem_create/destroy
This fixes b21fad1a80 (nvmf/subsystem: spdk_nvmf_valid_nqn fits nvme spec).
This patch was not rebased before last revision and some of these functions
had changed.

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

Reviewed-on: https://review.gerrithub.io/394110
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-01-09 14:27:15 -05:00
Pawel Wodkowski
a862d1cdd6 scsi: remove lun_db
Change-Id: Icc40b66cd0c6f63242bc3d3f26b34f323450c570
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/393501
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-01-09 13:56:00 -05:00
Seth Howell
b21fad1a80 nvmf/subsystem: spdk_nvmf_valid_nqn fits nvme spec
Added tighter regulations to the NVMe-oF nqn checking to conform with
the nvme 1.3 spec. including, adding checks for valid nqn's in the case
of a generic uuid based nqn and checking for reverse domain name and
colon prefixed strings in a user specific nqn. Unit tests included.

Change-Id: I3ee4b269d0655ac9968699617e43e3297695c7ed
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/393265
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-01-09 13:30:24 -05:00
Jim Harris
fb8acd90aa util: make spdk_io_channel_get_ctx() inline
This requires exposing struct spdk_io_channel in the
public header - mark it as internal with Doxygen
comments to make it extra clear that applications
should not use the data structure directly.

This is a very hot function in the main I/O path,
so making this function inline has a significant
performance benefit.  A bdevperf microbenchmark
using null bdevs shows a 11% improvement.

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

Reviewed-on: https://review.gerrithub.io/393824
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-01-09 12:46:35 -05:00
Pawel Wodkowski
61ba62bdae test/vhost: don't call vm_run.sh helper script to start VM
vm_run.sh is a proxy script for vm_run function which should
be called directly.

Change-Id: Ia7ac242fe8c24b9ce76e6d5483bd52f84225b0bb
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/393159
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>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-01-08 18:01:33 -05:00
Pawel Wodkowski
aa0f44b53b test/vhost: don't call run_vhost.sh to start vhost app
run_vhost.sh is a proxy script for spdk_vhost_run function which should
be called directly.

Change-Id: I6ca3e049e812bf05c9251e16c75f6ff90c3b0f0a
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/393145
Reviewed-by: Karol Latecki <karol.latecki@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>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-01-08 18:01:33 -05:00
Pawel Wodkowski
ac021a2e7d test/vhost: make FIO be configurable through env variable
Change-Id: I45b366ed39964514a8d409fe894ca941e8895b73
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/393057
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-01-08 18:01:33 -05:00
Pawel Wodkowski
575a291fa3 test/vhost: introduce notice, warning, error and fail message
helpers

So we can better trace what failed.
notice - just echo to stdout
warning - just echo to stderr
error - echo to stderr and return false, so trap ERR can catch this
fail - like err but call 'exit 1' at the end so if no trap ERR is used
it will exit anyway.

Change-Id: I5c7b3682fd6c0d81c07c58a5ec965155c7593407
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/392218
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-01-08 18:01:33 -05:00
Xiaodong Liu
c3b3138117 nbd: remove nbd test app
nbd functionality now can be gotten by nbd rpc.

Change-Id: I85ebcb44d9ed263bcee19162dc060f3b268dddcd
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/391371
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-01-05 17:39:48 -05:00
Xiaodong Liu
cc8533a990 nbd: add rpc test scripts
Test nbd rpc methods:
  start_nbd_disk
  get_nbd_disk
  stop_nbd_disk

Verify nbd data read and write by dd and cmp.

Change-Id: Ie32639d11727893ceac7adce0119b9c2085e74e1
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/391732
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-01-05 17:28:13 -05:00
Daniel Verkamp
d57306d8eb scsi: pass only task to SCSI exec functions
Retrieve LUN data directly from struct spdk_scsi_lun rather than copying
them into struct spdk_scsi_task, and access the LUN via the task->lun
pointer.

Change-Id: Id8745f116bc559fb2f9e58811c2b9781c8cbdae8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393709
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-01-05 13:49:05 -05:00
wenzhong wu
ec25ddd9cf autotest: Add perf as host with lvol backend and test different qd/io_size test in nightly
And perf as host with nvmf lvol_bdev backend and test differnet qd
and io_sizes in nightly(Proting from DTS).

Change-Id: I857fb66488d644ae0cc092dc1fff3370be09ba5e
Signed-off-by: wenzhong wu <wenzhongx.wu@intel.com>
Reviewed-on: https://review.gerrithub.io/387556
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-01-05 13:08:16 -05:00
Daniel Verkamp
e229b873e6 test/iscsi_tgt: add FIO test with 512KB QD=128
Change-Id: I21be11c2a8428fdc711c404bf3ce489979159ed5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393712
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
2018-01-05 12:24:58 -05:00
Daniel Verkamp
e45437aba7 scsi, iscsi: move task->parent to iSCSI task
The SCSI layer no longer needs to know about the parent/subtask
relationship maintained by iSCSI.

Change-Id: Ia6f7c5367c5b656bd7521ed1abb6d0f713a0500b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393697
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: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
2018-01-05 00:01:37 -05:00
Shuhei Matsumoto
c013db36fc scsi: SCSI string name format
it appears that scsi name string designator
format in SPDK is not correct. The name strings
are not null terminated (which causees garbage
to appear in scsi_inq -p 0x83). Further, they
are not padded correctly.

SCSI port name and device name strings must be null
terminated. Further, the length must be a multiple
of 4 bytes, and must be padded with 0s.

See SPC-5 Section 7.7.6.11.

Change-Id: Id7c4ad27e5c3a17ad68e5e466142801c0d03b1f2
Signed-off-by: Karandeep Chahal <devilsgrotto@gmail.com>
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/393027
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-01-04 15:48:28 -05:00
Pawel Wodkowski
891c12a63c util: add spdk_strerror() wrapper with TLS support
This patch remove need for additional buffer when translating error code
to string.

Change-Id: Iaa60088b5c450581d3cdddbb425119b17d55a44b
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/386114
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-04 15:00:09 -05:00
Sebastian Basierski
a70a000997 bdev: Renamed lvol->old_name to lvol->unique_id
Also added vbdev_get_lvol_by_unique_id function.

Change-Id: I55a64df008c23c0fedb8a59ef67e2c356097e780
Signed-off-by: Sebastian Basierski <sebastianx.basierski@intel.com>
Reviewed-on: https://review.gerrithub.io/392658
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-01-04 13:15:09 -05:00
Sebastian Basierski
b9afa3c732 bdev: Added bdev aliases list.
Added aliases list to bdev struct.
Added 2 API calls to add and remove aliases.
Added test for adding and removing aliases.

Change-Id: I1815aec8c02cfa398b2d1de41577197315665fdc
Signed-off-by: Sebastian Basierski <sebastianx.basierski@intel.com>
Reviewed-on: https://review.gerrithub.io/390200
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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2018-01-04 13:15:09 -05:00
Karol Latecki
6d8dc5239e test/vhost: keep fio config file name for log output
Copy fio config to guest VM with the same name instead of
renaming to /root/fio.job.
Use the same file name for creating log file in desired directory.

Remove not needed ls command in common/run_fio while at it.

Change-Id: I9e13d8cd6f7892a77d89afb99f7d57ef79f7b11f
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/393469
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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-01-04 02:15:53 -05:00
GangCao
3166267411 tool: add the config for interval of real time perf display
There used to be a fixed 1 second of real time performance
display with the "-S" parameter. Make it as a configurable
parameter, the minimum interval is still 1 second while user
can configure a larger value.

Change-Id: I159d867f2b6019b095d0291c436f01b110ff69d8
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/393306
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-01-03 15:32:18 -05:00
Dariusz Stojaczyk
fc03485b9d scsi/lun: fix hotremove with no io_channels open
When LUN with no io_channels is being hotremoved,
the hotremove poller was being started on the core
pointed by lun->lcore. However, this field is only
valid when there are io_channels open. For example,
when user tries to delete a bdev that's attached to
an unused vhost controller (no io_channels ever opened)
the scsi layer could start a hotremove poller on
lun->lcore == 0. If SPDK runs on a different cpuset -
not containing CPU0 - SPDK could even segfault.

Change-Id: I31a363352875d944f220b0296d5cfe570319023d
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/371863
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-01-03 14:38:11 -05:00
Dariusz Stojaczyk
e7885a9a05 test/vhost: send SIGABRT on vhost shutdown failure
There's a bug lurking somewhere in vhost
shutdown path causing intermittent
failures. Sending a SIGABRT instead of SIGKILL
will make the process dump core. We could use
it to speed up debugging.

Change-Id: I0825deecbf26e32ff073fdbcdfe42640c52453b9
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/393477
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-01-03 14:22:49 -05:00
Daniel Verkamp
f0c2093477 scripts: factor out iter_pci helper functions
Add a new file, scripts/common.sh, that can be shared between not only
autotest scripts, but also scripts/setup.sh, scripts/gen_nvme.sh, etc.,
and move the PCI iteration functions there.

The iterators are also expanded to work identically for both dev_id and
class_code on Linux and FreeBSD.

Change-Id: I98423cd06242e78535f5da4fce82166812ea96a8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393416
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-01-03 14:09:22 -05:00
Daniel Verkamp
581107c77a test/nvme: only run setup.sh test on Linux
For now, our scripts don't support detecting mounted filesystems on NVMe
devices on FreeBSD, so only run those tests on Linux.

Change-Id: I558715bf4e95eaad2dd2d8a546626269c0837edb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393420
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-01-03 14:09:22 -05:00
Daniel Verkamp
75bb8a5c5f test/nvmf: shorten nightly nvmf+pmem test
This test ran for 10 minutes, which is half of the allotted time for the
entire nightly test run.

While we're here, remove some of the duplication - we don't need to run
both the nightly long run and the shorter normal test run of the same
test, and they should be grouped together.

Change-Id: I66385054d425fb8b032e282050fd39e927a8eb80
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393095
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: Jim Harris <james.r.harris@intel.com>
2018-01-03 14:02:26 -05:00
GangCao
f95dacd504 bdevperf: explicit destroy the target when failing to alloc resource
The task resource is allocated one by one and when it fails
to allocate at some point, call the explicit destroy to release
the resource.

Change-Id: Ida916ed25a279806fee76104990f1f92daf3e1b6
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/393009
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-01-03 14:01:14 -05:00
Daniel Verkamp
331af9ea96 test/iscsi: add default IP addresses
The iscsi_tgt test scripts can assume that the default case is testing
on a local machine using the kernel TCP stack; add a fallback TARGET_IP
and INITIATOR_IP to make it easier to run the individual iSCSI tests
outside of the autotest.sh framework.

Change-Id: I07c58201691dc5f053d5f67787768dfee4110f73
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393214
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-01-03 14:00:37 -05:00
Daniel Verkamp
ddfc063f90 test/event_perf: remove DPDK dependency
Use the SPDK env layer functions to get the number of cores and iterate
over core numbers.

Change-Id: I77870ebcffc07db680bbb3783fbe5944cf88e2ea
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393188
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-01-03 12:05:59 -05:00
Daniel Verkamp
543cb17248 build: remove $(ENV_CFLAGS) where not necessary
Only Makefiles for libraries that directly depend on DPDK (rather than
the SPDK env abstraction) should add $(ENV_CFLAGS).

Change-Id: Ifdf44d3ef8c42bbf7f20edd524b330d00658235b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/392818
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-01-03 12:05:59 -05:00
Daniel Verkamp
61c1493785 iscsi: disallow netmask prefix of 0 bits
Netmasks with 0 bits of prefix do not make sense.  For example,
192.168.1.2/0 would allow hosts from any address, but this is
indicated with a special "ANY" value rather than a normal netmask.

Netmask prefixes of the full address size (e.g. 32 for IPv4 and 128 for
IPv6) are still allowed, since this represents a valid configuration
that matches a single specific address.

This also allows the IPv4 netmask math to be done entirely in uint32_t
instead of promoting to unsigned long long to avoid undefined behavior
when bits == 0 (shift count would have been 32 in that case).

Change-Id: I021b718e6a46f628c96a358edae816de81cd8929
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/392969
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-03 12:02:06 -05:00
Piotr Pelplinski
c315d8e8eb blob: Add read_only opt and spdk_bs_md_set_read_only to blobs.
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: Ibffb43e39b44e5f443d3dfbfa5b5d7dcac3243ef

Reviewed-on: https://review.gerrithub.io/391182
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-01-03 12:00:30 -05:00
Piotr Pelplinski
c355bbb144 blob: Add xattrs to spdk_blob_opts.
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: Ic2c23d16360b26359c2a32920b89f2f3a21a2a9a

Reviewed-on: https://review.gerrithub.io/391191
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-01-03 12:00:30 -05:00
Ben Walker
95ac75aabe nvmf: Add synchronization primitives for subsystems
This allows the user to pause a subsystem, make some
modifications, and then resume it.

Change-Id: Ia18371023d8fc66e1797fda293a01b68c0a61c96
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/392422
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-01-03 11:58:11 -05:00
Ziye Yang
acbec142ae bdevperf: remove static array allocation for head and coremap
We can use spdk_env_get_core_count() to determine the
core count

Change-Id: I854ec86f10c5670b02295214d1d36fe5d57e31a4
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/392934
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>
2017-12-29 16:02:35 -05:00
Jim Harris
fe8138cebb test: add histogram unit tests
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I79c2c30e15b8254c3cb75af5615dfafee84a9abd
Reviewed-on: https://review.gerrithub.io/392709
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>
2017-12-29 14:20:48 -05:00
Jim Harris
bc00666271 util: enable dynamic spdk_histogram_data sizing
Currently, each histogram range is hardcoded to
128 buckets (1ULL << 7), resulting in 58 ranges
(64 - 7 + 1) and a total size of 58 * 128 *
sizeof(uint64_t) = 59392 bytes.

To allow for more usage models in cases where this
size is prohibitive, enable the following changes:

1) specify number of buckets per range (in number of bits)
2) specify max datapoint value (in number of bits)

The latter can be useful for cases where datapoints
are never close to requiring all 64 bits - and allows
reducing the number of ranges.  Any data points that
exceed the max will be tallied in the last bucket
in the last range.

Testing shows no performance disadvantage using the
dynamic approach.

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

Reviewed-on: https://review.gerrithub.io/392707
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>
2017-12-29 14:20:48 -05:00
Jim Harris
ea17499c6c test: add util/histogram_perf test application
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I050ecd4f3bbccbd527387d080ce595fae16479d3

Reviewed-on: https://review.gerrithub.io/392704
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>
2017-12-29 14:20:48 -05:00
Daniel Verkamp
97f145c8b8 scsi: convert unmap command to bdev blocks API
Use spdk_bdev_unmap_blocks() in place of spdk_bdev_unmap(), since the
SCSI UNMAP descriptor already natively operates in blocks rather than
bytes.

Change-Id: I16a0c38d203cf5f60484229e7872783b11d8de6e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393202
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
2017-12-29 13:43:29 -05:00
Daniel Verkamp
a520198dba scsi: convert sync command to bdev blocks API
Use spdk_bdev_flush_blocks() in place of spdk_bdev_flush(), since the
SCSI SYNCHRONIZE CACHE command already natively operates in blocks
rather than bytes.

Change-Id: I11810948fb8d0b6b911d48620e2a363f767cc7f7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393201
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
2017-12-29 13:43:29 -05:00
Shuhei Matsumoto
b29d208267 vhost: Replace RTE_MAX_LCORE by spdk_env_get_last_core()
Adopt two improvements for iSCSI by Ziye to VHOST.
- iscsi/conn: remove rte_config.h header
- env: export spdk_env_get_last_core function

Change-Id: I8f067093d593c8d483c52587669f8b0b706f497f
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/392910
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>
2017-12-28 12:03:40 -05:00
Shuhei Matsumoto
0686f0381b vhost: Remove DPDK dependency and simplify load balancing
The latest patch for the iSCSI connection is applied to the vhost
too.

RTE_MAX_LCORE in the for loop is removed and the for loop is
replaced by SPDK_ENV_FOREACH_CORE().

When the cpumask is unexpectedly 0, not 0 but the first core is
returned.

Change-Id: I39cfc2219a3532eccc8c0ce59712102b947a76d7
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/392588
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@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>
2017-12-28 12:03:40 -05:00
Pawel Niedzwiecki
62dc3292f5 test/lvol: update help message
update help message to match reordered and new test cases

Change-Id: Id85391cfc84c1ee1567cae07da9ff797a95a6f68
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/392675
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-28 11:42:56 -05:00
Shuhei Matsumoto
f53462b432 iscsi: ANY does not work as wild card netmask of ACL (degradation)
A few previous changes replaced ALL by ANY for the initiator group
because ANY was normal for this case. ANY was tested enough for
the initiator name of the initiator group but not tested for
the netmask of the initiator group.

Hence the previous changes caused degradation.
This is the bug fix and UT code is added together.

Change-Id: Idf7642dd4c111a4788aca31a0105b3497631aecd
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/392923
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>
2017-12-26 17:21:50 -05:00
Karol Latecki
122c7db7bf test/vhost: use full path in spdk_vhost.sh
Current relative work dir path caused problems with downstream
test scripts when running spdk_vhost.sh using relative path

Change-Id: Ifd47bd37650a6328cb0f548a03cb4de010093320
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/392744
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-26 11:17:12 -05:00
Karol Latecki
08a7e4f4f8 test/vhost: change mask for ctrl construct negative test
Tests need adjustments due to patch:
https://review.gerrithub.io/#/c/392587/

Change-Id: I098aca99fe22a9e01246da74b4b9fbf25f4b5b99
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/392745
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
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>
2017-12-22 13:19:23 -05:00
Karol Latecki
90aca6641d test/vhost: add trap to lvol test
Change-Id: Ibd3e485085793260ca4bb2bfa3da6025b2c997aa
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/392450
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-21 14:21:52 -05:00
Shuhei Matsumoto
14797d839d vhost: Allow set cpumask more than active cores for vhost
The latest change for the portal group is applied to the vhost.
The following comment is quoted from it.

Currently the cpumask must be a subset of the reactor mask.

However, this is different from sched_setaffinity() function
and taskset command of FreeBSD and Linux.  The latter will
be familier for more people. Hence the later is adopted.

The following is quoted from the FreeBSD Man Page of taskset:

  The CPU affinity is represented as a bitmask, with the lowest
  order bit corresponding to the first logical CPU and the
  highest order bit corresponding to the last logical CPU.

  Not all CPUs may exist on a given system but a mask may specify
  more CPUs than are present.

  A retrieved mask will reflect only the bits that correspond to
  CPUs physically on the system.

  If an invalid mask is given (i.e., one that corresponds to no
  valid CPUs on the current system) an error is returned.

  The masks are typically given in hexadecimal.

Change-Id: Idcd72a12ef52e4ccec8476e7d54fab82867cf936
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/392587
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-21 13:32:31 -05:00
Jim Harris
40c911b957 blob: add used blobid bit array for valid blobids
This can be used for two purposes:

1) more quickly iterate the blob list, avoiding
   metadata pages that are valid but not the first
   page in the blob's metadata list
2) close races between delete and open operations -
   now we can clear the bit in the blobid bit array
   when the delete operation is in progress, ensuring
   no one else can try to open the blob

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

Reviewed-on: https://review.gerrithub.io/391695
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-21 12:28:21 -05:00
Karol Latecki
d6bf976af4 test/nvmf: increase number of subsystems in lvol test
Number of susbystems for test on physical server increased.
Due to SoftRoce limitations number of subsystems is not
increased for VM tests.

Change-Id: I6875204238f55f4bc4a819512ee0fd6a46c44fee
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/380459
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@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>
2017-12-21 12:20:42 -05:00
Karol Latecki
c7b8fb9116 test/nvmf: decrease number of subsystems for software rdma
SoftRoce does not implement enough queues
for multiconnection tests and cause test pool failures.
In case interface used for test is software
emulated - reduce number of NVMf subsystems in test.

Change-Id: I52cc78015e72603c487a5774b91c6bd4523326b0
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/392357
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>
2017-12-21 12:20:42 -05:00
Ziye Yang
cf1ab98c90 bdevperf: change the type of io_time_in_usec into uint64_t
Purpose: To avoid overflow, if the passed value is too
big.

Change-Id: I59d31c0baa742cab14e22dcd88a61cb5adca247a
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/392579
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-21 12:20:15 -05:00
Pawel Wodkowski
b5207c4488 test/vhost: remove obsolete parameters 'qemu-src' and 'dpdk-src'
This was removed some time ago.

Change-Id: I5e4b588fb881793d750999ff73e8bf891cb58fc0
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/391952
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-21 11:28:09 -05:00
Pawel Wodkowski
3911366d66 test/vhost: make run_fio.py to just run fio
Make shell scripts prepare fio jobs and just call run_fio.py to run
those jobs. This way run_fio.py don't need to know anything about test
environment configuration.

Change-Id: I10b6954011855e9139ff7b5372070ec553009d33
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/391929
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-21 11:28:09 -05:00
Jim Harris
d8b8bc4353 test/lvol: wait for lvolstore tasting after nvme bdev construction
A couple of the lvol tests delete the nvme bdev, then construct
it again to test lvolstore tasting.  But constructing the nvme
bdev and then the tasting can take a tiny bit of time, and if
we check for the lvolstore too soon, it could fail.  There are
a large number of intermittent test failures in the test pool
that show this signature.

So sleep one second to allow time for the tasting to complete.

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

Reviewed-on: https://review.gerrithub.io/392559
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>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2017-12-21 10:42:17 -05:00
Changpeng Liu
739cd41912 test/nvme_dp: cleanup swap16/32 with spdk endian library
Change-Id: I6ddce54d24570099f5237ea3acbac7e3be78e520
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/392434
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>
2017-12-20 15:12:26 -05:00
Changpeng Liu
9ca670ac8a util/crc16: add crc16 library support and unit tests
Change-Id: I7174f1799361b8337ff5590b90ad6a0564ca8e9b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/391899
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>
2017-12-20 15:12:26 -05:00
Daniel Verkamp
1fe9ba9dba bdevperf: replace floats with doubles
Use double-precision floating point in the performance_dump() function,
since we can be dealing with large numbers (especially now that
io_completed is now uint64_t).

This isn't part of the I/O path, just used to print statistics, so
there should be no performance impact.  Also, the arguments passed to
printf() were already implicitly being promoted to double, so this
actually removes an extra conversion step.

Change-Id: I12aae36bc42e83777eaa050561eb5e55060ae81c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/392414
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>
2017-12-20 13:53:08 -05:00
Karol Latecki
233c5189ab test/vhost: refactor lvol test
- Removing hardcoded lvol bdevs and blk controller sizes
Lvol bdevs will now be created with roughly equal size based on
size of used NVMe backend
- Create lvol structures and VMs setup independently

Change-Id: Ib1cfe1b60033200a9896fa0c8d1b17af41ea0eb1
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/390983
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>
2017-12-20 11:39:34 -05:00
Shuhei Matsumoto
b37d1b60f1 scsi&test/iscsi_tgt: SCSI device == iSCSI name
In the iSCSI specification, the SCSI device name is defined to be
the iSCSI name of the node.

However, when g_spdk_iscsi.nodebase is used, the SCSI device name
is made of the device specific string (the part of IQN after the
colon).

The size of the temporary buffer fullname[MAX_TMPBUF] in
spdk_iscsi_tgt_node_construct() is 1024 and the size of
spdk_scsi_dev.name is 255. The former is larger than the later.

However the max length of IQN, EUI, NAA are 223, 20, and 36,
respectively. All are less than 255.

Hence even if we use fullname as the SCSI device name, no overflow
will occur. Even if fullname is more than 255, strncpy() does not
write more than 255 in spdk_scsi_dev_construct().

It's possible to check the length of iSCSI name strictly, but I
will do the least in this patch.

Change-Id: Icc6655fcd846797720867c10e316d2951c664030
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/390360
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>
2017-12-19 13:34:03 -05:00
Cunyin Chang
6e82aa5ace nvme: Add support of hot remove vfio-attached devices in pcie layer.
Change-Id: Ia7d6ca2d6c0bec6345f05718f6a6328eccda2dcc
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/391329
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-19 13:07:20 -05:00
Ziye Yang
65a7fb47ff bdevperf: change type of io_completed to uint64_t
Reason: If test a very long time, it will overflow
when we use int

Change-Id: I729e8cb5862ab78808da5121666b41e599e1dddb
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/392122
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>
2017-12-19 11:58:30 -05:00
Maciej Szwed
13ece6a735 blob: add spdk_bs_create_blob_ext
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Iba33c55f129c60fad2d58f5254dec5c54ed56805
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Reviewed-on: https://review.gerrithub.io/388217
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>
2017-12-19 11:55:36 -05:00
Shuhei Matsumoto
a652471c99 autotest: uninitialized value in test/unit/lib/iscsi/tgt_node.c
It looks that initiator groups which were initialized after
being inserted to linked lists caused failures.

Change-Id: I43f4a6324e77221f0e9657667c0185b15e9c229c
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/392100
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>
2017-12-19 11:41:43 -05:00
Jim Harris
df03f9d119 test: add timing calls to vhost/initiator/blockdev.sh
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5e19266d5d418e1b356308d2b9efa419c1b22232

Reviewed-on: https://review.gerrithub.io/392002
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-19 11:10:57 -05:00
Seth Howell
102746245e test/nvme.sh: add support for older kernel versions
the sysfs for NVMe drives on some older versions of the linux kernel
differs slightly from the latest kernel versions. This patch adds a
fallback to support those older kernel versions.

Change-Id: I2787e0d15d310ce1f264b0a303f53e48525a9a1d
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/391983
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>
2017-12-18 14:53:07 -05:00
Seth Howell
80016bd9be test/vm_setup.sh: add missing packages from pkgdep.sh
Change-Id: Ib32434bfa81fa3de2b7bae88fdfbadba6f59a2d4
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/391984
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>
2017-12-15 16:16:31 -05:00
Seth Howell
40f8c5f951 vm_setup.sh: add libiscsi checkout
libiscsi will be used to test our iscsi target for spec compliance. I
check out the source from github incase we need to modify it and create
our own branch later.

Change-Id: I2d1c037e1aee47fa7f6f700ae186dd402f9ad52b
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/391887
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>
2017-12-15 16:16:31 -05:00
Cunyin Chang
bdcb0d709a nvmf: add support of hotplug for nvmf.
Change-Id: Iebd5b75e3525e77bf256f5b7f52aa2504d7a68c3
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/390549
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>
2017-12-15 16:14:02 -05:00
Cunyin Chang
7f5864be20 nvmf: Add public interface of remove ns from subsystem.
Change-Id: I9c2746dd54a13f3dae0ac2bab1d5fced931e8591
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/391699
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>
2017-12-15 16:14:02 -05:00
Ziye Yang
3f1b35f970 bdevperf: Fix the period performance print info data.
This patch does the following things:

1 Set the time period 1 second into a global variable,
then if we modify that value, we will make sure that
we change it in the whole file.

2 Fix the period performance printing data . We should not pass
the time period, but we should pass time period * times, since
I/Os completed are caculated from the beginning.

Change-Id: I1eaaf1655389cbccefdcc879a51fca94028afdcb
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/391421
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>
2017-12-15 15:57:03 -05:00
Jim Harris
77ad7caddb test/iscsi: reduce per-patch test times
1) move iscsi_pmem to nightly
2) move idle_migration to nightly
3) reduce number of malloc bdevs and lvols for iscsi_lvol

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

Reviewed-on: https://review.gerrithub.io/391976
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>
2017-12-15 15:48:06 -05:00
Jim Harris
7c2c5b947f test/rocksdb: reduce test time for per-patch tests
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I138362d4ebe157926228384ab032c057c03c822e

Reviewed-on: https://review.gerrithub.io/391891
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>
2017-12-15 15:48:06 -05:00
Ziye Yang
ca39602168 bdevperf: Add a print to demonstrate failed I/O
Change-Id: I619f2e772b38061e26e3c5f2b4014ee73a5f5d81
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/391894
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>
2017-12-15 12:51:20 -05:00
Jim Harris
befcf11a1b test/blob: check that we do not up rev super block version
This prepares for some future changes to blobstore
metadata.  For older (pre v3) blobstore disks, we
do not want to try to write new metadata fields,
since in many/most cases, there will not be room
allocated for them.

The current code will keep the existing version -
this is just adding tests to make sure this does not
break in the future.

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

Reviewed-on: https://review.gerrithub.io/391507
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-15 12:28:44 -05:00
Jim Harris
e3f54f321a test/blob: add some SPDK_CU_ASSERT_FATAL checks
I have no idea why - but scan-build starts complaining about
some missing SPDK_CU_ASSERT_FATAL checks when analyzing the
next patch - even though that patch has nothing whatsoever
to do with the scan-build error reports.

scan-build is really weird sometimes.

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

Reviewed-on: https://review.gerrithub.io/391875
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>
2017-12-15 12:28:44 -05:00
Jim Harris
ae5a01dd9f blob: change spdk_bs_iter_next parameter to spdk_blob *
Similar to previous change, the ** paradigm is a bit
problematic for asynchronous routines that could fail.

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

Reviewed-on: https://review.gerrithub.io/391483
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>
2017-12-15 12:28:44 -05:00
Jim Harris
e734bb9f9f blob: change spdk_blob_close parameter to spdk_blob *
Using the ** paradigm is a bit problematic for asynchronous
routines that could fail.  Currently we were inconsistent in
that some error paths would zero the pointer while others
did not.  So make this just a plain pointer, which simplifies
the API and its implementation.

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

Reviewed-on: https://review.gerrithub.io/391482
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>
2017-12-15 12:28:44 -05:00
GangCao
a6bf23e272 test/unit: add the unit tests for spdk_nvme_connect() API
Add the unit tests for the spdk_nvme_connect() API. This API
will be called both by the primary or standalone process and
secondary process. Introduce different unit tests to cover
different usage.

Change-Id: I9ded7d08b593c5e2c541cf6faad6aff0ff2ebff9
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/380895
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>
2017-12-15 11:26:07 -05:00
Daniel Verkamp
926740accd test/iscsi_tgt: move ext4test to nightly only
ext4test takes ~80 seconds to run, which is a significant portion of the
overall test time for machines running the iSCSI tests.

Change-Id: Id6384fe023f101d4e81bc4ed2da9a53a817d2a02
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391317
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-14 18:30:56 -05:00
Ben Walker
5165aee686 channel: Make spdk_for_each_channel support async operations
While iterating, allow the user to perform asynchronous
operations. To continue iteration, the user is expected
to call spdk_for_each_channel_continue.

Change-Id: Ifd7d03d5fbf17cf13843704274b036d49ca0484a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/391309
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: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-12-14 12:05:07 -05:00
Dariusz Stojaczyk
250f8e07bc test/nvmf: increase the delay before identifying kernel target
With the previous 2 seconds sleep we
still used to randomly fail from time
to time.

Change-Id: I99f8c50ba4af87c47bed5a629ddb79f5eb796d4c
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/391553
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Sebastian Basierski <sebastianx.basierski@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>
2017-12-14 12:04:08 -05:00
Daniel Verkamp
73c61bb576 test/iscsi_tgt: remove nightly iSCSI + pmem test
This test ran for 10 minutes, which is half of the allotted time for
the entire nightly test run.

Additionally, we should be testing each bdev backend at the component
level (e.g. via bdevio and bdevperf), rather than trying to add tests
for the whole matrix of front-end app (iscsi_tgt, nvmf_tgt, etc.) with
each bdev backend.

Change-Id: I10311e3e5092084dc939ab8662e8312066ecab6e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391303
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-14 11:59:29 -05:00
GangCao
9bbf06a652 bdevperf: only count successful IOs in completed IOs
Change-Id: I5a51d03c2cb4f2538b2b3567741c524991af46fc
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/391597
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>
2017-12-13 21:22:25 -05:00
Dariusz Stojaczyk
ec6a1afbdb util: add a helper function for parsing capacities (1K, 128M, 2G)
Also used it in parsing `-m` SPDK app param,
meaning that it can now accept numbers
followed by a binary prefix - like 512M or 2G.

Change-Id: If458dc08429237f2cb3f3f661bcaf382468df0f0
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/391670
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>
2017-12-13 21:19:53 -05:00
Jim Harris
d52dbda288 blob: rename bs_md functions
As part of clarifying the API and preparing for some
future changes, rename the following functions:

spdk_bs_md_create_blob => spdk_bs_create_blob
spdk_bs_md_open_blob => spdk_bs_open_blob
spdk_bs_md_delete_blob => spdk_bs_delete_blob
spdk_bs_md_iter_first => spdk_bs_iter_first
spdk_bs_md_iter_next => spdk_bs_iter_next

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

Reviewed-on: https://review.gerrithub.io/391031
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-13 13:06:16 -05:00
Jim Harris
7932847300 blob: remove spdk_bs_io_flush_channel
This function was a nop and is not needed.

lvol was calling this function when an lvol bdev
gets a FLUSH I/O, but that is not needed either.  So
lvol will now report it does not support flush.

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

Reviewed-on: https://review.gerrithub.io/391023
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-13 13:06:16 -05:00
Pawel Kaminski
56905c3877 test/lvol: Replace stop/start vhost with add/delete bdev
Change-Id: Ic960f2fe6966ae6eeb027a7c6a1d6929c741080d
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/388642
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-13 11:26:54 -05:00
Jim Harris
2c3591f183 blob: rename spdk blob metadata functions
spdk_bs_md_resize_blob => spdk_blob_resize
spdk_bs_md_sync_blob => spdk_blob_sync_md
spdk_bs_md_get_xattr_value => spdk_blob_get_xattr_value
spdK_bs_md_get_xattr_names => spdk_blob_get_xattr_names
spdk_blob_md_set_xattr => spdk_blob_set_xattr
spdk_blob_md_remove_xattr => spdk_blob_remove_xattr
spdk_bs_md_close_blob => spdk_blob_close

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

Reviewed-on: https://review.gerrithub.io/391006
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-12 18:36:18 -05:00
Daniel Verkamp
c2009e9e85 scsi: remove spdk_scsi_dev_print() function
Replace the single call to spdk_scsi_dev_print() with a reimplementation
using public SCSI API functions, and also using the SPDK logging
framework instead of printf().

Change-Id: Ifa455f9e6a4a07a35d5dec311a61e9a8afaa0227
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391320
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-12 18:04:20 -05:00
Jim Harris
474fcf64b2 test: remove all uses of strcpy in the code
Then also add a check in check_format.sh and fail if
a new instance is found again.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia35c343e1b7bb44b3b5f4f8484adb9e0d5702d67
Reviewed-on: https://review.gerrithub.io/390916
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>
2017-12-12 17:34:45 -05:00
Ben Walker
8b79ef3372 nvmf: Remove poll group from controller
Now rely entirely on the user to create and poll
the poll groups.

Change-Id: I66baaa2d0f493390a055a32e6c902f5e2f574534
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/385954
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-12 15:01:17 -05:00
Daniel Verkamp
2302dc6cdc nbd: add NBD subsystem to apps
Enable the NBD subsystem and RPC methods in the iSCSI target, NVMe-oF
target, vhost target, and bdev_svc test app.

Change-Id: I1c2e53a4c031ae6d4dc0a8e698bbfa085db33154
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391014
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-12 13:36:22 -05:00
Ziye Yang
d3e600066e bdevperf: change the type of time_in_sec to int.
Since we use time_in_sec to judge < 0 case

Change-Id: I8283c8209359acfe1b1d5db8a9d4315e5722c5c6
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/391154
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>
2017-12-12 13:35:46 -05:00
Jim Harris
b9b0fee224 blob: decouple spdk_blob from its actual data
Moving forward, the spdk_blob returned to users will
actually be an I/O channel - not the blob structure
itself.  So rename the existing spdk_blob to spdk_blob_data.
spdk_blob_data will continue to contain global state for
the blob.  In the future spdk_blob will point to an
I/O channel for the blob - for now it effectively still
points to the spdk_blob_data, but by changing the
structure names here it will reduce the code churn in
future patches.

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

Reviewed-on: https://review.gerrithub.io/390900
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>
2017-12-11 15:33:35 -05:00
Ben Walker
3ef479ab16 bdev: Correctly defer completion of resets until channels are unlocked
Change-Id: I23f71ff38b805723d74aca639489e0079ecdb993
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/390341
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>
2017-12-11 14:58:17 -05:00
Daniel Verkamp
9daf838db0 test/iscsi: only run NVMe-oF test when enabled
Check the SPDK_TEST_NVMF flag before running the iscsi_tgt + NVMe-oF
host test.

Change-Id: I0d545c98f188edefc089fb79e2879d5d307726f5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391027
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-11 11:20:17 -05:00
Daniel Verkamp
59970a89be astyle: enforce braces around single-line statements
Require braces around all conditional statements, e.g.:

    if (cond)
        statement();

becomes:

    if (cond) {
        statement();
    }

This is the style used through most of the SPDK code, but several
exceptions crept in over time.  Add the astyle option to make sure we
are consistent.

Change-Id: I5a71980147fe8dfb471ff42e8bc06db2124a1a7f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390914
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-11 11:19:32 -05:00
Cunyin Chang
fcccf16767 nvmf: close all the bdevs when delete subsystems.
Change-Id: Ie3c7c8d960b0074b86e983e0e8bf04de2d99f61f
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/390365
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>
2017-12-08 17:14:40 -05:00
Pawel Niedzwiecki
30dbca865b test/vhost: test for the vhost-blk readonly feature.
Change-Id: I5dde0555bd7d0e03dea3779dfd59c13ece92696a
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/382835
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>
2017-12-08 14:08:58 -05:00
Ziye Yang
e4c4fec260 bdevperf: add the shutdown callback function.
We also caculate the time for still dumping the
performance data.

Change-Id: I59b736268ca57a366666a4bf55458ec3f279f4e7
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/390702
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-08 14:08:43 -05:00
Daniel Verkamp
bedc405f35 nvmf: add duplicate QID check in I/O Connect
Disallow multiple I/O queues for the same controller with the same queue
ID.  NVMe-oF 1.0 ECN 001 specifies that this condition should return a
status value of Command Sequence Error.

Change-Id: I41126ddec388a985c403025e099ab15da5d3987c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390662
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>
2017-12-08 14:08:19 -05:00
Daniel Verkamp
fab9349fdc ut/nvmf/ctrlr: add Connect command unit tests
Change-Id: I4d3cced91e804fbbb96a15a09b575ff85960ddef
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390661
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>
2017-12-08 14:08:19 -05:00
Daniel Verkamp
2d630f9b75 ut/nvmf/ctrlr: replace stubs with mock.h macros
Change-Id: Ifd00dd647002ea226df826c558232d97d366ab81
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390660
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-08 14:08:19 -05:00
Chen Wang
1594b13993 test/vhost: Fix the lvol bdev name
The lvol bdev which used to create nested lvol store
should be $lb_name.

Change-Id: Ic8d68f8d18bcb0c1d4bca0b4612a4a07ed8b974d
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/390350
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-08 14:06:19 -05:00
Daniel Verkamp
93b71b9091 test/config: install libasan in vm_setup script
This is necessary for SPDK_RUN_ASAN to function properly.

Change-Id: I22f4e8dde225967a3db3718270c2626f178af319
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390858
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>
2017-12-08 12:32:56 -05:00
Daniel Verkamp
ffc0274a08 test/iscsi: initialize igs before adding to ig map
Similar to 759e5934eb (test/iscsi: initialize pgs before adding to pg
map), make sure the spdk_scsi_ig structures are zero-initialized before
passing them to spdk_iscsi_pg_map_add_ig_map().

Fixes Valgrind "Conditional jump or move depends on uninitialised
value(s)" errors in two tests.

Change-Id: I38c095aa7c6a89cb9332618b63fe12a02bcf3c2a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391000
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-08 12:31:19 -05:00
Karol Latecki
7c13831f39 test/vhost: replace remove_vhost_scsi_dev with _target
Change-Id: Ibf243d4e9804acda8ee712253722c963bb0120fc
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/390997
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-08 11:36:32 -05:00
Jim Harris
0fd9bba256 scsi: use lun instead of its name as spdk_scsi_lun_delete param
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7cf52d4d27ee3433da94a034ef320ad811ca6758

Reviewed-on: https://review.gerrithub.io/390842
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-08 09:26:47 -05:00
Jim Harris
759e5934eb test/iscsi: initialize pgs before adding to pg map
This fixes some issues found with Valgrind (incidentally *not*
found with ASAN).

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

Reviewed-on: https://review.gerrithub.io/390909
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
2017-12-08 09:26:47 -05:00
Sebastian Basierski
0709cc48c9 vhost: Switch "Dev" keyword to "Target"
Added new keyword 'Target' that will replace 'Dev'.
'Dev' is still usable, but deprecated and will be removed.

Change-Id: Iafd6114ef2cc5b2f8d58497e9fb454a3a237ed16
Signed-off-by: Sebastian Basierski <sebastianx.basierski@intel.com>
Reviewed-on: https://review.gerrithub.io/388568
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>
2017-12-08 09:25:49 -05:00
Daniel Verkamp
a7d816bfbe ut/scsi/dev: fix memory leak in lun_construct stub
Check if a LUN already exists before allocating the spdk_scsi_lun
structure - this matches the real implementation of
spdk_scsi_lun_construct().

Fixes: e44731d659 ("scsi: Remove the claimed flag from LUN")

Change-Id: I529648f93cd21e9f19ce82ef571cabe9c7e8c49a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390903
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-12-07 16:52:05 -05:00
Xiaodong Liu
f90beaeff0 nbd: add nbd as one event subsystem
Add g_spdk_nbd to record multi-nbd-disk in the
future. nbd subsystem will be used to init and
finish g_spdk_nbd and its linked spdk_nbd_disk.

Change-Id: Ia67caa57b9920d0080f8b2fa1c8e87615803e5fe
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/390097
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>
2017-12-07 16:23:19 -05:00
Xiaodong Liu
3b9c5e9c6a nbd: put get-bdev and register-poller to lib/nbd
nbd poller is put into spdk_nbd_disk.
nbd test app no longer needs to process spdk_bdev.
This enables upcomming patches to move nbd test app
functionality to SPDK library.

Change-Id: I1b563a49dc9488e8dcc20706be82b17fdbd07ff1
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/390093
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: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-07 16:23:19 -05:00
Ziye Yang
f8dcdfa99e scsi: Make the pending tasks handling logic correct for reset
In principle, we should not have active tasks, which means
that lun->tasks should be empty. But for the exceptional case,
we may still need to handle those active tasks, to make
the scsi related application continue running instead of quit.

We should not directly call spdk_scsi_lun_complete_task since
those tasks are already sent to bdev layer. And finally, those
tasks will be return (even aborted) by call backs. So we only need to
set task status to condition, but
not call spdk_scsi_lun_complete_task directly.

Change-Id: I6af2bda0f0b1de7b0c655d2ac2980ddca48c1162
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/386817
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-07 13:43:52 -05:00
Shuhei Matsumoto
e44731d659 scsi: Remove the claimed flag from LUN
Struct spdk_scsi_lun has the claimed flag as a member.

However the claimed flag is no longer required.

Moreover the claimed flag itself is not used but
spdk_scsi_lun_claim() and _unclaim() functions are used in the
UT code by hard to understand manner. Moving the logic into
spdk_scsi_lun_construct() and _destruct() in the UT code will
be more natural.

Hence remove the claimed flag from LUN and do a little refactoring
in the UT code.

Change-Id: Ica9680b49bbdb5be7c5c4161210fb3a6dcb35229
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/390566
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>
2017-12-07 12:30:19 -05:00
Shuhei Matsumoto
50ec73894c iscsi: Support SCSI port removal when PG map is removed
Currently even if PG mapping is removed from iSCSI target,
corresponding SCSI port is not removed. Hence dynamic
reconfiguration of PG to existing iSCSI target is not supported.

This patch supports dynamic SCSI port removal when the
corresponding PG mapping is removed from the existing target.

Some refactoring for SCSI port addition is also done

Change-Id: Ib06bc10743eb088d023f425742e39bb24f1b0df1
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/389056
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>
2017-12-07 12:28:02 -05:00
Daniel Verkamp
ea1c15791f log: rename SPDK_TRACE_* to SPDK_LOG_*
Disambiguate the log components from the trace functionality
(include/spdk/trace.h).

The internal spdk_trace_flag structure and related functions will be
renamed in a later commit - this is just a find and replace on
SPDK_TRACE_* and SPDK_LOG_REGISTER_TRACE_FLAG().

Change-Id: I617bd5a9fbe35ffb44ae6020b292658c094a0ad6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376421
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>
2017-12-07 12:23:19 -05:00
Liang Yan
c1352c2147 test:update common.sh to get port IP in Ubuntu system
The get_available_rdma_ips function can't get port IP in ubuntu
system. Update the function to fix this issue.

Change-Id: I1b8a0b1159ce7919f883a21067de78d5166954b2
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/390613
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>
2017-12-06 18:54:49 -05:00
Changpeng Liu
7e3a11f98b nvme: add doorbell buffer config support
NVMe specification 1.3 added a new Admin command: Doorbell buffer config,
which is used to enhance the performance of host software running in
Virtual Machine, and the Doorbell buffer config feature is only used
for emulated NVMe controllers. There are two buffers: "shadow doorbell"
and "eventidx", host software running in VM will update appropriate
entry in the Shadow doorbell buffer instead of controller's doorbell
registers.

Change-Id: I639ddb5b9a0ca0305bf84035ca2a5e215be06b46
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/383042
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>
2017-12-06 17:25:54 -05:00
Ben Walker
2b768821bf blob: spdk_bs_destroy now only zeroes the super block
The function just needs to zero out metadata so that the
blobstore is effectively destroyed. If the user wants
to unmap the rest of the disk after the blobstore is
destroyed, they are free to do so. On future initializations
of blobstores the code will do the unmapping, so performance
is not impacted.

While here, implement the zeroing using the new
write_zeroes functionality instead of allocating a buffer
full of zeroes.

Change-Id: I7f18be0fd5e13a48b171ab3f4d5f5e12876023bc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/390307
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: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-06 17:21:46 -05:00
Seth Howell
7e4a7b62e1 Add readme and script for fedora 26 vm configuration
This readme and bash script can be used by developers to quickly deploy
a new vm in which to pretest their spdk patches.

Change-Id: I12f805e925dae9120ea8c451c9c5b07df4ffaf4b
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/387673
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>
2017-12-06 16:36:05 -05:00
Daniel Verkamp
5f0c99c018 test/vhost/initiator: specify RPC address via -r
Remove the [Rpc] section of the vhost initiator bdev.conf file and use
the bdev_svc -r parameter to set the RPC address instead.

Change-Id: Iaa5f6947b49679082f00d4c30d625ab2e5db8441
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390327
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-05 13:16:57 -05:00
Daniel Verkamp
23c568aabe test/iscsi/ip_migration: remove [Rpc] conf section
A previous commit modified this test to specify the RPC address via
command line, but failed to remove the [Rpc] section from the
configuration file.

Fixes: 59515ed6f8 ("test/iscsi/ip_migration: use UNIX socket for RPC")

Change-Id: Ibd5ac69c8e72fefc7e7b540df280d8a55b0b9946
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390326
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>
2017-12-05 13:16:57 -05:00
Daniel Verkamp
56f61c8feb bdev/pmem: require name in construct_pmem_bdev RPC
Change-Id: I3cbb52cd9a4201704423b49eae74935b8a33b0fd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389903
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>
2017-12-04 18:51:14 -05:00
Seth Howell
deb694403f test/iscsi_tgt: increase memory for nvmf_tgt app
The iscsi fio_remote_nvme test was failing because the large malloc bdev
was consuming too many contiguous hugepages and the call to
construct_nvmf_subsystem was failing on some machines. This change increases the memory
allocated for the nvmf_tgt app which solves that problem.

Change-Id: Ibc882d83c5b983baee9b004bfc0970562f7f2e1f
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/390320
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>
2017-12-04 18:47:25 -05:00
Ben Walker
e26e0e2689 nvmf: Look up bdev channel from poll group instead of namespace
Change-Id: I9afa07b5dae99955ba87d7c8130b2ce6f04e7941
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/389641
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>
2017-12-04 16:02:16 -05:00
Ben Walker
c3080c5aa6 nvmf: Update poll group channel maps when a new namespace is added.
There isn't a way to remove a namespace just yet, but at least
adding one works.

Change-Id: I99416d1bc9cbc0e2303c16040d2311a07829cbea
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388293
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>
2017-12-04 16:02:16 -05:00
Shuhei Matsumoto
c5e5047d99 iscsi: Manage PG-IG maps of the target by linked list
This patch is a preparation for dynamic reconfiguration of PG-IG maps.

Current PG-IG map is implemented by a fixed-size array. Linked list
will make much easier to support dynamic reconfiguration of PG-IG maps.

Current:
target - (1..n) ---> PG_map (1..1) -> PG
                 |
                 --> IG_map (1..1) -> IG

This proposal:
target - (1..n) -> PG_map --- (1..1) -> PG
                           |
                           -- (1..m) -> IG_map - (1..1) -> IG

Change-Id: I92f668b81cdd8003aff222926f8f1ed96b61e56d
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/385532
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>
2017-12-04 14:21:13 -05:00
Karol Latecki
d07df58419 test/vhost: common.sh fixes for listing VMs
Add nullglob options where appropriate

Change-Id: If55b0b2e19a7834eaf2efc86b2c23fcc71d8b05f
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/389292
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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-04 12:48:54 -05:00
Jim Harris
d12ba75bd1 blob: add per-blob feature flags
Similar flags will be added at the blobstore level in a future
patch.

This allows backwards compatibility - i.e. allow older blobstore
applications to open blobstores created by newer blobstore
applications with new features.  Any blob's using a new feature
should have an associated flag set in one of three new flag masks:

- invalid: if a bit is set in this mask that the application is not
	   aware of, do not allow the blob to be opened
- data_ro: if a bit is set in this mask that the application is not
	   aware of, allow the blob to be opened, but do not allow
	   write I/O nor any operation that changes metadata
- md_ro:   if a bit is set in this mask that the application is not
	   aware of, allow the blob to be opened for performing any
	   kind of I/O, but do not allow any operation that changes
	   metadata

While here, bump SPDK_BS_VERSION to 3.  We intend this to be the
last change made to SPDK_BS_VERSION - future versioning will be
done via blobstore or per-blob feature flags instead.

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

Reviewed-on: https://review.gerrithub.io/388703
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-04 12:07:21 -05:00
Shuhei Matsumoto
c2f38258f9 iscsi: Remove redundant repetition from ACL
The results of access control procedure for login in the
spdk_iscsi_tgt_node_access() is defined in the following table:

   +------------------------------+
   |iscsi name |netmask  |result  |
   +------------------------------+
   +------------------------------+
   |denied     |-        |denied  |
   +------------------------------+
   |allowed    |allowed  |allowed |
   +------------------------------+
   |allowed    |denied   |next IG |
   +------------------------------+
   |not found  |-        |next IG |
   +------------------------------+

However current implementation have redundant repetition in the
spdk_iscsi_tgt_node_access() and the above definition is not
visible. Hence refactor spdk_iscsi_tgt_node_access().

Besides refactor spdk_iscsi_tgt_node_allow_iscsi_name() because
it has redundant repetition too.

Add UT code for these changes.

Change-Id: If06d87c1246c85439ee0482149bd887a7b53b169
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/379935
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>
2017-12-04 11:28:52 -05:00
Shuhei Matsumoto
1674f37ac9 iscsi: Rename access control functions of target
Naming rule of access control of iSCSI target does not reveal its
intention. Hence change it before refactoring to avoid unnecessary
repeated procedure.

Change-Id: I4064ec0a5a2b52244b6de3958ee2ab41342d1a57
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/381248
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: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-04 11:28:52 -05:00
Shuhei Matsumoto
eee268fea8 iscsi: Replace "ALL" by "ANY" for access control
In the accessibility control of iSCSI target, "ALL" is used to allow
ANY IP address-port pair or iSCSI name of initiators. However iSCSI
targets cannot know ALL initiators beforehand.

Hence "ANY" will be better than "ALL" and will avoid misunderstanding.

Comments and iscsi_tgt test code are also changed and UT code is added.

Change-Id: Id004d819df6e9ee89f6c1db2e4b4c149be062733
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/385168
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-04 11:28:52 -05:00
Pawel Kaminski
3effc335eb test/lvol: Check if lvol store exists after vhost reboot
Change-Id: I65c25842b9e965ea0816f9dfc8ef62b820da001e
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/388813
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-01 17:08:35 -05:00
Pawel Kaminski
08ff0eaa9e test/lvol: Check if lvol store is removed after vhost reboot
Fix: Add condition to some test cases
because there are more possible return values
in check_get_lvol_stores function.

Change-Id: Id035d1edc52252f009277c9afd5f07f8875e0dcc
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/388242
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>
2017-12-01 17:08:35 -05:00
Daniel Verkamp
c0cf813e11 test/nvme: disable AER in nightly tests
Currently, the nightly tests are hanging due to the AER test program,
which waits for a temperature threshold event to occur.  The QEMU
emulated NVMe controller (as well as the SPDK NVMe-oF target virtual
controller) don't emulate this condition, so the test never finishes.

Change-Id: I41a216f77ffbb3beaef2fdf7533fe62c36033fc6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389908
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>
2017-12-01 17:00:54 -05:00
Cunyin Chang
89dedde148 bdev/pmem: unregister pmem bdev when app exit.
Change-Id: I6ad0d74df8a445700fdb55531e496d8fb8df8132
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/389923
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>
2017-12-01 16:44:57 -05:00
Ben Walker
ad876c00d3 nvmf: Add a channel map to the poll group
As of this patch, it is unused.

Change-Id: I15f42b8cc43e3792ae69c91f3911b7853d5b5664
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388292
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>
2017-12-01 16:41:57 -05:00
Daniel Verkamp
f5acc37221 lvol: pass lvol store to vbdev_lvol_create()
All of the call sites already have a lvs pointer; there's no need to
look up the lvs by UUID again.

Change-Id: Icef54d84e7c89f682ea47f10b282839ab4237ce0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389892
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>
2017-12-01 16:36:12 -05:00
GangCao
5aae23aa08 test/bdev: handle the error case the IO channel is not setup
This issue may be hit under some large IO and large queue
depth cases where much memory will be consumed and the channel
may be failed to create due to insufficient memory.

The general fix here is that we need to properly handle
the error case that the channel is not created due to this
or that reason.

Change-Id: Icf58a7c8a9cba625ef1b8da6b8bf68ef72ef5546
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/386051
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-01 15:13:51 -05:00
Pawel Kaminski
70643bf2a3 test/vhost: Remove ip address from rpc command
Change-Id: I552c46b2bfb01640dd19a6478b56d69574044e70
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/389845
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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-01 12:55:35 -05:00
Daniel Verkamp
e9ac7a7252 bdev_svc: convert to spdk_app_parse_args()
Use the common SPDK application argument parsing function.

This adds support for several more common options to the bdev_svc test
tool.

Change-Id: Iccccf158164182aa36d0837210d8b189be3b6cd6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389866
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>
2017-12-01 11:49:23 -05:00
Pawel Kaminski
23782bc43c test/lvol: Reordering existing test cases.
It will allow to put another test cases
in specifig group.

Change-Id: Id352aa516676f78cdb102f8eac70144f115976a5
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/389098
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-30 16:02:54 -05:00
Jim Harris
f2223d7d21 blob: add data_ro and md_ro flags to spdk_blob
data_ro means that write, write_zeroes and unmap operations are not
allowed.

md_ro means that resize, set_xattr and remove_xattr are not
allowed.

There is no code yet that can activate this - it is coming in a future
patch.  Two usages are planned though:

1) a user explicitly marks a blob as read-only - this is persisted so that
   future loads of the blob will ensure the blob cannot be modified - neither
   metadata nor data
2) a future feature flag framework (how's that for alliteration) may allow
   a blob to be opened, but not allow metadata modifications, if there are
   feature flags set in the blob's or blobstore's metadata that the
   application does not understand

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

Reviewed-on: https://review.gerrithub.io/388663
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>
2017-11-29 17:25:34 -05:00
Daniel Verkamp
bb2444f474 nvme: add a per-process attached_ctrlrs list
Only multi-process shared controllers should be inserted into the shared
list in g_spdk_nvme_driver.  To accomplish this, create a second
per-process global list of attached controllers (g_nvme_attached_ctrlrs)
and rename the driver struct field to shared_attached_ctrlrs to clarify
its purpose.  Additionally, a new helper function, nvme_ctrlr_shared(),
returns whether a given controller should be on the shared or
per-process list.

Change-Id: I46d4e558ece8b7fc3d28868e32bb56d794f21aab
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/389190
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>
2017-11-28 16:21:07 -05:00
Daniel Verkamp
4525fc898f nvme/pcie: use common trid -> ctrlr function
Simplify the PCIe transport by using an existing function to look up a
controller by transport ID.

Change-Id: I261865df1ba23069b052ca64944b7637d70c85ba
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/388701
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>
2017-11-28 16:21:07 -05:00
Daniel Verkamp
1804f3c528 nvme: move init_ctrlrs out of multi-process struct
Each process should manage its own list of controllers that are
initializing; the list doesn't need to be shared between processes.

This is the first step toward preventing non-PCI controllers from being
added into the shared attached_ctrlrs list.

Change-Id: Ia6f85fe89e28a04f0950da5362bb2f49d1b76da9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/388695
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>
2017-11-28 16:21:07 -05:00
Ziye Yang
6802fe99f4 bdev: handling duplicated bdev name
Change the return type of spdk_bdev_register related
functions and try to handle the duplicated name
issue.

Change-Id: I23af11583cf2050579d1624508306a35394bffde
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/388178
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>
2017-11-28 16:20:30 -05:00
Ben Walker
44770c2a11 bdev: Remove poller abstraction
Use the new one from io_channel.h.

Change-Id: I7bf6729caf6eeebcb58450a36119601957ad5da4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388290
Reviewed-by: Jim Harris <james.r.harris@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>
2017-11-28 15:29:35 -05:00
Ben Walker
111eef8f19 channel: Add spdk_for_each_thread
This function will send a message to each allocated
thread asynchronously, then call a callback on
the originating thread.

Change-Id: I3ebe7c6c5b460a944a32487d1091b601a482a256
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388041
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-28 15:29:35 -05:00
Ben Walker
eaaddf3d48 nvmf: Poll groups now automatically register pollers
This simplifies the public API and requirements for
user applications.

Change-Id: Ibb0d25a7838a0fa683f39e79cb4fef78adf6aee8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/388040
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>
2017-11-28 15:29:35 -05:00
Pawel Wodkowski
2bbe6a8021 test/vhost: remove COMMON_DIR from common.sh
Change-Id: Id6bb86151ec3a90298c135acb45c5cc259975348
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/387799
Reviewed-by: Karol Latecki <karol.latecki@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: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-28 12:45:28 -05:00
Ben Walker
9c35e39c54 event: Move spdk_poller_register to io_channel
Make this generic and not directly dependent on
the event framework. That way our libraries can
register pollers without adding a dependency.

Change-Id: I7ad7a7ddc131596ca1791a7b0f43dabfda050f5f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387690
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-28 12:30:37 -05:00
Ziye Yang
09fec7f014 nvme,reset: remove dpdk dependency
Change-Id: Ib2bdbe6e8cbbefadac0b38f2a552daea7d4c4b1c
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/388151
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>
2017-11-27 16:54:40 -05:00
Ziye Yang
1d6dfe6ff1 bdevperf: remove task_pool
This should be removed.

Change-Id: I122ef2729d8389fab6cc8883bc70f221c48f574b
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/388884
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-27 15:21:54 -05:00
Chen Wang
93848f4114 test/vhost: Remove the repetitive work about kill the vm
When the ((timeo-=1)) value equal to zero, it will cause
the trap in main script to start "error_exit" function
which already does kill the vm.

Change-Id: I30fb7dfa0c3b1a5faa6a88e9743164137b376bef
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/386208
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-27 14:23:37 -05:00
Dariusz Stojaczyk
1a2c100332 Revert "test/vhost/initiator: temporarily disable fio test"
This reverts commit bc5f86e3e9 .

Change-Id: I0cfd05d9b8b05d8607c9ba67cd9ce34f5edcc0de
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/388836
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-27 12:18:24 -05:00
Ziye Yang
7da5c756b7 bdevperf: Remove task_pool for task management
This patch is used to remove tht task_pool allocated
by spdk_mempool_create.

Change-Id: I8d3a483477d7fd8b5893baa41b8658893c852f6c
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/388534
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>
2017-11-22 14:59:04 -05:00
Daniel Verkamp
b81550158d test/vhost: fix vhost_blk RPC tests
Commit c63d9de433 replaced
remove_vhost_blk_controller with remove_vhost_controller, but test
wasn't updated to match.  The test had already been broken before that
point, because the RPC method name was incorrectly spelled using "block"
instead of "blk".  This hadn't been caught because this particular test
is expecting a failure, just not the particular failure that is being
caused by the incorrect method name.

Additionally, the "create block controller with incorrect name" test was
actually using the construct_vhost_scsi_controller RPC rather than
construct_vhost_blk_controller, so fix it while we're here.

Change-Id: Ib60f51639e0a3f65b09e2663186aa259be407ee4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/388060
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@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>
2017-11-22 14:12:12 -05:00
Ziye Yang
8d62bec415 bdevperf: Allocate task for each target in the beginning
This patch could prevent the potential coredump of
accessing rte_mempool among multiple threads. We
allocate the tasks from the beginning.

BTW, this patch also refactors the bdevperf to remove
dpdk dependency

Change-Id: I841e6c8b43276923acaf6686377741c37e2e71ec
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/387871
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>
2017-11-22 14:11:45 -05:00
Pawel Wodkowski
b1e850cd10 test/vhost: small fixes to common.sh file
Change-Id: I7dd452a3e9535ad8e2612d8e9d99cf4f7f41b7d5
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/387798
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@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>
2017-11-22 11:30:16 -05:00
Pawel Wodkowski
ac176c7e87 test/vhost: remove outdated README
It is outdated and not really usefull.

Change-Id: Ifcfd1c987467448cb6f827457de215922a701d77
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/387797
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-22 11:30:16 -05:00
Pawel Wodkowski
45caa6f859 test/vhost: don't use global VHOST_APP in spdk_vhost_run
This is inconsisten with local variable deffining the same path. We need
also to move negative vhost app tests from run_vhost.sh since VHOST_APP
will not be available anymore.

Change-Id: I21cee58c545357ca7e7997cb529b15d436cfed57
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/387561
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: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-11-22 11:30:16 -05:00
Daniel Verkamp
136e7d13c8 test/vhost/initiator: temporarily disable fio test
Until the fio_plugin unload crash is fixed, disable the fio portion of
the tests so that we can re-enable the rest of the bdev/virtio testing.

Change-Id: I8d18fff729262fa88cbc66fce914cf1ff92db83e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/388307
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-21 16:33:55 -05:00
Daniel Verkamp
276d519afe test/iscsi/nvme_remote: use UNIX socket for RPC
Switch the iSCSI process in the iSCSI/NVMe-oF test to use a UNIX domain
socket for RPC instead of a TCP socket.

Change-Id: I130b2871c74b6bd9aa55a63d751c995a579e03bf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/388287
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-21 16:33:55 -05:00
Daniel Verkamp
59515ed6f8 test/iscsi/ip_migration: use UNIX socket for RPC
Switch the ip_migration test away from using TCP to access the RPC
service.

Change-Id: Ic89f59acf60016ae2669b267f09a035413ab22e1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/388286
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-21 16:33:55 -05:00
Daniel Verkamp
ec1551c598 test/vhost/initiator: fix discover_bdevs usage
discover_bdevs previously took a port number for the RPC service, but
after commit 6bef902ca5 ("rpc: add default UNIX domain socket listen
address"), running rpc.py with just a -p (port) parameter doesn't have
the expected effect, since the default server_addr is now a UNIX domain
socket path, and the port is ignored.

Change discover_bdevs to accept a socket path instead of a port number
to fix the issue for the vhost/initiator test; no other callers use the
disover_bdevs rpc_port argument, so this is the only instance that needs
to change.

Change-Id: I4e290f175ccc79caa3c4ef76c062641b9fe489a8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/388283
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>
2017-11-21 16:33:55 -05:00
Shuhei Matsumoto
b8705bf48c iscsi: manage IG's name and mask by linked list
To add initiators to an existing target, manage name and netmask
of initiator group by linked list. It is not easy for array to
detect duplication and change configuration.

Change-Id: Id9e77740e24ac309a33d8de1be37663681160d94
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/379932
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-21 16:06:30 -05:00
Shuhei Matsumoto
92ef1a64ec iscsi and ut/iscsi: return code to fail of IG creation
spdk_iscsi_init_grp_create_from_configfile() returns 0 even if
creating an initiator group (IG) is failed due to empty netmask or
initiator name. This will be unexpected behavior for end users.
Hence change the return code from 0 to -ENVAL for this failure.

Besides do the following.

Change other error return codes in the function by using errno too.

Current IG don't have any UT code in repository. UT code to confirm
this fix is also submitted.

Change-Id: Ic918feb5c6a3e772b325664d881b2673b553a217
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/384408
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-21 16:06:30 -05:00
Maciej Szwed
cf6fe9b15d lvol: add unmap and write zeros support
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ic11a56c5616098ff42f31f78aa96289af5965118

Reviewed-on: https://review.gerrithub.io/387611
Tested-by: SPDK Automated Test System <sys_sgsw@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>
2017-11-21 13:28:22 -05:00
Karol Latecki
5764d85c09 test/vhost: fix typo in spdk_vhost.sh
Typo caused lvol blk test to not run.

Change-Id: I1e26b96757450a3ea860e0b74a0b7d976c86bdf2
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/388413
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-21 13:20:13 -05:00
Pawel
f539bb0374 ut/vhost: move mock functions to common vhost file
Adding new functions to core vhost requires adding their equivalent
mocks in both vhost_scsi_ut and vhost_blk_ut separatly. By adding common
file "test_vhost.c", we can prevent duplicate mock functions.

Change-Id: I4542ae092e158b94b25559216e1fc46e10c1a1ae
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/383357
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
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>
2017-11-20 19:34:53 -05:00
Karol Latecki
bc6540ad05 test/lvol: add friendly name specific tests
Adding positive and negative lvol friendly names specific tests.
Test plan updated.
Also fix some test naming discrepancies between plan and
script while at it

Change-Id: Ifb1a62d6a231f4f4ebfb5bb6178d941fc2b9770d
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/385552
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-11-17 18:24:08 -05:00
Lukasz Galka
3a6f8dc856 test/lvol: Add lvol tasting test
Add lvol tasting positive test case.
Adding new autotest config option for better control
where test is executed

Change-Id: Ic08b2395bd14e15072711b97c77b7e1ce26dd2b7
Signed-off-by: Lukasz Galka <lukaszx.galka@intel.com>
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/383432
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-17 18:24:08 -05:00
Cunyin Chang
8bd0514b35 test: remove unused test code for iscsi hotplug.
Change-Id: I53c7911bfd1a530f37d5eddd22ab1611ac9d763e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/386370
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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-17 11:25:39 -05:00
Cunyin Chang
9124d31bb1 test: Add iscsi tgt hotplug test in bdev layer.
Change-Id: Ib45cfc3431189cd4c5b829c9b1396c4732adb40e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/386361
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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-17 11:25:39 -05:00
Ziye Yang
5fa2274ccb io_channel: change return type of spdk_channel_msg
Change the return type of spdk_channel_msg from
void to int. If this msg executed in a failure,
we do not need continue sending the message to other
threads, we can just tell the original thread, and
let the orgiginal thread call the spdk_channel_for_each_cpl
call back.

Thus we can track the qpair creation/destroy case for bdev
reset in nvme bdev module;

Change-Id: Ide9dffd1f84a29fcf61d8339a9ece2a0245d968d
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/387284
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>
2017-11-17 11:25:14 -05:00
Ben Walker
00b02039c5 event: Pollers must now be unregistered from the thread they run on.
Change-Id: I8ea8c59a0c67176c0c0c39abf807afad61ff3828
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387689
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>
2017-11-17 11:11:23 -05:00
Ben Walker
fcb4776fe7 event: Pollers must now be registered from the thread they run on.
Change-Id: I864cd8a6c206dfbe62fcb3f72275c1ae51aa4ed7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387688
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>
2017-11-17 11:11:23 -05:00
Ben Walker
03bb015cda nbd: Remove extra event on shutdown
nbd_start(), nbd_poll(), and nbd_stop() will all be called
on the same core, so the poller unregister will complete
synchronously.

Change-Id: I4f83f3821102277704422ed63d4cde424324e0a4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387686
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>
2017-11-17 11:11:23 -05:00
Ben Walker
9102eef73d Revert "test/bdevio: add delay before starting unit tests"
This reverts commit be2cb0c535.

Change-Id: Ie337700dbedbd2e5a57afcfb8bd256bd344db4c1
Reviewed-on: https://review.gerrithub.io/387683
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: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-17 11:11:23 -05:00
Ben Walker
435138b76d scsi: Register all pollers to the current core
Register all pollers to the current core. If necessary, send
an event to the correct core before registering.

Change-Id: Ie34cc8b11143a58c0f621c87c409a3d09d929648
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387682
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: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-17 11:11:23 -05:00
Karol Latecki
8175e30229 test/vhost: Remove norandommap from vhost initiator tests
Removing norandommap as it is not correct to use with
verify-enabled tests

From fio man:
Normally fio will cover every block of the file when doing
random I/O. If this parameter is given, a new offset will be
chosen without looking at past I/O history.
This parameter is mutually exclusive with verify.

Change-Id: I739642461b3dbe9ab8698836aa120bfb14c2b79e
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/385431
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-16 18:26:35 -05:00
Daniel Verkamp
ed53cba059 nvme: normalize PCI addresses before comparing
Use the env abstraction PCI functions to compare PCI addresses so that
details like whether or not domain is specified or whether 0-padding is
present don't affect the comparison.

For example, 0000:01:00.0 should compare equal to 01:00.0.

Change-Id: I9f3aaeb5f8fdbf3e246e31a41b4c09151288015e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/387202
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>
2017-11-16 18:17:09 -05:00
Maciej Szwed
c8b22dd071 unit/lvol: negative unit tests for lvols load
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Id50593446bd3ce5383ca10e917a541a0246cf3a7
Reviewed-on: https://review.gerrithub.io/384076
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-15 18:05:09 -05:00
Cunyin Chang
97f3104bc7 blobfs: Add conf parse for blobfs.
This patch make the cache buffer shift of blobfs configurable. We
can configure the cache buffer shift according workload, it will
help to improve the performance.

Change-Id: Ied1c2e5d6fd9eaa7aa0759c03c654fcf2e77aa23
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/383381
Tested-by: 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>
2017-11-15 18:03:00 -05:00
Daniel Verkamp
52412ab10b build: include spdk.app.mk in all app Makefiles
This will be used to include common app-specific rules in upcoming
patches (it currently makes no difference).

Change-Id: Ia828ba01c94fc9f70e15db3fc1d9cafda387e912
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/387629
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>
2017-11-15 17:57:07 -05:00
Ben Walker
ea134c5cbf nvmf: Store subsystems in array instead of a list
This helps enforce uniqueness of the subsystem id and
allows for quick lookup by that id.

Change-Id: I4d2948892839d42b8c2b2a406682848415ad2bd6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/376251
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>
2017-11-15 17:54:13 -05:00
Pawel Wodkowski
f7476d444b vhost/test: remove code that build SPDK and QEMU
qemu_build_and_install and spdk_build_and_install are unused for long
time so lets remove them.

As we are here also also remove unused VM_CNT.

Change-Id: I23368b2f2036b9eb82f9ac8e6880242748352e49
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/387560
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>
2017-11-15 17:53:19 -05:00