Commit Graph

1240 Commits

Author SHA1 Message Date
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
Paul Luse
721695e121 blob: fix issue with blobid handling
Fixes github issue #29.

Because of how we handle the blobid and pagenum in blobstore,
it was possible to have blobstore inadvertently open the wrong
blob if open is provided a blobid where the lower 32 bits match
an existing blob but the upper 32 are clear.

Patch does the following:
- removes assert() that caught this on MD load and replace with
an error given that this condition can be induced via the API
- cleanup of pagenum and blobid conversion/handling to make it
clearer how they're related and converted
- new UTs that would have failed w/o the new check in place

Change-Id: I2b49b237922b3b8cfc4df296f5bc20195e41dc41
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/380872
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-05 16:46:47 -04:00
GangCao
6f227249fa nvme: add a new opts_size parameter for default ctrlr opts
Add a new parameter for the default ctrlr opts initialization.
This is to make sure future compatibility when SPDK components
are built as a shared library. User's version and SPDK's version
may be in different size.

The change here is to make sure the backward compatibility when
new fields are added in the struct spdk_nvme_ctrlr_opts.

Change-Id: Icfc9640993cb06063b825d4df5835d920dd374e5
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/380846
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-05 14:51:20 -04:00
Daniel Verkamp
e960eb4733 Revert "test/vhost: lower fio job iodepth"
Now that the bdev layer handles ENOMEM errors internally, we can restore
the original fio queue depths that were reduced to avoid test pool
failures.

This reverts commit 26a40ff914.

Change-Id: Ib7f1bd1e0251f4b2a6370cfd84e2f60e8ee15428
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/380855
Reviewed-by: Changpeng Liu <changpeng.liu@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>
2017-10-02 14:07:34 -04:00
Dariusz Stojaczyk
8323be7df8 vhost: use external event API in get_vhost_controllers RPC call
Added spdk_vhost_call_external_event_foreach.

Continuation of patch I689226c [1]

[1] vhost: added API to call external spdk_events on vdev reactor

Change-Id: I5a404ec9de586d197e84eeda82009a803b4fa623
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/373262
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-02 14:07:04 -04:00
Tomasz Zawadzki
9f6f73d420 lvol: allow to configure cluster size of lvol store
New optional parameter -c or --cluster_sz in construct_lvol_store() RPC,
as well as in vbdev_lvol and lvol lib API.

This parameter allows to configure cluster size of blobstore that lvol store
is build upon.

When this parameter is not specified, default of 1GiB is used.

spdk_lvs_opts struct was created to facilitate any future options when
creating lvol store.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ibfe8765ede3e78ff19c36f46043e4cec2e5c9f97
Reviewed-on: https://review.gerrithub.io/379356
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
2017-10-02 13:45:12 -04:00
Jim Harris
3adb4053af bdev: use spdk_vbdev_unregister when unregistering partitions
Also add a unit test that reproduces the original issue and passes
with the one line fix.

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

Reviewed-on: https://review.gerrithub.io/380703
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-10-01 21:57:00 -04:00
Jim Harris
94bc8cfdba bdev: add ENOMEM handling
At very high queue depths, bdev modules may not have enough
internal resources to track all of the incoming I/O.  For example,
we allocate a finite number of nvme_request objects per allocated
queue pair.  Currently if these resources are exhausted, the
bdev module will return failure (with no indication why) which
gets propagated all the way back to the application.

So instead, add SPDK_BDEV_IO_STATUS_NOMEM to allow bdev modules
to indicate this type of failure.  Also add handling for this
status type in the generic bdev layer, involving queuing these
I/O for later retry after other I/O on the failing channel have
completed.

This does place an expectation on the bdev module that these
internal resources are allocated per io_channel.  Otherwise we
cannot guarantee forward progress solely on reception of
completions.  For example, without this guarantee, a bdev
module could theoretically return ENOMEM even if there were
no I/O oustanding for that io_channel.  nvme, aio, rbd,
virtio and null drivers comply with this expectation already.
malloc only complies though when not using copy offload.

This patch will fix malloc w/ copy engine to at least
return ENOMEM when no copy descriptors are available.  If the
condition above occurs, I/O waiting for resources will get
failed as part of a subsequent reset which matches the
behavior it has today.

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

Reviewed-on: https://review.gerrithub.io/378853
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-10-01 21:57:00 -04:00
Paul Luse
bd5ce60f82 ut/nvme: add coverage for spdk_nvme_probe()
Change-Id: I8662806c462a47ec389c96c5a233cce48cc11944
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/372554
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-09-29 18:45:31 -04:00
Daniel Verkamp
8acc4ae5da nvme: add controller option to specify host ID
A random host ID is generated per SPDK application startup if the user
doesn't specify a host ID during controller startup.

This also changes the default host NQN for NVMe-oF connections to a
random UUID NQN based on the host ID.

Change-Id: Ib0f70dd63e53087716842b412a1f134a9991d4da
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/380528
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-09-29 11:43:25 -04:00
Dariusz Stojaczyk
3595fc5f40 bdev: allow allocating custom-length buffers for bdev_io
This is required for upcoming UNMAP
implementation in bdev_virtio.

While here, also added documentation for
spdk_bdev_io_get_buf().

Change-Id: Ia769ee9b8b132f31208ae66598b29a1c9ed37312
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/379721
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-09-28 17:08:34 -04:00
Dariusz Stojaczyk
d4e19ecc1c vhost: use trylock inside async events body
This makes the async event body non-blocking
and also fixes potential deadlock scenario:
 * call_external_event() enqueues vhost_event
 * destroy_device() locks g_spdk_vhost_mutex
 * destroy_device() enqueues it's vhost_event
 * reactor dequeues events
  * cb from call_external_event is dequeued first
    * g_spdk_vhost_mutex is locked (deadlock)
 * destroy_device() times out, abort()

Change-Id: If8f51ada3ee5c47ba126f74187a40a285c001c77
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/380634
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-09-28 17:05:34 -04:00
Jim Harris
7e846d2bb9 test/bdev: add resource counting to bdev mt unit tests
This is in preparation for ENOMEM handling in the SPDK
bdev layer.

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

Reviewed-on: https://review.gerrithub.io/380512
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-09-28 13:36:23 -04:00
Maciej Szwed
67169cd707 unit/lvol: unit tests for hot remove functionality
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I58c14300b900709b20fed245cb4a9ae8d1677918
Reviewed-on: https://review.gerrithub.io/378577
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2017-09-28 12:46:18 -04:00
Maciej Szwed
4338d3c9a7 blob_bdev: hotremove support
This is in preparation for enabling hot remove of logical volumes when
their underlying blobstore device is hot-removed.


Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I310a3f64f0de5d628609c20a1a3b4d38df0755aa
Reviewed-on: https://review.gerrithub.io/377041
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-09-28 12:46:18 -04:00
Tomasz Zawadzki
b51b8b4f9c lvol: fix incorrect assumption of 1MiB cluster_size
Previously incorrectly it was assumed that cluster size
was always to be 1MiB. For most evident example of this
please see spdk_lvol_create() sz > free_clusters comparison.

This is now fixed and lvol->sz was changed to lvol->cluster_num.
It was done to increase readability - only dealing with
number of clusters when creating or resizing lvol.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If8cdbad18978319e57b6952dbf5a55d56785f108
Reviewed-on: https://review.gerrithub.io/380467
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-09-27 17:27:13 -04:00
Tomasz Zawadzki
3735f2d08e blobstore: verify options passed to spdk_bs_init
Three checks are added to options passed to spdk_bs_init,
with appropriate errors returned:
- whether any of the options is set to 0
- device size has to be bigger than cluster size
- pages reserved for metadata exceed total number of clusters

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Idee3c194b653e737ec7c7a768f1973ff72452c5b
Reviewed-on: https://review.gerrithub.io/379676
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-27 13:18:18 -04:00
Tomasz Zawadzki
9a58c40eba blobstore: always destroy bs_dev during spdk_bs_init()
Now bs_dev is destroyed only in two instances:
- within spdk_bs_init() on failure path
- vbdev_lvs_create() if spdk_lvs_init() errors out,
before even calling spdk_bs_init()

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I7b8af39fbe83907b0c47797f0f55ca3b941729d9
Reviewed-on: https://review.gerrithub.io/379848
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-27 13:18:18 -04:00
Paul Luse
130d278adf blob: defer calling unload callback until dev is destroyed
Fixes condition where blobstore was prematurely calling the
application callback on spdk_bs_unload(), if the application
tries to do something too quickly bad things happen.

To avoid application changes with how the g_devlist_mutex is
held, it is no longer held while calling
_spdk_io_device_attempt_free() because the app unload CB is
called from that function and may want to call
spdk_io_device_unregister() from its unload CB.  So the lock
is now held and releases strictly around the list its
protecting which allows the CB from _spdk_io_device_attempt_free()
to be called without issue.

Change-Id: Ib451cfe6b33ea0c3f9e66c86785316f9d88837c7
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/377872
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-09-26 19:10:28 -04:00
Pawel Niedzwiecki
c63d9de433 rpc/vhost: unify RPC "remove_vhost_controller" for all backends
replaced "remove_vhost_scsi_controller" and "remove_vhost_blk_controller"
with "remove_vhost_controller".

Change-Id: I6f4b180054c13f25aae992e9be50375d3750a376
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/377197
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-09-26 15:35:54 -04:00
Jim Harris
b4ffeaec7a bdev: fail IO submitted while reset in progress
This patch introduces per-channel flags to keep state of information
needed in the primary I/O path.  Setting/clearing of these flags
should only done through an spdk_for_each_channel() call.  Currently
there is only a RESET_IN_PROGRESS flag defined but more may be added
in the future.

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

Reviewed-on: https://review.gerrithub.io/377828
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-09-25 13:56:29 -04:00
Ziye Yang
4fc80cf0cb test/nvmf/host: Add bdevperf test
This testcase will help test on bdev constructed
by remote device exported by NVMe-oF target.

