Commit Graph

1162 Commits

Author SHA1 Message Date
Ziye Yang
15c96c6601 bdevperf: Fix the display name issue.
This patch does the following work:

1 Fix the performance display name issue. When doing
the io statistics, we call spdk_bdev_get_name, however
this time, we are already calling spdk_app_stop, so
we lost the name info. Currently code, we will not
see the correct name. And this patch will help to fix
this issue, by storing the name at the begining.

2 Fix memory leak issue. It seems that we do not free the target
space.

Change-Id: I716bda1a7340921e01f9f9ea28b2b908cd19e0af
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/385347
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>
2017-11-09 11:30:26 -05:00
Jim Harris
6238f566f5 test/iscsi: disable NVMe hotplug tests in iscsi fio test script
Rescanning the devices in VMs is frequently causing a system
hang, so disable these tests for now.

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

Reviewed-on: https://review.gerrithub.io/386325
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-11-08 18:34:27 -05:00
Jim Harris
258c5ea47a test/iscsi: add delay between pci rescan and setup.sh
It seems that the pci rescan at the end of the fio.sh
script needs some time to process before we run the setup.sh
script immediately after.  We have multiple instances where
the setup.sh is crashing.

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

Reviewed-on: https://review.gerrithub.io/386119
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-07 12:27:28 -05:00
Jim Harris
32bff28a25 nvme: use spdk_pci_device_claim() in nvme_pcie_ctrlr_construct
spdk_pci_device_claim() can be used to ensure only one process
at a time uses any given PCI device.  Previously this was only
used in the bdev_nvme driver - other apps like nvme/perf do
not use spdk_pci_device_claim() and could effectively rip out
the device from a running bdev-based app like the NVMe-oF target.

So instead of modifying all of the nvme apps, put this logic into
the core nvme driver instead so that all applications get the
benefit transparently.  Save the fd when the controller is constructed
and then close it when the controller is destructed to handle the
detach (including hotplug) cases.

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

Reviewed-on: https://review.gerrithub.io/385524
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: Daniel Verkamp <daniel.verkamp@intel.com>
2017-11-03 18:48:33 -04:00
Jim Harris
3178ad6476 env: return fd from spdk_pci_device_claim()
This allows users of this interface to then close the fd
when they want to release the claim.

This prepares for calling spdk_pci_device_claim() in the
nvme driver to cover not just the bdev_nvme driver but all
of our nvme example and test applications as well.  We'll
want the fd returned so that we can properly close it during
detach (including hotplug) use cases.

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

Reviewed-on: https://review.gerrithub.io/385523
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@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-11-03 18:48:33 -04:00
Daniel Verkamp
cbbac707c3 test/event_perf: fix spdk_app_stop() condition
Make sure the event_perf example calls spdk_app_stop() exactly once by
using an atomic flag to track when it has been called.

Previously, if the timing happens to be right, the current events at the
point where spdk_get_ticks() > g_tsc_end becomes true may not be running
on the master core, so none of the submit_new_event() calls that are
currently running will call spdk_app_stop(), and no new events will be
sent, so the test hangs.

Also, since event_work_fn() sends multiple events, spdk_app_stop() could
be called more than once, since all of the events would be executing on
the master core.

Change-Id: I384a3e0f56a3305bd4abfd5503325f0c10ca279e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/385677
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-11-03 16:49:38 -04:00
Jim Harris
f176436b69 test/bdev: wait for nbd device to become ready
Previously, we were waiting to find the target bdev as
registered before proceeding with nbd operations.  But
there can be a delay between when the bdev is registered
and when the nbd device becomes ready for block I/O
operations.  This delay has recently become longer as
lvol now performs I/O on registered bdevs to check for
an existing logical volume store.

So instead, check for the existence of the nbd device
in /proc/partitions output.

While here, also fix a bug in the nbd.c code - it needs
to wait for the poller to be unregistered before calling
spdk_nbd_stop().  Normally I would fix this in a separate
patch but because these issues are causing a lot of
failures in the test pool, I'm expediting this by putting
both fixes in one patch (so we can avoid a bunch of
re-runs).

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

