Commit Graph

485 Commits

Author SHA1 Message Date
Daniel Verkamp
3b951037a4 spdk_cunit: only evaluate assert condition once
Change-Id: I2e8591df23fcb686c3189b0f6215759d749b84bd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-19 08:09:45 -07:00
Daniel Verkamp
c194ebd833 nvme: move I/O qpair allocation to transport
This requires a couple of related changes:
- I/O queue IDs are now allocated by using a bit array of free queue IDs
  instead of keeping an array of pre-initialized qpair structures.
- The "create I/O qpair" function has been split into two: one to create
  the queue pair at startup, and one to reinitialize an existing qpair
  structure after a reset.

Change-Id: I4ff3bf79b40130044428516f233b07c839d1b548
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-19 08:09:45 -07:00
Daniel Verkamp
1bbe0c00bd bdevperf: report run failure via return code
Change-Id: I8f3e334df6c72cdff6d0d78a38f69b08c0158c49
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-18 17:45:51 -07:00
Daniel Verkamp
38d41acda4 check_format: check Python style with pep8
Also continue checking for errors after a problem has been found.

Change-Id: Iea37311e54f68fb6ba8c804ad4b2fb92d5238f36
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-18 13:35:19 -07:00
Daniel Verkamp
823958551b nvme: move ctrlr alloction to transport
Make the transport ctrlr_construct callback responsible for allocating
its own controller.

Change-Id: I5102ee233df23e27349410ed063cde8bfdce4c67
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-18 13:35:14 -07:00
Daniel Verkamp
62d7cded7a nvme: split out transport-specific ctrlr structure
Change-Id: Icba2a44ff8ff35df09b3f1d8e3282a784e397a06
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-18 10:35:02 -07:00
Daniel Verkamp
c655efd6a9 nvme: move create and delete I/O queue commands to PCIe
These are specific to local NVMe PCIe devices, so move them out of the
generic NVMe code into the PCIe transport.

Change-Id: Iea2056a4c438b7d3a303b4b5e977ce7aa9e58c05
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-18 10:14:00 -07:00
Daniel Verkamp
a5790100f2 nvme: add ctrlr construct/destruct to transport
Change-Id: I66842497a02bdb586d38ddc4a38d5b444a9d5dad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-18 10:13:37 -07:00
Daniel Verkamp
03aead3903 nvme: add qpair operations to transport
Change-Id: Id354ba13515d54bb54a8293569ee83ea72111183
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-18 10:13:37 -07:00
Cunyin Chang
706bace35a test: Create malloc bdev dynamically for nvmf test cases.
Change-Id: I64ec6eb16ff8480ce95fbd2c07d479c4d05965e9
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-18 09:51:32 -07:00
Cunyin Chang
134dce2669 rpc: Rename construct_malloc_lun to construct_malloc_bdev
Change-Id: I72f21881264226499a9cd64c72f3ab1b4808b2ec
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-18 09:51:31 -07:00
Cunyin Chang
83620f4e09 test: Add test case for nvme bdev construction.
Change-Id: Iff256c9df8bc6954a18291caa7cc452e7bbe78fc
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-18 09:51:31 -07:00
Ben Walker
1e6ffa0394 nvmf: Add a public API header
This changes as little code as possible while still creating
a single public API header. This enables future clean up
of the public API and clarification of the exposed
concepts.

Change-Id: I780e7a5a9afd27acf0276516bd71b896ad301c50
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-14 15:26:31 -07:00
GangCao
9a1d4a00cc test: check valid pointer in spdk_zmalloc before assigning value
Change-Id: I05f70a7aec000e57d20d56cf272bd39e64d5bcc8
Signed-off-by: GangCao <gang.cao@intel.com>
2016-10-14 12:59:40 -07:00
Daniel Verkamp
b0e9620b4f nvme: add qpair create and delete to transport
Change-Id: Ibc057972c7eb84ada95fb173d559255e5c86c5ba
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-14 12:46:58 -07:00
Daniel Verkamp
179f122cab nvme: add register access functions to transport
Change-Id: I2e80879e69770b42ea751a8ade7110ac9f4b6d13
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-14 12:46:58 -07:00
Daniel Verkamp
a00852c1fc nvme: add PCI ID accessor to transport
Change-Id: I1776c21d7479f3ef69fe254b8dc4b6d64bbe48bc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-14 12:46:58 -07:00
Daniel Verkamp
d7b7dbfb78 nvme: introduce transport abstraction
This will allow factoring out PCIe-specific code into a swappable
transport so that NVMe over Fabrics host support can be added.

Change-Id: I4df74dd268d655e3b36e8d6114ebe7d79a24844d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-14 12:46:58 -07:00
Pawel Wodkowski
eef39e8d35 ext4test: mount with sync option and print dev stats
Mounting with sync to do more IO during test.
Print dev stats after umounting.
Do not change directory to mounted system, as this is preventing cleanup
trap to umount used path in case of failure.

Change-Id: I2f444b67b1f293c9d7c939f8f94aa5756e20aa26
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-10-14 11:07:50 -07:00
Pawel Wodkowski
2025e8f3ce test: bdevio: extend test for vector io
Change tests to use read/write vector and non-vector versions.

Change-Id: I5a97568d3dc2f61d44721f4b0c75331baad417bb
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-10-14 19:46:40 +02:00
Pawel Wodkowski
113f8e23a7 bdev: enable IO vector operations
This patch enables vector operation for bdev drivers aio, malloc and
nvme.
The rbd driver still handle only one vector.

Change-Id: Ie2c1f6853bfd54ebd8039df9a0305854ca3297b9
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-10-14 16:21:24 +02:00
GangCao
f81888b2f9 nvme: add PCI BDF in spdk_nvme_ctrlr to check whether same ctrlr
Change-Id: Ic8eb395bbfcc688e9c999a6d0026b70c24d386e3
Signed-off-by: GangCao <gang.cao@intel.com>
2016-10-13 09:50:32 -07:00
Cunyin Chang
37a7fff634 iscsi/rpc: change get_target_nodes parallel arrays to objects
This patch makes lun_name:lun_id pair as one object,
the same for the pg_tag:ig_tag.

Change-Id: Ib08450d12bde9b8388d4ae41e214cc0ba64c8b1e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-13 09:05:43 -07:00
Daniel Verkamp
4afe9d1acb nvmf/rpc: make hosts parameter optional in create
Instead of a magical "All" value for allowing all hosts, allow the
caller of construct_nvmf_subsystem to omit the "hosts" parameter.

Change-Id: I97c7ae806a0be7142fb59708d47023e42e127fcc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-13 08:50:03 -07:00
Jim Harris
de16fcca32 nvme: fix sgl processing for single sge payloads > 4KB
For the nvme readv/writev APIs, the PRP checking logic was
incorrectly failing single SGE payloads that were larger
than 4KB.  This patch adds a test case for this scenario,
and fixes the PRP checking logic.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6357d620599666046d2cb74d7923dac1f75418c5
2016-10-12 14:51:58 -07:00
Jim Harris
68cdd81a83 test: add new ext4test
This test will create a malloc and NVMe iSCSI target node,
perform an iSCSI login, create and mount a filesystem, then
copy the SPDK contents to the mount and do a build.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I00291e6ca768dd4b685086cf1479098558b9329f
2016-10-12 14:49:49 -07:00
Daniel Verkamp
df4dbfb28c bdevio: #include <pthread.h>
Explicitly include the pthread header after removing some headers that
implicitly included it.

