Commit Graph

7941 Commits

Author SHA1 Message Date
Cunyin Chang
8a7aabeae3 nvme/perf: support Intel read/write latency statistic log page
Optionally enable and display the I/O latency histograms as reported by
the hardware if supported (e.g. Intel DC P3x00 NVMe devices).

Change-Id: I5c0138d51a282138b74f36fe8e1461c9444e6d0f
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-01-29 14:18:39 -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
Daniel Verkamp
cbcfe37a56 nvme: move request fail call into request builder
This will allow replacing these _nvme_fail_request_bad_vtophys() calls
with the correct error later. vtophys is not actually used within the
SGL request builder, so this is the wrong error.

Change-Id: Ibc2a3b029a8abad1d563b9df200325d7d64498da
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-27 16:52:53 -07:00
Daniel Verkamp
f856fd7138 nvme: split contiguous request building into a function
No code change, just moved into a function for readability.

Change-Id: I883443c06d961c6dbeffed1a6fb153177e6e3fcd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-27 16:52:53 -07:00
Daniel Verkamp
407a57165d nvme: combine various payload types into a struct
This cleans up the I/O splitting code somewhat.

It also moves the SGL payload function pointers up into the hot cache
section of struct nvme_request without pushing the other important
members past the cacheline boundary (because payload is now a union).

Change-Id: I14a5c24f579d57bb84d845147d03aa53bb4bb209
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-27 16:52:53 -07: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
Ziye Yang
a4133bc687 SPDK: remove the unnessary pci_device parameter
This patch is used to remove unnessary pci_device
related parameter

Change-Id: I8869307f49364797543c88ffa9c456da34d1487d
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-01-25 14:34:29 +08: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
Daniel Verkamp
b8d31e2454 doc: define away __attribute__ for Doxygen
Doxygen doesn't understand GCC attributes, so use the PREDEFINED setting
to define it to nothing.  Otherwise, Doxygen's parser gets confused on
e.g. packed structs.

Change-Id: I25b2a5fd7cfcc5014408c93d1913128e863dc60c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-22 08:56:51 -07:00
Changpeng Liu
bf927b44c8 spdk: add the ioat_kperf test tool to autobuild system
Change-Id: If45a7fd3d6d3a7a52e71595de32ea4cf04e23d36
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-01-22 07:58:13 -07:00
Cunyin Chang
3f7cfd212a SPDK: Add Intel vendor-specific log.
Change-Id: Ic4ff5859f24e7cc1c7b1ceece1234f0bf6c0ab71
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-01-21 16:22:39 -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
Changpeng Liu
0021c23dfe spdk: show total performance result in the ioat_kperf tool
Change-Id: I68010590988fb3e1314922501e45381a029fb9f6
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-01-21 14:37:57 -07:00
Daniel Verkamp
a7c6c3cc18 README: add libaio dependency
libaio is required by examples/nvme/perf on Linux, so add it to the list
of dependencies to install before building.

Change-Id: Iae590153f54327711081f9e81538dae4b2ef3f71
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-21 10:47:55 -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
Changpeng Liu
81a36e1c1a spdk: show error message when no DMA channel found
We will check the DMA channel count which associated with kernel
ioatdma driver, and print the error message when no DMA channel
found.

Change-Id: I1d24108acb8fc6ee0c8f6041072e2dd528f55b24
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-01-21 09:17:49 +08:00
Daniel Verkamp
97601bb358 nvme: simplify supported log page code
Change-Id: If16b1c237dc304378fe0742651a78d3ec0850665
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-15 13:45:16 -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
52ca42aa8a test/nvme/aer: use nvme_ctrlr_cmd_get_log_page()
Change-Id: I1c9be5dcc8ff0e9b21d17524e43de2b34f429d04
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-15 13:40:58 -07:00
Daniel Verkamp
f752abd6fa examples/nvme/identify: use nvme_ctrlr_cmd_get_log_page()
Change-Id: Ie7aea41cf3b2e986a5ebf309fda8c8d826fab652
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-15 13:40:58 -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
Jim Harris
b61b099030 autobuild.sh: git diff when astyle errors detected.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ife57a75c8e5ea6f7cc43d12a73a487b82e1bcd65
2016-01-14 11:25:36 -07:00
Changpeng Liu
0e6463d9b3 ioat: add ioat kernel driver performance test harness
For the purpose to make performance comparison between the ioat
kernel driver and user space driver, we added the kernel driver
test harness here, all the workload executed in the kernel space
and controlled via sysfs.

Change-Id: I2c8d826283405a5e1c9ba6a033503bcb98541370
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-01-15 10:53:19 +08:00
Daniel Verkamp
fceb072b09 pci: refactor Linux pci_device_has_non_uio_driver()
Use /sys/bus/pci/devices/.../driver to determine which driver is loaded
for a particular device.

