Commit Graph

12855 Commits

Author SHA1 Message Date
Li Peng
33b46ee9a8 nvme: fix typos
Signed-off-by: Li Peng <lip@dtdream.com>
2016-04-26 15:49:42 +08:00
Jim Harris
d05669cef4 build: prepare spdk.common.mk for building C++ files
1) -Wstrict-prototypes applies to C code only
2) add CXXFLAGS definition

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I440702d989c4e89bd297956a58725f62d2d72831
2016-03-25 04:31:32 -07:00
Liang Yan
11932ec118 nvme/test: Update unit test for the changes of PRP entries number
Change-Id: Ib58a0da307f9c5db36f6b14acd122cf2e2a0d377
Signed-off-by: Liang Yan <liangx.yan@intel.com>
2016-04-18 13:54:26 -07:00
Daniel Verkamp
e175af8879 nvme: add workaround for VFIO initialization issue
When using DPDK PCI support via VFIO, the PCI device is reset
immediately before calling the PCI driver's init function.  In some
cases, the device seems to not be ready to handle MMIO accesses right
away.  Until the cause of this issue is fully understood, add a 500 ms
sleep as a workaround.

Change-Id: Ic893080a6f34d57eee80df3e6aa68c220c08df3e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-04-14 14:24:27 -07:00
Cunyin Chang
7b25f04c43 spdk: Enable vfio for non-privileged user.
Change-Id: I72498ed727058e472b14c8ca8ee95b5858947afe
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-04-14 14:24:23 -07:00
Daniel Verkamp
c83f9378da scripts: merge hugepage config into setup.sh
For now, drop the option to configure the number of hugepages (just use
the default 1024).

Change-Id: I686b6151e4a32ffa4ae9a9cf2694693369e03f49
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-04-14 13:36:44 -07:00
Daniel Verkamp
21173cd036 setup.sh: factor out Linux driver binding
Change-Id: I7d0d919bc8b2ffbc8856648fe746468d9b9f6702
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-04-14 13:10:30 -07:00
Changpeng Liu
b2047c2b4a SPDK: shorten the definition of data protection type
Change-Id: I98f12e78cda913c3a1f89aac18eadab1bb79eb9d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-04-11 09:28:51 -07:00
Daniel Verkamp
cf368b5e5b nvme: add sanity check to nvme_free_request()
All children must be removed from a parent request before the parent is
freed.

Change-Id: I073ff0e9c5bcdd6181d90b918bfe4cce054f6c0b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-04-08 16:51:15 -07:00
Daniel Verkamp
73de52e9ae nvme: add sanity checks to remove_child
Change-Id: Id212700459901c3f7bb6cd2f63ba1b88a7417ac2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-04-08 16:51:15 -07:00
Daniel Verkamp
2cf675bb29 nvme: rename remove_child_request for consistency
Rename nvme_remove_child_request() to nvme_request_remove_child() and
move it next to nvme_request_add_child() to make the symmetry clear.

Change-Id: I78747c44ab3db1a656b33555a45f634dc5a55b31
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-04-08 16:51:15 -07:00
Daniel Verkamp
1f19be6515 nvme: destroy I/O queues before shutdown
The NVMe specification recommends destroying all I/O submission and
completion queues before setting CC.SHN.

Change-Id: Iad71dd3fe03d897858034f3ca6ee02e0c55cc2b0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-04-08 16:47:49 -07:00
Daniel Verkamp
2f7d4bee02 nvme: do not set EN=0 during shutdown
The NVMe specification recommends that orderly shutdown should just
write CC.SHN while the controller is still enabled rather than writing
CC.EN = 0 first.

This also allows removal of the now-unused nvme_ctrlr_disable() and
nvme_ctrlr_wait_for_ready() functions.

Change-Id: I4702ffda153f218ebb8ed92f0e36144b7ceded93
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-04-08 16:47:43 -07:00
Daniel Verkamp
87a3244f97 nvme: handle CC.EN = 0 && CSTS.RDY = 1 on startup
This can happen if the controller is still resetting as the SPDK NVMe
driver takes control.

Change-Id: I263ae8f2e7b271e0448450557452a115c90c4fb6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-04-08 16:47:25 -07:00
Ziye Yang
20f92ad45a SPDK: Handle the memory leak issue for nvme_request free
This patch is used to handle the memory leak issue when
a parent nvme_request is free. In our current code,
we did not free the nvme_request allocated by the children
in the exceptional case.

Change-Id: Iabd1f1c3594af60c38e74e3d96c14f78d1aa1aed
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-04-08 09:40:07 -07:00
Ziye Yang
deb90a93de SPDK: add nvme_remove_child_request helper function
This patch is used to add a nvme_request remove child
helpler function

Change-Id: I1e5bb228d53333ca3601f4ae30fcd801ea39e532
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-04-08 09:36:57 -07:00
GangCao
4e91a0b017 manage: add support for protection info and multi-path IO
Also made a slight change in the Namespace Display output.