Reviewed-on: https://review.gerrithub.io/385687
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
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>
2017-11-03 15:28:26 -04:00
Shuhei Matsumoto
fed2667127 iscsi and ut/iscsi: deny initiator grp w/ empty netmask
spdk_iscsi_tgt_node_access() (in lib/iscsi/tgt_node.c) regards
empty netmask of IG as ALL (allow all initiator's IP address).
However any user cannot create IG whose netmask is empty by both
JSON-RPC and config file. Instead user can create IG whose
netmask is ALL.

The code to regard empty netmask of IG as ALL never run in production.
Hence delete the code and add UT to confirm the fix.

Change-Id: Ib7206d0986db9093cfb6b36191be26293ff6c67a
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/382920
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-03 14:08:47 -04:00
Jim Harris
11bd19c80c iscsi: remove global data members for non-configurable parameters
FirstBurstLength, MaxBurstLength and MaxRecvDataSegmentLength
cannot be configured, so there is no need to keep global data
members for these parameters - just use the default #defines
instead.

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

Reviewed-on: https://review.gerrithub.io/385490
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-11-03 12:18:02 -04:00
Jim Harris
cce7b3078d iscsi: remove global MaxOutstandingR2T parameter
This was not used anywhere - sessions default to
DEFAULT_MAXOUTSTANDINGR2T and never look at the global
MaxOutstandingR2T value.

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

Reviewed-on: https://review.gerrithub.io/385488
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
2017-11-03 12:18:02 -04:00
Maciej Szwed
c40524fb81 unit/lvol: fix uuid setting in unit tests
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I868c3620edc13309d603cd29effa8e0a62788495

Reviewed-on: https://review.gerrithub.io/385411
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-02 14:13:03 -04:00
Maciej Szwed
ea22acd559 lvol: read lvols names on lvol store tasting
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I2077dab7b343e662bdcfd5681b4850c258f0431f

Reviewed-on: https://review.gerrithub.io/385406
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-02 13:59:48 -04:00
wenzhong wu
5069496ddc test/nvme: Add perf with AIO devices
Change-Id: I6507db2d3ea7276b9f204e68cbe0185110a5345c
Signed-off-by: wenzhong wu <wenzhongx.wu@intel.com>
Reviewed-on: https://review.gerrithub.io/384403
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-11-01 19:46:24 -04:00
Lukasz Galka
d88fa70e58 test/lvol: update test plan with tasting test
Postivive test case for testing lvol tasting feature.

Change-Id: Ifa8b87978e40a719ca59603cfd41a8fd1b22c6f9
Signed-off-by: Lukasz Galka <lukaszx.galka@intel.com>
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/382687
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-27 15:42:47 -04:00
Piotr Pelplinski
511adde02f lvol: add lvs name in rpc calls
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: Ic6770371d9d62cbdd40ae0612eb4f7dceccd507f
Reviewed-on: https://review.gerrithub.io/383771
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-27 13:10:21 -04:00
Piotr Pelplinski
e5b0dd6ead pmem: bdev names for pmem bdevs
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: Ifbb02f99cd2e5752b2bc9091733b87ddadec11a4

Reviewed-on: https://review.gerrithub.io/383895
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-27 13:10:07 -04:00
Tomasz Zawadzki
fde584034d lvol: give EEXIST error code on lvs name conflict
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1df83cbd6414a1bb8f54328c735950b9476e323b
Reviewed-on: https://review.gerrithub.io/384105
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-27 13:07:09 -04:00
Pawel Wodkowski
ff1863f428 vhost: interrupts coalescing
Virtio spec say that any IRQ requests are only hints. So try to limit
number of interrupts generated by vhost by defining minimum interval
between sending IRQ. Coalescing is disabled by default. Can be enabled
using RPC command 'set_vhost_controller_coalescing'.

Change-Id: I9b96014d004ea0ea022b4498c6b47d30d867091a
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/378130
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-10-27 13:06:40 -04:00
Pawel Wodkowski
fb0b17a19f test/vhost: always print command output
In case of error the message is command output and is confusing:

	ERROR! While executing FIO jobs - RC: 1, Err message:
	hostname=VM-11-0xC0000000, be=0, 64-bit, os=Linux, arch=x86-64,
	fio=fio-2.2.10, flags=1
	19:04:59 hostname=VM-10-0x30000000, be=0, 64-bit, os=Linux,
	arch=x86-64, fio=fio-2.2.10, flags=1

So change this to always print command output then error message.

Change-Id: Iee4b25a00438c153a0d4d250ae43fc0d283faf33
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/383596
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-10-27 13:06:40 -04:00
Pawel Wodkowski
d02bfbd3af test/vhost: print backtrace in failure handler
Change-Id: Ic42b54ba502259b73b8110d75dd5ab032f1f0928
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/383490
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-10-27 13:06:40 -04:00
Pawel Kaminski
bd34b7d9bb test/vhost: Fix write with verification.
Change is needed because fio job (trim_write_read)
submits unmap first and then write,
but sometimes write finishes before unmap.
It casues that write fails with verification.

Nvm Express 1.3:
"The controller fetches SQ entries in order from the Submission Queue,
however, it may then execute those commands in any order. "

Change-Id: Ia399e5677051c2e2077fe3082ede846a8ac9dd49
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/383436
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-27 13:06:03 -04:00
Tomasz Zawadzki
6c54c13cd4 event/subsystem/bdev: asynchronous SPDK finish
First this change moves spdk_subsystem_fini() to trigger on
spdk_app_stop(). This ensures that spdk_subsystem_fini() is called
before reactors are stopped in spdk_reactors_stop().

Finish paths for subsystems, bdevs and copy engine is now
asynchronous.
Each of those three mentioned have to make sure they are
asynchronous as well.

Only bdev that currently has requirement for asynchronous finish
are logical volume.
Thus the change in vbdev_lvol.c making it move to next bdev module
only after all lvol stores were unloaded.

Fio_plugin finish of bdev and copy_engine was removed for now.
Next patch in series adds it back with async support.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I80ee2d084f3d82c50bf1329e08996604ae61b1b3
Reviewed-on: https://review.gerrithub.io/381536
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-10-27 13:03:55 -04:00
Pawel Kaminski
29d4d1de08 test/vhost: Fio test for vhost initiator for nvme disk larger than 4G.
Change-Id: I3a017612dcadd519cfd427ba43450fa4d54edfce
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/381150
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-10-27 08:46:06 -04:00
Tomasz Zawadzki
ebf0312eef lvol: Add vbdev_lvs_destruct() and change unload behaviour [3/3]
This patch adds new API to remove logical volume store
from device it is on. It is only used from RPC, when
user explicitly requests. It allows to use the device to
use as any other bdev.

vbdev_lvs_unload() is now only called from hotremove and
during application shutdown. Which makes it possible to
load it again during application start up.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If6452ecc3fff99237d1704ff7cd8de4d7133221d
Reviewed-on: https://review.gerrithub.io/382021
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-10-26 17:23:58 -04:00
Maciej Szwed
e68e2e749b lvol: do not unload/destroy lvs when operation on lvol is pending
There is a scenario where we can try do unload or remove
lvol store while lvol present on that lvol store is being
closed or destroyed.

Scenario:
1. send delete_bdev rpc command
2. command returns before lvol is actually closed/destroyed
   (does not wait for callback)
3. send destroy_lvol_store rpc command
4. lvs is destroyed before lvol is destroyed
5. lvol destroy callback is called on destroeyd lvol store

Aboive scenario can be reproduced using:
spdk/test/vhost/spdk_vhost.sh --integrity-lvol-scsi

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ie715279195bd4b1145cf05d4f5a8477b4fac87f7
Reviewed-on: https://review.gerrithub.io/383595
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-10-26 17:23:58 -04:00
Maciej Szwed
2baeea7dd4 bdev: add callback to spdk bdev unregister and bdev destruct
Currently deleting bdev does not support asynchronous delete
operations. Because of that results are returned before device
is actually deleted and some operation can be peformed on that
device after removal of this device started.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I305c302d8abd5d7c2c0f947fca70c58396872132
Reviewed-on: https://review.gerrithub.io/383732
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-10-26 17:23:58 -04:00
Piotr Pelplinski
9d17cbdd23 blob: fix bug when specifing cluster size < 4096
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I59cbef4ce1bfe8af113c66c2c9cb9f208440c0aa

Reviewed-on: https://review.gerrithub.io/383887
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-10-26 14:21:22 -04:00
Karol Latecki
957ebeb506 test/vhost: remove read tests from vhost initiator
Removing read and randread from test runs as read operations are
performed as part of write with verify enabled tests.

Slight code cleanup included.

Change-Id: Ia3b92ed16cf4c1b873d0f54a0c0677c52f9b726a
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/383770
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-26 14:08:21 -04:00
Jim Harris
e6d053e78a lvol: add lvol unique name
Add a name to each lvol which is persisted as a blob
xattr.  lvol names must be unique within its
lvolstore.

While here, fix a few lvol_ut issues that were caught
as part of testing the lvol unique names.  Also fix
a couple of tests that registered the wrong string
name with CUnit.

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

Reviewed-on: https://review.gerrithub.io/383567
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-25 12:10:38 -04:00
Jim Harris
c6f1d12930 lvol: move name to old_name
There are some upcoming changes which will deprecate
the old lvsuuid_blobid name in favor of an
lvs_name/lvol_name name where these names are
user-specified.

In preparation for this change, rename the previous
lvol->name to lvol->old_name.  This will allow us
to add a new lvol->name but keep the original
old_name during the transition.

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

Reviewed-on: https://review.gerrithub.io/383534
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-25 12:10:38 -04:00
Jim Harris
08ac0074ce lvol: add unique lvolstore name
Each lvolstore now has a unique name which is persisted to
metadata.  Eventually this will provide a friendlier
way to reference logical volumes, in the form
lvolstore_name/lvol_name.

This patch only covers the unique lvolstore name.  An
lvolstore may not be created nor loaded if its name
conflicts with an already loaded blobstore.

Currently there is no way to rename an lvolstore to
resolve a conflict.  This will be coming in the future.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I842f13b79776e5b8f81e56de10778c35328e8cd3
Reviewed-on: https://review.gerrithub.io/383533
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-25 12:10:38 -04:00
Daniel Verkamp
2120e4d3e7 test/lvol: fix typo in log message
Change-Id: I467f1b41b7f412bbc906e58da5c7db0c9b527beb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/383142
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2017-10-24 18:02:21 -04:00
Daniel Verkamp
44a3f09b15 ut/lvol: add missing allocation checks
Change-Id: I48d96d072217ec1b4701760cd0b598f9a67e1c7b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/383649
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-10-24 16:39:04 -04:00
Maciej Szwed
fecd574bd5 unit/lvol: additional lvol tasting unit tests
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ie9e0821274755bb42f81cb0b2ef6c374e6224848

Reviewed-on: https://review.gerrithub.io/383277
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-10-24 13:36:51 -04:00
Jim Harris
70e25b39ac lvol: refactor unit tests
Create blob_store and blob placeholders, to mimic what a real
SPDK blobstore would do.  Then we can set different status
values on the blobstore and blobs to return different status
instead of just a single global variable for injecting different
status values.

This is also needed for future tests where we need to have
multiple lvolstores at once to test name collisions.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I68110fa87a63c6e5795bfccc0121c2f58d87c815
Reviewed-on: https://review.gerrithub.io/383036
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-24 13:36:51 -04:00
Jim Harris
7d8fe2ca2c lvol: keep list of open lvolstores
This will be used in a future patch to ensure we do not
allow creating or loading an lvolstore with a names that
matches an already opened lvolstore.

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

Reviewed-on: https://review.gerrithub.io/383012
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-24 13:36:51 -04:00
Maciej Szwed
199e73908d lvol: Lvol store tasting
This patch introduces lvol store and lvols parameters saving
on persistent memories and loading it from saved data on app start.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ia63f0cf3d6365d59f31c5f0a1724636bfe73b5b8
Reviewed-on: https://review.gerrithub.io/375764
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-10-24 13:36:51 -04:00
Piotr Pelplinski
dc7eb0397e ut_lvol: unit tests for i/o
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: Ic664740490f2a342d0d63947935fb081cb70934b
Reviewed-on: https://review.gerrithub.io/373748
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-23 15:53:25 -04:00
Lukasz Galka
9fb50ad867 test/lvol: adding test cases for lvol store cluster size
Added "-c" argument for construct_lvol_store calls in tests.
Added 2 additional test cases for checking cluster_size=0
and cluster_size>base_bdev_size.

Commit also includes small PEP8 fixes for additional empty lines
between class and function definitions.

Change-Id: Ibdfb3312a61828ad4aa0f79327b648b6ea67899b
Signed-off-by: Lukasz Galka <lukaszx.galka@intel.com>
Reviewed-on: https://review.gerrithub.io/381294
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-23 15:52:29 -04:00
Karol Latecki
392fdc8a89 test/lvol: Remove unsupported test
Removing test for lvol bdev resize as it is not supported

Change-Id: I73284f2260e595bfa5db2c24d2e37fcd1b255bd8
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/383086
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-23 15:52:29 -04:00
Tomasz Zawadzki
79745b8c8b blobstore: do not allow for spdk_bs_unload if blobs are still open
It is possible that a user will call spdk_bs_unload() with blobs
list not-empty. Instead of just asserting that, now the call fails
with appropriate error.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I83818453d6c90ff9b5bf657c90e12b2f9d5ca013
Reviewed-on: https://review.gerrithub.io/383220
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-23 15:31:48 -04:00
Dariusz Stojaczyk
830701b498 bdevio: call shutdown on proper thread
Fixed a typo introduced in patch 90440e1fe1.

Fixes: 90440e1fe1 ("test/bdevio: do unit tests on their own thread")

Change-Id: I15a6c5366435f5d84e171f443182f292d4f7a0e3
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/383431
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-23 11:55:59 -04:00
lgalkax
e6c4c8a15c test/nvmf: Add test scripts with FIO traffic and NVML backend
Add test script to use SPDK Nvmf with NVML backends and run FIO read/write
traffic with verify flag enabled.

Change-Id: Iff8a85f65c36cb7372963076252577b7a1b2378f
Signed-off-by: lgalkax <lukaszx.galka@intel.com>
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/379247
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-23 11:54:57 -04:00
Seth Howell
3f9cbe513b blob: add write_zeroes support
Unmap does not guarantee that erased blocks will return all zeroes.
using write_zeroes when unmapping metadata gives the
desired behavior for a blob.

Only metadata pages will be cleared with write_zeroes in this patch;
blob data clusters will still call unmap.  This behavior may be made
configurable in a later patch (to allow the user to request zeroing of
clusters rather than just unmapping).

Change-Id: I1b210abac110867ce703bcfdeb634eb45aa9d5c9
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/372004
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-23 11:50:16 -04:00
Seth Howell
3fd7f28dc9 bdev: add fallback from write_zeroes to writev
if write_zeroes is not supported by the block device, we can get the
same behavior by simply writing a buffer full of zeroes to the blocks
we want to erase. I also incorporate splitting into the bdev layer to
accomodate large i/o.

Change-Id: I8fa1bfaaf22d7bfc6e3afb6e89d22fa9f7767e55
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/373829
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-10-23 11:50:16 -04:00
Tomasz Zawadzki
f71f486d0b lvol: Add spdk_lvs_destroy() API [2/3]
This goes along with previous patch in series.
Adding functionality to remove logical volume store from
device.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6338a35ed02838498a3cd9bb2dddd25803e65f79
Reviewed-on: https://review.gerrithub.io/382020
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-10-20 16:06:53 -04:00
Tomasz Zawadzki
2df9f03c47 blobstore: New API call to destroy blobstore [1/3]
Currently exposed API allows to load/unload and to
initialize blobstore on a device.

A spdk_bs_destroy() call is added in order to reach
functional parity with spdk_bs_init(). It was not
possible to remove blobstore from device from within
SPDK previously.

spdk_bs_destroy() takes blobstore pointer as argument
(instead of bs_dev), because blobstore has to be already
loaded to destroy it.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I2c493a4407868fcf08fd1766a19fc8463f634ef5
Reviewed-on: https://review.gerrithub.io/382019
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-10-20 16:06:53 -04:00
Maciej Szwed
63fce5595b lvol: add reference counter for open lvols
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I3a86f28056e67b3c237441fb1048ca6ccd081ae7

Reviewed-on: https://review.gerrithub.io/383252
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-10-20 16:06:53 -04:00
Maciej Szwed
94cf9837aa lvol: support callbacks in lvol close/destroy functions
Close and destroy lvol functions should support callback
functions so that they can be processed sequentially
and also give user result.

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

Reviewed-on: https://review.gerrithub.io/383230
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-10-20 14:26:01 -04:00
Pawel Kaminski
c5f83bd8f3 test/vhost: Fio test for vhost initiator for unmap
Change-Id: I0bb922d6a135d4b49d2f5f89ec3874251b898090
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/381642
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>
2017-10-19 20:14:50 -04:00
Pawel Niedzwiecki
497321baf3 test/pmem: RPC pmem functional tests.
Functional pmem tests according to test plan:
https://review.gerrithub.io/#/c/378618/18/test/pmem/test_plan.md

Change-Id: Ia4594fe96a542c654656d2a6d2fed18eb1c2fcf7
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/379972
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
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>
2017-10-19 15:16:05 -04:00
Cunyin Chang
9f891d14ce blob: Make the files persisted cross power failure.
We only sync the metadata and data in the runtime of blobstore, which
means we only update the used md bitmap and used clusters bitmap in memory.
if the system crushed, we have no chance to sync the used md bitmap and
used clusters bitmap into disk, then next time when we try to load the
blobstore, all the data will lost, this patch add the logic to recover the
valid data from last dirty shutdown. We will go through all the metadata pages
to find all valid data and rebuild them.

Change-Id: Ieb7c5f932206b1b68fdde0cee35f2d2cb3a4f309
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/376470
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-10-19 15:13:58 -04:00
Jim Harris
f97c8b3142 lvol: add spdk_lvs_opts_init()
Some future patches will require specifying an lvol_store
name when calling spdk_lvs_init().  This means that passing
NULL for spdk_lvs_opts will no longer be an option.  So
add an spdk_lvs_opts_init() (similar to spdk_bs_opts_init)
which will initialize a default value for the cluster size.

While here, prepend an underscore to spdk_setup_lvs_opts, since
this function is not part of the public SPDK API.

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

Reviewed-on: https://review.gerrithub.io/383030
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-19 13:23:58 -04:00
lgalkax
4df57e999a test/iscsi: Add iscsi_tgt with NVML backend test
Add test script to use SPDK iscsi with NVML backends and run FIO read/write
traffic with verify flag enabled

Change-Id: I72c95154591034583400116b7c0f05413f35f9ee
Signed-off-by: lgalkax <lukaszx.galka@intel.com>
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/379349
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-10-19 13:00:27 -04:00
Dariusz Stojaczyk
66ed5a2bb6 test/bdevio: assert against get_io_channel failure
Added an additional error check.

Change-Id: Ida90b56593cad2bfc3e3d13b71481787a197e390
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382929
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-10-19 00:33:06 -04:00
Pawel Wodkowski
32f7f2af23 bdev_pmem: unit tests for persistent memory backend
Change-Id: I4837d489d4730423825929f0e53d3ef6b487f0d0
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>

Reviewed-on: https://review.gerrithub.io/379470
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>
2017-10-18 13:48:22 -04:00
Daniel Verkamp
ad6a4cab20 test/iscsi/lvol: add more timing markers
Separately account for the time taken during setup via RPCs, iscsiadm
discovery and login, and the fio run itself.

Change-Id: I0fc65668dc1c4f1c720721396d610eb7d2dcf80b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382894
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>
2017-10-18 13:03:48 -04:00
Daniel Verkamp
eca49c11b3 test/iscsi/lvol: remove unnecessary sleep
The construct_lvol_bdev RPC should not return until the bdev is ready to
be used, so sleeping before construct_target_node should not be
necessary.

Change-Id: I5f91a76f996132697db36b8857a56471d651a5cd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382893
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>
2017-10-18 13:03:48 -04:00
Lukasz Galka
e0b220b56d test/lvol: RPC lvol tests
Functional negative and positive lvol tests using RPC calls

Change-Id: I9b8d8501b8ab3087e786886ef1e78abe287f8820
Signed-off-by: Lukasz Galka <lukaszx.galka@intel.com>
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/375114
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-18 12:38:24 -04:00
Piotr Pelplinski
c0ed81a72b bdev_pmem: documentation
This patch adds documentation adn test plan for PMEM functional tests

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: Ia2e8bcb9901ab216c3e45d2db6d06a3a02fdd308
Reviewed-on: https://review.gerrithub.io/378618
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-10-17 16:28:16 -04:00
Dariusz Stojaczyk
90440e1fe1 test/bdevio: do unit tests on their own thread
Previously unit tests were run
on the same thread that called
the SPDK init. The bdevio app
had 2 threads: one for init&ut
and one for I/O processing.
When doing any asynchronous I/O,
the init&ut thread was waiting
via pthread condition variable
for I/O thread to finish it's
work.

With upcoming virtio-initiator
RESET implementation, the reset
I/O has to be processed by
a poller on the init thread.
When init&ut thread sends an
RESET requests the app deadlocks,
as pollers on the UT thread
won't be processed until I/O
thread wakes the condition
variable.

This patch separates ut thread
from init, so that init can
run it's tasks in background
even when ut thread is waiting
for condition variable.

Change-Id: Id4b6962f4288e6a07354dbf1d3aec0d0fd9de916
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382663
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-10-17 15:21:09 -04:00
Daniel Verkamp
b10dac2c78 bdev/lvol: add module name to driver_specific JSON
This allows the caller to know which bdev module is exporting the bdev
and therefore how to interpret the driver_specific fields.

Change-Id: I09641645875827eabc0a831fff5b0b5bed6b03d0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382519
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>
2017-10-17 13:59:34 -04:00
Pawel Wodkowski
3a33129a6d vhost: wrap rte_vhost_vring into spdk_vhost_vring
This enable storing SPDK specific stuff per queue. First use of
this will be event index feature.

Change-Id: Ieca6fa47a6f2e23bec73d2cda8b0ed8b9185bd28
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/376636
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>
2017-10-17 13:37:56 -04:00
Pawel Kaminski
598ba73f5f test/vhost: Add tests for hot-attach and hot-detach features.
Test plan for hot-attach and hot-detach included.
File with CPU core masks for vhost and qemu updated because more
than one virtual machine is needed to run the tests.

Change-Id: I6ba02f65398d09e2ef3335c2d5b0d6c04d3e393c
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/372268
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-17 13:37:09 -04:00
Maciej Szwed
eb8b1e20a9 blobstore: add bstype to blobstore super block
Introducing bstype as a way to identify and verify
 blobstore type.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I50267b5408625be10fe0c146ae329016d5509b4a
Reviewed-on: https://review.gerrithub.io/380476
Reviewed-by: Jim Harris <james.r.harris@intel.com>
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>
2017-10-17 13:36:03 -04:00
Jim Harris
1a15ce9b46 setup.sh: do not unbind NVMe devices with active mountpoints
Use lsblk to detect if an NVMe namespace or any partition on the
namespace has an active mountpoint.  If it does, do not unbind
the NVMe device associated with that NVMe namespace.

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

Reviewed-on: https://review.gerrithub.io/382479
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: Changpeng Liu <changpeng.liu@intel.com>
2017-10-17 12:49:18 -04:00
Daniel Verkamp
e5f69bb2ef ut/nvme: clean up mutex and mutexattr
Change-Id: Ia0ef86c281af8abeb311b4f15512ab5762f99095
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382724
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>
2017-10-17 11:34:38 -04:00
Daniel Verkamp
a0287fc0f7 ut/event: add fatal assert for allocation
Change-Id: I77ed68cb07f66511907a44a24fce6263a192cdd9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382723
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>
2017-10-17 11:34:38 -04:00
Shuhei Matsumoto
a07416d8d0 iscsi: delete spdk_iscsi_find_init_grp() function.
the function of spdk_iscsi_find_init_grp() is duplicated with
of spdk_iscsi_init_grp_find_by_tag(). The later one should be kept.
Hence delete former one.

Change-Id: I8d397648bd400550445de49c8a7731f0932f5324
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/381244
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-16 19:27:35 -04:00
Daniel Verkamp
3f9d0fb348 ut/nvme: clean up test_driver.lock in detach test
Change-Id: I1ec1ac16a2a49aa352c48c70408d5a8683972869
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382510
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-16 15:52:14 -04:00
Daniel Verkamp
a0488989e5 ut/lvol: add fatal asserts to check allocations
Change-Id: I270e6aac90f6bca9f5b047fba61f08fea16c6315
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382508
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-16 15:52:14 -04:00
Daniel Verkamp
08eeefc718 ut/lvol: remove use of sprintf()
sprintf() has no bounds checks, and in this case it is actually
overwriting a buffer allocated with spdk_sprintf_alloc(), which isn't
guaranteed to be big enough for the name we want to place in it.

Rather than trying to rewrite the name in place, just free the old one
and allocate a new one.

Change-Id: Ia6ea17c2f0c8e4ed4995946356b8a09ba2a02cbf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382507
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>
2017-10-16 15:52:14 -04:00
Dariusz Stojaczyk
8b0a4a3c53 bdev_virtio: implement multiqueue
Virtqueues now have to be "acquired"
by a logical CPU core in order to
perform any traffic on them. The
acquire mechanism is thread-safe to
prevent two reactors accessing the
same virtqueue at the same time.

For now a single virtqueue
may be used by only one io_channel.
Support for shared virtqueues will
be implemented in future.

Added new param "Queues" to the
virtio config file for VirtioUser
bdevs. VirtioPci will use the
max available queues num -
negotiated during QEMU startup.

Change-Id: I3fd4b9d8c470f26ca9b84838b3c64de6f9e48300
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/377337
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-10-16 15:48:09 -04:00
Tomasz Zawadzki
7aba48fe1e subsystem: move allocation of subsystem_init event to subsystem
Previously two spdk_events were allocated in spdk_app_start().

Now app allocated spdk_event for function to be called after
initialization is complete. Meanwhile subsystem allocates
its own spdk_event.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I4822f76d30cc2f7b95a86a4ffbfc61b80c0a903e
Reviewed-on: https://review.gerrithub.io/382673
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-10-16 15:14:36 -04:00
Tomasz Zawadzki
0473a303e0 ut/lvol: test vbdev_lvs_destruct() with lvol created
Previously vbdev_lvs_destruct() was only tested without lvols
created, so only simpler path was tested.

spdk_lvol_close/destroy() in unit tests now properly finishes
removing lvs and unregistering the device.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5f0f1feee4642aa01554aa0b7781f5cd0e22a4e6
Reviewed-on: https://review.gerrithub.io/382283
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-10-16 13:13:22 -04:00
Tomasz Zawadzki
df45eaecf7 lvol: prevent unloading lvol store when lvols are open
Similar to blobstore unload, lib/lvol assumes that unloading
lvol store is only possible after no lvols on it are open.

Before spdk_lvs_unload() is possible, for each lvol
on that lvol store spdk_lvol_close() or spdk_lvol_destroy()
has to be called.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I86bae67ec322a61fdc0045d799854eecd1f36407
Reviewed-on: https://review.gerrithub.io/382252
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-10-16 13:13:22 -04:00
Seth Howell
072d90ccc8 test/nvme: add app to check value of deallocated blocks
Useful in the case of drives that don't indicate this in their
information.

Change-Id: I128fb613cbc4638b9dcbe234b6bae6d056e48f71
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/379689
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-10-13 18:09:08 -04:00
Dariusz Stojaczyk
201c0188ac bdev_virtio: define virtio devs in separate config sections
This is required for adding
optional params for vdevs.

Since virtio-initiator README.md
had to be changed, some outdated
entries from TODO section has
been removed as a part of this
patch as well.

Change-Id: I472a966d8e4166305fb19ad3ab20e53289a1e071
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382347
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-10-12 19:40:19 -04:00
Maciej Szwed
ee732292d6 lvol: create super blob on lvolstore initialization
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I68a56666d30a550de4a2dc5a66fb669dfbad12dd
Reviewed-on: https://review.gerrithub.io/379659
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-10-12 16:34:54 -04:00
Shuhei Matsumoto
75af8a1081 scsi: add UT code for spdk_scsi_dev_add/delete_port
scsi_dev's port management became a little complex by supporting
delete port operation. Bugs were detected by code review. Hence
UT code were added. Submit UT code to master.

Change-Id: I7449dab9032683311268fcccc20513ee78fc981b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/381913
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-10-12 15:46:14 -04:00
Daniel Verkamp
6f6645e2d8 bdev/malloc: allow user to specify bdev name
The construct_malloc_bdev RPC method now takes an optional "name"
parameter to request a specific name for the created bdev, rather than
using the auto-generated Malloc%d-style name.

scripts/rpc.py is updated to add the new optional parameter, and it uses
-b/--name to match the corresponding parameter to construct_nvme_bdev.

Also update one of the test scripts to use the new parameter to get test
coverage.

Change-Id: I1f5bf76f406b8ea8a709d856f7624a38fbfa0d5f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/381728
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>
2017-10-11 23:55:45 -04:00
Maciej Szwed
e46404f9cb bdev: remove bdev_opened field from spdk_bdev structure
bdev_opened field in spdk_bdev structure is no longer required.


Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ie4a368425b11b1c2e1a3a48b5858857b3935498b
Reviewed-on: https://review.gerrithub.io/381375
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>
2017-10-11 12:13:38 -04:00
Maciej Szwed
6ae7b826ca lvol: claim base bdev on lvol load
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Idd19b8be38a843dfd50710c09d0c6c31773c2f0c
Reviewed-on: https://review.gerrithub.io/380014
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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-10-11 12:13:38 -04:00
Pawel Kaminski
96bd19093b test/vhost: Fio tests for vhost initiator.
Change-Id: Iad11eef12c0f7f80c26264f65a38df798eae1a27
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/378071
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>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-10-11 11:10:13 -04:00
Tomasz Zawadzki
526d759a2d vbdev/unit: destroy bs_dev during unload
If there is no lvol on lvol store in destroy bs_dev in
vbdev unit tests.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5b4783c98bb1b6bba011118f46f708ad0f0fb222
Reviewed-on: https://review.gerrithub.io/382018
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-10-10 16:41:40 -04:00
Daniel Verkamp
61b4258c56 test/nvmf: extend test plan for NVMe-oF target
Change-Id: Ifa6d8cc512942d35aecffd29f5b7e2a85f69f431
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/365065
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2017-10-10 16:27:58 -04:00
Tomasz Zawadzki
48b2eff97d app: spdk_app_fini no longer gives return code
spdk_app_fini() changed to void, as no operation within it
can fail with meaningful return code.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If77cbf745a8e3fcba4ea24411aa1816f3910cde7
Reviewed-on: https://review.gerrithub.io/381537
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-10 10:56:34 -04:00
Dariusz Stojaczyk
29a33dab93 vhost: implemented indirect descriptors
Every descriptor may now contain
a separate descriptor table.

This increases the maximum number
of concurrent IO in a virtqueue
from about (vq->size / 3) to
(vq->size * SPDK_VHOST_IOVS_MAX).

Knowing that SPDK_VHOST_IOVS_MAX
is 128, and assuming that vq->size
is 128 (current hardcoded limit
for QEMU), this gives us over 16k
concurrent possible iovectors
on the fly

Change-Id: I0853d80f6f90d53f8774231972b430a5bf05460e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/373703
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-10-09 14:09:00 -04:00
Dariusz Stojaczyk
024e0e9095 vhost: check against virtio descriptor table overflow
Also squashed function has_next_desc
into get_next_desc to simplify the
code.

We can't just mask indexes with
(desc_table_size - 1), since in
indirect descriptors case
desc_table_size might not be a
power of 2.

Change-Id: I8053b0e37c553548d76c7a9cfe6b4dbc11c28cfc
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/373744
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-10-09 14:09:00 -04:00
GangCao
6368d6c0f5 nvme: add new spdk_nvme_connect() API to directly attach the ctrlr
With this new API, callers can attach one specific ctrlr identified by
the transport ID directly along with optional ctrlr opts. If connecting
to multiple controllers, it is still suggested to use spdk_nvme_probe()
and filter the requested controllers with the probe callback.

Two primary use cases:
1) connecting to the NVMe-oF discovery controller
2) more straightforward way to connect a specific controller (avoiding
the probe callback)

