Commit Graph

11293 Commits

Author SHA1 Message Date
Daniel Verkamp
7198a4701a build: don't print subdir banners
Since the individual build steps include the path now, the subdirectory
printouts are less useful (especially with parallel make, where output
from multiple subdirs gets mixed together).

Change-Id: Ied71d39b360b847ca32ccd3547def751ddd9434c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-16 08:15:42 -07:00
Daniel Verkamp
bfafdec9ea autotest: add timing enter/exit for setup/cleanup
Change-Id: I5367f3d11db016674b4bc0e77fd81bf363c2e55c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-16 08:14:45 -07:00
Daniel Verkamp
4ad99808f2 nvme: allow user to override controller defaults
Provide a new structure, spdk_nvme_ctrlr_opts, to let the user modify
the default controller initialization options during probe/attach.

Currently, only the number of queue pairs can be modified in this way;
other options will be added later.

Change-Id: Ie27b9429291d93a9353c0d820f0ad467d3b0e7cb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-16 08:14:15 -07:00
Liang Yan
23f95df80d nvme/test: Add qprio unit test
Change-Id: I2e7cac7f7a0e65d6a15fed10ef2c0eb46b71c5e9
Signed-off-by: Liang Yan <liangx.yan@intel.com>
2016-03-15 13:02:21 -07:00
Daniel Verkamp
cf0871a57e ioat: make channel allocation explicit
Add a parameter to each I/OAT library function that requires a channel
instead of implicitly using the thread-local channel registration model.

I/OAT channels are already reported by the spdk_ioat_probe() attach
callback, so no infrastructure for channel allocation is necessary.

Change-Id: I8731126fcaea9fe2bafc41a3f75c969a100ef8f0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-15 09:50:17 -07:00
Daniel Verkamp
1dd7473078 nvme: create tracker pool in a single allocation
Replace the previous code that allocated each tracker individually with
one large allocation per queue pair.

struct nvme_tracker is now explicitly padded to reach exactly 4096 bytes
to allow normal array indexing to work correctly while maintaining the
alignment requirement that ensures each tracker's PRP list does not
cross a page boundary.

This also allows removal of the act_tr array, since the tr array can be
indexed directly now, and each tracker can store its own active state.

Change-Id: Ia7c51735b96594d12f7f478cefcc4aedc84207ad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-15 09:20:25 -07:00
Daniel Verkamp
3272320c73 nvme: make I/O queue allocation explicit
The previous method for registering I/O queues did not allow the user
to specify queue priority for weighted round robin arbitration, and it
limited the application to one queue per controller per thread.

Change the API to require explicit allocation of each queue for each
controller using the new function spdk_nvme_ctrlr_alloc_io_qpair().

Each function that submits a command on an I/O queue now takes an
explicit qpair parameter rather than implicitly using the thread-local
queue.

This also allows the application to allocate different numbers of
threads per controller; previously, the number of queues was capped at
the smallest value supported by any attached controller.

Weighted round robin arbitration is not supported yet; additional
changes to the controller startup process are required to enable
alternate arbitration methods.

Change-Id: Ia33be1050a6953bc5a3cca9284aefcd95b01116e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-14 16:00:54 -07:00
Daniel Verkamp
9f67a07fdc nvme: use full nvme_tracker space for PRP list
Since the nvme_tracker struct was extended to allow space for 253 SGL
descriptors at 16 bytes each, we can use the same amount of space in the
other branch of the union to store 506 PRP list entries at 8 bytes each.

This increases the maximum supported I/O size for PRP-only devices from
128 KB to slightly under 2 MB.

Change-Id: I2b9905be41343ff360b4cdaccca87ea6f753e89c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-14 08:25:57 -07:00
Daniel Verkamp
68ef53d128 nvme: make nvme_tracker fit in a single page
Also add a compile-time assert to make sure this doesn't accidentally
break again in the future.

Change-Id: I4d18cfbf21392291e1bdd76eff055429009d28d6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-14 08:25:57 -07:00
Daniel Verkamp
a606a3ed5c nvme/reset: simplify timing logic and shorten test
Change-Id: I070223e25988e9a35a4df91331ea88bc4f7c5f13
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-14 08:12:36 -07:00
Daniel Verkamp
cc0b900e29 nvme: don't set interrupt vector in create_io_cq
nvme_ctrlr_cmd_create_io_cq() was using the queue ID as the
IV (Interrupt Vector) field in the Create I/O Completion Queue command.

