Commit Graph

4942 Commits

Author SHA1 Message Date
Daniel Verkamp
0f99e7ab9e nvmf: report that namespaces may be shared
The namespaces exposed by the NVMe-oF target may be attached to multiple
(virtual) controllers at once, so we should indicate this via the
Namespace Multi-path I/O and Namespace Sharing Capabilities (NMIC) field
in the Identify Namespace data.

Change-Id: Iecca80f01577422f73d781c05dcb212db55f7ee1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407834
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-18 12:33:15 -04:00
Dariusz Stojaczyk
0a1a4ce116 virtio: rename ops->get_queue_num callback
It actually returns the size of given queue,
so renamed it to get_queue_size to clean up
the API

Change-Id: I88551116b3dc19644764bba78b58444802a1d443
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408174
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-18 12:32:00 -04:00
Ziye Yang
ec5cf8a221 bdev/iSCSI: Make the connection connect in async mode.
Change-Id: I9d3b56ed908273c6853014241a28237f8d077cfa
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/405537
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-18 12:31:31 -04:00
Dariusz Stojaczyk
3ed915618f io_channel: always set dev->unregister_thread under a mutex
Fixes #278

Change-Id: I5689c3c315feea221335ae4b0218b5e64410a3aa
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408194
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-18 12:29:58 -04:00
Dariusz Stojaczyk
a7aa9d5737 io_channel: ensure io_device is always freed just once
Imagine the following code flow:
1. `spdk_put_io_channel();`
2. `spdk_io_device_unregister();`

Since putting an io_channel is always deferred,
it is likely that spdk_io_device_unregister will
lock the io_channel mutex first. It will set
dev->unregistered flag and then quickly realize
there are still open channels for this device
(refcnt > 0) - so it'll return. All fine here.

However, if the deferred put_io_channel happens to
lock the mutex first from other thread, it will
decrement the refcnt and attempt to free the device.
Both the decrementation and freeing are done under
a mutex, but there is a slight window inbetween
where the mutex is re-locked. spdk_io_device_unregister
is already sleeping on a mutex_lock(), so it might
strike now. It'll see there are no more io_channels
for this device and free the device. Once
put_io_channels regains the lock again, it will attempt
freeing the device for a second time.

This patch removes the slight window mentioned above.

Related to #278

Change-Id: I6c0f6014353529028d658211135196d97f1d8547
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408193
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-18 12:29:58 -04:00
Dariusz Stojaczyk
6c0078300b bdev: defer freeing bdev_io mempool
There might be a couple of mgmt channels still
trying to use the mempool from their destroy
callback (spdk_bdev_mgmt_channel_destroy).

Change-Id: I59247bfa283dc0481923fdd4eaf8e1726e1267ce
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408192
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-18 12:00:16 -04:00
Ben Walker
2e1dbc4587 bdev: Fix race condition when testing whether QoS is enabled
When testing whether QoS is enabled, the code previously
checked mutable values in the bdev itself. Instead, it needs
to check the flag in the channel.

Right now, QoS can only be configured statically when the
bdev is created. This means that no channels will exist
prior to QoS being turned on, which simplifies setting
the per-channel flag (only need to set it when a channel
is created).

Change-Id: I59e56c64c18c262cc2a7f71a6dde8329edb35db7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407354
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-17 21:47:12 -04:00
Ben Walker
d859e3cc8d bdev: Remove implementation assumptions from QoS unit test
This will allow a bit of internal refactoring to occur
without breaking the unit test.

Change-Id: Id7da6b14e9cd4cab5fc4dc004b5858dbbb34bc3a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407366
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
2018-04-17 21:47:12 -04:00
Tomasz Zawadzki
5d94d6d3a5 vpp: add support for vpp comm library
This patch integrates VPP userspace TCP/IP stack,
as optional network framework to be used in SPDK.

Support is done via VPP Communications Library.

Change-Id: I4c2945c76878dbf24ff2f8612e0a21615f7d87e6
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/389566
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-17 20:33:43 -04:00
Daniel Verkamp
0a162815d6 Revert "subsystem.c: make subsystem_remove_ns asynchronous"
This reverts commit 498f9add11.

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

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