A typical usage of this API with specific ctrlr_opts:
1. struct spdk_nvme_ctrlr_opts user_opts = {}
2. Call spdk_nvme_ctrlr_get_default_ctrlr_opts(&user_opts, sizeof(user_opts))
3. Modify the content of the initialized user_opts with user required value like
   user_opts.num_io_queues = 8
4. Call spdk_nvme_connect(&trid, &user_opts, sizeof(user_opts))

Change-Id: Idf67ee5966f6753918c12604342c892d2f3bbe3a
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/370634
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-10-09 12:31:12 -04:00
GangCao
dc2fb2ed39 nvme: add a public API to rename spdk_nvme_ctrlr_opts_set_defaults
This change is relating to add a new public API spdk_nvme_connect() under
include/spdk/nvme.h. This new spdk_nvme_connect() API will connect the user
specified trid and have a user optional ctlr opts. Rename this API and make
it as public.

A typical usage of this API as following:
1. struct spdk_nvme_ctrlr_opts user_opts = {}
2. Call spdk_nvme_ctrlr_get_default_ctrlr_opts(&user_opts, sizeof(user_opts))
3. Modify the content of the initialized user_opts with user required value like
   user_opts.num_io_queues = 8
4. Call spdk_nvme_connect(&trid, &user_opts, sizeof(user_opts))