Since the SPDK NVMe driver does not enable interrupts, this is
misleading at best.

Change-Id: I3ea53701fdb9f21d9dc8d8fe20ccf2833b76cfbf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-14 08:04:44 -07:00
Ben Walker
badade1eed Update the README to point users at the examples.
This is very minimal and needs to be expanded, but
at least point the users at the examples as the next
place to go.

Change-Id: I74025f7addb994f97d01accb89d2e9bc870740bf
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-03-11 10:23:03 -07:00
Ben Walker
add1515c86 Clarifications to README.md
* List the components in the development kit
* Mention the examples directory
* Add installation commands for dependencies

Change-Id: I31302b3cd2e5df4f24b8da30af66f9f1daa11eaa
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-03-11 10:08:16 -07:00
Daniel Verkamp
e3cabfafd7 nvme_manage: accept more PCI address formats
Change-Id: Ie8177b320271c9e7cb9b2216dbdd9c3c11f39579
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-11 09:37:21 -07:00
Cunyin Chang
73b0afa867 nvme manage: nvme manage tool optimization.
Change-Id: I2647451c168a7bcdc739a5f599810387f52b17a8
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-03-11 09:33:10 -07:00
Cunyin Chang
30089f8939 nvme manage: Add interface for format progress indicator.
This patch just implement the feature of format progress indicator.
the NVMe available does't support FPI currently.

Change-Id: Ie937591fb1720d8a062354322aabcc95ff14b2d3
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-03-10 09:02:06 +08:00
Daniel Verkamp
17005b5756 nvme: remove nvme_request::timeout field
This field is write-only in the current code; the NVMe library does
not track timeouts on requests.

Change-Id: I50e53bb3c299bf16912c48be8aad3eec829154af
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-09 16:56:05 -07:00
Changpeng Liu
2374599671 spdk: fix wrong length parameter for large IO when uses hardware SGL
When I/O spans a stripe boundary, the driver splits the request into
multiple requests, so for 1 segment memory larger than the stripe
size, we also need to split the segment memory.

Change-Id: I22ea5734d7066865a57a3c90fe18d5f76f373f1d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-03-09 15:22:08 -07:00
Daniel Verkamp
04cde460cf Add a changelog
Import the release notes from previous releases and fill out the major
features for the next release.

Change-Id: I5050d6cc83a92fac4f1dbed5f7ef039cca208765
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-09 07:25:09 -07:00
Daniel Verkamp
d6540ae907 build: don't print top-level directory
For example, if the source code is located in a directory called "spdk",
don't print the "spdk/" prefix on all of the directories.

Change-Id: I9adc650b13e013773450c721c8434c6e5afeecc2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-08 10:59:56 -07:00
Daniel Verkamp
bafbc89d3a build: print path in CC, LINK, and LIB messages
This makes it somewhat clearer what is happening during parallel
builds (make -j).

Change-Id: Ibbe8862da7600e784cba64cd333086f1473455ac
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-08 10:43:29 -07:00
Daniel Verkamp
dfeacab2e2 nvme/reset: clean up Makefile
Remove the common code that was factored out to spdk.common.mk.

Change-Id: I2a6265fa144b2c03f3484e2aa528fd1e15d13429
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-08 10:43:27 -07:00
Daniel Verkamp
b1b84a2a66 nvme_manage: use inttypes.h SCN macro for uint64_t
Also switch from %d to %i to allow either decimal or hexidecimal input.

Change-Id: Ia866f9ab804d09e4bf8a2726b8db99208637a5ed
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-08 08:45:41 -07:00
Liang Yan
74a82a26b5 spdk: Add payload_offset unit test in split_test4
Add CUnit test case to verify payload_offset value in split_test4

Change-Id: I4a9a33854295ed802709bbe4f11746d284ed8cbd
Signed-off-by: Liang Yan <liangx.yan@intel.com>
2016-03-07 14:34:44 -07:00
Liang Yan
802d7fe0b9 spdk: Update sgl request unit test
Add test case which verify invalid second phys_addr would cause
_nvme_fail_request_bad_vtophys be called.

