Commit Graph

4052 Commits

Author SHA1 Message Date
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
Stephen Bates
5c13f5ae6d setup.sh: Add support for NVMe whitelisting
In some cases we may not want to assign all PCIe NVMe controllers in a
system to SPDK. Add a new input to the setup.sh script called
NVME_WHITELIST which whitelists (via PCIe slot ID) the NVMe
controllers you wish to add to SPDK.

If the NVME_WHITELIST input argument is not defined then all PCIe NVMe
controllers will be added. The values in the whitelist whould be
white-space seperated and the entire list should be enclosed in double
quotes ("").

To blacklist all PCIe NVMe devices use a non-valid PCIe slot ID
(e.g. the string "none" would work very well).

Examples:

NVME_WHITELIST="0000:02:00.0" ./setup.sh
NVME_WHITELIST="0000:08:00.0 0000:06:00.1" ./setup.sh
NVME_WHITELIST="none" ./setup.sh

Change-Id: If6ebb04307180cbac11fc41cd9a70749640bc598
Signed-off-by: Stephen Bates <sbates@raithlin.com>
Reviewed-on: https://review.gerrithub.io/394303
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-17 10:09:44 -05:00
Maciej Szwed
0e91725631 blob: add spdk_bs_batch/sequence_read/readv_bs_dev functions
This prepares for some future blobstore.c code that will use these
bs_dev functions directly making possible to read from different device
than the one in the current context.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I55b15544ea4b53475c4b72ee5c92ff1c0a2b8c88
Reviewed-on: https://review.gerrithub.io/393781
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>
2018-01-17 07:58:57 -05:00
Maciej Szwed
bf2d02b6ef blob: add _spdk_bs_allocate_cluster function
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I35779dc547e0c084086ec6d9bf44f86850cb7f05
Reviewed-on: https://review.gerrithub.io/393780
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-17 07:58:57 -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
Dariusz Stojaczyk
5c0c104b81 virtio: add opaque ctx param to PCI enumerate callback
In current bdev_virtio_scsi PCI enumerate callback
implementation we rely on a global variable - a global
list of virtio devices. We do not need any opaque
context data inside this callback just yet. It will
be required to add virtio devices in runtime. See the
next patch for details.

Change-Id: I116cbd3bd633f56922eedcc7c07b8c0310e51d49
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/394444
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-01-16 19:13:32 -05:00
Dariusz Stojaczyk
5b057b3a05 bdev/virtio/scsi: added RPC to remove vdevs
`rpc.py remove_virtio_scsi_bdev <name>`

The RPC will remove entire Virtio SCSI device together
with all underlying bdevs.

Change-Id: I87f349b0e7543955d54a34406cf73c4a91d1495f
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/394170
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-01-16 19:13:32 -05:00
Dariusz Stojaczyk
5eb213cec7 bdev/virtio/scsi: don't ever allow unregistering the same bdev twice
Consider the following scenario:
 * user deletes a Virtio-SCSI bdev (spdk_bdev_unregister)
 * user deletes entire Virtio-SCSI controller (virtio_scsi_dev_remove)

If there were any descriptors open with asynchronous
remove callback specified, the first bdev unregister
won't delete the bdev and won't notify the Virtio-SCSI
controller in any way. Subsequent Virtio-SCSI controller
deletion might result in unregistering the same bdev
again. This patch makes Virtio-SCSI controller open a
dummy descriptor on each of its bdevs, so that it's
notified of any started bdev_unregister

Change-Id: I9a8c841d08393ef1940c4cebc9dfcb58e9b0ac4a
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/394169
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-01-16 19:13:32 -05:00
Dariusz Stojaczyk
6a9fe9addc nvmf.conf.in: drop Core field description
`Core` field has been removed in patch 7b397f6.

Fixes: 7b397f6281 ("nvmf: No longer tie subsystems to CPU cores")
Change-Id: Iae6f284628ed67b8bd985501dc49ea2c926dcf7d
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/394814
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-16 19:12:54 -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
Xiaodong Liu
bd6de97a0e nbd: improve nbd to handle overlapped I/O
Previous nbd implementation only processes one I/O at a time.
This patch increases spdk_nbd_disk io queue-depth.
lists are added to accommodate and coordinate overplapped nbd_io.

Change-Id: I3bda2c957a561b884ebfe9550b7cb6f3c991aef8
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/392609
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-16 09:59:21 -05:00
Xiaodong Liu
90ef3021bc nbd: refactor nbd io workflow
Apply a state for nbd io instead of using flag
bits like payload_in_progress and resp_in_progress.

Change-Id: I331567f7c4d7a6a886a145390a8b1e4db0f6040c
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/392175
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-16 09:59:21 -05:00
Jim Harris
b5f4a259bd bdev: save mgmt_ch that spdk_bdev_io was allocated from
This avoids having to dereference the spdk_bdev_io's
channel in the spdk_bdev_free_io() path.

Cleaning up after hotplug events should ensure that
all associated bdev_ios have been freed (not just
completed) before the bdev channels have been freed,
but this patch gives us some more wiggle room in this
area.

Results in a small (1-2%) performance degradation on
a bdevperf microbenchmark, but should result in no
noticeable difference on any real world workload.

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

Reviewed-on: https://review.gerrithub.io/394399
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>
2018-01-12 13:27:20 -05:00
Cunyin Chang
cd31a31f03 env_spdk: make sure the Randomaccessfile opened as rocksdb posix env.
Change-Id: I89b1396c8e6dd2cfb521aa442fbc5e7fdc6c6312
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/394461
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-12 12:57:23 -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
0e48ef40df blobfs: return the correct file length.
If the file have cache data and not flushed, the file length will be
not correct.

