Commit Graph

2188 Commits

Author SHA1 Message Date
Changpeng Liu
ca3d1c5b45 spdk: add controller memory buffer support in driver
The D3700/D3600 series support Controller Memory Buffer(CMB) feature,
CMB is available for holding submission queues, for those controllers
which can support submission queues in CMB, user can set the option
whether to enable it or not.

Change-Id: I8b0dc9e28dd6f5bb01bee99a532087212c04e492
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-05-13 08:14:10 +08:00
Daniel Verkamp
bdece622f5 trace: add tracepoint library and app
Change-Id: I472fb7e7a82e1337c6c06b1d3bb4e8a2a13d884a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-11 10:43:09 -07:00
Cunyin Chang
f2168e1d73 nvme: Add firmware upgrade interface and unit test suite
Change-Id: If66e5f97f6793df0388629fab7c3d0e9f9d5eb67
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-05-11 10:18:33 -07:00
Daniel Verkamp
aaa533adc7 log: add SPDK logging library
Change-Id: I3d4060b619a3976ffff75c05f86214e3fcd18fb5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-09 15:54:49 -07:00
Daniel Verkamp
f9193f4ce7 json: add JSON parser and encoder libraries
Change-Id: Id73fb7e300d66d31a7c3986c0334b6f56e284905
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-09 13:30:02 -07:00
Daniel Verkamp
e42620be57 conf: add configuration file parsing library
Originally based on code from istgt.

Change-Id: Ie789ba511332528aa29f13428d95306253c2ceb5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-09 10:43:47 -07:00
Cunyin Chang
10f0f4b0e9 spdk: Add Intel specific log page.
This patch add support for Intel specific log pages :
marketing description page.

Change-Id: I87bccb2af286279598c9dd3c870094b384a0d2f7
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-05-05 13:39:14 +08:00
Daniel Verkamp
8eafb6546c doc: add Doxygen file marker to all public headers
For existing \file markers, move them to the top of the header and tweak
the wording for consistency.

Change-Id: Icce748effe4dbe97d79a8c87d31caf0ee5797058
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-04 11:17:17 -07:00
Daniel Verkamp
d0cbec4a19 lib/util: add spdk_str_trim()
Function to trim leading and trailing whitespace from a string.

Originally based on code imported from istgt.

Change-Id: I87abe584130bdf4930098fadb8e57291f18eda7f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-04 11:17:00 -07:00
Daniel Verkamp
e56aab98ac lib/util: add spdk_strsepq()
Parsing function for delimited strings with embedded quotes.

Originally based on code imported from istgt.

Change-Id: I448feb53ea232048ed8c68738e12bc3660eb4235
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-04 11:17:00 -07:00
Daniel Verkamp
c5611b26b3 lib/util: add spdk_strlwr()
Add function to convert string to lowercase in place.

Originally based on code imported from istgt.

Change-Id: Ica9fe2208e6ee09b22c9a652a33c5affe5be23cc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-04 11:17:00 -07:00
Daniel Verkamp
87d3dd870a nvme_spec: add queue size min/max constants
Change-Id: I5063212501c6ffba266d34b423170a75fb5e77c0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-03 14:58:03 -07:00
Changpeng Liu
784182ed47 SPDK: Add end-to-end data protection support in driver
For those controllers which can support end-to-end data protection
feature, add the support in the driver layer.

Change-Id: Ifac3dd89dec9860773c850416a6116113a6ce22a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-04-28 15:46:13 -07:00
Changpeng Liu
b2047c2b4a SPDK: shorten the definition of data protection type
Change-Id: I98f12e78cda913c3a1f89aac18eadab1bb79eb9d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-04-11 09:28:51 -07:00
Daniel Verkamp
719eddabf2 doc/ioat: add missing parameter documentation
Change-Id: I48abf43006df2babc134ea4fef1a02a0086e778a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 11:31:16 -07:00
Daniel Verkamp
df790e8d49 doc/nvme: add missing parameter documentation
Fix up a few minor formatting issues while we're here.