Change-Id: I39fe272acfcc63d3888d2430137de2c3426f1af6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-12 10:00:13 -07:00
Ben Walker
02a17e193e env: Replace DPDK atomics with gcc standard calls
Use standard GCC style atomic operations instead of
the DPDK calls. The DPDK calls end up translating
to the gcc standard inline calls in the generic
case anyway.

Change-Id: I0ea760c4e23c3660b082a803bbc174de7250f365
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-12 09:53:32 -07:00
Ben Walker
18a2cc11c1 env: Remove unused DPDK headers.
Remove #includes for all DPDK headers that weren't
necessary.

Change-Id: Ib02522e0f04e64a1c98afceb7508cc0e8d931a9d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-12 09:53:32 -07:00
Ben Walker
535827c559 env: Eliminate remaining usage of rte_memzone
This was only used for debugging. Everywhere else
used the spdk_memzone abstraction.

Change-Id: I8a828ea3c7abccb66c8a027cb13de43c560ff7a1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-12 09:53:32 -07:00
Ben Walker
7f5b671db7 env: Convert some rte_mempools to spdk_mempools
This converts some, but not all, usage of rte_mempool
to spdk_mempool. The remaining rte_mempools use features
we elected not to expose through spdk_mempool such as
constructors, so that will need to be revisited.

Change-Id: I6528809a864ab466b8d19431789bf0f976b648b6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-12 09:53:32 -07:00
Ziye Yang
cc402a588e iscsi: change the type and name of data_ref in spdk_iscsi_pdu
Change the type from int to bool and change the name
from data_ref to data_from_mempool.

Change-Id: If1fc11761e63561443ed44d6a0860e416e424df8
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-10-12 09:11:09 -07:00
Jim Harris
f7830911e2 bdevio: refactor to use event framework and I/O channels
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icea93b065b186ec998fb64bc0fc420a57060f3f9
2016-10-11 16:24:30 -07:00
Jim Harris
81b3d6c9fc Revert "bdev: enable IO vector operations"
This reverts commit 422eab7106.
2016-10-11 15:52:10 -07:00
Jim Harris
d4d82fc3ab event: directly add poller when adding to current core
This is required since pollers are now directly removed
(rather than scheduling an event) when the unregister call
is made on the poller's lcore.

Without this change, if a poller is registered then
immediately unregistered, the unregistration will seg
fault since the event adding the poller has not executed
yet.

Also add a test case that exhibits the sequence of events
described in this commit message.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5c6ba0ee224ac1f8f3ebb8e7571714e718bd42db
2016-10-11 15:35:36 -07:00
Ben Walker
0aa2986475 Replace rte_get_tsc calls with spdk_get_ticks
Change-Id: I809b900321433693ff9f2498183ad0dcdbb15030
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-11 13:34:09 -07:00
Ben Walker
2224ff2162 env: Replace rte_malloc with spdk_zmalloc
Use the env library to perform all memory allocations
that previously called DPDK directly.

Change-Id: I6d33e85bde99796e0c85277d6d4880521c34f10d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-11 13:34:09 -07:00
Ben Walker
bfdc02ab48 nvme: Eliminate nvme_impl.h and use the swappable env lib.
Change-Id: Ibbc557b732d5b0858a2922a7a442c4b17a0d579a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-11 13:34:09 -07:00
Ben Walker
e0196e8124 ioat: Remove ioat_impl, use swappable env lib instead.
Change-Id: I377e41503b349b34c9ffc911840cb8fb9b13f322
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-11 13:34:08 -07:00
Ben Walker
c0f04cedd0 env: Move memory pool into env library.
Change-Id: I8f384f4571a7b1936ff0388bb0c9fba8dcff8cc3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-11 13:33:41 -07:00
Jim Harris
534256097b bdevperf: exit with non-zero status code if any I/O fails
Also stop submitting new I/O for any target that reports
an I/O failure by setting its is_draining flag when the I/O
failure is detected.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I89c9d19b22a164caf5aef20d63b509d33b7aeef7
2016-10-11 13:33:11 -07:00
Daniel Verkamp
1a37acda67 eofnl: check for extra trailing newlines
Enforce exactly one trailing \n, and fix all of the existing cases.

Change-Id: I6218e4700e90aeb647eaee78089530c79993c8c8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-11 13:30:33 -07:00
Pawel Wodkowski
422eab7106 bdev: enable IO vector operations
This patch enables vector operation for bdev drivers aio, malloc and
nvme.
The rbd driver still handle only one vector.

Change-Id: I5f401527c2717011ecc21116363bbb722e804112
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-10-11 12:17:47 -07:00
Changpeng Liu
8646b06a6e nvme: add guard e2e data protection tests for extended lba format
Change-Id: Ic39df70ebf1dbc22c9d1898f0a9608446fad4656
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-10-10 12:51:41 -07:00
Daniel Verkamp
c7e0de8d21 bdevperf: replace rte_timers with SPDK pollers
Change-Id: I718cf58e528b0debdfa1db00a522074795890654
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-05 16:45:09 -07:00
Ben Walker
0dd80395f3 env: Move pci.c from util to env
This allows users to swap their PCI library from
libpciaccess/dpdk to another mechanism using the standard
method for swapping out the env library.

Change-Id: Ib2248f8b43754a540de2ec01897e571f0302b667
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-05 11:53:24 -07:00
Ben Walker
b9fbdd189a env: Move malloc/free wrappers into env
Change-Id: Ief591f5e23c4ae06cb77fab647a7afd082450a73
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-05 11:51:52 -07:00
Ben Walker
a4747c6048 env: Make the environment library configurable.
This allows users to swap out SPDK's third party
libraries for an implementation based on their own
framework.

Change-Id: Ia0b7384ce5e31acba5ad0d7002dec9e95b759c52
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-05 11:51:37 -07:00
Ben Walker
a30b5532cb memory: Rename to env
The new env library will wrap all third-party library
calls and be easily swappable with alternate implementations
at build time. For now, it's just the memory library
renamed.

Change-Id: I26a70933289f8137107208ba75f7520fd7a33da0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-05 09:49:35 -07:00
Ben Walker
6b1e4e732d Drop libpciaccess and switch to DPDK PCI
This patch also drops support for automatically unbinding
devices from the kernel - run scripts/setup.sh first.

Our generic pci interface is now hidden behind include/spdk/pci.h
and implemented in lib/util/pci.c. We no longer wrap the calls
in nvme_impl.h or ioat_impl.h. The implementation now only uses
DPDK and the libpciaccess dependency has been removed. If using
a version of DPDK earlier than 16.07, enumerating devices
by class code isn't available and only Intel SSDs will be
discovered. DPDK 16.07 adds enumeration by class code and all
NVMe devices will be correctly discovered.

Change-Id: I0e8bac36b5ca57df604a2b310c47342c67dc9f3c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-04 15:59:00 -07:00
Ben Walker
f4140ad023 nvme: Change the deallocate interface to generic dsm
Provide a convenience wrapper for general purpose dataset
management commands. The previous wrapper for deallocate
was difficult to use correctly and only for deallocate.

