Commit Graph

8134 Commits

Author SHA1 Message Date
Daniel Verkamp
7e069500ad nvme: remove unnecessary delays
These delays are left over from early development. They are completely
unnecessary and not based on anything in the NVMe spec.

Startup time should be slightly improved (on the order of 100 ms in
normal cases).

Change-Id: I9068b1a0f42feabcfe656d68be91e05a56cc53a3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-23 08:52:33 -07:00
Daniel Verkamp
7ab7984885 build: undefine _FORTIFY_SOURCE before setting it
Some compilers automatically define _FORTIFY_SOURCE to a different
value, so undefine it before setting it on the compiler command line.

Change-Id: Id662953bd4466b99d0fe9bd5bb96f9fc335ff9a8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-22 10:15:06 -07:00
Daniel Verkamp
0765bba91f ioat: add return code to ioat_process_events()
This lets us signal an error if the channel is halted in
ioat_process_channel_events().

Change-Id: Iffaf4fd1e27d1254f9d95a37d732ae4a5f3a0465
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-17 10:58:23 -07:00
Daniel Verkamp
4662e22a99 ioat: allocate descriptor rings in parallel arrays
Rather than individually allocating each ring entry, use two large
allocations, one for the hardware descriptors and one for the software
descriptor contexts.

This allows the use of simple array indexing on the rings and also
allows the removal of most of the software descriptor structure,
since the necessary information can be retrieved based on the ring
index now.

Change-Id: I73ef24450f69ca0fc35e350286282c6b1c77a207
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-16 08:59:32 -07:00
Daniel Verkamp
460327ea5c ioat, nvme: factor out MMIO helper functions
NVMe doesn't require the specific 64-bit MMIO ordering on 32-bit
platforms performed in spdk_mmio_read_8(), but it doesn't hurt.
We have to pick one of the two possible orderings, so pick the one
required by I/OAT.

Change-Id: I2b909d64d0c077b797d0f64a11d78d1ecc55eec7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-10 17:05:08 -07:00
Daniel Verkamp
25cad6ffcf ioat: clean up on exit in examples
Previously, the cleanup functions were only being called if there was an
error during initialization.

Change-Id: I1606cfa9a9c3732d670131f78249d34a5db47403
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-09 10:14:52 -07:00
Daniel Verkamp
d4ab30ba33 ioat: add user-mode Intel I/OAT driver
The ioat driver supports DMA engine copy offload hardware available on
Intel Xeon platforms.

Change-Id: Ida0b17b25816576948ddb1b0443587e0f09574d4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-09 10:14:15 -07:00
Daniel Verkamp
8925d9dec0 build: allow overriding CONFIG_COVERAGE
Make the CONFIG_COVERAGE definition in CONFIG consistent with the other
ones using ?=.

Change-Id: I5994b936eebf80dfff9733d38c842c4bb214c591
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-08 16:25:08 -07:00
Daniel Verkamp
8acae77e42 build: default to CONFIG_DEBUG=n
Normal users building SPDK probably won't read CONFIG, so provide a
reasonable default of release-mode builds.

Change-Id: I2609aa445eabf83bd2cdbe79c548d8c0da7db7e1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-08 15:54:05 -07:00
Daniel Verkamp
c714a9f06f configure_hugepages: use number of pages on FreeBSD
Also request fewer huge pages overall during autotest.

Change-Id: I6744c9a948e8db24b8ed3c7d9d99c89e1e50ba9c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-07 16:32:19 -07:00
Daniel Verkamp
01b48b7c90 build: define a common Makefile clean command
Use $(CLEAN_C) throughout the Makefiles to clean up a consistent set of
generated files.

This also adds coverage files to the list of cleaned files.

Change-Id: Iceb922935a45c9eecbf2f3443bd0ee4f5c966825
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-07 15:14:36 -07:00
Ben Walker
af2a731de3 build: Allow relative path for DPDK_DIR
This is very convenient. It also works from subdirectories, as
long as you adjust the relative path you pass appropriately.

