This suppresses:
make[3]: Nothing to be done for 'all'.
when nothing needs to be rebuilt.
Still more work will be needed, specifically in
examples and apps directories. But this will cover
most of lib/ and anything in unit/test that is using
the new spdk.unittest.mk.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1c0c2b88e70ec37629740aa47f612c9d46fc88fb
Reviewed-on: https://review.gerrithub.io/399725
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This includes removing the nvmf.unittest.mk that these
unit tests were using previously.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3b53db0a565aee910587826b37e8b43d6a324e75
Reviewed-on: https://review.gerrithub.io/399724
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This includes removing the json.unittest.mk that these
unit tests were using previously.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icfa2e5a5554b686002407d1ef5328a0aecb442f1
Reviewed-on: https://review.gerrithub.io/399723
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I53a04187638a8ea4569b18bb4959b0bcf7f3d860
Reviewed-on: https://review.gerrithub.io/399717
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
This is the first of a long line of patches which will
reduce Makefile rule duplication in all of our SPDK
unit tests.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1cd6e9e1e9cabab0a15dbcb901e4db782d73b1a4
Reviewed-on: https://review.gerrithub.io/399716
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
These aren't needed - the common %.o rule is sufficient.
As part of this patch, remove OTHER_FILES references from
nvme and nvmf unit tests, and just include these .c files
directly.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I76ab20da2f560c7997e978fcbfe28c2a4907f759
Reviewed-on: https://review.gerrithub.io/399715
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This can make profiling more challenging, but should not
affect debugging since we still have unwind tables.
Keep the C_OPT in COMMON_CFLAGS to allow a way to
still add compile flags, even though C_OPT is now
not set by default.
This results in a 11% performance improvement on
a bdevperf microbenchmark using null bdevs.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If16fef6e94a73dfca6c10d3b7f158a12dfc70b53
Reviewed-on: https://review.gerrithub.io/393823
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Only Makefiles for libraries that directly depend on DPDK (rather than
the SPDK env abstraction) should add $(ENV_CFLAGS).
Change-Id: Ifdf44d3ef8c42bbf7f20edd524b330d00658235b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/392818
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Exported lib/bdev/rte_virtio as a separate
library not dependent on bdev.
Virtio is now accessible via spdk_internal/virtio.h.
The header is marked `internal`, as it's
not meant to be used by end users. It's
not handy to handle all backend-specific
(e.g. Virtio-SCSI) logic in a user code.
For now the Virtio interface is publicly
exposed only via bdev_virtio module. We
might want to consider adding a separate,
public Virtio-SCSI library in the future.
Note: this patch doesn't do any changes
to the virtio code. Everything is
moved 1:1.
Change-Id: I805e5d12d265d82b0bc5784c89fbadb81abdb278
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/388166
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
For now, this only installs libraries and headers; we will need to
consider which binaries should be installed and what they should be
named before we add them to the install rule.
Change-Id: I78dc8631f793d0df88cd884b0ac66406df9e4427
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/387637
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Running the 'touch' command unconditionally causes the compile step to
return 0 even if the compilation failed. Instead, only run it if the
compiler succeeded.
Fixes: 4f16344356 ("make: Update build artifact timestamps for clang
support")
Change-Id: I46907851fde8bb9e3f73549276e489b6c30ed1fd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/388324
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <ed.rodriguez@netapp.com>
The tab inside the define ends up in the output when called, which leads
to problems if the output is quoted (the tab will be treated as part of
the filename).
Change-Id: I1038e1650a74861660fa4164dbde065217bc7b99
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/387631
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ibc165386b074d82969610467f4da73c73d8f4ea0
Signed-off-by: Ed rodriguez <edwinr@netapp.com>
Reviewed-on: https://review.gerrithub.io/386164
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Check the target machine type explicitly before turning on -march=native
rather than assuming any non-PowerPC machine is x86.
Change-Id: I651b1852dc5ac6a3d42c60d639ec48f399f6b3bd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/386348
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Similar to commit 98f84e6255 ("build: detect OS via cc -dumpmachine"),
we can use the C compiler's -dumpmachine output to detect the target
CPU architecture rather than relying on the build machine's uname
output. This helps enable correct CPU detection when $(CC) is a cross
compiler.
Change-Id: I72c34294a1ff7dd9df3aa45dfc319e5b81d51f85
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/385709
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Rather than running 'uname', which returns information about the build
system, use the C compiler's -dumpmachine option, which outputs the
target triplet, which looks something like "x86_64-unknown-linux-gnu".
This enables us to detect the correct target OS when
the configured $(CC) is a cross compiler.
Change-Id: I5659dd5b091094cc8e408a6c6f4e7f64a65e9070
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/385166
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
ppc64le does not support compiler option march=native
but instead uses mcpu
Change-Id: I2dd14b1acf003e8229e9c9392c4c0606e2c15af8
Signed-off-by: Jonas Pfefferle <jpf@zurich.ibm.com>
Reviewed-on: https://review.gerrithub.io/383725
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Use SPDK bdev subsystem to allow basic IO to pmem pool
using pmemblk_* calls.
New pmem bdev can be constructed using RPC call
construct_pmem_bdev PMEM_FILE
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If5ca94161fe53644b8fccd3b77de5479da1b2e55
Reviewed-on: https://review.gerrithub.io/376973
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This will be used to simulate multi-threading for
bdev unit tests.
While here, alphabetize the existing calls - calloc
had been inserted out of order in a couple of places.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I559cd1fd79e78f03ebdac313e0bbedbcdde4a8c1
Reviewed-on: https://review.gerrithub.io/377968
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This should be the default already on x86-64 compilers.
Note that the code may still not necessarily compile or work properly on
other architectures, but this is at least a start toward portability.
Change-Id: I9c842aa329dd761277bf90669f2c905e436e0af4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/378365
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ia96ae78ff9530d953181ac5f7255a38f3c8ec430
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Reviewed-on: https://review.gerrithub.io/375392
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Most of the work here revolves around having to split
an I/O that spans a cluster boundary. In this case
we need to allocate a separate iov array, and then
issue each sub-I/O serially, copying the relevant
subset of the original iov array.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0d46b3f832245900d109ee6c78cc6d49cf96428b
Reviewed-on: https://review.gerrithub.io/374880
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Supports both PCI mode (for usage in guest VMs) and
vhost-user mode (for usage in host processes). The rte_virtio
subdirectory contains a lot of code lifted from the DPDK
virtio-net driver. Most of the PCI and vhost-user code is
reused almost exactly as-is, but the virtio code is drastically
rewritten as the DPDK code was very network specific.
Has been lightly tested with both the bdevio and bdevperf
applications in both PCI and vhost-user modes.
Still quite a bit of work needed - a list of todo
items is included in a README in the module's directory.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I85989d3de9ea89a87b719ececdb6d2ac16b77f53
Reviewed-on: https://review.gerrithub.io/374519
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I6a138e1c1d775e8c8bfeede9600f8b0f799ecdad
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/362445
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Much like bdev modules inside the bdev directory,
add a subsystems directory inside of event. The subsystem
specific code for the bdev library is placed in to
a separate library in that directory, breaking the
strict dependency of the bdev library on the event subsystem
code.
Change-Id: I255941b823a9ec3e2d62f22a586414949d8ff5ad
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/365055
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This patch shows how to use the spdk_mock library which now only
consists of --wrap capability for a few functions.
Next will be a patch that provides a generic mock capability to
use either the --wrap feature or a combination of globals and
stubs to make adding more UT easier wrt mocking. After that is
in place nvme_ut.c will be updated to use the new library for
all mocking.
Change-Id: I1a6ffb722da043bb70bd4cfe1afa7c5e39a0fccb
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/365074
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This patch doesn't use it yet but sets up the ability to so that
upcoming unit test pathces can. The next patch will include use
of wrap in one nvme UT and then following that the wrap and
today's use of globally controlled stubs will be morphed into a
simple mock type capability for spdk unit tests.
Change-Id: I252160266f0b5c76e50fd213cb3e1686d48b9d0e
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/363441
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ibeab0bc70bb59da4ebb8bd175642f5f549f1d273
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362425
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Also change the discovery/nvmf.sh test to use it.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I56bce9a84bd46f13b6d4f34da81abf23413f2598
Change-Id: I9546d715b8d2ca3ebf46183bdbaa58e8aa921d95
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Add a configure script in the root of the repository
that looks and feels like one that would be generated
by autotools. This script simply generates a CONFIG
file for you, which used to be done by hand.
Now to build SPDK you can do the following:
./configure --with-dpdk=path
make
Change-Id: I44ebb91f0cb1468b86da4c0033ac1406595d4967
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
No functional change, just rearranging code.
Change-Id: I28328dfefd7de269d326834c484f2c2fca4e6c1f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This patch adds a library, application and test scripts for extending
SPDK to present virtio-scsi controllers to QEMU-based VMs and
process I/O submitted to devices attached to those controllers.
This functionality is dependent on QEMU patches to enable
vhost-scsi in userspace - those patches are currently working their
way through the QEMU mailing list, but temporary patches to enable
this functionality in QEMU will be made available shortly through the
SPDK github repository.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Krzysztof Jakimiak <krzysztof.jakimiak@intel.com>
Signed-off-by: Michal Kosciowski <michal.kosciowski@intel.com>
Signed-off-by: Karol Latecki <karolx.latecki@intel.com>
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Krzysztof Jakimiak <krzysztof.jakimiak@intel.com>
Change-Id: I138e4021f0ac4b1cd9a6e4041783cdf06e6f0efb
This flag is on by default for compilers that support it, and it
prevents compilation on older compilers that do not recognize it.
Change-Id: I862cff6297ecd4fc40f2f8761bf398d524771921
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This virtual block device takes an underlying block device and splits it
into several smaller equal-sized block devices.
Change-Id: I6f6e686c1177b2e4885f7e88809ad329caae55bd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This flag prevents the compiler from merging multiple tenative global
variable declarations (e.g. 'int i;' without an assignment) into a
single copy later. In the default (-fcommon) mode, this allows multiple
definitions of an uninitialized global variable to be linked into a
single program without any warnings.
Change-Id: I0339012a7164dccd311ab1f62d11111d24529fbd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The unit test Makefiles should already declare exactly which files to
include.
Change-Id: Icae8a2c862db164d72d8e9ed4064d777de43742b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This is shorter and matches the more commonly-used name.
Change-Id: I6af862de90e5cf8a7c27161f1ee9bb5a1164bec6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
If a library rule is being built, one of the files it contains was
rebuilt, so we need to regenerate the whole library anyway.
Remove the previous copy of the library to make sure nothing is
left from the previous build.
Change-Id: I835f721d5bf7cc908c343f47de78bd1f44be58b8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
-Wformat-nonliteral needs to be disabled since clang triggers it on the
call to vsnprintf() now that it is nested two calls deep.
Change-Id: I228b9d099cfc2b65181941cbb4798b7f8eae3baa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Make it easier to use SPDK libraries by putting them all in a single
directory that can be added with -L rather than scattered around the
source tree.
Change-Id: I5c0f5dd6e7058b5f92fa9bc41548190ffc064761
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This requires a couple of related changes:
- I/O queue IDs are now allocated by using a bit array of free queue IDs
instead of keeping an array of pre-initialized qpair structures.
- The "create I/O qpair" function has been split into two: one to create
the queue pair at startup, and one to reinitialize an existing qpair
structure after a reset.
Change-Id: I4ff3bf79b40130044428516f233b07c839d1b548
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This allows users to swap out SPDK's third party
libraries for an implementation based on their own
framework.
Change-Id: Ia0b7384ce5e31acba5ad0d7002dec9e95b759c52
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This patch also drops support for automatically unbinding
devices from the kernel - run scripts/setup.sh first.
Our generic pci interface is now hidden behind include/spdk/pci.h
and implemented in lib/util/pci.c. We no longer wrap the calls
in nvme_impl.h or ioat_impl.h. The implementation now only uses
DPDK and the libpciaccess dependency has been removed. If using
a version of DPDK earlier than 16.07, enumerating devices
by class code isn't available and only Intel SSDs will be
discovered. DPDK 16.07 adds enumeration by class code and all
NVMe devices will be correctly discovered.
Change-Id: I0e8bac36b5ca57df604a2b310c47342c67dc9f3c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This patch will add a new bdev module, rbd.
It can make ceph rbd as the backend of iSCSI
target.
Change-Id: Id5eb3b159ee607052e3c33a2e59d721739fd9977
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Fix the existing cases (all missing void in parameter lists) and enable
the warning to prevent new ones from being introduced.
Change-Id: Ieaf00b3dfd5daf1e21fcbefb124514882e8996c9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The V= syntax is more familiar from other build systems, so allow both.
Change-Id: I024cf4a338c2fe10bef482311a1703bf5fb2a38e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Drop the special-case preprocessor definition for PCI access library now
that config.h is available with an equivalent SPDK_CONFIG_PCIACCESS
define.
Change-Id: I4891d0f2fd7d3eea51b767df9e594555b36265ea
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The upcoming DPDK version adds objects that have no externally
referenced symbols but that must be linked in (specifically, the
default mempool handlers are now assigned by a constructor function).
Link all of the DPDK libraries with -Wl,--whole-archive to fix linking
against a static library build of DPDK.
Change-Id: Ia54b100d81aa7be30a8f4bcad65cc182e91dcc65
Reported-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
The NVMf target is being refactored to split the RDMA transport-specific
code into its own file. Once this is complete, we should be able to
plug in other transports and build the NVMf target without any RDMA
dependency if desired.
To enable this, change the CONFIG option to RDMA; it still controls
whether the whole NVMf target is built for now, but once the RDMA
dependency is actually made optional, we will be able to build the
generic NVMf target code without libibverbs installed.
Change-Id: I8cd90a9aaa85dcefcc9b0f8f2e7b6af21958b2a8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Linking this library into an application makes the log
configurable via RPC. This only works if the rpc subsystem
is also loaded.
Change-Id: If1340cf2a845ef159290232c26f341150c98fb9a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
On some platforms, librt may be a static library, so linker command line
order matters. Create a new Makefile variable, SYS_LIBS, which is added
to the end of all link commands and move -lrt there.
Change-Id: Ie28ebd91a255097bf33cbcf9f0f74f7177a0b142
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This is the standard way to add multithreading support and handles
platform-specific requirements for pthread library name, #defines, etc.
Also include -pthread in CFLAGS, since it affects preprocessor
definitions.
Change-Id: I94b436c7ef482ae3320b7937f4f64b51e5d57032
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
All source files will now depend on config.h, which is generated based
on the defaults in CONFIG and the command line arguments passed to make.
This ensures that any configuration changes, including on the command
line, cause a full rebuild.
Change-Id: I6b6fa3290941200dbcf32297c66df8dc5ee18e94
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
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>
1) -Wstrict-prototypes applies to C code only
2) add CXXFLAGS definition
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I440702d989c4e89bd297956a58725f62d2d72831
Allow end users to build the code even if, for example, warnings are
added with new compilers versions.
-Werror is still enforced for automated builds.
Change-Id: I567009d55cf5b941c452bd41d09f75d03b037209
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Since the individual build steps include the path now, the subdirectory
printouts are less useful (especially with parallel make, where output
from multiple subdirs gets mixed together).
Change-Id: Ied71d39b360b847ca32ccd3547def751ddd9434c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
For example, if the source code is located in a directory called "spdk",
don't print the "spdk/" prefix on all of the directories.
Change-Id: I9adc650b13e013773450c721c8434c6e5afeecc2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This makes it somewhat clearer what is happening during parallel
builds (make -j).
Change-Id: Ibbe8862da7600e784cba64cd333086f1473455ac
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>
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>
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>
Some compilers automatically define _FORTIFY_SOURCE to a different
value, so undefine it before setting it on the compiler command line.
Change-Id: Id662953bd4466b99d0fe9bd5bb96f9fc335ff9a8
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>
This is very convenient. It also works from subdirectories, as
long as you adjust the relative path you pass appropriately.
Change-Id: I8cfeac380ccb5fad4389ee1feb838f986a837f11
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
librte_malloc has been deprecated by DPDK, but to allow for backwards
compability, check for its existence and link with it if it exists.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3e05a3295b6768bd6804a8ec86c301e22040df37
Replace $(UT_APP) in nvme.unittest.mk with $(APP); there is no actual
difference in the way they are used.
Change-Id: I039c2488ee998ee8b1a67af129045b66a97bc29c
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>
Modern GCC and Clang versions can generate .d files without needing the
complex sequence of sed scripts that we currently use.
Also adjust the .o rule so the .d file is regenerated if it gets
deleted.
Also make the .o depend on all of the Makefile fragments in
$(MAKEFILE_LIST) so that it is rebuilt if the Makefile is changed.
Change-Id: I44e186c0f34dabfa0cf35db1ffa66b84d9dae87d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
We don't use any C11-specific features, and switching to C99 will allow
us to support older versions of GCC.
In particular, the version of GCC used by Travis CI is too old to
support -std=gnu11.
Change-Id: Id5bd8351fdd83e7f4b6703048a921c78c3f06ec6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This partially reverts commit fd93c1b1ef.
Older versions of GCC don't consider the empty initializer to be
acceptable when this warning is turned on.
Change-Id: I5c1c22ca988f464990c68eb56e4dd4d51cb99410
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This catches functions with empty parameter lists, which are not the
same as void parameter lists in C, as well as other (less-likely)
K&R-style parameter lists.
Change-Id: I18b09e01a60b3669d1cc5d8d96eec20cd872c497
Signed-off-by: Daniel Verkamp <daniel.verkamp@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>
-Wold-style-declaration, -Wsign-compare, and
-Wmissing-field-initializers are included in -Wextra.
-Wunused-parameter is not very useful, so disable that explicitly, but
enable the rest of -Wextra.
Change-Id: I034b368d16306544e0eadafab9ec1ccf27f21645
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>
Collect coverage information for use with gcov.
Coverage is disabled on FreeBSD because the current version of clang
provided by FreeBSD can't successfully link with -ftest-coverage enabled
(the compiler-rt support libs are too old).
Change-Id: Icc444936caa852bfb9a02b37223209319a27a770
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>
This allows the same objects to be linked into static and shared
libraries and allows the creation of position-independent executables
with the static libraries.
Change-Id: I119949c3644c02a83e414227615dcc2d8f896286
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Some of these are covered under -Wall, but add them all just to be clear.
Change-Id: I63104be4bf58becd19a4c30a4d275d2c24c6761d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Modern toolchains already enable noexecstack by default, but set it
explicitly just to be sure.
Change-Id: I2866220db5a5ed0bb6e78a4e83763839ea3b93b0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This forces the ELF loader to resolve all relocations immediately at
load time rather than allowing lazy binding.
Therefore the loader can make the GOT (global offset table) read-only
once the relocations are complete during the loading process.
Change-Id: I89a878d1060ce79d58c5be7700d8b122a33a8ceb
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
Set -DNDEBUG to make assert() a no-op. Since nvme_assert() is just an
alias for assert(), this controls compilation of nvme_assert as well.
Change-Id: Ie9d0c7fea007eff030179c1b54865adc3dcaf6b6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This will add different flags, src files, etc. for FreeBSD.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I4f2d664cf42d01745318f241ce9558dccf148b7d
Inherit the CFLAGS and other common setup from spdk.common.mk instead of
redefining it in nvme.unittest.mk.
In particular, this enables warnings for the unit test code that were
not enabled before.
Change-Id: Id0fbf0ee0b0d63f9de0c362d1d23e2bd036a7145
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>