Commit Graph

1260 Commits

Author SHA1 Message Date
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
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
1010fb3af1 SPDK: Initial check-in
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-09-21 08:52:41 -07:00