Change-Id: I9a561f43132ab68b9f031702647fa92d6aee156b
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/379224
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-09-22 17:40:22 -04:00
Tomasz Zawadzki
dd9fdb0c55 lvol: remove page_size field from lvol store struct
It does not seem nessecary to include it, when this it used just once
in lvol disk creation.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I42ead55329f0ac7e55bb73702d071f118a5c7931
Reviewed-on: https://review.gerrithub.io/379678
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-09-22 15:53:06 -04:00
Jim Harris
1f935c7a9b bdev: properly handle aborted resets
Previously, we naively assumed that a completed
reset was the reset in progress, and would
unilaterally set reset_in_progres to false.

So change reset_in_progress to a bdev_io pointer
instead.  If this is not NULL, a reset is not in
progress.  Then when a reset completes, we only
set the reset_in_progress pointer to NULL if we
are completing the reset that is in progress.

We also were not aborting queued resets when
destroying a channel so that is fixed here too.

The added unit test covers both fixes above - it will
submit two resets on a different channels, then destroy
the second channel.  This will abort the second reset
and check that the bdev still sees the first reset as in
progress.

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

Reviewed-on: https://review.gerrithub.io/378199
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-22 15:38:44 -04:00
Jim Harris
ab29d2ce5d bdev: improve handling of channel deletion with queued resets
Upper layers are not supposed to put an I/O channel if there
are still I/O outstanding.  This should apply to resets as well.

To better detect this case, do not remove the reset from
the channel's queued_reset list until it is ready to be
submitted to the bdev module.  This ensures:

1) We can detect if a channel is put with a reset outstanding.
2) We do not access freed memory, when the channel is destroyed
   before the reset message can submit the reset I/O.
3) Abort the queued reset if a channel is destroyed.

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

Reviewed-on: https://review.gerrithub.io/378198
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-22 15:38:44 -04:00
Jim Harris
674c709733 test/bdev: add simulated multi-thread unit tests
Use the mock wrappers to override pthread_self(), enabling
the unit tests to switch emulation between different threads
from the context of a single unit test threads.

These tests don't do anything useful yet, but will get
fleshed out more as part of some upcoming changes that
will require some more rigorous testing for multi-thread
scenarios (such as multiple channels).

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

Reviewed-on: https://review.gerrithub.io/377970
Reviewed-by: Paul Luse <paul.e.luse@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-09-22 15:38:44 -04:00
Dariusz Stojaczyk
ad9a842c71 rpc/vhost_scsi: defer remove_scsi_dev RPC response
Defer writing RPC response until after the device has been hotremoved.

Change-Id: I052280b205415e4a2ffa1421653cc49b8e3b1445
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/371119
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-22 14:13:40 -04:00
Dariusz Stojaczyk
f61b71d71a vhost_scsi: implemented vhost device hot-attach
Devices can be added to a SCSI
vhost controller at any time now.

Change-Id: Ic5dd4b78465d3431479e0389b7ea902e1e25c337
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/371281
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-22 14:13:40 -04:00
Dariusz Stojaczyk
4c4492dcc4 vhost_scsi: removed internal eventq events ring
Since we are calling eventq_enqueue only from inside of the controller
reactor, such ring is not needed. Eventq events will now be sent
immediately. This simplifies the whole process greatly.

The abstract vhost event layer is being replaced with much simpler and
less error-prone vhost external spdk_event API.

This reverts commit 542b5415 [1] together with vhost scsi device
hot-attach feature. Hot-attach shall be reintroduced in upcoming
patches.

[1] 542b541588 ("vhost_scsi: implemented abstract vhost event layer")

Change-Id: I39a427332d573c4e0be548d1c8caf0cf2858f6a5
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/371117
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-22 14:13:40 -04:00
Liang Yan
4ac30f9f3c test:move env initialization steps after the parameters parsing
Move the nvme/reset tool's environment initialization steps
after the parameter parsing.

Change-Id: Id7a4302fa85b88b279895453293c701b982914a7
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/379261
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-21 14:07:17 -04:00
Changpeng Liu
8181c59293 nvme: override the default queue depth if users specified the value
SPDK already uses DEFAULT_IO_QUEUE_SIZE and MQES to decide the correct
queue depth of NVMe queue pair, hardcoded it to NVME_IO_ENTRIES(512)
does not make sense if users want to set queue depth bigger than 512.

Change-Id: Iaa73fc79e055292ae9bd19af0c8c12f257ae5c46
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/379052
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-20 19:58:49 -04:00
Cunyin Chang
29bcd5a90d blob: Add support for crc of super block.
Change-Id: I424833a0af6e5e8265c03c168b9dfdbae1a49cd8
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/378233
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: Jim Harris <james.r.harris@intel.com>
2017-09-20 19:56:57 -04:00
Seth Howell
70684937b7 test/blobfs: add timing for rocksdb benchmarks
Change-Id: Ibcbb75671e3526076d31f6dc53da490f3c0e6d3e
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/378830
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-09-20 19:33:50 -04:00
Jim Harris
f7eb7d6434 util: fail io_device unregister if foreach operations outstanding
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic102dd4a352d3f796a4a46e4703bedefe014101f

Reviewed-on: https://review.gerrithub.io/378228
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@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-09-20 19:27:06 -04:00
Jim Harris
93cfe874b2 lib/util: handle channel being removed during spdk_for_each_channel
A channel may have been deleted between when a message was sent to
a thread and when it gets executed on that thread.  So we must look
for the channel when the messages gets executed - if it's not found,
just continue to the next thread(s).

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

Reviewed-on: https://review.gerrithub.io/378002
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>
2017-09-20 19:27:06 -04:00
Jim Harris
32a87ed9e3 test: add framework for simulating multithreading in unit tests
Use the mock wrappers to override pthread_self(), enabling the
unit tests to switch emulation between different threads
from the context of a single unit test thread.

Add this into the io_channel unit tests with some very basic
testing of allocating and freeing multiple threads.

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

Reviewed-on: https://review.gerrithub.io/377992
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-09-20 19:27:06 -04:00
Jim Harris
372df452a4 test: flesh out test_env implementation for mempools
Some modules rely on accurate memory buffer counts.
For example, bdev checks that all of its buffer pools
are back to original capacity during spdk_bdev_finish().

So flesh out the mempool implementation in test_env.c
to keep accurate counts of the number of buffers "available"
in the test mempool.  Note that test_env is only designed
for unit tests, so this functionality is not multi-thread
safe.

Still allow for NULL mempool pointers and just default
to old behavior in that case - some unit tests such as
the blobfs cache tree tests still rely on that behavior.

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

Reviewed-on: https://review.gerrithub.io/377969
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-09-20 19:27:06 -04:00
Karol Latecki
6264dfa956 test/iscsi: Add iscsi_tgt with lvol backend test
Test using multiple iscsi target nodes with LUNs backed by
logical volume bdevs

Change-Id: If87ed19dbef84fdc79d5758e063fc11d047e790e
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/378034
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-20 19:03:34 -04:00
Maciej Szwed
c783caabc7 bdev: remove bdev_opened_for_write restriction
This restriction causes bdevs examination/discovery to fail
when there are asynchronous operations. We should remove this
limitation for now. Future plan is to implement approach
similar to the one that is present in kernel.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ibe5572297672022412d25a4a835dc9527ce97f3e
Reviewed-on: https://review.gerrithub.io/378758
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-20 14:43:32 -04:00
Karol Latecki
564524a7dd test/nvmf: Add nvmf with lvol integrity test
Test for veryfing correct interoperability of nvmf with
use of lvol store / lvol bdev backends.

Also added initial test plan in which test is described.

Change-Id: Ided093091847dff2bca76063926798d5606d73bd
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/377529
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-20 14:21:45 -04:00
Tomasz Zawadzki
c0e6ecaa0b test/vhost: add vhost with lvol backends test
Script for testing vhost using lvols as backends for
virtual machines. Option for using nested lvol stores and
nested lvol bdevs also provided.

Change-Id: Iad8a196c97f292881a8b424b4433ec281f12aec6
Signed-off-by: Lukasz <lukaszx.galka@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/365798
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-20 12:53:28 -04:00
Daniel Verkamp
8011d8c0e6 nvmf: don't allow 0xFFFFFFFF as a NSID
FFFFFFFFh is reserved for the broadcast NSID and can't be used as a
NSID for a specific namespace.

Change-Id: I64a3cc80993d7b34324823462f4d992d1415773f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/378849
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-09-19 17:16:59 -04:00
Seth Howell
9290e0bcf7 test/blobfs: consolidate run_tests.sh into rocksdb.sh
move the main portion of run_tests.sh into rocksdb.sh to simplify
rocksdb testing and allow for the provision of more granular timing
coverage.
Change-Id: I60649394c496a347f4dca948d1d499ad8578c4a0
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/378827
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-19 17:16:05 -04:00
Jim Harris
76774528be test/bdev: initialize descriptor array in open_write_test
A later patch in this series fails the test pool because
scan-build says we might be using garbage for one of the
descriptor pointer comparisons.  That later patch does not
touch this unit test file at all, and the bdev-related changes
do not touch the code path used around the bug report.  But
the report is valid - it's possible that with the additional
bdev.c changes that scan-build's ability to detect this
bug changed for the better.

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

Reviewed-on: https://review.gerrithub.io/378825
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-09-19 17:15:15 -04:00
Daniel Verkamp
5323a02613 nvmf: move fabrics command processing to ctrlr.c
This is the final set of command processing functions (admin and I/O
commands were already handled in ctrlr.c), and it allows us to clean up
the ctrlr.c API some more.

Change-Id: Ic73c56c44d7fd64bfaa72b6f5f6f0984b4dfa053
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/378018
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-19 17:14:52 -04:00
Daniel Verkamp
4ff0eba871 nvmf: merge connect handling into single function
Combine nvmf_process_connect() into spdk_nvmf_ctrlr_connect() to
simplify the logic and keep it all together in one function.

This also allows us to move the invalid connect helper function and
macros back out of the header into a static function in one file.

Change-Id: Ia3bd80d0309392520d51bf8f5830d3f23332c5e3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/378016
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-19 17:14:52 -04:00
Daniel Verkamp
f4a4ddd8a1 nvmf: add subsystem ctrlr management functions
This moves the subsystem->ctrlrs list management fully into the
subsystem code, which will help simplify thread safety considerations
once we start adding locks.