Change-Id: I849572c64b4464257d878fd0a8b2dc2cc3fc6dcb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 11:19:02 -07:00
Daniel Verkamp
7d74bd7072 nvme: remove duplicated doc comment
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>
2016-03-29 10:27:55 -07:00
Daniel Verkamp
2144f0e97f nvme_spec: fix SPDK_NVME_MAX_IO_QUEUES off-by-one
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>
2016-03-28 15:12:02 -07:00
Daniel Verkamp
35d53846b1 Remove static_assert fallback for old compilers
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>
2016-03-28 09:16:41 -07:00
Daniel Verkamp
24119894f4 nvme_spec: fix SGL descriptor bitfield order
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>
2016-03-28 08:57:58 -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
58e46b9469 doc/nvme: fix outdated references
Change-Id: I90d62dce25c5e9fdd0b346a585e6ec361dafb19d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-16 14:39:28 -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
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
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
e20639540e nvme_spec: declare CSTS with the correct type
nvme_spec.h already has a structure with the correct bitfields for the
CSTS register, so use it in struct spdk_nvme_registers.

Change-Id: Id0663aee2611fb5195f9012a3176799e32701bb0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-02 08:52:35 -07:00
Daniel Verkamp
8acc50fc05 nvme_spec: add Create I/O SQ QPRIO enum
Change-Id: Ibab79bea19048c636ebbb52ddf549840e2dfc136
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-01 14:42:04 -07: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
c0a1cd3827 ioat.h: remove duplicated spdk/pci.h inclusion
Change-Id: I9371faa22bf79a670b1ffceb5620e5fad6e58079
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-22 09:57:11 -07:00
Daniel Verkamp
5dafa4940f nvme.h: include stdbool.h and stdint.h
Explicitly include system headers for types that are used in public
headers.

These were being pulled in by example code, so SPDK itself would build,
but other apps that did not include stdbool.h would fail to compile when
including spdk/nvme.h.

Also include nvme.h first in nvme_internal.h so this case gets tested
during normal compilation.

Change-Id: I8ed0fc4e0dcf71551738c461b4b825cc2ee1d233
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-22 09:57:11 -07:00
Changpeng Liu
6d497a8e88 spdk: add NVMe controller memory buffer definitions
Change-Id: I49de87a502b979e1457bde4e850a081faee31cae
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-02-18 10:31:23 +08:00
Ziye Yang
3d7bcab40a SPDK: Add spdk_pci_device_cfg read/write for byte, word.
This patch is used to support spdk_pci_device_cfg read/write
with byte and word size.

Change-Id: I49084e231bd6b5f5b22180a3eb36ddad4430b3a4
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-02-16 09:54:43 -07:00
Daniel Verkamp
04adec22bc Add extern "C" wrapper to all public headers
Also consistently place the extern "C" before any includes or other
declarations in files that already had it.

Change-Id: Ia316d5be3e509ec76c4a98cfa90ed516073351e0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-12 07:52:35 -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
c7150a5611 ioat_spec: add spdk_ prefixes
Change-Id: I91444f10b98d7e247af5eb2fea719e283a1156a2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-11 10:39:28 -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
Daniel Verkamp
7672976a6a nvme: move class code to pci_ids.h
Move toward collecting PCI IDs, class codes, etc. in pci_ids.h instead
of individual device-specific headers.

Change-Id: Icff162d48ac663db71d0576ceee16a9bd7a751cd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-09 09:32:49 -07:00
Daniel Verkamp
8332f9e47e nvme_intel: add spdk_ prefixes and tweak names
Change-Id: I7c256bce365c92636f4f183e218117a1d7fe63d9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-08 16:53:36 -07:00
Daniel Verkamp
516c37562d vtophys: add spdk_ prefix
vtophys() -> spdk_vtophys()
VTOPHYS_ERROR -> SPDK_VTOPHYS_ERROR

Change-Id: I68ab24fbb48f419ba1d41b78d7c9958cf666b800
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-08 14:28:56 -07:00
Daniel Verkamp
40c591eac8 string: add spdk_ prefix
sprintf_alloc() -> spdk_sprintf_alloc()

Change-Id: I24970baa37615633572d132abe3e57d0889f1a48
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-08 14:28:56 -07:00
Daniel Verkamp
8cb09df68e pci_ids: add SPDK_ prefix
PCI_VENDOR_ID_INTEL -> SPDK_PCI_VID_INTEL

Also change the inclusion guard macro to be consistent with the other
SPDK headers.

Change-Id: I29346267172cb8c07cc4289eed4eca2d55e942d6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-08 14:28:47 -07:00
Daniel Verkamp
87844a30ef nvme: move struct pci_id into nvme_internal.h
This doesn't need to be part of the public API. It is only used by the
NVMe quirk lookup tables.