Change-Id: Id1b62e249b7192e29334bd7cab33815722f5662d
Signed-off-by: Liang Yan <liangx.yan@intel.com>
2016-03-07 14:34:33 -07:00
Liang Yan
ddc4e7d0d5 spdk: Add ns cmd readv and writev unit test
Change-Id: I993daff2e5b729c72a96e030d380a5eb71bd41e3
Signed-off-by: Liang Yan <liangx.yan@intel.com>
2016-03-07 14:34:11 -07:00
Daniel Verkamp
3cbeaae6e9 nvme: add unit tests for nvme_ctrlr_process_init()
Change-Id: I87899f1e6bff5d79e5c48fc22d6ac8cdaceee8ee
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-07 13:34:25 -07:00
Zeng Linggang
5096b4e033 build: remove redundant MAKEFLAGS set
Change-Id: I4596284950c491acc576192d8e9b3a31241fbe49
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-03-07 13:25:18 -07:00
Daniel Verkamp
2e61a144dd nvme_manage: sort devices by PCI address
This way, they are listed in a consistent order across runs.

Change-Id: Ie920f4e0c2763efb6c1d2856b5ed0f57ecbe48c8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-04 16:08:14 -07:00
Daniel Verkamp
ce13ccf8b0 nvme_manage: check NS management support earlier
Don't keep prompting the user for input if the controller doesn't
support the NS management command.

Change-Id: I5bf001657ca1cbbdbf33cafff2509ade2d47bd9d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-04 15:49:51 -07:00
Daniel Verkamp
6e2a6ff132 nvme_manage: move ctrlr_list to a local variable
This doesn't need to be stored in the device struct, since it is only
used within ns_attach(), and it is freed at the end of the function.

Change-Id: I0d4a14a6743e8cbf9e8f1a6c19c68cf0dfc2bab2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-04 15:48:45 -07:00
Daniel Verkamp
c015a2485b nvme_manage: move ndata to a local variable
This doesn't need to be stored in the device struct, since it is only
used within ns_manage_add(), and it is freed at the end of the function.

Change-Id: If725408026736d4ef9a0695ab28bc30e6648932e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-04 13:51:46 -07:00
Changpeng Liu
eb9ef5cc2b nvme: Add SGL support in NVMe driver
For those NVMe controllers which can support SGL feature in
firmware, we will use SGL for scattered payloads.

Change-Id: If688e6494ed62e8cba1d55fc6372c6e162cc09c3
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-03-04 09:36:40 -07:00
Cunyin Chang
9841610855 spdk: Add namespace management interface and unit tests.
Change-Id: I9d203bf7532d50b1f8c8ca50c50df09ded8b5256
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-03-04 09:52:30 +08:00
Daniel Verkamp
e20639540e nvme_spec: declare CSTS with the correct type
nvme_spec.h already has a structure with the correct bitfields for the
CSTS register, so use it in struct spdk_nvme_registers.

Change-Id: Id0663aee2611fb5195f9012a3176799e32701bb0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-02 08:52:35 -07:00
Daniel Verkamp
8acc50fc05 nvme_spec: add Create I/O SQ QPRIO enum
Change-Id: Ibab79bea19048c636ebbb52ddf549840e2dfc136
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-01 14:42:04 -07:00
Daniel Verkamp
345d9a4da3 nvme: add spdk_ prefix to nvme_qpair_process_completions()
This will be exposed in the public API.  This rename is in a separate
commit to ease review.

Change-Id: I1b7fef36f85265db27935ac4d22ceef3c7282502
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-01 14:42:04 -07:00
Daniel Verkamp
df26ab0583 nvme: add priority field to qpair
Set up the infrastructure for creating I/O submission queues with
variable queue priority (QPRIO in Create I/O SQ command).

Currently, this is unused, since we always use the default arbitration
method (round robin), but it will allow reinitializing submission queues
with the correct priority once weighted round robin is supported.

Change-Id: I425003879e624cfcc9687bdc495b5c1726b5a8af
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-01 14:42:03 -07:00
Daniel Verkamp
0b2848ffb8 nvme: remove nvme_ctrlr_post_failed_request declaration
This function no longer exists and was not part of the public API.

