Commit Graph

16477 Commits

Author SHA1 Message Date
Daniel Verkamp
36eea2e1c2 nvme/test: simplify struct zero initializations
Use {} consistently rather than {0} when initializing structs as part of
definitions.

Fixes warnings about initializing subobjects when compiling with clang.

Change-Id: I507fdf47e7c41455033d6c3d5edc563ec4667dee
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-24 10:48:46 -07:00
Daniel Verkamp
9a96ff3b9b nvme/test: build unit tests using common CFLAGS
Inherit the CFLAGS and other common setup from spdk.common.mk instead of
redefining it in nvme.unittest.mk.

In particular, this enables warnings for the unit test code that were
not enabled before.

Change-Id: Id0fbf0ee0b0d63f9de0c362d1d23e2bd036a7145
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-24 10:48:46 -07:00
Daniel Verkamp
0a92b40bb8 nvme/test: stub out missing ctrlr_cmd function
nvme_ctrlr_cmd_set_async_event_config() is called from within nvme_ctrlr
but was never stubbed out in its unit test.

Change-Id: I44002540e74ee010f21d0cf2d089d1dc51217a2f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-24 10:48:46 -07:00
Daniel Verkamp
ed24b97159 nvme/test: remove unused variable
Fixes warning about unused variable req.

Change-Id: Ic192c6f10d59f579755b3d84d5686c6cbf36ffe0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-24 10:48:46 -07:00
Daniel Verkamp
2d95465379 nvme/test: set phys_addr in stub nvme_malloc()
This prevents warnings about unused phys_addr variable in the unit
tests.

Change-Id: I022483735ba92eb112e541e6de37dc9a8c5d2b8e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-24 10:48:46 -07:00
Jim Harris
5e95ec6f47 README.md: add more detailed quick start instructions
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I267f27edb8797c794dc732334b557f44dc677015
2015-09-24 09:59:56 -07:00
Daniel Verkamp
3181a61450 nvme: replace stray printf with nvme_printf
This is the only place that was using printf directly in the NVMe
library.  Replace it with the official nvme_printf logging mechanism.

Change-Id: I689a7c0854b5e47eb357150f814e347cd44be79c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-23 16:25:16 -07:00
Daniel Verkamp
7004492324 build: check formatting with astyle
Change-Id: Ic09b4dd7ccccb557e8236fc0b7e3105fce1644b3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-23 09:05:51 -07:00
Daniel Verkamp
5abc81fd9a build: make scan-build warnings fatal
Change-Id: I70e86d4b94f24e7e915f6fe011f387919a7c76c7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 16:44:12 -07:00
Daniel Verkamp
5717784633 nvme: assert that tracker's request is valid
In nvme_qpair_complete_tracker, make sure we got a valid request in the
tracker that is being completed.

This should never occur in practice, but safeguard against it in case of
programmer error.  Fixes a scan-build warning about potential NULL
dereference.

Change-Id: Id82af604d2a5ed5de0aeccf3affa1900f6712ebe
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 16:44:12 -07:00
Daniel Verkamp
2e1b5532e1 build: handle builds with no scan-build output
Change-Id: Ic96422be95c9e4f84b34d05329ca79b4af989342
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 16:44:12 -07:00
Daniel Verkamp
c028633b50 nvme: assert valid nvme_qpair_construct parameters
Document the assumptions made by qpair_construct using asserts.

These values can't actually be 0 in practice due to the way they are
derived, but scan-build can't see that.  It is also useful to have these
asserts in case of future modifications.

Change-Id: I546c057f5cbe7ccc62acd90b595e423cd450d86a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 16:31:26 -07:00
Daniel Verkamp
b177c56881 nvme: clean up test_nvme_ctrlr_fail
Replace unnecessary allocation with a stack variable.

Clears up a potential NULL pointer dereference indicated by scan-build.

Change-Id: I81a7591729b0f1630bab9ce378716bd2369d6b85
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 16:15:48 -07:00
Daniel Verkamp
84cfc97fdf nvme: fix allocation in test_nvme_qpair_destroy
act_tr is supposed to be allocated with the system allocator
(malloc/calloc) rather than nvme_malloc.