Change-Id: I8cfeac380ccb5fad4389ee1feb838f986a837f11
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2015-12-07 14:08:28 -07:00
Liang Yan
ed616a7902 nvme: test admin and io queue in nvme_qpair_destroy
Change-Id: Ic0377960a75d0ec9ed9eb489e7806dc4b27e8be5
Signed-off-by: Liang Yan <liangx.yan@intel.com>
2015-12-04 09:37:57 +08:00
Daniel Verkamp
2a00199d30 nvme: minor nvme reset test cleanups
Change-Id: Ia397d4c8325d059b19a41e079789e157dca5dfb1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-02 16:17:30 -07:00
Jim Harris
df7eb6361a Improve parsing of readelf output in process_core logic.
Sometimes readelf prepends an "fname: " note, to the line
with "psargs", and in that case just using awk with $2 does
not work.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6695352da641111f90be9f3e519accbf05107e91
2015-12-02 13:58:58 -07:00
Liang Yan
1df5899cf5 nvme: Add reset test tool
Realize reset tool to test nvme reset function.

Change-Id: Ia38de1907ddce46738f74b65d3d15ca9f911ac7f
Signed-off-by: Liang Yan <liangx.yan@intel.com>
2015-12-01 13:26:16 +08:00
Jim Harris
366d931183 Reduce NVME_MAX_IO_QUEUES to 1024.
Most devices today support far fewer than 1024, but this is a
more reasonable default upper limit than the spec-defined 64K.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia8a6d80c3a5aa181f27c8354758c6ca468013d92
2015-11-30 09:33:34 -07:00
Jim Harris
38ea764f6d Conditionally add -lrte_malloc.
librte_malloc has been deprecated by DPDK, but to allow for backwards
compability, check for its existence and link with it if it exists.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3e05a3295b6768bd6804a8ec86c301e22040df37
2015-11-30 08:54:39 -07:00
Daniel Verkamp
ecf1d7d4d4 build: use $(LIB) as library target name
lib/memory was already using this pattern; extend it to lib/util and
lib/nvme.

Change-Id: I84a633d7805522fc94d8fc11ad5486ce552702e5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-11 14:59:55 -07:00
Daniel Verkamp
1c3b08c63c build: move $(OBJS) definition to spdk.common.mk
Change-Id: I2dd592269ef644cfe73921151b9b174dc255323d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-11 14:59:55 -07:00
Daniel Verkamp
3d988d287a build: use $(APP) target consistently
Replace $(UT_APP) in nvme.unittest.mk with $(APP); there is no actual
difference in the way they are used.

Change-Id: I039c2488ee998ee8b1a67af129045b66a97bc29c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-11 14:59:54 -07:00
Daniel Verkamp
1c28700070 build: remove useless 'objs' targets
The .o files are always kept anyway, so there is no need for an explicit
rule.

Change-Id: Id1687ba89daabfda5802e4328deb127403277928
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-11 14:59:54 -07:00
Daniel Verkamp
dba4829471 build: factor out common compile and link commands
Add common $(COMPILE_C), $(LINK_C), and $(LIB_C) variables that contain
the commands to build a .o from a .c, an app from objects and libraries,
and a library from objects, respectively.

Change-Id: Ie2eaa13156b8bf3db7a4ffa66161382d829aef07
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-11 14:59:54 -07:00
Daniel Verkamp
22eced89c4 build: simplify vtophys test Makefile
Use the standard pattern of OBJS automatically generated from C_SRCS,
and also link against libspdk_memory instead of including the object
file directly.

Change-Id: I0c8cd8996cde2bcc1f25d9d97811fff3b0bbc88b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-11 14:59:54 -07:00
Daniel Verkamp
d6cf6b44a2 lcov: enable branch coverage
Change-Id: Idf98cf36c2e1080d204a475272302e0d7229a280
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-11 14:54:28 -07:00
Daniel Verkamp
9ea5194634 build: simplify dependency generation
Modern GCC and Clang versions can generate .d files without needing the
complex sequence of sed scripts that we currently use.

Also adjust the .o rule so the .d file is regenerated if it gets
deleted.