Change-Id: I7662e333c70b7c5f814bd7c8a528b6bff1f0732e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-08 14:00:16 -07:00
Daniel Verkamp
aae6ee8c80 file: add spdk_ prefix to public APIs
file_get_size() -> spdk_file_get_size()
dev_get_blocklen() -> spdk_dev_get_blocklen()

Change-Id: Iba1eb4a22ba331887e2c5c3a16e1c0f9e695d83e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-08 13:44:34 -07:00
Daniel Verkamp
53e45aee8c barrier: add spdk_ prefix to wmb() and mb()
Change-Id: Ie5e724e34cbcd8ef9feb9054c867fcb0065f5a1d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-08 13:32:19 -07:00
Ziye Yang
6a1463deee nvme: add definitions for nvme namespace commands
This patch is used to add enumerations for nvme
namespace attach, detach, create, and delete commands.

Change-Id: I03fb40438ba137affaf81dcf69479c83a4bb9c09
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-02-08 12:39:01 -07:00
Daniel Verkamp
93933831f7 pci: clean up public pci.h interface
Rename all functions with a spdk_ prefix, and provide enough of an API
to avoid apps needing to #include <pciaccess.h>.

The opaque type used in the public API for a PCI device is now
struct spdk_pci_device *.

Change-Id: I1e7a09bbc5328c624bec8cf5c8a69ab0ea8e8254
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-08 09:58:13 -07:00
Daniel Verkamp
9a924a066e pci: factor out PCI enumeration into util lib
This is a step toward abstracting PCI access so that libpciaccess can be
swapped out more easily.

Change-Id: I5491459460cbfbd0be471f70f9d07a7eb3175234
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-08 09:58:13 -07:00
Daniel Verkamp
047c5aaaa8 ioat: refactor ioat_attach() API into ioat_probe()
Similar to the NVMe API change, this allows better abstraction of the
PCI subsystem.

Change-Id: I2b84d9c3c498a08d4451b4ff27d0865f0456c210
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-08 09:50:57 -07:00
Ziye Yang
3c10754a8d SPDK: add the support to use pci functions provided by DPDK
This patch did the work to use pci related functions
provided by DPDK.

Change-Id: I263b79f1b42868ef0c1efcf1bc392a4b3a328e93
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-02-08 09:33:54 -07:00
Ziye Yang
ff6125195c SPDK: Support configuring libpciaccess library
With CONFIG_PCIACCESS=y in CONFIG file, we can
use libpciaccess library; With CONFIG_PCIACCESS=n
in CONFIG file, we use pciaccess functions provided
in DPDK.

Change-Id: I786c5589b8e7909ba2e59d222938dd5ba45bf92d
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-02-04 17:30:09 -07:00
Daniel Verkamp
8374a727a9 nvme: refactor nvme_attach() into nvme_probe()
The new probing API will find all NVMe devices on the system and ask the
caller whether to attach to each one.  The caller will then receive a
callback once each controller has finished initializing and has been
attached to the driver.

This will enable cleanup of the PCI abstraction layer (enabling us to
use DPDK PCI functionality) as well as allowing future work on parallel
NVMe controller startup and PCIe hotplug support.

Change-Id: I3cdde7bfab0bc0bea1993dd549b9b0e8d36db9be
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-02-03 11:15:31 -07:00
Haomai Wang
20c767e796 nvme: add support for write zeroes command
Change-Id: I07ae5805c434d3c06ac24c1a8e09c761b5506ff4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-02-03 10:28:35 -07:00
Changpeng Liu
8aa497f083 spdk: Add block fill API to ioat driver
For those Crystal Beach DMA channels which support block fill capability,
we add a fill API here that can zero out pages or fill them with a
fixed pattern.

Change-Id: I8a57337702b951c703d494004b111f6d206279fb
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-02-02 13:29:07 +08:00
Daniel Verkamp
26b1964c8f pci: fix spdk_pci_device_get_dev() accessor
spdk_pci_device_get_dev() needs to access the 'dev' member of a struct
pci_device, but the pointer to the struct is also called 'dev' in the
macro argument list.  Change it to something else so the 'dev' member
doesn't get replaced by the macro argument.

This is the minimal bug fix; more cleanup will happen later as the PCI
interface is refactored.

Change-Id: I37b4a303f980d40c5b1528293ecfd22ad0be9dc7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-29 14:26:58 -07:00
Cunyin Chang
aa2970b9f3 nvme: Add Intel NVMe device supported feature quirks
This patch adds Intel NVMe device list and overrides the
supported log pages according to the quirk list.