Change-Id: Ibc118923f1bd520f1e524cde5d45ccfcc69aee1e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376025
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-19 17:14:52 -04:00
Ben Walker
21ea290192 nvmf: cntlid is now only unique within a subsystem
Previously we made cntlid globally unique as part of
a strategy for scaling connections that never panned
out. Now, we have a new strategy and don't need cntlid
to be globally unique, so relax the restrictions
and simplify the code.

Change-Id: I167772f5e7d37183715bf9967b0102529144bb2b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/376250
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-19 17:14:52 -04:00
Cunyin Chang
13ecee44a4 blob: Add support for crc of metadata pages.
This patch add support crc for metadata pages, we will also
add crc for supper block, used md and used clusters bitmask
pages in the following patches.

Change-Id: Ie36fcc16b39296d06721f1f8eb5689260194c558
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/377901
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-09-15 17:13:14 -04:00
Cunyin Chang
2d18887fbd blobfs: Make the behaviour of "delete file" as unlink.
Mark the file as deleted in the function spdk_fs_delete_file()
when the referance is not 0, and delete the file when it is closed,
make the behaviour as "unlink".

Change-Id: Ia934bb73c82c48fdbab79dbe4b56296a73abc01e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/374944
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-09-15 17:13:14 -04:00
Dariusz Stojaczyk
a8599cd4f0 vhost: sync controller creation with g_spdk_vhost_mutex
Controller creation RPC can't be done on controller's reactor
(as there's obviously no controller yet...), so a special
set of vhost_mutex_lock/unlock() functions to has been added
to synchronise controller creation with the rest of
ctrlr-enumerating code.

Change-Id: Ib6e4b894a85ff1f70ebd047832c5a3568a00f1a7
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/377651
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-15 14:18:46 -04:00
Dariusz Stojaczyk
1fc1068049 vhost_scsi: vhost_scsi_dev_add_dev now takes vhost_dev param
Continuation of patch 94afad5a [1].
That function could be called from outside of the vhost reactor,
causing data races and possible segfaults.

Now, after this patch, all ctrlr-changing functions take spdk_vhost_dev
parameter, meaning they should be called via external event API [1],
which soon will be the only way of obtaining spdk_vhost_dev pointer.

[1] 94afad5a ("vhost: added external API to call spdk_events on vdev reactor")

Change-Id: I40ea66ad09fb5c433dd897a4e22aedeb423f9b4b
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/371013
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-09-15 14:18:46 -04:00
Dariusz Stojaczyk
2670503d46 vhost: readded return codes for dpdk callbacks
Added spdk_vhost_dev_backend_event_done function
that sets the return code for the callback and
transparently calls sem_post.

Change-Id: Iba27af780cd1753056c1607177c945e13c95c712
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/377585
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-09-15 14:18:46 -04:00
Tomasz Zawadzki
27f44662ac lvol: Logical volume implementation
Change-Id: Ia96ae78ff9530d953181ac5f7255a38f3c8ec430
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Reviewed-on: https://review.gerrithub.io/375392
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-09-14 19:30:54 -04:00
Daniel Verkamp
0caab4e1da nvmf: add Write Zeroes support
Change-Id: I743f5e4d1c24ad5ef9f1fef4c2678e347b179a9f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/377260
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-14 17:41:52 -04:00
Daniel Verkamp
5eb129647d nvmf/bdev: refactor read/write into separate funcs
This makes it easier to unit test the individual functions and also
easier to follow the logic.

These helpers will also be used in the upcoming Write Zeroes function.

Also cleans up the variable names to be consistent with the rest of the
code.

Change-Id: I69847b6a052fb7baff058ed8e5b79904ddf2ec6d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/377259
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-14 17:41:52 -04:00
Tomasz Zawadzki
5f6306ea24 bdev/gpt: free base bdev_part in gpt after examining
Currently GPT keeps the bdev it is examining open, even after determining there is no GPT on it.
It is due to spdk_gpt_base_free() not notifying bdev layer to free base bdev_part.

Additionally release of bdev module for that bdev was moved to bdev_part_free,
as the module is not claimed until bdev_part on base bdev are created.

Functional tests added to verify the changes.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Id75f88259267847e8ec476d19750dc1e2690f11a
Reviewed-on: https://review.gerrithub.io/378621
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-09-14 13:39:29 -04:00
Dariusz Stojaczyk
6d1bcaafbb test/bdevio: support 4kb blocksize
bdevio used to do I/O at hardcoded offset 2048.
This obviously fails for any blocksize > 2048.
All 2048 offsets has been changed to 8192.

Change-Id: I70c057b8de539718175a8d29aa91422ba3fba70e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/378298
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-09-14 12:29:50 -04:00
Daniel Verkamp
4454df7006 blobfs/fuse: remove -ldl from linker args
This is already included in ENV_LINKER_ARGS when necessary.

Fixes GitHub issue #193 (Compile error for fuse.c on FreeBSD).

Change-Id: I30fce30b709d73c2c01b6782a9b1f3c39d823d42
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/378210
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-13 15:35:57 -04:00
Daniel Verkamp
34e3bf9c86 test: move subsystem_ut to unit test directory
Change-Id: I22c4273812922e1a2f7bb7ec0d3e8353e74780a3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/377822
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-12 21:00:07 -04:00
Young Tack Jin
ef1437b313 nvme: support meta data on vendor specific commands
spdk_nvme_ctrlr_cmd_io_raw_with_md() will be verified
on Cosmos+ OpenSSD as soon as it will support meta data.

Change-Id: Ib5f3f1f1eba66d0147a566804395bfa5ec959c2f
Signed-off-by: Young Tack Jin <youngtack.jin@circuitblvd.com>
Reviewed-on: https://review.gerrithub.io/377428
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-09-12 16:14:11 -04:00
Jim Harris
0491b3cbc6 bdevperf: use blocks API
This is a better performing API since it avoids
unnecessary bytes-to-blocks conversions.

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

Reviewed-on: https://review.gerrithub.io/377798
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-12 11:16:50 -04:00
Jim Harris
85cc223946 bdev: add common partition helper functions
split, gpt and error all have a lot of similar code, and
are based on the presumption of one or more "partition" bdevs
on a "base" bdev.  This results in quite a bit of duplicated
code between these three bdev modules.  The error bdev
module does follow this same model - it just always has only
a one-to-one mapping between the error bdev and its base bdev.

As all of the modules move to allocating their own bdev_io
rather than allowing for adjusting an existing bdev_io and
resubmitting it, there will be even more duplicated code
between these modules.

So this patch adds a set of helper functions in the common
bdev library to eliminate all of this duplicated code.

This patch also moves the split module to use it - future
patches will also convert gpt and error.

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

Reviewed-on: https://review.gerrithub.io/376423
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-12 11:16:50 -04:00
Cunyin Chang
e87808c4fb blobstore: sync super block after set the "clean" as 0.
The system could crash anytime, we need sync the "clean" flag
into disk as soon as we load the blobstore. Then if the system crashed,
we will find the blobstore is not clean shutdown next time when we load
the blobstore, and we could run the recover process then.

Change-Id: I6189678e970ffe979a224e02be6cede0ee44dde8
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/376276
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>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2017-09-11 15:44:38 -04:00
Karol Latecki
26a40ff914 test/vhost: lower fio job iodepth
Temporarily lower iodepth to avoid random test pool
failures while running vhost blk fio tests.

Reenable old iodepth value once 'too high' vhost blk performance
is solved.

Change-Id: I385ff3151b4433b331807be6ce0f3103980bae7c
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/377697
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-08 17:16:54 -04:00
Jim Harris
018e488cbc test/vhost: disable scsi resets
This is still causing a lot of random failures in the test
pool.  Disable this for now.  There are a series of patches
coming up which will improve reset handling significantly -
let's wait to re-enable this until that is in place.

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

Reviewed-on: https://review.gerrithub.io/375651
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-07 17:52:18 -04:00
Dariusz Stojaczyk
e28f3397c5 vhost: added spdk_vhost_event_fn
The next step towards fixing synchronization issues between RPC and
vhost controller reactor.

This patch makes changes to already present vhost timed event API
to conform it to the upcoming external spdk_events API. The timed_event
API shall be removed from headers in future. See next patch for details.

Change-Id: I31b0d7c383b39c32326daa750663ebdeb4edd562
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/377584
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-09-07 14:34:01 -04:00
Pawel Niedzwiecki
3dfd4a7c71 ut/vhost: add UT coverage for vhost_blk.c
Change-Id: I933baf8294926eae63bc7392c51e4b24e6173def
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/376651
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-09-06 18:14:15 -04:00
Paul Luse
9b99f2c0f3 log: add new parm to spdk_trace_dump()
Allows called to specify something other than stderr such as
stdout. Existing callers updated to use stderr.

Change-Id: I48a703e1474a45952878121a83c19fef1c43d630
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/377420
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-06 17:33:03 -04:00
Daniel Verkamp
1578b5b59b nvmf: convert to bdev _blocks APIs
Change-Id: I46dea98bf762967d49867e428f8ce6b3ec881072
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376257
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-06 17:19:26 -04:00
Daniel Verkamp
e83f976743 bdev: introduce APIs with block units
Add new versions of all of the I/O calls that take parameters in blocks
instead of bytes.  These are intended to replace the old APIs, but
we'll keep them for now to preserve compatibility.

Change-Id: I85ab665c653e8c697016c628837d49aa0c3bfcd0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376255
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-09-06 13:01:13 -04:00
Daniel Verkamp
7987a7b243 ut/vhost_scsi: fix formatting
Caught by astyle 3.0.

Change-Id: Ie175f354526fbae01513e47228eb7dad249c081a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/377248
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-05 19:07:45 -04:00
Daniel Verkamp
75574cb898 ut/vhost_scsi: fix build
This new vhost_scsi_ut code was merged after changes to the vhost
timed_event functions and didn't get rebased correctly.

Change-Id: Ia92936a19a668a0f1113518097b20b818f39986c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/377246
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-05 18:42:03 -04:00
Pawel Niedzwiecki
b6653164c9 ut/vhost: add UT coverage for vhost_scsi.c
Change-Id: I7616613eac6a6b8047f8d505018cc3887adb4fcb
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/375943
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: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-05 17:58:25 -04:00
Lukasz Galka
3d738d4569 test/vhost: move fiotest functions to common directory
Move files from test/vhost/fiotest to test/vhost/common.
Scripts and functions from fio tests will be re-used in
any new test scripts.

Change-Id: I2423d636d41dcb2b2af12987769961607e969392
Signed-off-by: Lukasz Galka <lukaszx.galka@intel.com>
Reviewed-on: https://review.gerrithub.io/372545
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-05 13:54:47 -04:00
Daniel Verkamp
a2db49a121 nvmf: add AllowAnyHost option to subsystems
The previous behavior with an empty host NQN whitelist was to allow any
host to connect.

Change-Id: I5401e52d96642cf20afe0d50c692613e67262edf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376432
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-09-05 13:03:09 -04:00
Dariusz Stojaczyk
63af5ff13b test/bdev: cleaned up / added local run_fio function
Change-Id: I7aa80792bf6d14ff8beb104bfe967482316e8c28
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/376097
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-09-05 11:29:19 -04:00
Ben Walker
3e084a34e1 env: Automatically register new memory with the IOMMU
If the IOMMU is enabled, automatically register memory
added by the user through spdk_mem_register().

Change-Id: Ie02c7bf445314da23e2efee9de9c187ed0773a9f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/375249
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-09-01 15:25:24 -04:00
Ben Walker
01bed940fe env: Remove old translation reference counting
Memory is now reference counted at a higher level.

Change-Id: I61b24db7b92a129686775eddbff3a48814c842fe
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/375644
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-09-01 15:25:24 -04:00
Ben Walker
3f09f0f98a env: Add unit tests for memory module
Change-Id: Iad372db86857ce92145388279e5095b17efe3983
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/375829
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-09-01 15:25:24 -04:00
Daniel Verkamp
d3828a23ec scsi: remove LUN I/O channel ref counting
spdk_bdev_get_io_channel() already handles this.

Change-Id: I6b28fe10b86b00762ff15324fcd0a32aae94e012
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376267
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: Changpeng Liu <changpeng.liu@intel.com>
2017-09-01 12:46:43 -04:00
Daniel Verkamp
f9958316d8 ut/scsi/lun: clean up old stubs, simplify
The SCSI LUN unit test was still stubbing spdk_spdk_get_task(), which
doesn't exist anymore.  Replace it with a unit test helper function to
initialize a task, and remove the unnecessary heap allocation by putting
the tasks on the stack.

While we're here, clarify which tests should result in the task
completion function getting called by removing the (unnecessary)
spdk_scsi_task_put() calls.

Change-Id: If2b7983a66611131e6a1547dbfed2ad869bdb6e8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376266
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-09-01 12:46:43 -04:00
Ben Walker
7c6ca97834 nvmf: Move all struct definitions to nvmf_internal.h
This is not a public API, so simplify the number
of internal header files where important types
are defined.

Change-Id: I115d0497d37e3cfe399c3a5b2546d20aa4fe24b4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/376249
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-09-01 12:43:26 -04:00
Ben Walker
c1535ca0af nvmf: Poll groups can now span transports
We are still creating one poll group per controller,
so this isn't particularly useful just yet.

Change-Id: I65c54385bdba587d4b1098629727877970d39277
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/376241
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-09-01 12:43:26 -04:00
Daniel Verkamp
376c0de84d ut/nvme: restore spdk_memzone_lookup mock value
Make sure the global spdk_memzone_lookup mock variable is set back to
NULL rather than pointing at dummy, which is a local variable.

Change-Id: I2c2d478fb5fd8cbb96983d7005e788cd88fe642f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376684
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-31 19:18:40 -04:00
Karol Latecki
bab64051de test/vhost: update filesystem integrity test
Updates for running with vhost-blk.
Removed checking & cloning Qemu sources - should be
already installed in working directory.
Some other minor fixes for typos.

Change-Id: Ifd790a301c8ca1e19434f03ba32f5eb916dbe0a6
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/373897
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-31 19:02:50 -04:00
Pawel Niedzwiecki
ced09e3eb6 ut/vhost: add UT coverage for vhost.c
Change-Id: Ie62f7684d64736fa393aaaddfc4a3232c6423c62
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/375077
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-31 12:31:28 -04:00
Pawel Niedzwiecki
9fdc10fc56 vhost: improve app vhost.c test coverage
Change-Id: I5e19d7ff6cc38e08fa4d7aebd5cc2a9c74fd5175
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/370952
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-31 12:30:51 -04:00
Ben Walker
7b3c6fbd40 nvmf: Remove connect/disconnect_cb from subsystems
The requests are now sent using spdk_thread_send_msg
internally, so the user no longer needs to supply
these callbacks.

Change-Id: I84b0f5f0f1f6fa6eaf9a717934925d3ad802fcfd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/376240
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-30 15:07:22 -04:00
Ben Walker
d5ce9cff63 nvmf: Transport polling now done by poll group
Instead of polling each individual qpair, polling is now
done by poll group. This allows transports to use more
efficient polling schemes in the future.

The RDMA transport as of this patch still just loops
over each qpair in the group and polls it individually,
so this patch results in no performance change yet.

Change-Id: I0f63f0dbbc5fd43c1e0d9729b10b37c2cb0d9881
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/376239
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-08-30 15:07:22 -04:00
Ben Walker
3c3c9da4ea nvmf: Remove g_nvmf_tgt
It isn't referenced directly anywhere but the unit tests, so
now we can remove it entirely.

Change-Id: I92bbf0e15ecffe2fbbdf5eecc29b6ef0e2fd5baf
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/375462
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-08-30 15:07:22 -04:00
Daniel Verkamp
932a186b4c log: remove uses of SPDK_TRACE_DEBUG
Replace SPDK_TRACE_DEBUG with component-specific flags.

Change-Id: Iee7eafab5e6ac8713f247323a18552b5afb0e86a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/375834
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-29 15:07:13 -04:00
Ben Walker
6428de9e34 nvmf: Remove spdk_nvmf_listen_addr
Everywhere this is used, we can just use
spdk_nvme_transport_id instead.

Change-Id: I407c812cd6a1ca3afcb3d1fe87c7e22183b09d7a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/375461
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-08-29 14:59:33 -04:00
Ben Walker
ff4f68a55f nvmf: Rename spdk_nvmf_ctrlr_gent_cntlid to spdk_nvmf_tgt_gen_cntlid
Also, move it to the appropriate compilation unit. Further,
remove use of g_nvmf_tgt.

Shift the function to a new compilation unit as well.

Change-Id: I1a43ff366532b450f00aed54a290fb9eed9bf453
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/375455
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-08-29 14:59:33 -04:00
Daniel Verkamp
d92f0f75ca log: rename SPDK_TRACELOG to SPDK_DEBUGLOG
This matches the name to the behavior and prepares for addition of a new
log macro for "info" log level.

Change-Id: I94ccd49face4309d3368e399528776ab140748c4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/375833
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-29 13:25:58 -04:00
Daniel Verkamp
47182bd7c9 io_channel: allow user to provide a thread name
This moves the thread name setting code into the generic SPDK thread
setup code, so now all spdk_threads can be named, not just ones created
by the event framework.

Change-Id: I6c824cf4bcf12fe64a8e2fc7cdc2d6c949021e40
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/375220
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-29 13:11:08 -04:00
Daniel Verkamp
02f088bb95 nvmf: dynamically allocate ns array
This allows the user to configure an arbitrarily large number of
namespaces instead of the current hard-coded limit of 16.

Change-Id: I3a29b0de10eafd682b12c54e12411d1f9d41ce85
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/375636
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-29 12:35:35 -04:00
Daniel Verkamp
8f10b6b875 ut/blob: add fatal asserts for allocations
Change-Id: I9b1c8a1be8e6bce705ba6c549957e82e492038cc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/375623
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-28 13:54:09 -04:00
Daniel Verkamp
34f66f237c ut/nvme: add fatal asserts before dereferencing pointers
Make sure that req returned from the request allocation functions isn't
NULL before starting to check its fields.

Change-Id: I21869834148200f4bfd5065ebbc874041c559599
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/375618
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-28 13:53:54 -04:00
Pawel Kaminski
c08ac18f28 test/vhost: Change VM core mask for multiqueue integrity test
Change-Id: Icdd37efd2110739cbde899a4d2ab427ab68dcbca
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/371111
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-08-24 10:14:12 -04:00
Paul Luse
5b4fbce2c7 ut/nvme: add coverage for nvme_init_controllers()
Change-Id: Icfd37861ececa4568a377f3312d879797d7d5c8a
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/372552
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-08-23 13:51:36 -04:00
Paul Luse
b9f0ad28ec ut/nvme: add coverage for nvme_driver_init() & new mock macro
Change-Id: I1d62e34deed873446a9a87f16188b5c8ed21aea5
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/372551
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-08-23 13:51:36 -04:00
Paul Luse
85e26192d8 ut/nvme: add coverage for spdk_nvme_detach()
Change-Id: I222b0483d6b2b804ece87f2d2694f07770c885c5
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/372549
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-08-23 13:51:36 -04:00
Paul Luse
56799c8d9b ut/nvme: add unit test for test_nvme_completion_poll_cb()
Change-Id: Ib848a58821d17b76195af2074613216c03734392
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/372548
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-08-23 13:51:36 -04:00
Paul Luse
b85529572b ut/nvme: add UT coverage for nvme_user_copy_cmd_complete()
Change-Id: I8bb02911444094853d8b7e6f6716d8c3ce72e92d
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/372547
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-08-23 13:51:36 -04:00
Paul Luse
84b2933ff5 ut/nvme: add coverage for nvme_allocate_request_null()
Change-Id: I39757052a7458ff1520b2cc13face2db1fafbf75
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/372542
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-23 13:51:36 -04:00
Paul Luse
198c373264 ut/nvme: add UT coverage for nvme_allocate_request()
Change-Id: I2c871d583b7e43bd5f904f6603333923deaf4fd9
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/372541
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-08-23 13:51:36 -04:00
Konstantin Vyshetsky
305088e594 nvme: Obtain number of queues controller allocated via "Get Features/Number of Queues"
Certain vendors do not report correct number of queues allocated in "Set Features/Number of Queues" completion CDW0 per spec.
As a work around, issue "Get Features/Number of Queues" and rely on the value provided there.

Change-Id: Ib9cc4dcf1bdb732413becc751883a7311c6f672f
Signed-off-by: Konstantin Vyshetsky <kon.vyshetsky@stellus.com>
Reviewed-on: https://review.gerrithub.io/375234
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-23 12:14:43 -04:00
Piotr Pelplinski
51c223729d blobstore,ut: add possibility to delay scheduled tasks
Adding ability to delay scheduled tasks until _bs_flush_scheduler is called.
This allows to test blobstore when tasks do not finish immediately.

New unit test added for spdk_bs_unload.

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9c1b3c0c2ebb1e16c032fd136d11ef351d8f3fe0
Reviewed-on: https://review.gerrithub.io/374767
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-08-23 11:19:03 -04:00
Tomasz Zawadzki
70eff4fbb0 blobstore,ut: explicitly allocate spdk_bs_dev
Explicitly allocating spdk_bs_dev on init_dev() allows to check if dev_destroy for it was called.
If it was not, then ASAN will provide information on that.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I333185958dd8c29180954077a6c326b82e5949ae
Reviewed-on: https://review.gerrithub.io/374766
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-08-23 11:19:03 -04:00
Ben Walker
f1015fbda6 nvmf: ctrlr_discovery.c no longer uses g_nvmf_tgt
Change-Id: I19d1866fb90ffd3e3543ccc66a098571ade3e3de
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/375203
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-08-23 11:06:47 -04:00
Ben Walker
656e443dd1 nvmf: spdk_nvmf_tgt_listen now takes a target parameter
Also, move the implementation into the appropriate
compilation unit.

Change-Id: Ie1c56bc5e077b81d744414716f9267ceaf591e49
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/375034
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-08-23 11:06:47 -04:00
Ben Walker
70bc390c82 nvmf: spdk_nvmf_find_subsystem now takes a tgt parameter
The user can now specify which target they want to
search for the subsystem. Also, change the name to
spdk_nvmf_tgt_find_subsystem and put it in the correct
compilation unit.

Change-Id: I7c085959814c14d8400a0ba2572103b0814a4d0e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/374879
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-08-23 11:06:47 -04:00
Ben Walker
4addb5c899 nvmf: spdk_nvmf_tgt_create_subsystem takes a tgt parameter
The user can now specify which target to create the subsystem
on.

Change-Id: I6206c0d762d59ff6312cb58d36180281baaa7266
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/374878
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-08-23 11:06:47 -04:00
Jim Harris
179ed697b3 blob: add readv/writev support
Most of the work here revolves around having to split
an I/O that spans a cluster boundary.  In this case
we need to allocate a separate iov array, and then
issue each sub-I/O serially, copying the relevant
subset of the original iov array.

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

Reviewed-on: https://review.gerrithub.io/374880
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-08-22 18:19:00 -04:00
Paul Luse
a5014efc2b blob: add check for supported underlying dev block lengths
Fail spdk_bs_init() if the dev being used has an
LBA size that is larger than a metadata page or not evenly
divisible by the size of a metadata page.

Change-Id: I0e0ca747ecd5b6039c20fb6a885382bde4527158
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/374182
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-22 17:17:07 -04:00
Pawel Niedzwiecki
00380d62d9 vhost: improve test coverage
-Added creating controllers in vhost.conf

Change-Id: I8b995904c93d5252644d8ff44bb82e669ea4c88c
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/372491
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-08-22 11:29:26 -04:00
Jim Harris
76bbc020e6 bdevperf: correctly map targets to cores
Previously this only worked if bdevperf was set to
run on a contiguous set of cores starting at 0.

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

Reviewed-on: https://review.gerrithub.io/374536
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-08-18 18:57:21 -04:00
Daniel Verkamp
14451d76fe nvmf: encapsulate namespace data into a struct
Add a new struct spdk_nvmf_ns to hold namespace information, and add
accessor functions so that it can be moved out of the public API in
future patches.

Change-Id: Id926aaa3cc279649057afc65e08024628edbc435
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/374740
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-18 17:50:58 -04:00
Daniel Verkamp
5b4b66bab9 nvmf: move admin processing to ctrlr.c
Now that the discovery controller is using the common admin command
functions, move all of them into the common ctrlr.c file.

This also eliminates the subsystem ops, which are now just direct calls.

Change-Id: I0a25a61e0ad8742d3d76a3cacd46db4701fc7d63
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/374733
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-18 17:50:58 -04:00
Daniel Verkamp
bf6caa753d nvmf: refactor identify into a common function
Also remove the stored controller data from spdk_nvmf_ctrlr and instead
generate up-to-date information every time the command is called.

Change-Id: Icdcc7c826eff25711c6700d12089a86a8dedee54
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/374559
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-17 17:58:49 -04:00
Daniel Verkamp
89d35cefd5 nvmf: refactor get_log_page into a common function
Both regular NVM controllers and discovery controllers implement the Get
Log Page command; combine the implementations into one in ctrlr.c.

Change-Id: I7fabf40ec52d8738263ac152afe9cd7773ff7fbd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/374555
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-17 17:58:49 -04:00
Daniel Verkamp
2d1a2926c5 nvmf: refactor controller creation
Simplify the initialization of controller identify data and properties.
This is mostly common between discovery and NVM subsystems.

Change-Id: Id8074d5260213e32892fd77845884a80071c9d88
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/374534
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-17 17:58:49 -04:00
Daniel Verkamp
d7e194f235 nvmf: report optimal I/O boundary in Identify NS
Change-Id: I50be9315d19c4189140f79634841ee53315470cf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/374533
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-17 17:56:18 -04:00
Daniel Verkamp
2eec131e4d nvme: decouple NVMe memory page size from PAGE_SIZE
PAGE_SIZE is the host memory page size, which is irrelevant for the NVMe
driver; what we actually care about is the NVMe controller's memory page
size, CC.MPS.

This patch cleans up the uses of PAGE_SIZE in the NVMe driver; the
behavior is still the same in all cases today, since normal NVMe
controllers report a minimum page size of 4096.

Change-Id: I56fce2770862329a9ce25370722f44269234ed46
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/374371
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-17 12:52:12 -04:00
Jim Harris
ced2c57b67 test/overhead: print error and exit if no device found
While here, do some additional cleanup:

1) add -h option to print help and exit
2) parse args before initializing the environment - this
   allows "overhead -h" to immediately show a usage message
   without having to wait for DPDK to initialize.

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