Also make the .o depend on all of the Makefile fragments in
$(MAKEFILE_LIST) so that it is rebuilt if the Makefile is changed.

Change-Id: I44e186c0f34dabfa0cf35db1ffa66b84d9dae87d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-10 14:40:22 -07:00
Daniel Verkamp
8836b6f681 doc: tweak Doxygen footer
Remove the $generatedby string, which contains the current date, causing
diffs whenever the docs are regenerated even if there is no new content.

Change-Id: I2a45a086d464bb23cac4b9ffc802666722c45d06
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-10 09:31:16 -07:00
Daniel Verkamp
68ff76297b nvme/perf: add -m option to limit max completions
Change-Id: Idb607f2024f1640d2f4a92e310360e0fc9bba67d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-05 16:45:33 -07:00
Daniel Verkamp
afee86f9f8 nvme/perf: rename -m option to -c to match DPDK
Change-Id: I367bb9d3804ae7808a10c6166f0e752b7d6ce87f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-05 16:38:54 -07:00
Daniel Verkamp
668847e150 nvme: add max completions limit to I/O polling
nvme_ctrlr_process_io_completions() now takes a second parameter,
max_completions, to let the user limit the number of I/Os completed on
each poll.

If there are many I/Os waiting to be completed, the
nvme_ctrlr_process_io_completions() function could run for a long time
before returning control to the user, so the max_completions parameter
lets the user have more control of latency.

Change-Id: I3173059d94ec1cc5dbb636fc0ffd3dc09f3bfe4b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-05 15:07:52 -07:00
Daniel Verkamp
181de7bf79 nvme: reorder nvme_controller for better packing
After converting is_resetting to bool, it is smaller and can be packed
more efficiently with is_failed and reordered after the larger fields
used in the I/O path.

Change-Id: Ifa2301eb61ce8d38eb5412cca61d2a91b1474101
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-05 12:48:55 -07:00
Daniel Verkamp
bc185fe7dc nvme: convert is_resetting to bool
It was previously uint32_t because it was accessed with special
uint32_t-only atomic read/write helper functions, but that was replaced
with normal variable accesses protected by a mutex.

Change-Id: I304a7ef8c723cb33fd08110b697f848823a163e7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-05 12:48:55 -07:00
Daniel Verkamp
4d7b500ade README: add link to Doxygen API docs
Change-Id: I0b91e14ccce642079537abc09d92682ee5598c2d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-04 15:07:46 -07:00
Daniel Verkamp
f04508a30c README: add Travis CI build status image
Change-Id: I2555c069bc9f0847636dc662639ad13e589a28f2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-04 14:39:38 -07:00
Daniel Verkamp
7cb4463dc5 build: use -std=gnu99 rather than -std=gnu11
We don't use any C11-specific features, and switching to C99 will allow
us to support older versions of GCC.

In particular, the version of GCC used by Travis CI is too old to
support -std=gnu11.

Change-Id: Id5bd8351fdd83e7f4b6703048a921c78c3f06ec6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-04 14:39:38 -07:00
Daniel Verkamp
189814de83 autotest: tweak nvme/perf command to test splits
Previously, the I/O splitting code and child I/O completion were not
being tested (aside from in the unit tests).

Tweak the I/O size so that it will get split into two child I/Os on
devices with 128 KB striping.

This causes nvme_cb_complete_child() to be exercised, improving code
coverage.

Change-Id: Ia0299f7f809f8edb93452b5ad45939977a9f67f1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-04 14:35:25 -07:00
Daniel Verkamp
555a3d85c6 build: add Travis CI integration
Use the container-based travis-ci.org infrastructure to run only the unit
tests.

Change-Id: I4f7d011edb07341a668fa6fea495f6eb2a9c029b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-04 11:05:59 -07:00
Daniel Verkamp
3677f46af8 build: allow make to work from any directory
Set SPDK_ROOT_DIR explicitly in each Makefile so that make from a
subdirectory will work (assuming all dependencies from the upper
directory have already been built).  This allows partial rebuilds of the
source tree, as well as building the unit tests without requiring DPDK.