In particular, the READ_CMD_LATENCY and WRITE_CMD_LATENCY pages are
supported on Intel DC P3x00 devices despite not being listed in the
Intel vendor-specific log page directory.

Change-Id: I3a2b6a5fa142c6e9c93567df65e85980bd3c7cc0
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-01-29 13:45:05 -07:00
Daniel Verkamp
c02b179490 Remove year from copyright headers.
Also add a space between Copyright and (c).

The copyright year can be determined using git metadata.

Also remove the duplicated "All rights reserved." - every instance of
this line already has a corresponding "All rights reserved" immediately
below it, except for examples/ioat/kperf/kmod/dma_perf.c, where I have
added it manually.

Performed using this command:

git ls-files | xargs sed -i -e 's/Copyright(c) \(.*\) Intel Corporation. All rights reserved./Copyright (c) Intel Corporation./'

Change-Id: I3779f404966800709024eb1eb66a50068af2716c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-28 08:54:18 -07:00
Cunyin Chang
16eee6e20e spdk: Add new API to check if given feature supported.
1 Add new API nvme_ctrlr_is_feature_supported().
2 Add unit test for new API.

Change-Id: Ia6d8710755c3b13984fca9d56700efe043be1402
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-01-28 08:45:21 +08:00
Changpeng Liu
82db40dbd5 spdk: add reservation support flag to NVMe namespace
A namespace indicates support for reservations by reporting a non-zero
value in the Reservation Capabilities field in the Identify Namespace
data structure, and controller indicates support for reservation in the
Identify Controller data structure, Here we used namespace field as the
support flag.

Change-Id: I0e1e29548aa3fc8b6d3bbeb4149ec4864316f092
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-01-27 11:10:01 +08:00
Ben Walker
81f4046402 nvme: add FUA and LR support
Support for the Force Unit Access and Limited Retry
bits on reads and writes.

Change-Id: I9860848358377d63a967a4ba6ee9c061faf284d4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-01-25 15:22:26 -07:00
Ziye Yang
9195cfb207 SPDK: define spdk_* macros for getting info of pci_device
This patch is used to wrap the inner implementation
of libpciaccess and prepare for the same interface
to applications in the future patch

Change-Id: I4d40fae0bd86b451ed38dbfd9bcc015f9bfc8436
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-01-25 12:05:13 -07:00
Changpeng Liu
92fa3ec537 spdk: add NVMe reservation commands support
NVMe reservations provide capabilities that may be used by two or more
hosts to coordinate access to a shared namespace, here we add the 4
reservation commands: reservation register/acquire/release/report.

Change-Id: Ib03ae2120a57dd14aa64311a6ffeb39fda73018c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-01-25 11:42:41 -07:00
Changpeng Liu
d3d6d19bef spdk: add scattered payloads support to NVMe driver
For the purpose to support different types of input scattered payloads,
such as iovs or scattered list, we define common method in the NVMe
driver, users should implement their own functions to iterate each
segment memory.

Change-Id: Id2765747296a66997518281af0db04888ffc4b53
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-01-22 14:51:53 -07:00
Cunyin Chang
d2806e6204 spdk: Move the declaration of set/get feature API to nvme.h.
Change-Id: Iad4863b51850920fbe15fce6638c7439a94b58fd
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-01-21 15:58:01 -07:00
Cunyin Chang
ffa548df9d nvme: Add Intel vendor-specific data structures of get/set features.
Change-Id: I7afedbec40d6ea66f8a958c07413b0ef8c4fdb61
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-01-20 10:06:21 -07:00
Daniel Verkamp
ab17933468 nvme: represent log_page as uint8_t consistently
Change nvme_ctrlr_is_log_page_supported() to match
nvme_ctrlr_cmd_get_log_page().

Change-Id: I4c8a1f11044b083f8f8990ef40a4f789fa3c24e3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-15 13:44:14 -07:00
Daniel Verkamp
6109cd0220 nvme_spec: add doxygen comments for log pages
Change-Id: I9f554aa66f4a827b5f184ab170124c14fa11a134
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-15 13:01:30 -07:00
Daniel Verkamp
16194e1afe nvme: clean up Doxygen for log page functions
Change-Id: I432ca6fdcbd565414a8997f7458266a03f684838
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-15 12:55:31 -07:00
Daniel Verkamp
af99c46557 nvme: add return code to nvme_ctrlr_cmd_get_log_page
Request allocation may fail, so we need a way to indicate failure to the
caller.