Reviewed-on: https://review.gerrithub.io/374508
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-08-16 16:13:29 -04:00
Seth Howell
23b89186bc test/nvmf: add delay before identifying kernel target
Change-Id: I9146621bdc924b2c6a0793f6c4b40e8a0719d821
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/373813
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-08-16 16:00:01 -04:00
Daniel Verkamp
d0c013a7e3 bdev/rbd: add get_bdevs JSON dump function
Report the Ceph pool and RBD name in the get_bdevs output for RBD bdevs.

Change-Id: I0e9be0b540e90503ce052c968f979b5887673c24
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/373416
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-16 15:57:04 -04:00
Daniel Verkamp
99f838a36a nvme: add support for NS Optimal IO Boundary
An optional field was added in NVMe 1.3 to indicate the optimal I/O
boundary that should not be crossed for best performance.  This is
equivalent to the existing Intel-specific stripe size quirk.

Add support for the new NOIOB field and move the current quirk-based
code so it is updated in nvme_ns_identify_update().

Change-Id: Ifc4974f51dcd59e7f24565d8d5159b036458c6e5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/373132
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-16 15:55:29 -04:00
Pawel Niedzwiecki
6552b6dac2 vhost_rpc: increase vhost_rpc.c coverage
Change-Id: I5276fc808400449d0d7f09e03b0792ebb1da6b33
Signed-off-by: Pawel Niedzwiecki <pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/373473
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-08-16 15:51:59 -04:00
Seth Howell
4d43844f4d lib: replace strerror with strerror_r
replaces all references to strerror in the spdk lib directory with
references to the thread safe strerror_r