Change-Id: Ideec8247365ebf7dd15069e29821be8ea27b08be
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/380849
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-10-09 12:31:12 -04:00
Karol Latecki
f5e27c45da test/lvol: Logical volumes RPC test plan
Change-Id: I48b59deb9d119963961427db75e79609060777b9
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/372290
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>
2017-10-06 17:21:28 -04:00
Daniel Verkamp
5faa855989 ut/lvol: avoid using empty struct
Add a field to the unit test mocked version of struct spdk_blob_store to
avoid having an empty struct.

Fixes build warning with scan-build:

  lvol_ut.c:86:7: warning: Call to 'calloc' has an allocation size of 0
  bytes
          bs = calloc(1, sizeof(*bs));
               ^~~~~~~~~~~~~~~~~~~~~~

Change-Id: If7e48b4cce167ad12f475861bbd6ed4c751febfd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/380816
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>
2017-10-06 17:14:44 -04:00
Shuhei Matsumoto
666dc8af4e iscsi: login poller per portal and portal cache
A few foundational change to support safe removal of portal.
- global login poller -> login poller per portal
- Caching portal data for active connection

Change-Id: I62f4d90c9ac11a433ad47421b2b0c69bfc3c70b7
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/379930
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-10-06 17:00:45 -04:00
Shuhei Matsumoto
0b4a37d86b iscsi: turn the <open/close portal> code into functions
Group the code fragments of open/close portal procedure
and create spdk_iscsi_portal_open/close() function.

