Commit Graph

105 Commits

Author SHA1 Message Date
Daniel Verkamp
e120c17a96 examples/nvme/hello_world: specify -n to DPDK
The example won't run without specifying the number of memory channels.

Change-Id: I278c225ee82181677a6206f73a11df09fd045209
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-20 09:05:01 -07:00
Daniel Verkamp
fc8d73f896 nvme_manage: list allocated NS IDs in NS attach
Change-Id: Ie518cc5b1a9eb0cb8a59f4d101b7d2181975728d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 14:10:36 -07:00
Ben Walker
68eb363be7 perf: Write a pattern instead of 0.
Writing 0's hits SSD firmware special cases and gives
unrealistically high performance numbers.

Change-Id: I73c72ee52494075e354dcddd067e3ce49c156204
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-08 08:49:47 -07:00
Daniel Verkamp
e2256173a8 nvme/identify: dump CAP and VS registers
Change-Id: I157dc7f1eda082f1bdf0a176fc6c6061291e2ac1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-07 15:32:20 -07:00
Tsuyoshi Uchida
247a59082a nvme/perf: add min and max latency (#23)
Change-Id: I8f6ac966dad5f2ef0ab81c5160417dd6cb74a913
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-06 13:36:40 -07:00
Daniel Verkamp
19fec6bb9c nvme: add remove callback to spdk_nvme_probe()
This will allow removal notifications to be propagated to the library
user (e.g. for hotplug).

The callback is currently unused, but this at least prepares the API for
the future hotplug support.

Based on a patch by Dave Jiang <dave.jiang@intel.com>

Change-Id: I20b1c2dbf5e084e0b45a7e51205aba4514ee9a95
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-28 14:21:58 -07:00
Daniel Verkamp
e2d3cc6502 nvme: replace rte_memcpy with specialized function
Use the knowledge that both the source and destination of
nvme_copy_command() are aligned to emit the aligned variants of the
SSE2/AVX mov instructions.

Change-Id: I0a7e32a3bb10b9a1920cd85691b79fa7172eecb3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-28 14:17:21 -07:00
Ben Walker
6b10df3576 nvme: Update nvme_spec.h to 1.2.1
This moves some definitions from nvmf_spec.h to
nvme_spec.h based on the latest publication.

Change-Id: I51b0abd16f7d034696239894aea5089f8ac70c40
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 09:18:14 -07:00
Ben Walker
9a2f8eb234 nvme: Add gitignore for hello_world example
Change-Id: Ifc6632de1da6733ff78510e64d27fbfeb9ac390e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 08:55:55 -07:00
Daniel Verkamp
39cc59635a build: include -lrt and -lpthread in LDFLAGS
Simplify the build rules so that common libraries are always linked.

Also fix up a couple of -lpciaccess instances that should have been
changed to $(PCIACCESS_LIB).

Change-Id: I4c50fa3aa59cae013d3385e38fbb830794299f6e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-23 09:04:02 -07:00
Tsuyoshi Uchida
7fea41512c fix typo in fio plugin REAME (#25)
Fix defconfig_x86_64-native-linux-gcc to
defconfig_x86_64-native-linuxapp-gcc
2016-06-21 17:08:27 -07:00
Ziye Yang
7991eb1957 Create a utility and enable WRR arbitration mechanism
Change-Id: I2194863ae812ece72c17b78e003ccf7895b8a812
Signed-off-by: GangCao <gang.cao@intel.com>
2016-06-21 16:35:04 -07:00
Jim Harris
213e7a640d examples: add hello_world example for NVMe
This is a very basic example app that shows how to
use the SPDK NVMe driver API for basic enumeration and
I/O operations.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I411f6f90781832f00d98b3d6782a9c2ca6591ce3
2016-06-17 12:05:39 -07:00
Tsuyoshi Uchida
3fc793591d nvme/perf: Improve aio code
Use O_WRONLY flag for write IO
Cleanup io_context_t and io_event when perf exits

Change-Id: Iefa1d8be5e017a1ca5719489c1ec4b868df94722
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-25 15:50:14 -07:00
Tsuyoshi Uchida
239fdb3d2e nvme/perf: Free memory
Free memory of worker_thread, ns_entry and ns_worker_ctx when perf
exits.

Change-Id: I4707eea31ca1a1c4a9ce6ded857c4576e57b4532
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-24 09:55:09 -07:00
Daniel Verkamp
4957d2642a nvme: return NSID from spdk_nvme_ctrlr_create_ns()
Previously, there was no way to determine what namespace ID was assigned
when a namespace was created via the NVMe library interface.

Also drop the incorrect comment about calling
spdk_nvme_ctrlr_process_admin_completions(), since
spdk_nvme_ctrlr_create_ns() checks the admin queue internally.

Change-Id: If90a6e9fc773aefa220ebbf6effc2d033c9f20cc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-18 17:06:09 -07:00
Daniel Verkamp
8f876a612f nvme_manage: display available LBA formats
Add a helper function, get_lba_format(), to print available LBA formats,
and use it in Create Namespace as well as Format NVM.

Change-Id: I4bfa4db0aa5a083f51b8da6b5103acf64f1da788
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-18 16:52:14 -07:00
Ben Walker
ddb59105ee nvme: Add an fio plugin
Change-Id: Ife815e371325df7fbec388530dc09097c3e4ffac
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-05-18 13:51:36 -07:00
GangCao
dd27218532 nvme/identify: Correct the Arbitration Burst bits (0..2)
Change-Id: Ia9bcca01d7d2e2c0a7c97c0a7c7a49f5c3417a0b
Signed-off-by: GangCao <gang.cao@intel.com>
2016-05-16 09:56:50 -07:00
Cunyin Chang
0f805b3622 nvme_manage: Add command to support firmware upgrade.
Change-Id: I3702c979de136a4821dee671434667e8beabf119
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-05-11 10:18:38 -07:00
Changpeng Liu
de1669585e spdk/perf: add average latency statistics to perf tool
Change-Id: Ic8042e0c7b1e727292af211a3857fda987dfb2b0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-05-11 09:52:04 -07:00
Daniel Verkamp
cd48a01fcb build: wrap $(CURDIR) relative paths in $(abspath)
Resolve relative paths before using them to clean up command lines.

This should also help shorten the overall command line length that gets
embedded in the binary and used when locating the executable from a
coredump.

Change-Id: Ibff9849ede198bb04313496c8b7131485ffaf14f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-09 13:56:07 -07:00
Cunyin Chang
32ecdedda3 identify: Add support for intel marketing description page
Change-Id: I9d3db2efa7111b1812aa944d6cf591451c53baa2
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-05-06 09:01:52 +08: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
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
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
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
Daniel Verkamp
1698689412 nvme_manage: handle fgets() failure
fgets() will return NULL if it encounters EOF.

Change-Id: I35b1744514f2a90d6e95156c3916a18c1a4ecce2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-16 14:39:42 -07:00
Daniel Verkamp
4ad99808f2 nvme: allow user to override controller defaults
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>
2016-03-16 08:14:15 -07:00
Daniel Verkamp
cf0871a57e ioat: make channel allocation explicit
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>
2016-03-15 09:50:17 -07:00
Daniel Verkamp
3272320c73 nvme: make I/O queue allocation explicit
The previous method for registering I/O queues did not allow the user
to specify queue priority for weighted round robin arbitration, and it
limited the application to one queue per controller per thread.

Change the API to require explicit allocation of each queue for each
controller using the new function spdk_nvme_ctrlr_alloc_io_qpair().

Each function that submits a command on an I/O queue now takes an
explicit qpair parameter rather than implicitly using the thread-local
queue.

This also allows the application to allocate different numbers of
threads per controller; previously, the number of queues was capped at
the smallest value supported by any attached controller.

Weighted round robin arbitration is not supported yet; additional
changes to the controller startup process are required to enable
alternate arbitration methods.

Change-Id: Ia33be1050a6953bc5a3cca9284aefcd95b01116e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-14 16:00:54 -07:00
Daniel Verkamp
e3cabfafd7 nvme_manage: accept more PCI address formats
Change-Id: Ie8177b320271c9e7cb9b2216dbdd9c3c11f39579
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-11 09:37:21 -07:00
Cunyin Chang
73b0afa867 nvme manage: nvme manage tool optimization.
Change-Id: I2647451c168a7bcdc739a5f599810387f52b17a8
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-03-11 09:33:10 -07:00
Cunyin Chang
30089f8939 nvme manage: Add interface for format progress indicator.
This patch just implement the feature of format progress indicator.
the NVMe available does't support FPI currently.

Change-Id: Ie937591fb1720d8a062354322aabcc95ff14b2d3
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-03-10 09:02:06 +08:00
Daniel Verkamp
b1b84a2a66 nvme_manage: use inttypes.h SCN macro for uint64_t
Also switch from %d to %i to allow either decimal or hexidecimal input.

Change-Id: Ia866f9ab804d09e4bf8a2726b8db99208637a5ed
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-08 08:45:41 -07:00
Daniel Verkamp
2e61a144dd nvme_manage: sort devices by PCI address
This way, they are listed in a consistent order across runs.

Change-Id: Ie920f4e0c2763efb6c1d2856b5ed0f57ecbe48c8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-04 16:08:14 -07:00
Daniel Verkamp
ce13ccf8b0 nvme_manage: check NS management support earlier
Don't keep prompting the user for input if the controller doesn't
support the NS management command.

Change-Id: I5bf001657ca1cbbdbf33cafff2509ade2d47bd9d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-04 15:49:51 -07:00
Daniel Verkamp
6e2a6ff132 nvme_manage: move ctrlr_list to a local variable
This doesn't need to be stored in the device struct, since it is only
used within ns_attach(), and it is freed at the end of the function.

Change-Id: I0d4a14a6743e8cbf9e8f1a6c19c68cf0dfc2bab2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-04 15:48:45 -07:00
Daniel Verkamp
c015a2485b nvme_manage: move ndata to a local variable
This doesn't need to be stored in the device struct, since it is only
used within ns_manage_add(), and it is freed at the end of the function.

Change-Id: If725408026736d4ef9a0695ab28bc30e6648932e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-04 13:51:46 -07:00
Cunyin Chang
9841610855 spdk: Add namespace management interface and unit tests.
Change-Id: I9d203bf7532d50b1f8c8ca50c50df09ded8b5256
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-03-04 09:52:30 +08:00
Daniel Verkamp
5ee7a5df37 nvme: add spdk_nvme_ns_is_active() function
This function returns true if the namespace is active or false if it is
inactive (e.g. no namespace has been attached to the specified namespace
ID yet).

Also use the new function to add checks in the examples and tests where
applicable.

Change-Id: I35465b315ae1a1677c5a82191ad9b1da1c216d50
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-01 14:40:44 -07:00
Daniel Verkamp
bba5f43ce5 kperf: use $(MAKE) to invoke make
Change-Id: I51e587abe2c032ff97ea3133e53dd3bc36dd58cf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-23 16:36:37 -07:00
Daniel Verkamp
ab7541d810 kperf: add .gitignore entries
Change-Id: I80725118e44e147e12dcac31d0ba58f175a89d10
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-23 16:36:37 -07:00
Daniel Verkamp
5cab054f4e ioat: add spdk_ prefixes
Change-Id: Ic42f204a9a4e65661931af2220e8f8ac77242a69
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-11 12:35:57 -07:00
Daniel Verkamp
6ce73aa6e7 nvme: add spdk_ prefix
Shorten commonly-used names:
controller -> ctrlr
namespace -> ns

Change-Id: I64f0ce7c65385bab0283f8a8341a3447792b3312
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-10 11:27:45 -07:00
Daniel Verkamp
ad35d6cd86 nvme_spec: add spdk_ prefixes
Use shorter names for commonly-used objects:
namespace -> ns
controller -> ctrlr
command -> cmd
completion -> cpl

Change-Id: I97d192546b35a6aeb76ad3a709f65631502cde71
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-09 11:06:48 -07:00