Change-Id: I80d946cce3299007ee10500b93f7e1c8e503ee41
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/374012
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-08-15 16:47:01 -04:00
Cunyin Chang
dcbbaa3c34 test: make sure the hotplug test case cover both "read" and "write".
after we fix the "write" issue for hotplug of iscsi target, we should
also modify the test case the cover "write" test case for hotplug.

Change-Id: I5ef8d6836548d0f682ecfb44da41543e16e979de
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/373799
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-08-15 16:43:50 -04:00
Ziye Yang
9ea96234d8 blobfs, tree: fix a bug in spdk_tree_insert_buffer
From the exising code, the comparison should + 1.
Suppose offset = 2^19, we still can be fit into
tree with level =0, since there will be 64 buffer,
each with size 2^18, so we do not need to
increse the tree level.

Also a unit test is added to demonstrate this.

Change-Id: I95d3542b0881aa7bb661bc57bc789cc4ef4e7509
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/372396
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-08-15 16:36:41 -04:00
Pawel Wodkowski
68048bcfc4 test/vhost: use blk multiqueue
Add num_queues for vhost-user-blk-pci to use multiqueue.

Change-Id: Id0ddf234d936c7c31da0c3ee47a7220b2e0044bc
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/373483
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-15 15:27:59 -04:00
Daniel Verkamp
0720ad357b scsi: allow zero-length read and write
The SCSI spec says that zero transfer length shouldn't be considered an
error.

Change-Id: I98958cc393e0e487e25fdbb0eb7fc8126aff9945
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/374320
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-15 15:26:37 -04:00
Daniel Verkamp
75a3ee3f66 test/bdev/gpt: link spdk_util for CRC32 function
Change-Id: I1e815b1d6672804aed7c51a6a2a1d9941a671e35
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/374346
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-08-15 15:24:29 -04:00
Hailiang Wang
38317981fe Gpt: add unit tests for parse,check_mbr,read_header,read_partitions functions.
Change-Id: I45c6f696052213b00c8db0c9c63e01d14b900672
Signed-off-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/370775
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-15 15:09:46 -04:00
Daniel Verkamp
a31c600a9c test/bdev: remove partition table after GPT test
Make sure later tests don't fail due to a GPT partition table created on
an NVMe device.

