Commit Graph

330 Commits

Author SHA1 Message Date
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