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>
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>
tr->u.sgl is already a struct spdk_nvme_sgl_descriptor pointer.
Change-Id: Ie2c8c052fc28e6369d1d095b8d566acae47975d1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
_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>
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>
Fix up a few minor formatting issues while we're here.
Change-Id: I849572c64b4464257d878fd0a8b2dc2cc3fc6dcb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
Prepare for adding more text files per module.
Change-Id: If08c61e2572c802d2d75a0c1b2d19d0f275885e3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
Fix section name collisions after combining Doxyfiles.
Change-Id: I9b717598f74839c0fd80415fc5c46f636801a93b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The next_sge callback can be called multiple times for a single I/O if
the I/O is split. Get the physical address for each element once
instead of every time the SGL is walked.
Also bake the SGL element offset into the physical address.
Change-Id: I5d83426a234ffe9d13b89621077dbbb1561181c9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Also use uint32_t consistently for counting SGL elements.
Change-Id: Ibeffffdc5e0eccd11681703cd333bfb64319e164
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This allows us to test elements with particular (mis-)alignments without
depending on the internal behavior of the DPDK allocator.
Change-Id: I006358b82ae3a677353333954ba88d1bcfe289f6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
There's no reason to use the system-defined iovec structure; we only use
it for our internal scatter-gather callbacks. Define our own structure
so it can be extended.
Change-Id: Ifc055adfdae8cddd53e7f5d638a24f1e812b1ac6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This helps identify which iteration of the test failed.
Change-Id: I9186de08ea8217348b8ee61b0ecba4e9d7ab986e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
fgets() will return NULL if it encounters EOF.
Change-Id: I35b1744514f2a90d6e95156c3916a18c1a4ecce2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
If the controller is failed, attempting to submit additional I/O is
futile - it will be immediately failed using the completion callback,
which can result in infinite recursion if the application code resubmits
I/Os on failure.
Instead, provide a way for request submission to indicate failure, and
use it to exit early if the controller is failed; this can only happen
when a reset failed (timed out).
If a request is submitted directly by the user when the controller has
failed, we can return an error code directly. For the case where I/O
was queued and is being resubmitted after a reset, we still need to call
the completion handler via _nvme_fail_request_ctrlr_failed().
Change-Id: I9e144328d524b25db2acf48e923b584746e8d0b6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This test is only intended to validate functionality, not actual
performance, so one second is plenty.
Change-Id: I2ff198c035226b50a113f9ff189c1abbd0fd1c17
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
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>
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>