Change-Id: I623e4fd0a84588a85f9d1ced6daf539d48267f50
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/374007
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-14 16:40:16 -04:00
Daniel Verkamp
0b1bbb4532 scsi_bdev: add Maximum Transfer Length check
We report SPDK_WORK_BLOCK_SIZE (1 MiB) as the Maximum Transfer Length in
the Block Limits VPD.  The initiator should not submit a request larger
than this; if it does, fail the request.

Change-Id: I39575cdca4555ac1f78e055a48569be3f47e4781
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/373162
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-14 15:47:18 -04:00
Paul Luse
02e7c3ffbb ut/nvme: add coverage for nvme_free_request()
Change-Id: I7be51b1eae787e7f87c7bc95633a5f58005c1cce
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/372538
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-14 15:38:04 -04:00
Jim Harris
7e4ab4d54a test/bdev: limit memory size to 1GB
This helps prepare using the bdev test tools (bdevio and
bdevperf) with a virtio/vhost-scsi initiator.  For virtio
initiators running in the host OS, SPDK must open file
descriptors for every hugepage to pass to the vhost
target.  vhost typically limits the number of memory
regions to 8 - meaning 2MB hugepages generally will not
work, but even for 1GB hugepages we need to limit it so
that we do not default to trying to use all of the
hugepages.

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

Reviewed-on: https://review.gerrithub.io/374013
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-08-14 13:14:47 -04:00
Ben Walker
77bcc2454d bdev/fio_plugin: Add trim support
Change-Id: I4b046e63a669d52c875efffb5a91e99845fc623d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/370383
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-08-11 19:54:32 -04:00
Ben Walker
c0de8a8b0e scsi: Remove global unmap config parameters
None of these make sense as global parameters - they're
all only configurable per-disk. This is a large simplification
and removes the SCSI library's dependency on the config
file entirely.

Change-Id: I1236158a23fa49e437938c51022b13772e404561
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/371598
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-08-11 19:54:32 -04:00
Seth Howell
8422f88644 test/nvme: increase delay between plugging devices
When the hotplug test was run in a qemu virtual machine, it consistently
failed to unplug the devices after insertion. Increasing the delay here
to four seconds resulted in proper deletion of the devices and a passing
test. (replicated three times)

Change-Id: I0283c8440568edd8dd8ca8945e691a29b775aab5
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/371401
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-11 19:45:26 -04:00
Ben Walker
baa936a173 nvmf: Replace transport controller with poll_group
For now, this is a name change of controller to poll_group
in the transport layer. Over time, the poll_group will
become a more general concept than a controller, allowing
for qpairs to be spread across cores.

Change-Id: Ia92a2934541ad336f462f73175d53aaaf021f67b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/371775
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-08-11 19:44:35 -04:00
Daniel Verkamp
671179409c bdev/aio: allow user to override block size
Add a file-backed AIO bdev to test it out.

Change-Id: Ifdf206bbdf6cae9379fdc02c80755e96a7198bce
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/373673
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-11 19:36:30 -04:00
Dariusz Stojaczyk
8123aef784 vhost: don't abort on mem region registration failure
A single warning message is printed instead.
This is required for VMs which have memory mapped virtual devices. (e.g
NVDIMM in Clear Containers). This memory won't ever be used by guest
kernel for IO processing.

Change-Id: Ie24501acbdb3ba0d67bd29b146a09b222451427d
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/373224
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: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-08-10 13:32:36 -04:00
Dariusz Stojaczyk
b597955f29 env/vtophys: vtophys functions will now return error codes
Change-Id: Ic2b799c7d1dbd3249a890a79f42118fc79a30b94
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/373223
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-08-10 13:32:36 -04:00
Pawel
83c2b65a4f vhost: RPC: unify RPC "get_vhost_controllers" for all backends
replaced "get_vhost_scsi_controllers" and "get_vhost_blk_controllers"
with "get_vhost_controllers"

Change-Id: I4988313e311e5b66632d8e216bde209c8ea5e318
Signed-off-by: Pawel Niedzwiecki<pawelx.niedzwiecki@intel.com>
Reviewed-on: https://review.gerrithub.io/369399
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-10 13:31:20 -04:00
Lukasz Galka
fcfa6f3432 test/vhost: Change blocksize in fiotests
Default configuration job for FIO integrity test uses block size 4k.
This patch changes it to 4k-512k for better bs coverage.

Change-Id: Ib31b9c663288b5fa9226dd429458ae0fe8ba9209
Signed-off-by: Lukasz Galka <lukaszx.galka@intel.com>
Reviewed-on: https://review.gerrithub.io/372081
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>
2017-08-10 13:30:58 -04:00
Seth Howell
ba21932806 test/nvmf: fix bash syntax error in common.sh
Change-Id: I3823bac5934b4a72560be3ce5eb2adf7cd019f09
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/373661
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-09 18:24:56 -04:00
Daniel Verkamp
b89c1b985b autotest: remove support for $CEPH_DIR
Now that we have scripts that work with the standalone 'ceph' utility,
drop support for the previous hard-coded Ceph source path.

Change-Id: I6d8db999e4fc33075dfafd9ba3734f95ad0f9351
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/373410
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-09 13:55:11 -04:00
Ziye Yang
94efdd3fdd vhost, unit: fix DPDK include issue in Makefile.
According to the env.mk, DPDK include file can be
passed by user, so we need to use DPDK_INC to
avoid the compilation issue.

Change-Id: I24f6ca496eefe16c18bba7278cc6d00120da79e1
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/373235
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-08-09 13:43:42 -04:00
Vishal Verma
94262269de test/blobfs: add 'drop_cache' in run_tests script
This adds support for cleaning page caches between each of the
db_bench test within run_test.sh script.

Change-Id: Ibcf37945d530a7a940d4a6365e3f1a9eeffb26c0
Signed-off-by: Vishal Verma <vishal4.verma@intel.com>
Reviewed-on: https://review.gerrithub.io/373631
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-08-09 13:39:27 -04:00
Karol Latecki
752a4576de test/vhost: re-enable vhost scsi resets
Change-Id: I321546e27d217544cb97c694c8471a3eb05e15e6
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/368639
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-08-09 13:37:54 -04:00
Seth Howell
36fb7fcd23 test/nvmf: configure all nics when running NVMF tests.
Change-Id: Ia40f0817320ac7f12312299633a7c40136c2e806
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/371219
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-09 13:36:33 -04:00
Seth Howell
80c91e4e46 test/nvmf: add logic to include soft-roce nics in NVMF tests
This will allow us to virtualize all of our tests.

Change-Id: Ic9697c1622e516d0021c8af37c0cd4c0f65d430a
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/370992
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-09 13:36:33 -04:00
Paul Luse
d63c9dce6a ut/nvme: add coverage for nvme_allocate_request_user_copy()
Adding this coverage identified how the functions in test_env.c
are closely related to the new mock library. Given that there are
not that many here I don't think we *need* to try and consolidate
or make this any tighter. As it is now, I added a note at the top
of test_env.c to mention the use of mock globals to control when
a function is to be mocked or passed through and this first use
serves as an example.

Change-Id: Iac819f60f2028ac8bd8c75898e7dba7f4e12df35
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/372529
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-08-09 13:04:04 -04:00
Ben Walker
7e3b9f25ba nvmf: Clarify transport API for listen and accept
There are now three simple functions on the transport:

listen(transport, trid)
stop_listen(transport, trid)
accept(transport)

This makes the code quite a bit simpler.

Change-Id: I550343a084b5c095240703952c8c07ae535b5c16
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/371774
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-08-08 15:46:28 -04:00
Ben Walker
a4e28342a8 nvmf: Add wrappers for transport calls
Instead of scattering direct calls to the function
callbacks throughout the code, add some wrappers.
This will make some later refactoring marginally
easier.

Change-Id: If735089967e3ce828dcff68f2430e7810bf2f123
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/371749
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-08-08 15:46:28 -04:00
Ben Walker
31d033f944 nvmf: Transports are no longer global
Create one transport per nvmf target. Today, there is just
one global nvmf target, but this paves the way for multiple.

Change-Id: Iaa1f8c5e7b3c1e87621ef2a636c68c2dd8fd929e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/371748
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-08-08 14:09:45 -04:00
Daniel Verkamp
269910c05c nvme: refactor PRP building code
This also changes the SGL -> PRP case to translate each 4K page from
virtual to physical, in case the buffer is not physically contiguous.

Change-Id: If027f9d656c52c56504f0c64cd4464e16440df63
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/371616
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-08 14:09:33 -04:00
Ben Walker
1d304bc5d8 nvmf: Rename spdk_nvmf_conn to spdk_nvmf_qpair
Match the terminology used in the NVMe-oF specification,
which is queue pair. For the RDMA transport, this maps to
an RDMA queue pair, but may map to other things for other
transports. It still is logically a "connection" from
a networking sense.

Change-Id: Ic43a5398e63ac85c93a8e0417e4b0d2905bf2dfc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/371747
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-08 13:46:48 -04:00
Ben Walker
03788f93df nvmf: Rename spdk_nvmf_session to spdk_nvmf_ctrlr
This is just a rename - the functionality hasn't changed.
Use the same terminology as the specification (which is controller)
so those familiar with the specification can more easily
approach the code base.

This is still conceptually equivalent to a "session" in the
networking sense.

Change-Id: I388b56df62d19560224c4adc2a03c71eae6fed0d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/371746
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-08 13:46:48 -04:00
Daniel Verkamp
610374cd49 nbd: allow exporting more than one NBD at once
Change-Id: Ib6245e981d550e951a518176730a0e8d88378207
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/372341
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-07 17:56:21 -04:00
Daniel Verkamp
3754eedc9b bdev: validate I/O offset block alignment
Change-Id: I33506d6b9ff09c45c057326f7339d742eebc45b4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/372861
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-07 17:48:22 -04:00
Daniel Verkamp
906ce69413 ut/bdev: add spdk_bdev_io_valid() tests
Change-Id: I58fa306781fd2cd5cd2d63809cf900b03c132edc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/372860
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-07 17:48:22 -04:00
Ben Walker
1c83074299 nvmf: Use spdk_nvme_transport_id
The NVMe-oF target was written before we defined
spdk_nvme_transport_id. Now that we have it, go back
and replace all of the locations where we individually
tracked traddr, trsvcid, trtype, etc. and use a trid.

