Commit Graph

2214 Commits

Author SHA1 Message Date
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