Change-Id: Ieee288f4ec8c91c11ed5006824a5c7c069e89b00
Signed-off-by: GangCao <gang.cao@intel.com>
2016-04-07 10:24:07 -07:00
Daniel Verkamp
2c4476560b nvme: simplify SGL length calculation
Drop the "data_transfered" variable and just update length, since length
was not used otherwise after this point in the loop.

Change-Id: Icd2991e4e85de7e8c951ba14c441434e871ea4ef
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-30 10:45:08 -07:00
Daniel Verkamp
3cec6c846b nvme: clarify single SGL descriptor case
If only one descriptor is needed, there is a special case in the spec for
SGL1 using the Data Block descriptor type.  Add a comment to make it
clear what is going on.

Also tweak the SGL1 setup to copy from the first SGL descriptor list
element instead of relying on the last value from the loop above, since
that could be easily broken by accident.

Change-Id: I49ef97fe5bf18d2bf1d86b4310a7d3abdfd03e57
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-30 10:45:08 -07:00
Daniel Verkamp
1524f2935c nvme: remove unnecessary cast
tr->u.sgl is already a struct spdk_nvme_sgl_descriptor pointer.

Change-Id: Ie2c8c052fc28e6369d1d095b8d566acae47975d1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-30 10:45:08 -07:00
Daniel Verkamp
bf6477ccab nvme: remove dead code for zero-length SGL request
_nvme_qpair_build_hw_sgl_request() will only be called for payload_size
!= 0, so every SGL will have at least one segment.  Drop the 'else' that
was handling nseg == 0, and add an assert to document the payload_size
requirement.

Change-Id: I48e2a862a7657ba85605c0d35c0b65dfac072167
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-30 10:45:08 -07:00
Daniel Verkamp
69f9796482 nvme: move assert out of SGL loop
The assert is checking a variable that is invariant within the loop, so
move the assert up to the top of the function.

Change-Id: Iee7eea1736bc7f953665feb390c3d6340dbeffbc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-30 10:44:34 -07:00
Daniel Verkamp
719eddabf2 doc/ioat: add missing parameter documentation
Change-Id: I48abf43006df2babc134ea4fef1a02a0086e778a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 11:31:16 -07:00
Daniel Verkamp
df790e8d49 doc/nvme: add missing parameter documentation
Fix up a few minor formatting issues while we're here.

Change-Id: I849572c64b4464257d878fd0a8b2dc2cc3fc6dcb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 11:19:02 -07:00
Daniel Verkamp
149ee30ee8 doc/nvme: move pages to separate text files
This makes it easier to find the larger doc comments that produce separate
pages.

It also allows removing the lib/nvme directory from the Doxyfile, so
only the public API headers are used to generate documentation.

Change-Id: I8c46edb8067a91dda5b23fb0864efd3dd8aaeba5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 10:49:06 -07:00
Daniel Verkamp
6d13f8d555 doc: create per-module directories
Prepare for adding more text files per module.

Change-Id: If08c61e2572c802d2d75a0c1b2d19d0f275885e3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 10:34:54 -07:00
Daniel Verkamp
7d74bd7072 nvme: remove duplicated doc comment
spdk_nvme_qpair_process_completions() is already documented in
spdk/nvme.h, so merge the doc comment from nvme_qpair.c into the public
header.

Change-Id: Id7722d99d209852ee64286e0a3fa127b863e10aa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 10:27:55 -07:00
Daniel Verkamp
e7499dc328 doc: make ioat and nvme section names unique
Fix section name collisions after combining Doxyfiles.

Change-Id: I9b717598f74839c0fd80415fc5c46f636801a93b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 10:20:47 -07:00
Ben Walker
c9290aa492 identify: Print out the NVMe Error Log Page
Change-Id: Ieddc9f4d7f295fc9ffa5c458d9fc8d27465425af
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-03-29 09:45:48 -07:00
Daniel Verkamp
173b4144da nvme_manage: shorten simplistic controller listing
Fit all of the info about a controller onto a single line.  This is more
readable with larger numbers of controllers.

Change-Id: I145844d5df5c0b1e3f544fd6c8d846ee94b4e662
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 09:41:23 -07:00
Daniel Verkamp
5bb16e86a1 nvme_manage: replace magic number with #define
Change-Id: I870db323a7801fc0d49cb3ad27e306c898fae603
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 09:41:23 -07:00
Daniel Verkamp
4fe88e4393 nvme_manage: only ask for required info in format
If the selected LBA format does not have metadata, skip the questions
about metadata and protection information.

Change-Id: I3620990eff2f12f2b7df2e8a293314b4001f52b2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 09:41:23 -07:00
Daniel Verkamp
90095a79fe nvme: enforce minimum and maximum I/O queues
Don't allow the user to request more than the valid maximum number of
I/O queues (65535) or 0 I/O queues, since this can't be encoded.