Change-Id: I5859a776e524033e1c6d6ec3796b7e11bdcf0bc4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-12 08:58:03 -07: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
e73007a63a nvme/perf: fix memory leaks on error conditions
This doesn't really matter, since the program will be exiting
immediately if associate_workers_with_ns() fails, but it makes static
analyzers happy.

Change-Id: Ic21d234dec50bd2b6684b5fe2caa78d616f93052
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-11 09:45:40 -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
Daniel Verkamp
3d6b230ae9 nvme/utest: add asserts to check allocations
Make sure allocation succeed in the unit tests.

Change-Id: I1c9dd64c256d529f2e40be49448d56359969a6f5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-08 09:31:13 -07:00
Daniel Verkamp
5f844a0477 nvme/utest: add SPDK_CU_ASSERT_FATAL wrapper
The normal CU_ASSERT_FATAL macro calls a function that is not marked as
noreturn, so static analyzers (e.g. scan-buid) can't figure out that
fatal asserts are really fatal.

Add a wrapper macro that calls abort(), which the analyzer can determine
does not return.

Change-Id: I0c087bf9c8d3c272bf88120caa70e87dab6d9546
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-08 09:31:10 -07:00
Daniel Verkamp
0c703940a5 ioat: allocate channel context with calloc()
This ensures that any uninitialized fields are 0/NULL so if
ioat_channel_start() fails, ioat_channel_destruct() will not try to free
bogus pointers.

Change-Id: I99278c9fa280cbcdf3f7448e77db3ac98b59cdd6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-06 15:05:25 -07:00
Daniel Verkamp
b96536e74a nvme: check request allocation when submitting AER
Previously, if nvme_allocate_request() failed in
nvme_ctrlr_construct_and_submit_aer(), there was no error checking, so a
NULL pointer would be dereferenced.

Add a return value to nvme_ctrlr_construct_and_submit_aer() so we can
signal failure to the caller.  This can only really be reasonably
handled during initialization; when resubmitting a completed AER later,
there is nowhere to report failure, so the AER will just remain
unsubmitted.

Change-Id: I413eb6c21be01cd9a61e67f62f2d0b7170eabaa3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-06 13:51:15 -07:00
Liang Yan
a0ba9ce276 nvme/reset: don't crash if no namespaces are usable
Change-Id: I79b03c97f09125070dbdb1abe49db4a338f6a27f
Signed-off-by: Liang Yan <liangx.yan@intel.com>
2016-01-06 12:21:04 -07:00
Daniel Verkamp
cb18017c42 nvme/aer: check command completion status
If any command fails during the asynchronous event request test, exit
the test with an error rather than waiting for an event that won't
arrive.

Change-Id: I7297afe362bfdac04dd6585cc97ffdceb9f0096e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-06 10:30:12 -07:00
Daniel Verkamp
3b38dd8282 autotest: remove extra process_core invocations
The top-level autotest.sh script will catch any core dumps at the end of
the test run, so sprinkling process_core in the individual test scripts
is unnecessary.

Also make the per-component test scripts run with 'set -e' (exit on
error).

Change-Id: I85f124e164ca93d35eaf672a428a841c119c550b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-05 15:31:56 -07:00
Daniel Verkamp
e634bb8db1 autotest: use generic DPDK path on Linux
Switch to /usr/local/share/dpdk on Linux to use the latest installed
DPDK.

This is the filesystem layout from building DPDK with:

  make install T=x86_64-native-linuxapp-gcc DESTDIR=/usr/local

Change-Id: I95cb0a3ee2ad1fcc89f6abb73ff0005aa65110e5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-05 13:31:07 -07:00
Daniel Verkamp
b663d3c669 README: update to DPDK 2.2.0
DPDK's install target now requires DESTDIR to be set, so change the
build instructions to set DESTDIR=. to match previous behavior.

Change-Id: Ib697c2f54704210a5b60278ba1a5b20a16f517be
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-05 13:18:21 -07:00
Daniel Verkamp
3da8af26b0 nvme/perf: don't crash if no namespaces are usable
Change-Id: I8ecf5b632c2d3bf94f913fb5e0aa5b4ff2e68c40
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-01-05 08:05:43 -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
Ben Walker
a46c7d6fba build: autobuild.sh now detects number of cpu cores
It was just using 16 make threads by default before.
Now it uses the number of CPU cores.

Change-Id: I695705eb73fc5f5ed3eafe1f85c686bde0e4b7d6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2015-12-31 10:28:18 -07:00
Liang Yan
d5cbe304b9 nvme: update nvme_ns_cmd_deallocate unit test
The deallocate command's num_ranges have changed to unit16_t.
Update the nvme_ns_cmd_deallocate unit test for the change.

Change-Id: I43b8637bbb953b0e56c39998e1e6682a54304a8f
Signed-off-by: Liang Yan <liangx.yan@intel.com>
2015-12-30 09:40:22 -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