Change-Id: Idde23e158c1d010e67579b5d6a8d87d3cfbfed2d
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/393784
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 15:50:01 -05:00
Cunyin Chang
cacfeef389 blobfs: only delete the "removed" file when ref count == 0.
Change-Id: I7bbbed5e62715fbbec381ce4226c5273ebef1a0a
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/393729
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 15:50:01 -05:00
Cunyin Chang
ac17ab3da9 blobfs: remove unnecessary opts.
Change-Id: I53c7f242c7c74b47f01568649a0a0e9ab82052ce
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/393716
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 15:50:01 -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
Dariusz Stojaczyk
21ec62533d CHANGELOG: add fio 3.3 support
Change-Id: I650d5cdb6237d1e74edbaa5d80a6c9eaeaa65a7f
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/394382
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-11 15:02:54 -05:00
Cunyin Chang
96e930fc13 iscsi: Fix the potential core dump issue for hotplug test case.
when test hotplug case with large write command which need r2t, after the
device hot removed, the outstanding r2t commands are waitting for data out PDU,
and the primary commands probably already return with error, then the lun
could be deleted, later the related data out PDU will received and try to send
other r2t, this patch make sure the r2t command sent smoothly even the device
hot removed.

Change-Id: I49061d1258e65cb0964526f755d870ebe7095920
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/394321
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 14:37:08 -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
Dariusz Stojaczyk
60c1cd75dc vhost_blk: set proper vring_used_elem->len
This `len` field describes the amount of bytes
*written* by the device. It is used to prevent
the driver from reading buffer memory that wasn't
really written to - it could contain either
leftover values from previous requests or even
be completely unitialized.

In a couple of invalid-request error conditions
we still write the VIRTIO_BLK_S_UNSUPP response while
returning used_len == 0, but that's fine. A properly
written driver will likely handle both of these cases
the same way.

Change-Id: I8e9f3a8051561096e2ee755122d534b4ffd94db1
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/393963
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-11 12:01:53 -05:00
Dariusz Stojaczyk
9605a2eace vhost_scsi: set proper vring_used_elem->len
This `len` field describes the amount of bytes
*written* by the device. It is used to prevent
the driver from reading buffer memory that wasn't
really written to - it could contain either
leftover values from previous requests or even
be completely unitialized.

Change-Id: I67aee5c8b9455fc86cdeb600ea3a051a7737c66f
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/393962
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-11 12:01:53 -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
Daniel Verkamp
77311f59cf changelog: make blobstore API changes a list
Also add parentheses to function names so they will get auto-linked
(once these functions have Doxygen comments).

Change-Id: Iba19bd60dc5ea9d2120234e185a7ca3e6604e177
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393818
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:31:26 -05:00
GangCao
8d61a0a5f6 nvmf: remove the unused thread variable
The thread variable defined in the struct spdk_nvmf_rdma_qpair is
not used. Just remove it.

Change-Id: I5f406ff276733cc9474a997b3c18d23c7420cac8
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/394152
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-11 11:00:11 -05:00
Xiaodong Liu
9802eb0e48 iscsi: remove pointless comparasion
Change-Id: I343d2f1a8f3327ad030a786633bbe9e8c66c14fc
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/394138
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-11 10:58:57 -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
Seth Howell
0a97bd140b json_internal.h: rename to utf.h and place in spdk_internal
Change-Id: I1b1f3a6c10b97c6323e52b58537293f6a6c5c56b
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/394117
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
Dariusz Stojaczyk
9014e913d9 scsi/dev: print an error when cannot find bdev with specified name
When trying to create a scsi dev with inexistent
lun (bdev name), the scsi_dev_construct would
just return a NULL without printing any error.
We should probably return an error code of some
kind, but for now let's just print an extra
message.

Change-Id: I28823c2cb83204c11207d3e7011fecbf725a691c
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/393918
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: Ben Walker <benjamin.walker@intel.com>
2018-01-10 16:19:20 -05:00
Jim Harris
cd55b3886e bdev: change spdk_bdev_io buf_link to STAILQ
This is more efficient and buf_link users don't
need the extra flexibility that TAILQ provides.

link could also be changed to an STAILQ, but its usage
is not in the performance path so not touching that
as part of this commit.

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

Reviewed-on: https://review.gerrithub.io/393834
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
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
Daniel Verkamp
053fbb2300 autotest.sh: run 'setup.sh status' at startup
Record the current state of the system at the beginning of the test run.
This exercises the 'status' functionality of setup.sh, which isn't
tested otherwise.

Change-Id: If5bf3d42fd83c43201fbf5b0b924f5d65711866b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393723
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-09 15:53:21 -05:00
Daniel Verkamp
4393f43fbe setup.sh: fix NVMe status on older kernels
Very old kernels (e.g. 3.13 from Ubuntu 14.04) don't have the nvme
directory in /sys/bus/pci/devices/$bdf/, so check for its existence
before trying to list it.

Change-Id: I1f1ca04c71de6359de2b924fb9437ad03c56523b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/393725
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 15:53:21 -05:00
Ziye Yang
678fe32898 nvmf,rdma: set cm_id = NULL
Purpose: If the qp creates in a failure state,
we should set cm_id = NULL, then we do not need to
destroy the qp which is not created.

Also this patch add return value check while calling
spdk_nvmf_rdma_qpair_initialize.

Change-Id: I084c186738fcf6079cb36666f68e10b906e77145
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/394016
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 15:51:50 -05:00