Change-Id: Id6e291f3f6e5a926f3ea0d01741a200fa64db81b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/379934
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-10-06 17:00:45 -04:00
Karol Latecki
d348d7e590 test/iscsi: increase number of LUNs in lvol backend test
Possible to create iSCSI target with multiple LUNs via RPC command
after a fix.
Increasing the number of created lvol LUNs for the test.
Also decreasing FIO blocksize and iodepth parameters as more LUNs
will spawn more processes.

Change-Id: Ie3c953d3bff08db612f072aff6920b8624d4d3df
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/381623
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-10-06 16:37:27 -04:00
Daniel Verkamp
36a8f75006 scsi: fix LUN 0 check in scsi_dev_construct
When constructing a SCSI device, LUN 0 must be assigned to some LUN.
However, the current code was assuming that LUN 0 had to be in the first
array element of lun_id_list in spdk_scsi_dev_construct().  Combined
with the scripts/rpc.py implementation that uses a Python (unordered)
dictionary object to generate the lun_ids array, there could be cases
where LUN 0 exists in the list but isn't first.

Fix the check by allowing LUN 0 in any position of the lun_id_list
array.

Change-Id: I39f387ec238fcecca8d2d786d3d42c42a4790637
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/381611
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2017-10-06 16:37:27 -04:00
Karol Latecki
9e1d2b8967 test/vhost: run controllers on different cores in lvol test
Add possibility to attach lvol bdevs to controllers running
on varying CPU cores

Change-Id: I8d9eec854b2d0ee6c3b8863cefe30d24de138d40
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/380441
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-10-06 15:31:58 -04:00
GangCao
3d0f1168ff nvme: add the UT code for get_default_io_qpair_opts
The newly added UT code will exercise the cases that opts_size is
smaller and equal to the current version of spdk_nvme_io_qpair_opts.

This is for the backward compatibilty when SPDK components are built
as the shared library later.

Change-Id: Ic906d765f5b638070e3d9c8e38827577c625b679
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/380893
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-10-06 13:21:54 -04:00
Tomasz Zawadzki
d4dc859947 lvol: Add size info to get_lvol_stores RPC
Currently there is no way to know total space availible on lvol store or
how much is left after creating lvol bdevs.
Four new fields should were added to get_lvol_stores:
- total number of blocks
- number of free blocks left
- block size (currently always 4096, but should be known to user)
- cluster size

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I93dec2d4b2843f0ee51dc9883c8451cf55353f7b
Reviewed-on: https://review.gerrithub.io/381131
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-05 16:49:56 -04:00