Change-Id: I2d6e0bba03476085842bad683b273cdf9d6e6d5e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-28 15:34:29 -07:00
Daniel Verkamp
2144f0e97f nvme_spec: fix SPDK_NVME_MAX_IO_QUEUES off-by-one
Only 65535 I/O queues are allowed, not 65536.

Each I/O queue must have a unique queue ID, and since queue ID 0 is
reserved for the admin queue, there can be only 65535 unique I/O queue
IDs.

Change-Id: I51875e5a72e08ec1727365ca9706c43f3142fd83
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-28 15:12:02 -07:00
Daniel Verkamp
42e10f3e01 autotest: only run NVMe AER test in nightly tests
Change-Id: I39c54db5474ec5fe56f83f1297aa2d0c0445baaf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-28 15:11:55 -07:00
Daniel Verkamp
6887721802 scripts/check_format: use git to find text files
Use 'git grep -I' to determine the list of files that git considers to be
text (rather than hardcoding a list of known text file extensions) and
check all of them for newline at end of file.

Change-Id: I9b947176af2792c139a2782856e3c41061e18f10
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-28 10:24:57 -07:00
Daniel Verkamp
35d53846b1 Remove static_assert fallback for old compilers
This does not work reliably, since the line number is not unique when
multiple headers that use the assert macro are included.

The automated test systems will catch any issues that would
theoretically be missed by contributors compiling with old
pre-static_assert compilers.

Change-Id: I0ded2eeb61d20a28065358cf568a329749283155
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-28 09:16:41 -07:00
Daniel Verkamp
24119894f4 nvme_spec: fix SGL descriptor bitfield order
The type field is in the 4 high bits per the spec, but nvme_spec.h had it
in the low 4 bits.

Change-Id: I04dcb8f194bdcd28da803dd512b0ac5709ce773f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-28 08:57:58 -07:00
Daniel Verkamp
982095e51f doc: use spdk.io stylesheets
Some styling needs to be applied via the Doxygen stylesheet, since the
class names don't match up with what Bootstrap uses.

Change-Id: Ie7b38259496e262752750235b0630d59b00ae492
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-25 14:00:15 -07:00
Daniel Verkamp
c843092091 doc: add default Doxygen CSS
Prepare for customizations.

Change-Id: If35d604e71d5cfe814494d542c6ce4c632ac9df6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-25 14:00:15 -07:00
Daniel Verkamp
32526ba69f doc: enable Doxygen autobrief
This treats the first line of each doc comment as the brief for that
function automatically, rather than requiring an explicit \brief tag.

Change-Id: Ia264c1611ca4b367aeda2b7500cd60c4b72fb364
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-25 14:00:15 -07:00
Daniel Verkamp
a7cab063bc doc: add links and intro blurb to main page
Change-Id: Icc4e3add7d36804de968b4ad2136af773d044001
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-25 14:00:12 -07:00
Daniel Verkamp
60811b5bf7 doc: add Doxygen-generated header.html
Prepare to customize the header.

Change-Id: I97ab3d3ea57ca843df9a1f7d76bf00172bea02e7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-25 10:06:37 -07:00
Daniel Verkamp
4b1f79b5e7 doc: merge ioat and nvme into a single Doxyfile
Add a top-level index page and convert the I/OAT and NVMe main pages
into normal pages.

Change-Id: I4e7c8d2fd43303a8aa56de921037dac96fe8a1a5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-25 09:59:39 -07:00
Daniel Verkamp
4671dbd53f nvme: add compile-time assert for SGL alignment
Per the NVMe spec, SGL segments must be Qword (8-byte) aligned.  Add a
static assert to make sure this is true for the sgl member of struct
nvme_tracker (assuming the whole nvme_tracker is at least 8-byte aligned).

Change-Id: I827aa40b56de648d83f524a4f1e79c3202b676be
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-23 10:39:30 -07:00
Daniel Verkamp
6a3735e393 nvme_manage: show supported block sizes for format
Change-Id: I4da94631d9543c6e50b3cd4f8935845a1237ccab
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-23 10:16:18 -07:00
Cunyin Chang
db3fda2e68 nvme: handle NULL ioq array in nvme_ctrlr_destruct()
Fix a potential segmentation fault issue.

Change-Id: I39d2cd1850265ca0dfa987995011563cadeb5bb5
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-03-23 09:37:02 -07:00
Daniel Verkamp
55d9ff6a66 config: make -Werror optional and off by default
Allow end users to build the code even if, for example, warnings are
added with new compilers versions.

-Werror is still enforced for automated builds.

Change-Id: I567009d55cf5b941c452bd41d09f75d03b037209
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-18 10:42:28 -07:00
Cunyin Chang
eae688576a spdk: Add nvme format interface and unit tests.
Change-Id: Ie0506debf547a5fc011e116421387a5adb7abf0e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-03-17 13:37:20 -07:00
Daniel Verkamp
4fc355ba68 examples/nvme/reserve: add malloc checks and frees
Change-Id: I576ac640c3c8a94237e5437e7e7f029d8526c071
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-17 10:07:55 -07:00