Change-Id: I84334a12c7581f414c1e84680f122fe885a3b9dd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/370744
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-08-07 17:07:58 -04:00
Ben Walker
29f6172a56 nvmf: Use trtype enum in transport instead of strings
Change-Id: Ie05f58e677107072fea6cc7702bab47a077cb595
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/370743
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-08-07 17:07:58 -04:00
Ben Walker
60c38d4022 bdev: Change unmap to use offset/len instead of descriptors
This is far simpler, although it does limit the bdev
layer to unmapped just one range per command. In practice,
all of our code reports limits of just one range per command
anyway.

Change-Id: I99247ab349fe85b9925769e965833b06708d0d70
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/370382
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-08-04 20:03:37 -04:00
Ben Walker
914b1d15ae bdev: Add new tests using the fio plugin
Change-Id: I90edce0d9aac7be12ce8ba346aa6e16f67628b0e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/369677
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-08-04 20:03:37 -04:00
Daniel Verkamp
7571c2bb0c nbd: move poller out of lib into app
This allows the library user the flexibility to use a different
threading model.

It also provides a way to indicate when the connection is closed so the
app can cleanly shut down.

Change-Id: Ibc196c0b8334fcb8f50d0233def16c6acf3c90d6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/372377
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-03 16:05:15 -04:00
Daniel Verkamp
b483027aca util/crc32c: add SSE 4.2 CRC32 instruction support
Use the CRC32 CPU instruction, if available, to optimize the iSCSI
CRC-32C calculation.

Change-Id: Ifb706528c28f5e6921ebf525274b959d8cac85a0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/370766
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-02 19:47:35 -04:00
Daniel Verkamp
ae60710ab8 util: add CRC32 utility functions
Factor out the iSCSI and GPT CRC32 functions into generic library
functions.

Change-Id: I1f1a5f3968a983b663a51bd984500492eeb12605
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/370765
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-02 19:47:35 -04:00
Seth Howell
85206ad06e test/rbd: remove requirement for local ceph directory
Previously, the local ceph directory was the only requirement for
running rbd tests. This patch allows the tests to be run if hash is a
known command.

Change-Id: I176bfc2e1d95f7d6d210c2faa03ff272819fe34b
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/372326
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-08-02 18:36:36 -04:00
Ben Walker
fd4cb17f81 test: Add a bdev management service
This allows us to query and configure the bdev
modules much more dynamically.

Change-Id: I11f757039892f4353721be422317b641d72bd2a9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/370584
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-08-02 18:04:55 -04:00
Jim Harris
002660c4f0 nvme: add transport get_max_sges abstraction
For pcie, this just equals the number of SGLs we can fit
into the per-tracker memory.

For rdma, this is just set to 1 for now since nvme_rdma.c
does not support multiple SGEs yet.  Once that support is
added, this will change to use MSDBD (Maximum SGL Data Block
Descriptors) instead from the controller identify data.

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

Reviewed-on: https://review.gerrithub.io/372358
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-08-02 17:15:21 -04:00
Daniel Verkamp
905f19304d test/nvmf: remove direct mode unit test
This was missed as part of commit f6e62d2ce1 (nvmf: Remove direct mode).

Change-Id: I2b00cc1f4faac4a5c26cba44e65e3e16508e24fe
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/372344
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-08-02 16:06:55 -04:00
Seth Howell
e4cfa8e34e test/nvmf: remove hardcoded NVMF ip address.
This is the first in a series of patches to remove network configuration assumptions from the NVMF test suite.

Change-Id: I9d8a9daab6910c5e80276db7e6701e1aa8e1d38f
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/371193
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-08-02 14:00:22 -04:00
Ben Walker
f6e62d2ce1 nvmf: Remove direct mode
There is now only virtual mode. Virtual mode has been
improved enough to reach feature parity with direct
mode and performance benchmarks show no degradation.
Simplify the code by always using virtual mode.

Change-Id: Id5cdb5d4d8c54e661b245ed7250c2f9d66ca2152
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/369496
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-02 13:57:45 -04:00
Jim Harris
7e9f556363 nbd: move nbd code to a new library
This prepares for enabling nbd mounting as a service within existing
applications.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I225ae20dc86b2d70a1a39a325e754b22f34feaee
Reviewed-on: https://review.gerrithub.io/369674
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-08-02 13:27:21 -04:00
Cunyin Chang
1c442639df autotest: Add hotplug test case for iscsi tgt.
Change-Id: I421a718d363395200311fd658f874deb27cd31bc
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/371814
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-01 21:35:54 -04:00
Paul Luse
ca2931227e unit test: add new mock macro and use macros in nvme_ut.c
No new coverage added, just used the STUB macros in nvme UT
to make sure they cover all the cases and discovered a few small
tweaks needed: (1) added _V variant to declare void stubs (if
someone sees an easy way to make DECLARE_STUB handle this case
that'd be cleaner but I don't think its a big deal) and (2)
updated DECLARE_STUB so that it can set a struct return value
by adding {} to the ut_ variable set statement.

Also ordered the declarations simply for readability, the _V
first, the regular stubs next, the _P next and then the stubs
that don't have a macro to cover them because they do something
other than return a specific value.

Change-Id: Idd8919d2b9e9daa76dd629364ea1d0285657fa81
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/368420
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-08-01 17:29:43 -04:00
GangCao
4f7210f664 nvme/unit:add two unit tests for IO compare operation
Change-Id: Ia5f8811c8dec0be85b002ccb26df8fc9e1f988eb
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/370865
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-08-01 16:59:51 -04:00
Seth Howell
0ce9b8aa3f rbd: add option for using installed version of ceph on rbd tests
previously, the tests have been hardcoded to use a manually installed version of ceph.
The attached scripts allow the user to create a ceph cluster from a package managed version
of ceph which requires no extra configuration.

Change-Id: I22e4ea9eb95f1e84a968ee2bce6133568fda33a8
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/370399
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-08-01 16:07:02 -04:00
Daniel Verkamp
16c362a8de string: add spdk_str_chomp() function
Add a helper function to remove trailing newlines.

Change-Id: I8b1a2bf3d70ef17e0bc7e74429ac955c68cb6bcf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/370592
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-08-01 13:42:26 -04:00
Paul Luse
2f2dc36f1d makefiles: remove DPDK_INC cflags, no longer needed
Change-Id: I2b388aa50bf6da3341c74ba4ea414939c91e22e1
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/371791
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-01 13:41:26 -04:00
Jim Harris
0b33e77e4c nvme: fix _nvme_ns_cmd_split_sgl_request for last SGE not page aligned
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2b6a22591d0a5f7435d9fd9dd8d6a1c854da3d89

Reviewed-on: https://review.gerrithub.io/371978
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paweł Niedźwiecki <pawelx.niedzwiecki@intel.com>
2017-07-31 13:10:52 -04:00
Jim Harris
bab34df6ca vhost: split iovs which span hugepage boundaries
A virtio descriptor may specify a buffer that spans
a huge page boundary or even a vhost memory region.
So modify spdk_vhost_vring_desc_to_iov() to take this
into account.

While here, also change spdk_vhost_vring_desc_to_iov
to return int instead of bool.  int return with -1 is
most standard to indicate failure.

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

Reviewed-on: https://review.gerrithub.io/371756
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-07-31 13:10:52 -04:00
Jim Harris
c41338ce70 vhost: add unit test framework
While here, add a new DEFINE_STUB_V for void stubs.

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

Reviewed-on: https://review.gerrithub.io/371735
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-31 13:10:52 -04:00
Ziye Yang
3a289a6eea test, blofs: remove the RESULTS_DIR prefix
Remove RESULTS_DIR PREFIX since we already change the folder

Change-Id: I6be0b4dda481377a96d8fdbb69d5d60a6616c7d0
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/370829
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-07-25 15:56:57 -04:00
Dariusz Stojaczyk
73358c99e1 util/nvme: added io_device unregister callback
Patch afe860ae deferred freeing the io_device. However, for nvme, the
io_device context (spdk_nvme_ctrlr) is still being destructed before
io_channels are destroyed, causing segfaults on hotremove.

This patch defers io_device context destruction and fixes nvme
hotremove.

Fixes: afe860aeb1 ("channel: Correctly defer unregisters if channels exist")
Fixes: 5533c3d208 ("util: defer put_io_channel")

Change-Id: I7af699174cac0c6c6a6faa2cc65418c47347eb9a
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/370459
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-20 16:07:02 -04:00
Dariusz Stojaczyk
542b541588 vhost_scsi: implemented abstract vhost event layer
Implemented abstract vhost event layer on top of virtio eventq.
This allows us to defer virtio-event-related actions to be called from
the vhost poller thread. This is required for hot-attach, for which
io_channels have to be created on the I/O thread.

This adds full support for hot-attaching and hot-detaching vhost scsi
devices. They can be now attached to a controller via RPC at any time.

Change-Id: Icf353bfcf69c83ef16b8fc771ea4c487002094f9
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/370016
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-20 13:19:26 -04:00
Ziye Yang
59d6f04758 nbd: fix bdev alignment issue
When using AIO as the real device of /dev/nbd, we
fail the test due to the alignment issue

Change-Id: I608dfdad1e0cac0beaf438c7a1f115c2d1a9f943
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/370233
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-07-19 13:54:38 -04:00
Daniel Verkamp
ce4fcbce71 nvme: add I/O qpair creation options
Add a new struct spdk_nvme_io_qpair_opts to allow the user to override
controller options on a per-I/O qpair basis.

Existing callers with qprio == 0 can be updated to:

  ... = spdk_nvme_ctrlr_alloc_io_qpair(ctrlr, NULL, 0);

Callers that need to specify a non-default qprio should be updated to:

  struct spdk_nvme_io_qpair_opts opts;
  spdk_nvme_ctrlr_get_default_io_qpair_opts(ctrlr, &opts, sizeof(opts));
  opts.qprio = SPDK_NVME_QPRIO_...;
  ... = spdk_nvme_ctrlr_alloc_io_qpair(ctrlr, &opts, sizeof(opts));