Change-Id: I278c3f42e4d2fa1902bb0ab33ad3bf7c7007fd0d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-15 12:49:16 -07:00
Cunyin Chang
9945c00cf2 NVMe: Add public API to get log pages.
1 Add supported log pages data structure.
2 Bulid up supported log pages when NVME start.
3 Provide unified API for getting log pages.
3 Unit test suit optimization base on above modification.

Change-Id: I03cdb93f5c94e6897510d7f19bc7d9f4e70f9222
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-01-15 09:10:35 +08:00
Daniel Verkamp
040742359e pci: rename pci_device_has_non_null_driver to non_uio
This more accurately represents what function it performs.

Also remove pci_device_has_uio_driver() from the public API.  Callers
should use pci_device_has_non_uio_driver() instead.

Change-Id: I9623fe1345b43e981d5823804e33d01ac0d3bb1c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-12 08:58:02 -07:00
Daniel Verkamp
2ced60e9bf nvme: return number of completions processed
nvme_ctrlr_process_io_completions() and
nvme_ctrlr_process_admin_completions() now return the number of
completions processed.

This also adds the possibility of returning an error from the
process_*_completions functions (currently unused, but this at least
gets the API ready in case error conditions are added later).

Change-Id: I1b32ee4f2f3c1c474d646fa2d6b8b7bbb769785f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-11 14:44:22 -07:00
Daniel Verkamp
16a45d2591 Add static_assert fallback for older compilers
_Static_assert is new in C11, and older versions of GCC don't support
it.  Detect whether static_assert is available in <assert.h> and if not,
define a fallback macro.

Change-Id: Iaf513677e5f356832e0a3d1f6b1f4f9ea07e6627
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-08 15:29:03 -07:00
Cunyin Chang
b7b8dea6f2 SPDK: Add Intel vendor-specific log pages and data structures.
Change-Id: Ib77c8e8f4ae0fe873b5d9166472f126ccd690795
Signed-off-by: cunyinch <cunyin.chang@intel.com>
2016-01-04 15:22:17 -07:00
Daniel Verkamp
625fcb9ed3 ioat: add a union of all descriptor types
The ioat library currently only supports DMA copy operations, but the
hardware can do other types of transfers.  Add a union of the hardware
descriptor structures to enable support for the other operations in the
future.

Also add a generic hardware descriptor type to allow access to the parts
of the descriptor that are common between all types.

Change-Id: I3b54421ce771f58b78910e790b53026f311f918e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-30 09:28:47 -07:00
Changpeng Liu
81db062c52 nvme: fix wrong type of the deallocate function parameter
According to the specification, the dataset management for deallocate
attribute can support to 256 ranges, so we should use uint16_t
instead of uint8_t as the ranges parameter.

Change-Id: Ibacc00da8b4b9e2b2f3454d382aadf7ad353ff31
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-28 11:02:17 -07:00
Daniel Verkamp
c0ebf12e3e nvme/identify: identify more NVMe 1.2 features
Add support for the full set of Optional NVM Command Support bits from
NVMe 1.2, and interpret the various SGL-related feature bits.

Change-Id: Ie3fcca27571b5236479e05a1ea3b834adbeb18a8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-12-23 09:06:00 -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
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
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
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
aaf0555e03 util: add file size and block size functions
Change-Id: I0d3269805470768ce75e81955db601c48ae0e737
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-10-26 11:16:56 -07:00
Daniel Verkamp
92da744700 util: add sprintf_alloc() function
Like sprintf() with automatic buffer allocation.

This should help to avoid fixed-size buffers in
non-performance-sensitive code that formats strings.

Change-Id: I35209ae84014ed5daf41baa5b03af8a5f6b02b8e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2015-10-06 10:40:51 -07:00
Jim Harris
4ba47234f3 Add pci_device_has_non_null_driver().
This helps enable FreeBSD, where pciaccess pci_device_has_kernel_driver()
is not functional.  The function will return 0 if there is no driver
attached, or the Linux uio or FreeBSD nic_uio driver is attached.  It will
return 1 otherwise.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0921e61c9040b1e0411b5dc40b36fc7f2721c8c5
2015-09-25 12:45:04 -07:00
Jim Harris
5e1c75eedc Break out queue.h code pulled from FreeBSD into a separate file.
Then only include this new file on Linux, to help enable building
SPDK on FreeBSD.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id818a2d8662c95e603d8b580f1f4b92889cc626e
2015-09-25 12:45:04 -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