Note that the name is "dataset_management" as opposed to
"data_set_management" to match the NVMe specification.
It's questionable whether "dataset" is valid English, but
it is best to match the specification.

Change-Id: Ifc03d66dbabeabe8146968cf8a09f7ac3446ad68
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-04 14:36:09 -07:00
Ben Walker
d7bbac146c nvme: Add asserts to nvme_ns_cmd unit test.
Change-Id: I3295cf9a44fb6818bc8afe7dbdabbbdfa0003ee1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-04 14:34:07 -07:00
Daniel Verkamp
2f777920c9 test: run more unit tests under Valgrind
Where possible (for tests that don't require DPDK), run the unit tests
under Valgrind to check for memory leaks and out-of-bounds accesses.

Change-Id: Ic7b3cdd39a6d59f4e41b4a161be3363f6b076f65
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-04 09:38:34 -07:00
Daniel Verkamp
7e69966975 test/jsonrpc_server: allocate large structs on heap
Avoid putting the large JSON-RPC server structs on the stack in the unit
test code, since it confuses Valgrind.

Change-Id: I598530810aa23e802d07cd1bb94de16920f33dac
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-04 09:38:34 -07:00
Daniel Verkamp
d31df7042a test/cpp_headers: autogenerate header test files
Rather than requiring changes to a static list of header files, use the
GNU Make wildcard function to generate a .cpp file per header.

This also tests whether each header includes all of the system headers
for the types it uses.

Change-Id: I05b82510b194533672568019e138d7d1aad2e86b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-03 10:24:18 -07:00
Daniel Verkamp
59955a12d2 event: allow unregistering a poller within its poller fn
Modify the spdk_poller_unregister() function so that it works correctly
when unregistering a poller from its own callback function.

Change-Id: I57fa5ebd8a8bad522e34f597b406a4726f1b76ad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-03 08:41:26 -07:00
Ziye Yang
6c4a07ecbe scsi: change spdk_put_task to spdk_scsi_task_put
Change-Id: I2598627523b2a78b68d7e7fdadbb7d8ef44592b9
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-29 15:42:29 -07:00
liupan1111
0bde77082d Fix some cppcheck errors on lib/iscsi & lib/scsi. (#41)
Fixed error types:
 1 nullPointerRedundantCheck;
 2 unsignedLessThanZero;
 4 invalidPrintfArgType_sint;
 5 arrayIndexThenCheck
2016-09-28 13:55:56 -07:00
Daniel Verkamp
109fc9561e test/io_channel: fix one more NULL fatal assert
This was added after the previous SPDK_CU_ASSERT_FATAL change was
merged.

Change-Id: I9d26fcd78157b6c9b232ac1e7484d0939cc90612
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-28 10:28:08 -07:00
Ben Walker
a17ad921e2 Replace RTE_VERIFY with assert
We already require the assert header from the C standard library,
so use that instead of RTE_VERIFY to further isolate DPDK
dependencies.

Change-Id: I4a718af858c88aff6080e33e6c3dd533c077b8f4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-09-28 10:15:56 -07:00
Ben Walker
29004b6738 ioat: Use log library instead of ioat_printf
Change-Id: I10a71b5c83f60d3ef1bbf83b464813405edd1938
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-09-28 10:15:56 -07:00
Ben Walker
b0e349a804 nvme: Use log library instead of nvme_printf
Change-Id: Ic9b2db9bff3a914b3e5021695287157f1e076f9f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-09-28 10:15:55 -07:00
Daniel Verkamp
9e33504370 test/bit_array: add a few more tests
Add some checks to hit paths not covered by the current tests.

Change-Id: If8e7977ab8327eacfa33657d0a167f3b935b0113
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-28 08:32:42 -07:00
Jim Harris
32aa4fa0a3 util: add context parameter for unique I/O channels
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I296992b2e03b9b516cfd26726405e49616ad08a5
2016-09-28 07:53:47 -07:00
Jim Harris
c1e3a87bf7 util: add 'unique' parameter to spdk_get_io_channel
Some subsystems may wish to create unique I/O channels
which are not shared across all users of the same I/O
device on the same thread.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3ade3675d57338cf85b6a301285e6f392bd6cd2e
2016-09-28 07:53:47 -07:00
Daniel Verkamp
634786e583 test/io_channel: add to autotest and unittest.sh
Also remove libspdk_util.a from the io_channel_ut linker command, since
it already includes the tested C file directly and doesn't depend on any
other util library functions.

Change-Id: I4b3fc4d57b5af4524b53664365f6ba52686e4b80
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-27 16:32:36 -07:00
Daniel Verkamp
93c986865f test/io_channel: use SPDK_CU_ASSERT_FATAL for NULL checks
The test can't continue if a NULL pointer would be dereferenced.

Change-Id: If857057c69679de3be08c4605d15bc2b3892210a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-27 16:32:36 -07:00
Daniel Verkamp
a8cfc54e14 test/lib/scsi: add init_ut gitignore
Change-Id: I0b25963bdb2249c46aa51fb447998a185eb9368d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-27 16:25:14 -07:00
Daniel Verkamp
bb817900c9 test/nvme_impl.h: restore posix_memalign() check
If posix_memalign() fails, it may not have updated buf, so set it to
NULL explicitly.

Change-Id: I756bdc59ec1e31987ad3e6754eec4e2194b95074
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-27 15:34:34 -07:00
GangCao
372942e569 nvme: move global request_mempool allocation into nvme_impl
The user no longer needs to create the request pool.

Change-Id: I83bb8948143d4cc961d232f9f30df3106d5e0eab
Signed-off-by: GangCao <gang.cao@intel.com>
2016-09-27 14:25:39 -07:00
Cunyin Chang
d7734d165b test: Use rpc methods to create nvmf subsystem.
Change-Id: I5db50a2db0b7096a10fb97406d51410c1678dc92
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-09-27 12:04:05 -07:00
Ziye Yang
b1e3279ae0 nvmf: change nvmf_session to spdk_nvmf_session
Make the structure definition consistent

Change-Id: If147066cee041a2a357bc7efcb1f882f914e5b42
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-27 09:57:17 -07:00
Cunyin Chang
658faa3d25 test: Add calsoft test for iscsi target.
Change-Id: Iab3b7bbabc0d327a9c834bc5dbef8c339b19817d
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-09-27 08:13:07 -07:00
Cunyin Chang
3e83ccce9f test: Add idle migration test for iscsi target.
Change-Id: I971b7b61f09902d12c63b160e8b0dd9a7eb9ef51
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-09-27 08:13:07 -07:00
Jim Harris
0babf8ce81 bdev, copy: move all I/O paths to use I/O channels
bdev and copy modules no longer have check_io functions
now - all polling is done via pollers registered when
I/O channels are created.

Other default resources are also removed - for example,
a qpair is no longer allocated and assigned per bdev
exposed by the nvme driver - the qpairs are only allocated
via I/O channels.  Similar principle also applies to the
aio driver.

ioat channels are no longer allocated and assigned to
lcores - they are dynamically allocated and assigned
to I/O channels when needed.  If no ioat channel is
available for an I/O channel, the copy engine framework
will revert to using memcpy/memset instead.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I99435a75fe792a2b91ab08f25962dfd407d6402f
2016-09-26 14:02:07 -07:00
Jim Harris
fa29c70938 test/bdevio: detach from build
With the I/O channel changes, this test needs to be rewritten
to be event-based.  bdevio uses the spdk_bdev_do_work() function
to poll for completions, which is built on the check_io functions
that are going away when we move to using I/O channels.

Do not delete the code from the tree - just detach it from the
build and the test scripts for now.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I88674988db6ccb3673faf7eb5b3e79b403059fa4
2016-09-26 14:02:07 -07:00
Jim Harris
06ef766bc0 scsi: add spdk_io_channel support
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I189ea68c8550bbaeab79be36cb3c4faba7cd2f69
2016-09-26 14:02:07 -07:00
Jim Harris
ee66e58e0a util: add spdk_thread and spdk_io_channel
This patch adds a basic framework for creating I/O channels
for I/O devices.  An spdk_io_channel represents a one-to-one
mapping between a calling thread (represented by spdk_thread)
and an I/O device that the thread will perform I/O operations
on.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I658ab7f995cc962f4e2a204e058cdd3ad3fd735d
2016-09-26 14:02:07 -07:00
Ziye Yang
b0b59a356f NVMf: add spdk prefix for two funcs defined in session.h
Purpose: To make the function definition style consistent

Change-Id: I7ade943881aa5076fdd419958e386ae3c3661da6
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-23 10:07:41 -07:00
Daniel Verkamp
63408d5dd4 test: validate that all headers compile as C++
Change-Id: I743a2694a58725f51a0f3d6e1fe130df3d5cd3c5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-21 15:27:08 -07:00
Daniel Verkamp
6c5f05f177 util: add bit array data structure
Change-Id: Idab4473fa23486e72334ec07d0853c6325197c20
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-15 15:47:56 -07:00
Jim Harris
ac6e76991d test: remove unnecessary indirection in bdev_io test functions
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I43dec4387dff82d18a6ca03a21b807370e507256
2016-09-14 11:03:58 -07:00
Jim Harris
f93bb8a32d Switch spdk_bdev_read/write arg order for length and offset.
This matches the general order (LBA start then LBA count) for
the NVMe API.

While here, fix a copy/paste error in a debug message (write
instead of writev).

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ice326af5d6025867dffed4d1f6c7b81fb9eba5eb
2016-09-14 10:51:25 -07:00
Jim Harris
edbed73064 Rename and move fd related helper functions to fd.c.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ieccdd778348e8709ca4ef6cdf4f58f40021638db
2016-09-14 10:51:25 -07:00
Daniel Verkamp
5e9d859327 nvme: alloc buffer internally for non-I/O requests
Rather than forcing the NVMe library user to pass a specially-allocated
block of memory (e.g. rte_malloc() in the case of the default
nvme_impl.h), just make the NVMe library allocate a suitable buffer
itself and copy to/from the user buffer as needed.

The fast path I/O functions still require special rte_malloc()
allocations, since we don't want to add an allocation and copy to the
I/O critical path.

Change-Id: I7fe88c0ba60c859a33bbe95b7713f423c6bf1ea8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-13 12:47:46 -07:00
Ziye Yang
6a6ef0d7e0 nvmf: update nvmf_disconnect to spdk_nvmf_session_disconnect
1 Rename this function and make it more meaninful, since
we have spdk_nvmf_session_connect which is used to link a
connection to the session
2 split spdk_nvmf_session_destruct.

Change-Id: I150df7ccdf4de3428d8cecbb286d5f7944510a8c
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-13 09:50:46 -07:00
Daniel Verkamp
77e4ebe8b2 scsi: import initialization unit test
Change-Id: I10729699c539b2e28ee09444238cb6b65606c8bc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-12 10:24:49 -07:00
Daniel Verkamp
bc0867dcaf nvmf: move subsytem poller to nvmf_tgt app
The application is now entirely responsible for scheduling subsystem
pollers and sending events between threads.

Change-Id: I88da1f53b5e8852c7c4acd6f0a7a1e2219fbed41
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-12 10:10:27 -07:00
Ziye Yang
9f2fc78e3f NVMf: Handle the memory leak issue of nvmf tgt
Reason: In acceptor_poller_unregistered_event, we
directly call spdk_nvmf_check_pools and spdk_app_stop,
it will fail the memory check.

And function nvmf_delete_subsystem_poller_unreg will
not be called since we already call spdk_app_stop.

Change-Id: I3ffa30c87b149a66cee1d87d1bb81d4dc8cc96b9
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-09-09 07:58:29 -07:00
Daniel Verkamp
f9967879c6 test/nvmf: disable trace log level
The trace logs were useful during development, but now that the target
is working reliably, we can make the test output quieter and shorter by
turning them off.

Change-Id: I46cd2e22a3ccd69a5f94a1843b722f517223a343
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-08 10:09:59 -07:00
Jim Harris
d3b58c006f scsi: do not fill out more than allocation length for standard inquiry
The translation code currently cheats a bit - it allocates a full 4KB
buffer for any DATA_IN command that is not a READ, and then the
different SCSI commands that fall into this category (INQUIRY,
READ_CAPACITY, MODE_SENSE, etc.) can write as much data as they
want without having to worry about a buffer overrun.  Code higher
up the stack makes sure we only send the correct amount of data back
to the iSCSI initiator.

This patch fixes this behavior for standard INQUIRY (EVPD = 0).
Future patches will fix the behavior for other non-READ DATA_IN
commands, at which point we can remove the 4KB allocation and
only allocate the amount of data specified in the CDB.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If5e4a10eeba9851e2d91cab71228d2fc2d5baad0
2016-09-08 09:34:49 -07:00
GangCao
20953e1ccd nvme: add the APIs to use the shared memory zone
Change-Id: I7faca95a15d320f3e2940c112b91d05a69797c90
Signed-off-by: GangCao <gang.cao@intel.com>
2016-09-06 13:18:16 -07:00
Daniel Verkamp
3e9ddce6f3 test/nvmf: add virtual subsystem to nvme-cli test
Change-Id: I4880e227b90949a26670900baed6f6bcf836a66e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-30 09:28:15 -07:00
Ben Walker
b6e94ef17c bdev: Remove unecessary include from bdev.h
Change-Id: Ie8bfe32edd10f2e85bf1bc5e694853a7d6624310
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-26 09:40:01 -07:00
Ben Walker
0ea0a4e646 bdev: Use the reset enum type instead of an int
Change-Id: Ia1b6503b707d71d6e2687800e750f3c07634f8f3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-26 09:40:01 -07:00
Cunyin Chang
b4d9cca109 nvmf: Add support for virtual controller.
Change-Id: I413553fcf7315038b4ce4ac9ebea70fffbec9a3d
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-08-25 15:02:21 -07:00
Daniel Verkamp
d2ea70cafd iscsi: use spdk/endian.h functions
Switch from the non-portable <sys/endian.h> functions (htobeXX/beXXtoh)
to the SPDK endian conversion functions.

Change-Id: Id49b87f2e536c68f0d5d567e78e1990c0a37ef14
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-25 13:29:56 -07:00
Daniel Verkamp
c04b2968a6 nvmf: enforce NQN validity at creation time
Move the NQN validation into the subsytem creation function, and fix the
allowed size to match the spec.

The spec is not clear about the allowed NQN size; for now, interpret it
as 223 bytes, including the null terminator (222 bytes of actual NQN
plus one terminator byte).

Change-Id: If9743ab2fe009d9d852e8b03317d9b38d8af18dc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-24 13:34:47 -07:00
Liang Yan
d66600ebf8 nvmf/test: update subsystem unit test
Change-Id: Icf5a1def906baf783853337b9e030a76ac40292a
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
2016-08-23 09:57:05 -07:00
Daniel Verkamp
98c8867e5a scsi: move spdk_strcpy_pad() into util/string.c
This will be useful outside of the SCSI code, so put it in the common
string utility file.

Also reorder the parameters so they match the order used in strncpy().

Change-Id: I9e25a59b64e4bedf04e5a96de463b1d8aa0ddac3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-22 08:58:07 -07:00
Daniel Verkamp
759dbf46d8 nvmf: unregister subsystem poller on shutdown
Clean up the poller and only then free the associated subsystem's
memory.  This prepares for future dynamic subsystem creation/deletion.

Change-Id: I9e56cbf8822814930fdbb662095c51b6ad40fbc4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-22 08:47:51 -07:00
Daniel Verkamp
f36f4a7985 test/iscsi: add a sleep before detecting device
Allow some time for the iscsiadm login command to finish before trying
to find the attached SCSI disk. This makes the reset test consistent
with other uses of iscsiadm.

Change-Id: I9521a41b51956643a437fcaccceefd256fb4b609
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-19 13:18:20 -07:00
Daniel Verkamp
5f9fe92a9b test/ioat: shorten test times to 1 second
Change-Id: I1eb513446b80681c801d4e9588e670cbd2e4b5a2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-19 13:17:54 -07:00
Ben Walker
a9f1988ed6 nvmf: Use nvme-cli to connect inside tests
Change-Id: I953a41a54e8eddcf07a8fa607c9a1e1a34e2b20c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-19 10:53:06 -07:00
Ben Walker
0606eaad1a No longer wrap assert()
assert is part of the C standard library and is available
on any platform we'd consider porting to. Don't put a
wrapper around it.

Change-Id: I0acfdd6a8a269d6c37df38fb7ddf4f1227630223
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-19 10:53:06 -07:00
Ben Walker
888014289c nvme: No longer abstract away pthread calls
pthreads are widely supported and are available on any
platform we currently foresee porting to. Use that API
instead of attempting to abstract it away to simplify
the code.

Change-Id: I822f9c10910020719e94cce6fca4e1600a2d9f2a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-19 10:53:06 -07:00
Ben Walker
1f75a72781 ioat: No longer abstract away pthread calls
pthreads are widely supported and are available on any
platform we currently foresee porting to. Use that API
instead of attempting to abstract it away to simplify
the code.

Change-Id: I28123d427ea8da07c6329b0233f0702f2d85c2a0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-19 10:53:06 -07:00
Daniel Verkamp
69c7ff06dc json: allow decoding of non-standard comments
Comments are not allowed in the JSON RFC, but some JSON libraries accept
JavaScript-style comments.

Add a flag that enables non-spec-compliant comment parsing.

Change-Id: I9dfb66bb46ecff1a22d8af5a9c50620686a4707c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-19 09:49:18 -07:00
Daniel Verkamp
0b8198ce27 overhead: remove redundant system lib options
spdk.common.mk already adds -pthread and -lrt.

Change-Id: If6ea5aa5875ddd5043c2915dbe3e785a4dab7f56
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-19 09:47:57 -07:00
Ben Walker
f0ab59a325 nvmf: Include the JSON RPC server
This allows live configuration of the target, much like
the iSCSI target. More function calls will be added
over time.

Also, make the tests wait until the target is listening
on the RPC port to determine that the target is ready.

Change-Id: I8f762e49511d482ef820f6b25a7d3ad9a8bb41f9
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-19 09:47:04 -07:00
Tsuyoshi Uchida
0d2330c2df nvme: Add some status codes specified in NVM Express 1.2b (#37) 2016-08-19 08:52:31 -07:00
Daniel Verkamp
1d737a8dc0 test/iscsi: add target node config parsing test
Change-Id: I39d74043e73aef9e51aca342308b0ec774a9c481
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-18 09:54:34 -07:00
Daniel Verkamp
b4a15dfb46 test/iscsi: add parameter negotiation unit test
Change-Id: I9411c01960a8cff4b128a08fb42d3970915dbf6f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-18 09:54:34 -07:00
Liang Yan
2dc1a19ad9 nvmf/test:rename nvmf_c to nvmf
Change-Id: I4fd806903456232b16505aaa732d7a1239ca6e53
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
2016-08-17 14:11:51 -07:00
Ben Walker
086346a4fc event: Allow idle reactors to sleep
The user can now specify a maximum delay, in microseconds, that
defines the maximum amount of time a reactor will sleep for
between polling for new events. By default, the time is 0
which means the reactor will never sleep.

Change-Id: I94cddb69c832524878cad97b66673daa4bd5c721
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-17 10:02:38 -07:00
Daniel Verkamp
0b3bd6a9c5 nvme/overhead: track min and max submit/complete
Add slightly better statistics to get a range of values instead of just
the average.

Change-Id: I159994dce38412755afdd8980030c407125957e9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-17 09:32:37 -07:00
Daniel Verkamp
0d61bf4b50 autotest: move NVMe device cleanup to startup
Make sure any partition tables or other random data on the disks is
cleaned up before running the tests, rather than trying to clean it up
on failure when the system is in a potentially bad state.

Change-Id: Ia2119485aee6a50243744328dff2314d7a72adad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-17 09:04:16 -07:00
Tsuyoshi Uchida
81976ebd55 nvme: modify not to retry IOs on reset (#33)
When a controller reset is finished, all outstanding IOs and all queued
IOs which submitted before the reset are returned to the caller.
2016-08-15 10:01:02 -07:00
Daniel Verkamp
5d8c94536a event: hide struct spdk_poller internals
This leaves more flexibility for future changes to the poller
representation without requiring API changes (after this one).

It also prevents the user from accidentally using poller fields in a
non-thread-safe way, since they can't be accessed directly anymore.

Change-Id: I7677d5b93668665d29ae39c5e0ba74333ad3f878
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-12 10:42:12 -07:00
Cunyin Chang
fc75d2a282 nvmf: Add nvmf controller operation structure.
Change-Id: I3f8c0cea7fbbf443b13ed336a786d0e14927131e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-08-09 15:50:40 -07:00
Daniel Verkamp
f279de1f71 nvmf: set ASQSZ in discovery log
Report the maximum admin queue size correctly.

Change-Id: I52cad654bf59806e0abb8d869c22973647056617
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-08 08:45:38 -07:00
Daniel Verkamp
6697ff02f9 nvmf: test nvme cli over NVMf
Change-Id: I2d71945edc9596775092b59f70ca108c775b322e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-05 12:51:30 -07:00
Daniel Verkamp
021be6df16 bdev: add Linux AIO (libaio) backend
Change-Id: I6e7de4330f0c792514df21557a3010adef08c670
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-05 09:08:23 -07:00
Daniel Verkamp
5a9fa1d146 test/bdev: move large I/O bdevperf test to nightly
We are already testing bdevperf in the previous 'verify' test, and the
I/O splitting is handled by the NVMe-specific tests, so shorten the bdev
tests somewhat by only doing the large I/O bdevperf test in the nightly
test run.

Change-Id: I33439be4553ea94127e2039069dd7f58162e5d0f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-05 08:48:36 -07:00
Daniel Verkamp
79f158a3b2 test/iscsi: shorten FIO tests
Move the long verify to nightly testing only, and make the other FIO
invocations shorter.

Change-Id: Ic09b88aa16ad2ce62113821ad0c66dbf44a5721e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-04 16:48:35 -07:00
GangCao
b724e2e5a6 nvme: change global g_nvme_driver object to a pointer
This is a step towards enabling sharing SPDK NVMe
device access from multiple processes using DPDK's
multi-process framework.

Change-Id: I57d5eec158b42addc1036bd2583596471a467a95
Signed-off-by: GangCao <gang.cao@intel.com>
2016-08-04 15:45:35 -07:00
Ben Walker
1e92d78a10 iscsi: Add an iscsi target application
Similar to our NVMf target, this is an iSCSI target that
can interoperate with the Linux and Windows standard iSCSI
initiators.

Change-Id: I6961c5ef99f7b161c396330ed5b543ea29b0ca7b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-04 13:15:33 -07:00
Daniel Verkamp
c41ab41c17 event: add timer-based pollers
Allow pollers to be scheduled to be run periodically every N
microseconds instead of every iteration of the reactor loop.

Change-Id: Iaea3e98965d81044e6dc5ce5f406bcb7a455289e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-03 09:00:54 -07:00
Changpeng Liu
aeb3d50603 nvme: add gitignore to overhead directory
Change-Id: I83f18ad923fe8b96034f75e752180f5a4462ad1f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-08-02 14:33:21 -07:00
Ben Walker
e648950f89 bdev: Delete bdev_db
Combine the necessary functionality with the main bdev file.

Change-Id: I96d796bc87ac2a8688cdf1fd3c16d2a7c8aef730
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-02 09:08:51 -07:00
Daniel Verkamp
d054c97e65 test/nvme: add overhead to autotest
Change-Id: Ic52f23c80f8698d361064365336c32b394fd2c98
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-01 16:43:06 -07:00
Jim Harris
766da93b27 test: only apply overhead test heuristic for AIO test case
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I29ee2575ba13724baad4caac72b35c57b92347ac
2016-08-01 14:32:08 -07:00
Jim Harris
da214ab254 nvme: add new test application to measure SW overhead
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I330ca1577e5725b0e135422156328d5b165e79a3
2016-08-01 12:58:30 -07:00
Daniel Verkamp
bd4ac74eaf scsi: import SCSI/blockdev translation layer
Change-Id: Ie96943f40ea8be4156d55bc5eeacc567743cf9d6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-01 10:35:01 -07:00
Changpeng Liu
5627b6871e nvmf: add identify namespace list support to NVMf target
We reported virtualized NVMe devices through NVMe over Fabric specification,
with 1.2.1 NVMe version. For direct mode, the NVMe device maybe has lower
version, such as 1.0, the identify namespace list can not support in those
devices, so we need to add helper function here to simulate such commands
from initiator.

Change-Id: I226f4f34bf61017f538d2dd80332f1d054a501f1
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-07-29 15:49:41 -07:00
Ben Walker
8e1a8b8752 nvmf: Change fio tests to write and verify
No need to do read and writes plus verify - the verify is
a read itself.

Change-Id: I28d08717e49b1327b04490810f8e6069504173c2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-26 09:24:31 -07:00
Ben Walker
e660e677b8 nvmf: Delete partitions when tests end
Change-Id: Ia30e037e98df8b0c781ce769453bbf891091334d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-26 09:24:31 -07:00
Ben Walker
0e1dcce24a nvmf: Disconnect the initiator on test exit.
Change-Id: I8e640a77dc4c17582ff5ec0a4daba4f1d509c30c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-25 14:12:58 -07:00
Daniel Verkamp
1d81cbc955 test/nvmf: stub out per-file unit tests
Change-Id: I9606b82dbfaa6c84d8dafc07fb76a113e3436083
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-22 12:50:44 -07:00
Ben Walker
944695ca21 nvmf: Remove controller.[ch] and probe for each subsystem.
This is a much simpler approach and is only slightly
less efficient.

Change-Id: I909de376d576a74156c1be447e90e7dbc240f025
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-22 09:24:45 -07:00
Cunyin Chang
d439f4408a nvmf: Add subsystem modes
Change-Id: I74f69eb10e4d8807a323f463775f4953fe0baee0
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-07-21 17:45:06 -07:00
Daniel Verkamp
861e78bf48 bdev: add block device abstraction layer
Change-Id: I235cf146a52714756c9782c03b118f518c5f5182
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-21 10:35:03 -07:00
Daniel Verkamp
b8f95cbb1a subsystem_ut: add missing copyright header
Change-Id: I85783dcc5b8fb1ecadc8afbe9994ea97c31647c6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-20 13:46:37 -07:00
Daniel Verkamp
b1860be94a test/nvme: run hello_world example during autotest
Change-Id: I31d1a5a7a03eb4dc105f31ec031d722f5d5563e6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-20 09:05:10 -07:00
Ben Walker
88245ea26b nvmf: Rename MaxConnectionsPerSession to MaxQueuesPerSession
Change-Id: I9891f9ed481b93312152c2a59f4263003167f1d6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-20 07:26:58 -07:00
Ben Walker
207223c4f4 nvmf: Clean up documentation in configuration files
Change-Id: I030b5a60b9da513734188a02c8e5a1726f5a764c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-20 07:26:58 -07:00
Ben Walker
2b9d85c448 nvmf: Remove host.[ch] and port.[ch]
These can be simplified and merged into the subsystem.

Remove the concept of mappings from subsystems and replace
it with a list of hosts and ports. The host is optional -
not specifying a host means any host can connect.

Change-Id: Ib3786acb40a34b7e10935af55f4b6756d40cc906
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-15 14:35:24 -07:00
Daniel Verkamp
6a1383813c nvmf: rename FabricIntf to Listen, add transport
Change the Port configuration file entries to a new format:

[Port1]
  Listen <transport> <address>:<service>

Initially, this still only supports RDMA, but the new format will allow
specifying other transports once they are added.

Change-Id: Iadfd19b91db57b571064379368dbe77204ccecbb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-15 13:07:43 -07:00
Daniel Verkamp
3f80d55199 CONFIG: rename CONFIG_NVMF to CONFIG_RDMA
The NVMf target is being refactored to split the RDMA transport-specific
code into its own file.  Once this is complete, we should be able to
plug in other transports and build the NVMf target without any RDMA
dependency if desired.

To enable this, change the CONFIG option to RDMA; it still controls
whether the whole NVMf target is built for now, but once the RDMA
dependency is actually made optional, we will be able to build the
generic NVMf target code without libibverbs installed.

Change-Id: I8cd90a9aaa85dcefcc9b0f8f2e7b6af21958b2a8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-14 12:58:17 -07:00
Ben Walker
32a70c1ffc nvmf: Remove subsystem groups
This never really made sense, so replace it with a list of
subsystems.

Change-Id: Ie7a9400083c091ac7142d01c23948200f515bdf7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-14 10:35:21 -07:00
Ben Walker
b531f5914e nvmf: Remove NodeBase. Each Subsystem now defines its own NQN
This is just extra complication for no real benefit.

Change-Id: I528af98e799d0641e753390fe35ff561fa3d7d76
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-14 10:34:04 -07:00
Ben Walker
9113e6a949 nvmf: Sync before unloading the NVMf initiator
This is a bit heavy handed, but really make sure all
activity has ceased.

Change-Id: Iaa1ce16fd9e059f9eaec6712226344d69075b243
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 11:19:54 -07:00
Daniel Verkamp
c9090beffe test/nvmf: remove redundant process_core calls
This is handled by autotest.sh already.

Change-Id: I2210df16fc10f36507c469318b278d6f5568e48f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Daniel Verkamp
b6af6bc6c1 test/nvmf: leave modules alone if already loaded
There's no benefit of reloading the NIC drivers (unless the drivers
themselves are buggy), so save some time by skipping the rmmod of
drivers we are about to load.

Change-Id: I05c3fd06042a2e06333d0cac123d24e6cce65b23
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Daniel Verkamp
176856c92b test/nvmf: don't try to unload nvme module
Only nvme-rdma should be loaded as part of the NVMf testing.

Change-Id: I232363bf0988ea9bd99a37df27c39cc8e9732ad5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Daniel Verkamp
18ab3da5ad test/nvmf: clean up filesystem test
Inline function that is only called once.

Fix == bashism.

Create the filesystems on the partition created by parted rather than on
the raw namespace block device.

Add 'sync' invocations to make sure data gets flushed to the block
device we are testing.

Drop the copy-pasted FIO cleanup code (filesystem test does not run
FIO).

Change-Id: Id47d68db208a618841291c4184824031476268f1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Daniel Verkamp
de81deda06 test/nvmf: disable tracelogs for filesystem test
Change-Id: Ia29ae2504afa28dbea6c2800ca3777cdcbde4dc3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Daniel Verkamp
c4bb610d93 test/nvmf: only run RDMA NIC setup once
Change-Id: I69607670de95652f997712ad3e7441718c97e3ab
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Daniel Verkamp
e6a5bb1067 test/nvmf: make sure non-zero returns fail tests
Add 'set -e' to all nvmf test scripts.

Change-Id: I8271268a4b82335adf07719f4bde13e9086b5a77
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-11 09:13:00 -07:00
Ben Walker
11b0c3cc51 nvmf: Standardize rdma init/fini functions
Change-Id: Ifa453e865e110cd534d34aae1bc036cc9f09b1bd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-11 09:06:30 -07:00
Daniel Verkamp
20c1996756 test/nvmf: disable fio verify_async
Change-Id: If30690930087f12c82cbe0abe8345c8cc1d7d9bc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-07 17:00:00 -07:00
Daniel Verkamp
a9df326a0e nvmf: only allow one Controller per Subsystem
Multiple NVMe controllers within a subsystem does not work correctly,
since we would need to virtualize the controller data, namespace IDs,
and so on.  For now, only allow pass-through mapping of a single NVMe
controller per subsystem.

Change-Id: Ib2d3576d2856c46a086f38eb6bec56f3e7a73575
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-07 15:09:30 -07:00
Daniel Verkamp
0e93df5c34 nvme: combine CAP register into one 64-bit union
Previously, we used cap_lo and cap_hi to represent the 32-bit halves of
the full CAP register.  However, it is simpler to keep them in a single
64-bit structure, and is no less efficient on 64-bit platforms.

Also name the NSSRS field from NVMe 1.2, which was previously reserved.

Change-Id: I1d5d9b0dccbb12373b4aed3db29c883881d43223
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-07 13:52:16 -07:00
Daniel Verkamp
80c350ed69 nvmf: evaluate .. in $rootdir
Make the path to the executable shorter so it fits in the coredump.

Change-Id: I651c6cb4bd37fea51dd8e39b47a97c4edeace22f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-07 11:29:41 -07:00
Cunyin Chang
adcbbe19ff event: Add dpdk framework start function into event.
Make sure the reactor mask in profile take effect.

Change-Id: Ia471b2b88a711f05738cf93068c4f3a8c9a3039d
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-07-01 10:07:42 -07:00
Changpeng Liu
4fbe54f10e nvmf: add discovery subsystem to NVMf target
Change-Id: I4ee79ad268ae75208feddd62e22d6210a9c0d944
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-06-30 16:20:09 -07:00
Ben Walker
a84c493af3 nvmf: Enable tracing in filesystem test.
There is a sporadic error mounting ext4. Enable
tracing to attempt and catch it.

Change-Id: I8cb8425cbd076add0676064fccce66fdd4531b19
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-30 09:32:02 -07:00
Daniel Verkamp
fa45aa0ae7 nvmf: remove unused RPC section
Change-Id: Ib7b9c894573e4e8fd6e21b414fec038abd43d1e2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-29 15:37:52 -07:00
Daniel Verkamp
4946c154c2 nvmf: change default RDMA port to 4420
4420 is the officially assigned IP port from IANA for NVMe over Fabrics.

Change-Id: I433a5ed0780d1ffd7ca6512617759d59fa5e8def
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-29 15:36:14 -07:00
Daniel Verkamp
42111e78de nvmf: replace IQN references with NQN
NVMe over Fabrics defines its own NVMe Qualified Name (NQN) format; it
does not use iSCSI Qualified Names.

Also change the default node base for nvmf_tgt to "nqn.2016-06.io.spdk".

Change-Id: I2b73c1426ef1d8c83cc2df499d79228ea61257cd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-28 14:38:15 -07:00
Daniel Verkamp
19fec6bb9c nvme: add remove callback to spdk_nvme_probe()
This will allow removal notifications to be propagated to the library
user (e.g. for hotplug).

The callback is currently unused, but this at least prepares the API for
the future hotplug support.

Based on a patch by Dave Jiang <dave.jiang@intel.com>

Change-Id: I20b1c2dbf5e084e0b45a7e51205aba4514ee9a95
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-28 14:21:58 -07:00
Daniel Verkamp
e2d3cc6502 nvme: replace rte_memcpy with specialized function
Use the knowledge that both the source and destination of
nvme_copy_command() are aligned to emit the aligned variants of the
SSE2/AVX mov instructions.

Change-Id: I0a7e32a3bb10b9a1920cd85691b79fa7172eecb3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-28 14:17:21 -07:00
Daniel Verkamp
eb9d77a910 test/nvme: allocate aligned memory in unit tests
Match the expected alignment for nvme_alloc_request() and nvme_malloc()
to allow optimized memory copy code to work even in the unit tests.

Change-Id: I546692a6df9615a12a8209618fb6159a9c9e426b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-28 14:10:29 -07:00
Daniel Verkamp
2a3e39a154 nvmf: add spdk_ prefix to struct nvmf_request
Also finish up the req_state -> req conversion.

Change-Id: I131dd52dcd36a790b942e06f0207a3274cc04ffc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-27 10:24:00 -07:00
Ben Walker
d7fbeda710 nvmf: Move process_*_cmd functions to request.h/c
Change-Id: I16481463a8735f71387c69dd9ca4e187d743d8fc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 11:30:59 -07:00
Ben Walker
2a2615ec6e nvmf: Unify completion path of fabric and other commands.
Fabric commands were skipping a step, so unify all
types of requests through the same completion path.

Change-Id: I5f38a7e1cdcdf33baf71486d5ddae9f5a6157fac
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 09:25:19 -07:00
Ben Walker
6b10df3576 nvme: Update nvme_spec.h to 1.2.1
This moves some definitions from nvmf_spec.h to
nvme_spec.h based on the latest publication.

Change-Id: I51b0abd16f7d034696239894aea5089f8ac70c40
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 09:18:14 -07:00
Daniel Verkamp
1d3ee6c5f1 nvmf: remove nvmf_request cb_fn field
It is always set to nvmf_process_async_completion and is only used
within the library.

Also rename nvmf_process_async_completion to spdk_nvmf_request_complete
to clarify its purpose.

Change-Id: Ie737fb60688329bfe329a8553c4a40ff2e5f8f1d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-23 11:12:19 -07:00
Daniel Verkamp
8836a17f80 nvmf: drop redundant nvmf_process_admin_cmd params
Everything necessary for processing an admin command is now stored in
nvmf_request.

Change-Id: I74e75a5b7bb3b406ad167c2b31cab1af7a1f270a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-23 11:12:19 -07:00
Daniel Verkamp
2f5ccef310 nvmf: remove redundant nvmf_process_io_cmd params
Everything necessary for processing an I/O is now stored in
nvmf_request.

Change-Id: I3f390707ebe83ea66a116dcfda4d0388a6823629
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-23 11:12:19 -07:00
Daniel Verkamp
39cc59635a build: include -lrt and -lpthread in LDFLAGS
Simplify the build rules so that common libraries are always linked.

Also fix up a couple of -lpciaccess instances that should have been
changed to $(PCIACCESS_LIB).

Change-Id: I4c50fa3aa59cae013d3385e38fbb830794299f6e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-23 09:04:02 -07:00
Daniel Verkamp
4db1b420f4 vtophys: fix usermode address range check
vtophys() was checking for out-of-range addresses incorrectly: vfn_2mb
is already shifted to account for 2 MB hugepages, but it was being
compared with a mask that did not account for the shift.  This would
allow out-of-bounds access to the 128tb map array for certain invalid
addresses (it had no effect on addresses within the valid userspace
range).

Change-Id: Ida7455595e586494c9025f9ba65d050abb16b1b9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-22 16:41:29 -07:00
GangCao
c65210d034 nvme: return error immediately when enabling controller failed
Change-Id: Id9cf6873cc831bd5099df49db95ef5073badf461
Signed-off-by: GangCao <gang.cao@intel.com>
2016-06-21 16:37:15 -04:00
Ziye Yang
7991eb1957 Create a utility and enable WRR arbitration mechanism
Change-Id: I2194863ae812ece72c17b78e003ccf7895b8a812
Signed-off-by: GangCao <gang.cao@intel.com>
2016-06-21 16:35:04 -07:00
Ben Walker
422b147499 nvmf: Standardize names in init_grp.h
Prefix with spdk_nvmf_host.

Change-Id: I053030febf5b7157cc2c7075ac6170bc59ce0ced
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-17 13:31:05 -07:00
Ben Walker
6eb1bee64b nvmf: Rename spdk_nvmf_init_grp to spdk_nvmf_host
Host is the term used in the specification.

Change-Id: Ie9a06e3ff176e00e2fdcdc5bede701fe768d4b35
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-17 13:31:05 -07:00
Ben Walker
e1d1040703 nvmf: Improve script that detects RDMA NICs
Work around an issue with the mlx4 driver.
Make discovery of NICs more generic.

Change-Id: I9701d8d7937faa299d12d7ca4bfe1c923983c263
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-17 13:23:17 -07:00
Daniel Verkamp
1bb4fac463 nvmf: remove unimplemented AuthFile config
This enables SPDK_NVMF_BUILD_ETC to be moved out of the library as well,
since only authfile was using it before

Change-Id: I10d1145881f9a0358d7effe2d2d9851899413e1b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-09 14:25:26 -07:00
Ben Walker
58f9dcd220 nvmf: Rename SubsystemGroup to Susbystem in conf file
The section is really defining a subsystem as defined
by the NVMf specification. There does not appear to be
any need for a group of subsystems.

This change only updates the configuration file. It does
not remove all references to a subsystem group from
the code.

Change-Id: I38e62735a5ac924dcafacb3c9a332a103d751d4a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-09 14:24:57 -07:00
Ben Walker
a4b857213b nvmf: Rename InitiatorGroup config section to Host
The specification refers to this concept as a Host,
so use that term. This only changes the configuration
file usage. Initiator groups are still referenced in
the code and will be removed later.

Change-Id: I897f4dbdfb65d94da1e5a77434fc07a2c18bcdc2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-08 16:37:32 -07:00
Daniel Verkamp
1c089ae19c nvmf: rename framework.c to nvmf.c
Change-Id: Ia9b4bf4738ad9e1ae158f3a610da8f0ab87e0215
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-08 13:15:26 -07:00
Ziye Yang
34731b0b17 nvmf: create a common script file for nvmf automation test
Put the common funcs in test/nvmf/common.sh to
reduce duplicated code

Change-Id: I1c72f6fb22d092dafb7fb134b8bb3780b5525e48
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Signed-off-by: Gang Cao <gang.cao@intel.com>
2016-06-08 09:28:57 -07:00
Ziye Yang
2c43473adc nvmf: fix fabricintf parsing in spdk_nvmf_parse_port function
The index should be 0 for fabricintf.
Moreover, when there is no fabricintf found, error should
be returned

Change-Id: I3aa04566a5a318b8c921dd37c8573ed075254266
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-06-08 09:11:35 -07:00
Daniel Verkamp
d237632434 nvmf: add unit tests
Change-Id: I22c57c3989f4b69cb35ef4e17507864d0f07f084
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-08 08:49:38 -07:00
Daniel Verkamp
91330eb5c8 nvmf: add automated fio and mkfs tests
Change-Id: I499ae29155b8f053babf18750cecb5c8d210d59c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-07 10:16:01 -07:00
Daniel Verkamp
c711736d6f test/log: fix typo
Change-Id: Iff84a6e17a2e6bf5848fee33d5bf5ed289058c7c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-01 09:48:39 -07:00
Daniel Verkamp
eeeac6676d Add event-driven application framework
Change-Id: Iba90db6d8853dde972b4eec2c35eb44eeddae780
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-31 09:58:05 -07:00
Daniel Verkamp
ab1f6bdc54 nvme: add enum for opcode data direction
NVMe opcodes contain a two-bit field that encodes the expected data
direction for each command.  Add an enum and a function to extract these
bits.

Change-Id: Ie214319f121cf0899c6aa5663866f2988b128dd2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-27 08:59:14 -07:00
Daniel Verkamp
376d117c90 jsonrpc: add JSON-RPC 2.0 library
Change-Id: I4f58792c3af1f85f55144717478f868ebe5b1700
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-23 10:28:58 -07:00
Ben Walker
ddb59105ee nvme: Add an fio plugin
Change-Id: Ife815e371325df7fbec388530dc09097c3e4ffac
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-05-18 13:51:36 -07:00