Change-Id: I8ac3ea369535cfde759abbe75e1d974b6450a800
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369676
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-18 18:33:20 -04:00
Ziye Yang
8b6f5d54db bdev,test: move common gpt partition code to autotest_common.sh
Change-Id: I261e6ed578335ab091973f7546035e63a00dbbf4
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/369735
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-07-18 13:45:51 -04:00
Seth Howell
f03f5e7de8 iscsi: change iscsi_bhs_scsi_req variable names.
These variable names are changed to retain conformity with astyle 3.0.1. Astyle 3.0.1 recognizes 'final' as a keyword and incorrectly formats the iscsi_spec.h file breaking the build. Names were changed to avoid this case and maintain consistency within the struct.

Change-Id: I39c29d768c0ddfd459a9e9212c29cf564dad1963
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/369905
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-07-18 13:14:16 -04:00
Liang Yan
fe84b2eb02 test/blobfs: test file creation in async mode
Change-Id: I155d956b0492120bf1b0194d0e7303d781bcdb25
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/365106
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-17 18:20:25 -04:00
Daniel Verkamp
0d9842813f test/iscsi: remove gen_nvme from FIO test
The iscsi_tgt fio test script called gen_nvme, but it never actually
used any NVMe bdevs, only Malloc.

Change-Id: I1a4eb16a4aa48f7f5de7a292c2e06a7a1711e181
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369495
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-14 19:35:44 -04:00
Ziye Yang
36a0d1e5d1 test, blockdev: simplify the if statement
Change-Id: I88b4e91181ef87264a71bcbddb56d7a71cc0b084
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/369542
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-07-14 16:02:44 -04:00
Jim Harris
be9a3b9f69 bdev: pass descriptors for I/O operations
This enables checking permissions - for example,
spdk_bdev_write will fail if the descriptor was not
created with write permissions.

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

Reviewed-on: https://review.gerrithub.io/369493
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-14 13:31:30 -04:00
Jim Harris
f71447e80d bdev: remove differentiation between bdev and vbdev modules
We still will sort the bdev_module list so that modules
with an examine() callback are initialized first.  This ensures
they have a chance to initialize before later modules start
registering physical block devices.

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

Reviewed-on: https://review.gerrithub.io/369486
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-14 13:31:30 -04:00
Jim Harris
4fc7e66614 bdev: add vbdev claim/release semantics
vbdev modules still open/close bdevs as normal, but
should open bdevs read only when tasting (i.e. reading
the GPT to see if there are SPDK partitions).  When
a vbdev module is ready to claim the bdev for purposes
of creating virtual bdevs on top of it, it calls
spdk_vbdev_module_claim_bdev().  It can pass its
open descriptor as well to have it promoted to
write access (required for future vbdev modules like
logical volumes).

Note: error vbdev was changed to copy the base bdev
parameters one-by-one instead of a blind memcpy - we
do not want to copy the base bdev's vbdev_claim_module
into the new bdev!

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

Reviewed-on: https://review.gerrithub.io/368628
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-14 13:31:30 -04:00
Jim Harris
86af2ae59f test/bdev: do not hardcode sgdisk directory
At least on Ubuntu, sgdisk gets installed to /sbin, not /usr/sbin.

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

Reviewed-on: https://review.gerrithub.io/369304
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-14 13:31:30 -04:00
Daniel Verkamp
e283c385e7 iscsi: fix AHS handling
Previously, we had a pdu->ahs pointer that was always NULL (never set
anywhere), and we would try to read data into this NULL pointer if the
initiator ever sent a PDU with a non-zero TotalAHSLength.

Rename the existing ahs_data array in the PDU to just "ahs" to minimize
the necessary changes.  We never actually dereference the ahs structure,
so its type is not important. (We can cast it later if we add support
for anything that requires an AHS.)

Change-Id: I10d19a6e0d99f326794cbe6469eacedadc634c67
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369315
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-14 11:14:21 -04:00
Karol Latecki
86538ffa24 test/vhost: remove tee pipe from vhost start command
Also restoring vhost block tests in autotest.

Change-Id: Idc6a3068650ce28636f4709df5a51029bfddbcdd
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/369470
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-07-13 19:18:18 -04:00
Daniel Verkamp
2c28fa5426 test/json_util_ut: assert that string is valid
Make sure the output.my_name pointer is not NULL before calling memcmp()
on it.  Fixes static analysis warning about a potential NULL pointer
dereference.

Change-Id: I85faf57c63b0760c4f90d9ee99f6d7e3df121211
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369264
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 18:13:23 -04:00
Daniel Verkamp
cb29ce869f bdev/gpt: dump partition name
Change-Id: I1899a47fa9d9821c16ea648bbe3290f6306d0e3d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368626
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 18:12:52 -04:00
Daniel Verkamp
429672d31b json: add function to write UTF-16LE strings
spdk_json_write_string_utf16le() writes a UTF-16LE string to a
JSON write context.

Change-Id: I413ffb8a3dee6e1b44ec96ce2415fd1b9c36320f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368625
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 18:12:52 -04:00
Daniel Verkamp
229f64942d test/bdev_ut: fix build with --with-vtune
Change-Id: Iaed5e670bef4ef5e588c9df4858f4d1ff240df58
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369273
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <roman.sudarikov@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 18:11:50 -04:00
Dariusz Stojaczyk
fa15dc611a scsi: removed dev->maxlun field
This variable was misleading and unnecessary. Replaced all it's
occurences with SPDK_SCSI_DEV_MAX_LUN.

Change-Id: Iaaf9ed5efb60f9a89585121d2fbec7b43c3723e9
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/368115
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 13:16:55 -04:00
Jim Harris
e075a3dc7a bdev: track number of outstanding examinations
Add a new spdk_vbdev_module_examine_done() API which
vbdev modules can use to notify the generic bdev layer
once a base bdev examination is complete.

This is especially required for asynchronous vbdevs
like GPT which must issue I/O to the base bdev.

As part of this patch, add examine callbacks
for both split and error, which for now only call
this new functions.  Later patches will move code from
the init callback to the examine callback for these
modules.  examine callbacks are now required for all
vbdev modules.

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

Reviewed-on: https://review.gerrithub.io/368831
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-12 12:42:56 -04:00
Jim Harris
be2cb0c535 test/bdevio: add delay before starting unit tests
This is a bit of a workaround for some upcoming changes
where bdev subsystem initialization will not wait for
all vbdevs to finish tasting all bdevs that are registered.

We need to allow those vbdevs to clean up after themselves
after doing their initial tasting, before we start the
unit tests, since the unit tests are blocking and won't
return to the reactor loop to allow asynchronous tasting
I/O to get returned to the vbdev modules.

Eventually we should consider modifying bdevio run
asynchronously, maybe including removing its use of CUnit
for test reporting.

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

Reviewed-on: https://review.gerrithub.io/368616
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-07-12 12:42:56 -04:00
Jim Harris
4794c791de bdev: add pointer to module structure
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic3051b63942770e45be22af0ae03a78a7c543f81

Reviewed-on: https://review.gerrithub.io/368597
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-07-12 12:42:56 -04:00
Daniel Verkamp
4e003b6714 jsonrpc: allow asynchronous request completion
Move the per-connection send buffer into each request, and allow a
connection to have a queue of responses ready to be sent.

Change-Id: If6b2151691c4cd76f3cf7cde0cdd8f20cac77ceb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368470
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-12 12:10:31 -04:00
Daniel Verkamp
977fd23033 jsonrpc: dynamically allocate request object
This will be necessary when the lifetime of a request can exceed the
lifetime of the values stored in spdk_jsonrpc_server_conn.

Change-Id: Icd9772eb142e3f6ae69303aff1e12bc213f435a4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368455
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 12:10:31 -04:00
Daniel Verkamp
35d46267b8 jsonrpc: remove support for batch requests
This will greatly simplify the implementation of asynchronous requests,
and asynchronous requests also allow clients to submit multiple
overlapped requests, making batches unnecessary for executing multiple
RPCs at once.  Additionally, our RPC client (scripts/rpc.py) does not
use batch requests.

Change-Id: I2529793c54b43acbacd934d82926aa32e286210c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368449
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-12 12:10:31 -04:00
Daniel Verkamp
ac4398a31d log: set print level when enabling tracelogs
The default print level used by the apps is SPDK_LOG_NOTICE, which will
prevent the tracelogs from being shown.

Change-Id: I5f136e8aa0be0aa7634c7dd72231f2c23b129e51
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368803
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-11 18:02:47 -04:00
Karol Latecki
5dd160bde6 test/vhost: Modify wait time for vhost start in fiotest
Look for open RPC port instead of issuing "sleep" for a
number of seconds.

Change-Id: Id75476ae3d6c39de7f7da2c0878d251384c2bb65
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/364974
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-11 17:27:30 -04:00
Karol Latecki
0abf67ce31 test/vhost: add vhost block option to fiotest
Allow running VMs in fio tests with vhost-block instead of
vhost-scsi.

Change-Id: I89ee437264ddcda0aaefdb71744cee6ce7d451d8
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/365808
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2017-07-10 19:18:16 -04:00
Daniel Verkamp
b509410cb1 nbd: add -t tracelog flag support
Adjust the usage() output so it matches the spdk_tracelog_usage() style.

Change-Id: I2555b7587ebb9a891a08412f045d94f980cd1255
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368802
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-10 18:36:00 -04:00
Ben Walker
58b9ea3ac0 nvme: Simplify the multiprocess tests
Nearly all tests now make extensive use of the stub application,
so they're effectively all testing multiprocess all the time.
Further, we believe it to be the best policy to not attempt
to support scenarios where the primary process crashes unexpectedly.
We consider this equivalent to a kernel panic and all of the
processes will need to be halted and restarted.

Given the two things above, we can make some fairly dramatic
simplifications to the NVMe multiprocess testing. Only
one piece of functionality - multiple simultaneous secondary
processes - was not already tested by the other regular
tests. This patch removes all other multiprocess tests
and adds a simple test of multiple secondaries.

Change-Id: If99f85913b99862f02c3815ea7c10cd80ea3ce02
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/368208
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-07-10 17:25:53 -04:00
Daniel Verkamp
782b0f1a75 bdev/gpt: dump partition type and unique GUID
Change-Id: Ibb28b8432c94e70f522bdf34c5f4a10e4c25a8bb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368610
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-10 15:36:52 -04:00