fgets() will return NULL if it encounters EOF.
Change-Id: I35b1744514f2a90d6e95156c3916a18c1a4ecce2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
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>
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>
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>
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>
This way, they are listed in a consistent order across runs.
Change-Id: Ie920f4e0c2763efb6c1d2856b5ed0f57ecbe48c8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Previously, ioat_init() in the example programs was returning 0 even if
initialization failed.
Change-Id: I96b2ec5646f7051ab881611acff424fb8547d5eb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
If the I/O size is larger than the total namespace size or smaller than
the block size, ignore that namespace in the perf utility.
Change-Id: I297303d8c41ceb36eef91c6c33da809a35758f4e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This allows identify to print the raw data so that the user can look up
fields that aren't yet formatted in a human-readable way.
Change-Id: If3db1fed85fee06c8b8c18246a2ea253b1e6ae13
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This patch is used to remove the unused pci_dev parameter from the nvme
perf utility functions that no longer need it.
Change-Id: Ib139b080b7668aed712b4489c5ee95bd2fa2b350
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
Previously, the cleanup functions were only being called if there was an
error during initialization.
Change-Id: I1606cfa9a9c3732d670131f78249d34a5db47403
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
Use $(CLEAN_C) throughout the Makefiles to clean up a consistent set of
generated files.
This also adds coverage files to the list of cleaned files.
Change-Id: Iceb922935a45c9eecbf2f3443bd0ee4f5c966825
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The .o files are always kept anyway, so there is no need for an explicit
rule.
Change-Id: Id1687ba89daabfda5802e4328deb127403277928
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Add common $(COMPILE_C), $(LINK_C), and $(LIB_C) variables that contain
the commands to build a .o from a .c, an app from objects and libraries,
and a library from objects, respectively.
Change-Id: Ie2eaa13156b8bf3db7a4ffa66161382d829aef07
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
Set SPDK_ROOT_DIR explicitly in each Makefile so that make from a
subdirectory will work (assuming all dependencies from the upper
directory have already been built). This allows partial rebuilds of the
source tree, as well as building the unit tests without requiring DPDK.
Change-Id: I3f65b805d490b40ff5ec53cceb61df542ce814f1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Previously, as soon as a worker thread failed, the program would exit
before printing results.
Also add a message at exit time if any errors occurred during test
execution.
Change-Id: I7b3920f0acb8ce364e2bc5cbb78bbe88f3fa7146
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This matches the size of the request pool and enables running with a
higher concurrency level.
Ideally, these limits should be calculated from the requested queue
depth and number of workers, but for now, just increase the hardcoded
limit.
Change-Id: I6e890efc78a1336dddc0ab61db20c68004b30f54
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Previously, if the work function on the master lcore failed, the perf
program would still return with a successful exit code.
Change-Id: Iec91c1f60824759ae62476ef6dce670fd402ddc5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Do not continue running the thread work function if that thread could
not get an I/O queue.
Change-Id: I89033250bde0663f073ff35c76d1558d55b72ece
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Intelligently allocate cores and devices to handle
the following cases:
1) Equal cores and devices
2) More cores than devices by using multiple cores per device
3) More devices than cores by using multiple devices from a single core
Change-Id: I3703f5c523268539bd00d399fe104c474a8e8c99
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This helps weed out functions that should be static, functions that are
not declared in public header files, and .c files that don't include
their .h interface headers.
Change-Id: Ie39f83ad4b320847e4a938bd1d4d0b4fa21c2ffa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Replace {0} initializers with {}, since it is equivalent and simpler
(and avoids the warning).
Change-Id: Id2014a352e2c627598cd3b4f1ca04dba35f2dc3a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Fix all of the uses of __thread so they are at the beginning (similar to
e.g. static).
Don't actually enable -Wold-style-declaration, since clang doesn't
understand that.
Change-Id: I0dcbb758143eab90fc978334c8f256c6602cc4cd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This allows comparing the Linux kernel driver's performance to the SPDK
user-mode NVMe driver.
Change-Id: I71c70163a4133c2f237c8c57b3c698ec261455f5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
Move dependency includes into a new spdk.deps.mk file,
then include it at the end of Makefiles that build
source files.
Also add a test to autobuild.sh to confirm that
binaries are regenerated if we make after touching a
header file.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If6a1905706a840f92cbdf3ace7fbdb27fe2de213
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