Change-Id: I3f65b805d490b40ff5ec53cceb61df542ce814f1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-04 10:19:08 -07:00
Daniel Verkamp
35e56a9603 nvme/perf: let all threads complete on error
Previously, as soon as a worker thread failed, the program would exit
before printing results.

Also add a message at exit time if any errors occurred during test
execution.

Change-Id: I7b3920f0acb8ce364e2bc5cbb78bbe88f3fa7146
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-03 15:57:33 -07:00
Daniel Verkamp
55f3f20e3b nvme/perf: increase task pool size
This matches the size of the request pool and enables running with a
higher concurrency level.

Ideally, these limits should be calculated from the requested queue
depth and number of workers, but for now, just increase the hardcoded
limit.

Change-Id: I6e890efc78a1336dddc0ab61db20c68004b30f54
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-03 15:57:33 -07:00
Daniel Verkamp
cfc88a45d0 nvme/perf: capture master lcore return code
Previously, if the work function on the master lcore failed, the perf
program would still return with a successful exit code.

Change-Id: Iec91c1f60824759ae62476ef6dce670fd402ddc5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-03 15:57:33 -07:00
Daniel Verkamp
a900f9ac9a nvme/perf: check nvme_register_io_thread() status
Do not continue running the thread work function if that thread could
not get an I/O queue.

Change-Id: I89033250bde0663f073ff35c76d1558d55b72ece
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-03 15:57:33 -07:00
Daniel Verkamp
c04ba5e952 nvme/perf: check memory allocations
Change-Id: I1ca8203a4f803e04afececc8f382cd088c53d63e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-03 15:57:33 -07:00
Daniel Verkamp
860c3ed1ba autotest: use hostname as lcov test name
This will allow us to figure out which test machines actually executed
each path when the results are combined.

Change-Id: I965fed0153f5d28aa8a0ff5e0d02fed19b49003d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-03 15:54:11 -07:00
Daniel Verkamp
f40e98d200 autobuild: add sleep to fix dependency test
With a reasonably fast machine, the full build can take less than a
second.

Make sure that at least one second has passed so the stat output will
differ when testing Makefile dependencies.

Change-Id: I462944d00c9c2ace2f6a1a7d6dadec4f77c25784
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-03 15:19:36 -07:00
Ben Walker
70db0e1c08 nvme/perf: Add support for multiple cores per device.
Intelligently allocate cores and devices to handle
the following cases:

1) Equal cores and devices
2) More cores than devices by using multiple cores per device
3) More devices than cores by using multiple devices from a single core

Change-Id: I3703f5c523268539bd00d399fe104c474a8e8c99
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2015-11-03 13:07:37 -07:00
Daniel Verkamp
afed5ba9da build: disable missing field initializer warning
This partially reverts commit fd93c1b1ef.

Older versions of GCC don't consider the empty initializer to be
acceptable when this warning is turned on.

Change-Id: I5c1c22ca988f464990c68eb56e4dd4d51cb99410
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-02 19:47:34 -07:00
Daniel Verkamp
2e03f6fe1c build: enable strict prototypes warning
This catches functions with empty parameter lists, which are not the
same as void parameter lists in C, as well as other (less-likely)
K&R-style parameter lists.

Change-Id: I18b09e01a60b3669d1cc5d8d96eec20cd872c497
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-02 16:05:06 -07:00
Daniel Verkamp
8307eb5f55 build: enable missing function declaration warning
This helps weed out functions that should be static, functions that are
not declared in public header files, and .c files that don't include
their .h interface headers.

Change-Id: Ie39f83ad4b320847e4a938bd1d4d0b4fa21c2ffa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-02 14:40:23 -07:00
Daniel Verkamp
e9fa656027 build: enable -Wextra except -Wunused-parameter
-Wold-style-declaration, -Wsign-compare, and
-Wmissing-field-initializers are included in -Wextra.

-Wunused-parameter is not very useful, so disable that explicitly, but
enable the rest of -Wextra.

Change-Id: I034b368d16306544e0eadafab9ec1ccf27f21645
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-11-02 14:40:22 -07:00