Change-Id: I856572c02e6267f708da3a956accbbedae7260fb
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/407012
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-17 18:23:19 -04:00
Pawel Wodkowski
1a6dac405b bdev/virito: add JSON config dump and generic create RPC
The new construct_virtio_dev allow creating virtio SCSI and blk for both
PCI and user transports.

Change-Id: Ibd79c4fb75e3cbd993b46227d86e915c1b740a18
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/405419
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-17 17:16:06 -04:00
Karol Latecki
8ebaed2eb5 test/vhost: live migration test case 3
To be run only manually as test pool does not
have DUTs connected in pairs.

Change-Id: If3ab3e671156b583adb35d5b23ee90003a6de732
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/400988
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-17 17:10:29 -04:00
Tomasz Kulasek
0d1c3aefc3 blobstore: clone-snapshot classification
This patch introduces API to get some blobs capabilites:

bool spdk_blob_is_read_only(struct spdk_blob *blob);
bool spdk_blob_is_thin_provisioned(struct spdk_blob *blob);

to be used in upper level in the unified way.

Change-Id: I4411bb3f4dd0c64826ae16a66141b2911cbaab79
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/405022
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2018-04-17 17:05:53 -04:00
Liang Yan
aa749442cb test/iscsi_tgt: merge the two steps of running fio_remote_nvme.sh
Change-Id: Icb98e4628962591da32d169853d0ff14400e1e50
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/406922
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-17 14:27:25 -04:00
Maciej Szwed
208748b423 lvol: Creating 2 lvols simultaneously with same name
This patch fixes issue where user creates 2 lvols
with the same name simultaneously. New solution
builds list of names of lvols that are currently
being created and when new request comes it compares
name against existing lvols and lvols that are in the
process of creation.

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

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

Change-Id: I5626f7ea979d0db921208355ba23314cf48e971f
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/407910
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-17 13:55:44 -04:00
Pawel Wodkowski
f34fae94fe bdev/lvol: add dump config mock
Change-Id: I0e081b17071bb5d906676c1b509bf8e0fc528b8e
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/407745
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-17 13:30:32 -04:00
Jim Harris
18f3a22b20 test: disable ASLR for multi-process tests
Multi-process tests should work fine using the DPDK
-base-virtaddr parameter.  But we run tests with ASAN
enabled and ASAN instrumentation results in mmap
address hints getting ignored.

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

Reviewed-on: https://review.gerrithub.io/407843
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-17 13:26:24 -04:00
Jim Harris
dba0f6e0a8 test: run pmap on stub process after it starts
This will be a debugging aid to root cause some intermittent
test failures seen due to ASLR in the test pool.

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

Reviewed-on: https://review.gerrithub.io/407842
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-17 13:26:24 -04:00
Pawel Niedzwiecki
876458478c test/vhost: move vhost migration test to nightly tests
Change-Id: Ibaaddcb34bd9a4528cf655a979c9fd91dde99856
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/407791
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2018-04-17 12:20:29 -04:00
Ben Walker
979d9997c9 io_channel: Fix race between put channel and get channel
Previously, there was a period of time where the user
had put the last reference to a channel, but when
calling to get a new channel would end up with the
previously created channel and channel destruction
would never execute.

This causes a number of unexpected issues to pop up,
as often the creation and destruction of a channel
is a key event.

Change-Id: Ie68135f6efdf45093a5a227f8c51cd11b971fcff
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407602
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-17 11:47:09 -04:00
Ben Walker
ade146b966 bdev: Wait for io device to unregister in bdev_part
Change-Id: I6627fd4253094548816c50bd97e13b22dc245df1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407838
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-17 11:47:09 -04:00
Ziye Yang
27d47b9a10 nvmf: make the qpair disconnnect in the right order.
Reason: Initiator sends the qpair deletion in wrong order.
The correct order should be all io qpairs deletion and then
the admin qpair deletion. However, nvme perf does not follow
this since we did not catch ctrlr + c. If we catch ctrlr + c,
we need to use the spdk app framework, or other methods. We should
support this in another patch.

Morever, to prevent the incorrect behavior causing the coredump
of target, we need also consider such case in our NVMe-oF target
design. And this patch, can solve this issue, it will defer the
admin qpair deletion when there are still active io qpairs.