Change-Id: I94fd066b63e812367687d11bc00aa11ab88d4671
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-01 14:42:03 -07:00
Daniel Verkamp
89bf6d5ce1 nvme: add error checking for internal ctrlr_cmds
Many of the internal controller initialization functions did not check
for allocation failure; add return codes and check them where
applicable.

Change-Id: Id1b33bb06fca84035369d8b7ecd4c36b8ba7134c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-01 14:42:03 -07:00
Daniel Verkamp
5ee7a5df37 nvme: add spdk_nvme_ns_is_active() function
This function returns true if the namespace is active or false if it is
inactive (e.g. no namespace has been attached to the specified namespace
ID yet).

Also use the new function to add checks in the examples and tests where
applicable.

Change-Id: I35465b315ae1a1677c5a82191ad9b1da1c216d50
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-01 14:40:44 -07:00
Daniel Verkamp
6eb18e2f3d nvme: rename nvme_qpair to spdk_nvme_qpair
Prepare for qpair to be exposed as part of the public API.

Change-Id: Ia63e863e95554adceeade20c829f12fe346375d5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-29 10:11:35 -07:00
Ben Walker
03a0af30c8 Add the mailing list to README.md.
Change-Id: Iac2c600095042c86a51bad28038bc4b6c2f31ed2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-02-26 15:50:59 -07:00
Ben Walker
89ce43646f Add gitter link to README.md
Change-Id: I1f5858ddacdee9cc182aae627454bc146f44fa1d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-02-26 14:36:53 -07:00
Liang Yan
d6ec160211 spdk: Add sgl request unit test
Change-Id: I07b253c394d82b92564bfbdea8014e75b8dbf9ce
Signed-off-by: Liang Yan <liangx.yan@intel.com>
2016-02-26 11:14:17 -07:00
Daniel Verkamp
61f706e8c8 test/nvme/reset: fix behavior with >1 ns per ctrlr
Store each namespace's associated controller in its ns_entry structure
rather than trying to assign them during associate_workers_with_ns().

Change-Id: I679a1902d5c787e35f3afb5292342ce369f1fe52
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-25 13:26:02 -07:00
Daniel Verkamp
20abbe8abe nvme: perform resets in parallel during attach
When multiple NVMe controllers are being initialized during
spdk_nvme_probe(), we can overlap the hardware resets of all controllers
to improve startup time.

Rewrite the initialization sequence as a polling function,
nvme_ctrlr_process_init(), that maintains a per-controller state machine
to determine which initialization step is underway.  Each step also has
a timeout to ensure the process will terminate if the hardware is hung.

Currently, only the hardware reset (toggling of CC.EN and waiting for
CSTS.RDY) is done in parallel; the rest of initialization is done
sequentially in nvme_ctrlr_start() as before.  These steps could also be
parallelized in a similar framework if measurements indicate that they
take a significant amount of time.

Change-Id: I02ce5863f1b5c13ad65ccd8be571085528d98bd5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-25 13:25:59 -07:00
Daniel Verkamp
a62b194f1b nvme: add timestamp counter interface to nvme_impl
Change-Id: Ic652163e4f5944c1516eaf58615f7eabcbe34a7a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-24 21:17:12 -07:00
Daniel Verkamp
d82473cd7d nvme: remove cc.en check in ctrlr_wait_for_ready
This check was dead code, since both places that called
nvme_ctrlr_wait_for_ready() could only ever have cc.en = 1.

Remove the original nvme_ctrlr_wait_for_ready() wrapper and rename
_nvme_ctrlr_wait_for_ready() without the underscore to replace it.

Change-Id: I6c9aa6a5b93606fb89d168c23f6735fcf3a84eaa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-24 21:17:11 -07:00
Liang Yan
02191a0086 spdk: nvme ns cmd child requests testing
Two test cases should be added.
1. ns cmd don't have child requests;
2. Assert that the correct number of child requests are created
and verify that each one has the correct payload_offset.

Change-Id: I1182a1a6673ceaf2ba35be268f80d8668af82848
Signed-off-by: Liang Yan <liangx.yan@intel.com>
2016-02-24 16:57:53 -07:00