Additionally, the size was incorrect - act_tr is an array of pointers,
not a single struct nvme_tracker.

Change-Id: I2c66b4891d11d0a8a32e3740c27fcfb42b1db2d7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 16:06:37 -07:00
Daniel Verkamp
25f0056e9b nvme: clean up test_nvme_completion_is_retry
Remove unnecessary allocation (which was missing the corresponding free
call).

Simplify code to avoid unnecessary ret_val variable.

Change-Id: I267e90d8744bf04907c610f0ff6899de7dddca71
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 15:58:35 -07:00
Daniel Verkamp
8217814218 nvme: remove dump_command and dump_completion
nvme_dump_command is totally unused aside from the unit test.

nvme_dump_completion was used in qpair, but it can be replaced with the
equivalent nvme_qpair_print_completion.

Also added the missing nvme_completion fields to nvme_qpair_print_completion
that had been printed by nvme_dump_command.

Change-Id: Ia5ee66f3553df06febe8f465d42e49a84c555dd2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 15:48:12 -07:00
Daniel Verkamp
a6cf458c9d nvme: tweak unit test PCI config space accessors
Make nvme_pcicfg_read32 set the referenced variable and make
nvme_pcicfg_write32 appear to read it so that the compiler doesn't warn
about unused/uninitialized data.

Change-Id: I4f06c0cca2fc11a8c6c5a60543c1c50a2f6a412d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 12:37:21 -07:00
Daniel Verkamp
7f9d22a494 nvme: clean up nvme_ctrlr_cmd_ut
Replace a bunch of allocations with stack variables.

Remove many unnecessary variables.

The actual tests are unchanged (and still not testing very much), but
this removes a lot of cruft that should make it easier to see what the
tests are actually doing.

Change-Id: I2c4810391cbf4d8edde88d5bc1c0dddcba3ae175
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 11:10:14 -07:00
Daniel Verkamp
18ce432337 nvme: simplify nvme_ctrlr_construct_admin_qpairs
Remove unnecessary local variables.

Change-Id: Iddcbe24f0a704b6576c9139734258a27a6d272c6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 10:12:33 -07:00
Daniel Verkamp
d7dda8ec63 nvme: delete outdated comments about xfer size
This is calculated elsewhere now, so remove the comments around
nvme_qpair_construct calls.

Change-Id: I2dc4956a9e250b88e62038bc55cdd315940ad391
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 09:40:53 -07:00
Daniel Verkamp
4f939758ea nvme: remove dead store
rc is reinitialized before it is ever read.

Change-Id: I9abbc256fb06022f3024b0aa3827be02a273f20a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 09:39:00 -07:00
Daniel Verkamp
ad74310a3a doc: update Doxyfile.nvme
Updated using 'doxyfile -u Doxyfile.nvme'.

No configuration value changes.

Change-Id: I7ad043cb3320804a419ef6353436ebe4572f9a37
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-22 09:24:40 -07:00
Daniel Verkamp
5b88369cd2 doc: add include/spdk to Doxygen path
Fixes broken links on the main page (public header nvme.h is now in
include/spdk rather than lib/nvme).

Change-Id: If85f9d676602d09f45b6a7607df5a4529f19c7ca
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-21 15:53:14 -07:00
Daniel Verkamp
a65aafd006 build: add automated build infrastructure
Change-Id: Ie929debaaa74b0d8460b508199e842a244e090fa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-21 15:53:09 -07:00
Daniel Verkamp
a56f73febb README: fix Markdown link syntax
Change-Id: I69ab57ee6307355c925c30cb379bcefe0bd90fc7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-21 14:11:31 -07:00
Daniel Verkamp
7c77021c51 Add extremely basic README.md
Change-Id: I4e41e63a075ef53a9cf93fe07dcd56a68809b73c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-21 11:32:05 -07:00
Daniel Verkamp
1010fb3af1 SPDK: Initial check-in
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-21 08:52:41 -07:00