Change-Id: Iec9b88c1d6254f36963c92402ebfe8bd99abaea5
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/407771
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-17 01:58:36 -04:00
Pawel Wodkowski
a3f8876777 vhost: add JSON config dump
Change-Id: If6c9ea6f9959b6c34ef90b8e382ceba9889040ee
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/404373
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-16 19:27:33 -04:00
Seth Howell
e3263286d3 test/nvmf: confirm kernel finds NVMe-oF namespaces
In Fedora 27 the nvme program returns before the kernel has loaded the
namespces associated with the subsystem. This patch ensures that those
namespaces can be enumerated by the kernel before we run any tests on
them.

Change-Id: I77505ed5cd5b1118a841650851fa5ecaf76f5619
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/407829
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-16 19:25:37 -04:00
Ziye Yang
b332897a04 nvmf: add the assert in spdk_nvmf_ctrlr_disconnect
Change-Id: I41c9946e6c30c3eda1abf3669270a9b9533e3a50
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/407612
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-16 19:23:18 -04:00
Pawel Wodkowski
5f6c428dbc bdev/iscsi: initialize g_iscsi_lun_head staticly and make iqn per bdev
Change-Id: I3cdf920a937209fd03cf3998c7927e505504b5f9
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/407767
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-16 19:14:54 -04:00
Jonathan Richardson
ce70f29662 nvme: Remove calls to getpid() when submitting nvme requests
As of glibc version 2.3.4 onwards getpid() is no longer cached. SPDK
makes calls to it in nvme_allocate_request() which is called for each
nvme request received. This results in a system calls up to millions of
times per second which slows down nvme submissions. Since the pid never
changes, it only needs to be called once in initialization per process.
This improves the performance of nvme_allocate_request() signficantly.

Change-Id: Idee0f06484d459906b9ce1d9b7360a33119c7e56
Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-on: https://review.gerrithub.io/407599
Reviewed-by: Scott Branden <sbranden@gmail.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-16 16:19:44 -04:00
Shuhei Matsumoto
e5c5740911 app: Add "NoPci" to command line options
Add "NoPci" to command line options as '-u' to avoid lost of
compatibility when JSON config file is supported.

Change-Id: I8ee429f4f66f8837da22ef8e259a1a011edd9257
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407036
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-16 12:42:15 -04:00
Shuhei Matsumoto
67f2fb6363 app: Fix scan-build errors due to optarg handling
Change-Id: Ia952f0a962ee63d25ac5297498bffb7e70e5204b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407029
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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-16 12:42:15 -04:00
Daniel Verkamp
fa6f7a166d nvme: improve error messages in set_num_qpairs
The functions they were referring to have been renamed; rather than
fixing up the function names, use the spec-defined NVMe command names so
it's more understandable. (The second message was also incorrectly
referring to "set" instead of "get", which is fixed as well.)

Change-Id: Id140a91c837d8c913760d2f55318472689c00f45
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407593
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-16 12:31:26 -04:00
paul luse
a4a497d5b0 bdev: add new optional bdev i/f entry point
Add new optional bdev module interface function, init_complete, to notify bdev modules
when the bdev subsystem initialization is complete. Useful for virtual bdevs that require
notification that the set of initialization examine() calls is complete.

Change-Id: I0997fb5749d430f2fd3a40172ec8a1d5caa96964
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/407222
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-13 17:46:33 -04:00
Ben Walker
bdfeddd3a3 Add strncpy to the list of banned functions
strncpy does not guarantee that the resulting strings
are null terminated, which leads to mistakes. It's
always better to use a function like snprintf instead,
so ban it.

Change-Id: I6ca56103a35df3364a04bdd68937768bc0479235
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407027
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-13 16:15:52 -04:00
Ben Walker
e450a34aa9 check_format: Ignore rte_vhost code in forbidden function check
Also print out line numbers.

Change-Id: I1beb363795d7c8b0d04cb501a2e7169b313134a0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407495
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-13 16:15:52 -04:00
Ben Walker
931b7d1f85 test: Remove all uses of strncpy
strncpy is going to be added to the list of banned functions because
it does not guarantee strings are null terminated.

Change-Id: I73adb5d3eea5c95ea705c67de4fc967e926eb6ce
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407025
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-13 16:15:52 -04:00
Daniel Verkamp
453c804d1b nvme: continue initialization even if NN=0
Similar to the previous patch, some controllers may report 0 namespaces;
we should still be able to send admin commands in this situation.

Change-Id: Ia14e3ce773c63e645199e1c40ba5b37095da2473
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407497
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-13 15:59:00 -04:00
Daniel Verkamp
c9ef7642c9 nvme: make set_num_qpairs failure non-fatal
A controller that fails the Set Features/Get Features - Number of Queues
won't be able to create I/O queues, but it may still accept admin
commands.

Change-Id: Iec79d641f7d460448a8d8e1295764f1f03f98594
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407378
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-13 15:59:00 -04:00
Karol Latecki
c43dc1f1e3 scripts/rpc.py: calculate num_blocks with floor division
If called with python 3 num_blocks will be calculated
as float number with .0 decimal part.
Change to floor division so that is't always int.

Change-Id: Ic0aae404e21a1bdfe7db291532d80d4b4598d307
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/407547
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-13 15:44:46 -04:00
Changpeng Liu
df159388ff examples/fio_plugin: add SGL support for R/W commands
Add an new option to let users choose PRP or SGL for I/O commands,
for SGL, users can append `-enable_sgl=1` when starting fio tests.
PRP is used by default.

Change-Id: Ic28c85c95fdd92d4bbe8a02616686b57e91e7271
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/407251
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
2018-04-13 12:42:49 -04:00
Ziye Yang
31bf5d795e nvme: make timeout function per process
Change-Id: I6e58baaeb09580b5f70e1acf5323376ca0b26bbf
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/407382
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-13 12:30:51 -04:00
Tomasz Kulasek
ebf079362b test/lvol: Snapshot and clone test cases for lvol feature.
Also move snapshot and clone test plan into implementation.

Change-Id: Ifa1f2da651305747ae24c50921deebd0266c5888
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/392371
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-12 19:29:00 -04:00
Pawel Kaminski
9b5fd19225 test/lvol: Praparation for snapshot and clone test cases
Refactor run_fio_test method and create compare_two_disk method.

Change-Id: I0228ad68d2b28057dc64f4f997a93edd90b6a324
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/406697
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-12 19:29:00 -04:00
Tomasz Kulasek
2da6293e85 lvol: add UUID to lvols snapshots and clones
See commit 8887697f8c ("bdev/lvol: add UUID to lvols")

Change-Id: I8b0c2678678588fc9ab85bfcf19fefffc0e26b0c
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/407300
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-12 19:29:00 -04:00
Daniel Verkamp
be0eef0a0d nvmf: check for missing NQN in conf parsing
Avoid dereferencing a NULL pointer if NQN wasn't specified in the
configuration file.

Change-Id: Ie43111fce2c5fcf06bad00af10413a665dfbc45f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407484
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-04-12 17:56:21 -04:00
Dariusz Stojaczyk
6820d312e1 vhost: move memory registration to DPDK thread
Moved it to the DPDK thread, so that we don't stress
SPDK I/O reactors on device start/stop. This is mandatory
if we want to maintain hundreds of simultaneous connections.

This patch also fixes various memory registrations leaks
in cases where further device initiation fails.

Change-Id: I435062108fe96d7e67e2a078a3547acb1f73ad11
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/406960
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-12 16:06:31 -04:00
Ben Walker
aedbb3b81a nvme: Rmove all uses of strncpy
strncpy is going to be added to the list of banned functions because
it does not guarantee strings are null terminated.

Change-Id: Ic18623c281cca7c3d87732bc7677b284d57685c8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407023
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-12 13:45:04 -04:00
Ben Walker
9611db82a3 lvol: Remove all uses of strncpy
strncpy is going to be added to the list of banned functions because
it does not guarantee strings are null terminated.

Change-Id: Iabd65cc703f56e8bc561344893aaeb6dc5f25fb8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407022
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-12 13:45:04 -04:00
Pawel Wodkowski
6ebfbf7351 test/vhost: add live migration test case 2
Change-Id: I114c11d9f7c1e9a5a8c0a989541a41b8747cc125
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/398753
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-12 13:43:18 -04:00
Daniel Verkamp
90922c60df rpc: reword doc comments
Change-Id: I4fa713afbb94ad0d0d61860f1bf9ab361eaa0dde
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407360
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-12 13:31:45 -04:00