Commit Graph

72 Commits

Author SHA1 Message Date
Daniel Verkamp
9cc423f061 scripts/rpc.py: add Unix socket support
Change-Id: I0750563f4fc706ddd803c9679f63aa006427c8a5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 08:06:33 -07:00
Cunyin Chang
94cf5c00d2 test: Add autotest for hotplug.
Change-Id: I5822c36a7374b680a3b213b8768afd834daf59d9
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-12-14 15:04:33 -07:00
Jim Harris
a9616e8497 setup.sh: allow overriding of NRHUGE
Default is still 1024 2MB huge pages, but user can
override this by setting a different value in the
environment.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8d189d3a71f474469a44b6eb41b4443591863f3c
2016-12-14 10:27:28 -07:00
Daniel Verkamp
e8b7ccbd8e autotest: enable UBSan
Only enable it on the Linux test machines currently, since linking fails
on FreeBSD.

Change-Id: Ib0b30baa90575c7ee93e291ec98883d987cc88f4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-06 16:50:11 -07:00
Daniel Verkamp
4668287bec autotest: disable shell tracing around helper functions
Clean up the output a little bit.

Change-Id: I34e97d14be861e7cb7d71be5d56a5a7c36b37008
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-06 12:57:42 -07:00
Daniel Verkamp
49369134cf genconfig: add special case for DPDK_DIR shorthand
Change-Id: Iaf7195316c757b22cb601318c38762b3fd6f7c0e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-01 12:41:51 -07:00
Daniel Verkamp
0ee75c5fc4 genconfig: pick up defaults from the environment
This matches the behavior of Make and ensures that we rebuild correctly
when the configuration is only modified in the environment.

Change-Id: Iaf63c488b7c817d6c74a89da2d1de8e4c01be045
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-01 12:41:51 -07:00
Daniel Verkamp
1e9c049638 genconfig: simplify argument parsing
Split the arguments into var=val once at startup and put them in a dict.

Change-Id: Ic6b337e010a185448c1dab20659575081f03a645
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-01 12:41:51 -07:00
Daniel Verkamp
56306a468f scripts/setup.sh: add logname fallback
In some circumstances, no utmp entry is available, so logname fails.

In particular, gnome-terminal no longer creates a utmp entry:
https://bugzilla.gnome.org/show_bug.cgi?id=747046

As a workaround, try $SUDO_USER - the use case here is to determine
the (unprivileged) user name so we can give them ownership of
certain files, so this is usually the right thing to use anyway.

If we are not running under sudo, the caller should have passed the
username as a parameter to scripts/setup.sh anyway, since we can't
reliably determine which user is intended.

Also check if username is actually set before using it to run chmod - it
is possible that the scripts/setup.sh caller does not want to provide
access to an unprivilieged user and just wants to run everything as
root.

Change-Id: I20631c325b52884a378029dcf38568a2b311b457
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-30 10:51:49 -07:00
Daniel Verkamp
c0b0afd44e eofnl: check for DOS-style newlines
Change-Id: Iaaf03848a9187ede3cffd0851291300b2f6c007e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-29 11:15:18 -07:00
Pawel Wodkowski
7dce704c20 scrips/rpc.py: add vhost scsi RPC commands
Add new commands:
get_vhost_scsi_controllers
construct_vhost_scsi_controller
add_vhost_scsi_lun

These RPC commands are in preparation for an upcoming SPDK vhost-scsi
target.

Change-Id: I8dc3045f832df76a34c55f41dba213d480a3e5fe
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-11-23 12:42:10 -07:00
Daniel Verkamp
19d56fead7 test: move RBD test pool setup to autotest.sh
Leave the RBD pool configured and running throughout the tests so that
it can be used in multiple test scripts.

Change-Id: I056ef29bd8d97fa63f1ca78ee728f9c51f4bdf41
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-17 12:46:37 -07:00
Pawel Wodkowski
77c57e2ff8 setup.sh: two minor fixes
Fix typo in checking for mounted hugepages and replace expr with
arithmetic context as expr is returning error when expression is zero.

Change-Id: I2433fa938b3b2e758e1a4267414c10c5a3a5caff
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2016-11-09 10:04:41 -07:00
Daniel Verkamp
e1baabee4a bdev: add get_bdevs RPC
Add an RPC interface to list all blockdevs and their properties.

Change-Id: I50db730d5eff8cffcbe8fe5df6b3461457e8581e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-02 09:10:54 -07:00
Daniel Verkamp
7d30f5aa1e bdev/rbd: use consistent block_size name in RPC
Rename the construct_rbd_bdev "size" parameter to block_size so that it
is consistent with other bdev construct RPCs.

Change-Id: I88f8ed35444495ffce9550dc224fbcbd58231787
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-31 13:48:27 -07:00
Daniel Verkamp
8d22515b52 rpc.py: trim whitespace before splitting args
Leading and trailing whitespace will otherwise lead to empty array
elements, which are not intended.

Change-Id: Ie7bd5dfce8cb9904090a06491d0bde4905de1e3a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-31 11:19:24 -07:00
Daniel Verkamp
0404c306cb bdev: make construct RPCs return the bdev names
When creating a bdev via the RPC interface, there was no way to know
what name it was assigned (other than predicting it based on the
numbering scheme).  Change all of the relevant RPC interfaces to return
an array of bdev names so they can be used to construct LUNs/subsystems
dynamically in scripts.

Change-Id: I8e03349bdc81afd3d69247396a20df5fcf050f40
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-31 11:17:46 -07:00
Ben Walker
78a018260d test: Clearly denote start/end test in log
This makes it easier to search logs on test
boundaries.

Change-Id: I4500479cb8c8322d5ba73bbefd51e006cbb1e82a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-24 09:10:39 -07:00
Daniel Verkamp
38d41acda4 check_format: check Python style with pep8
Also continue checking for errors after a problem has been found.

Change-Id: Iea37311e54f68fb6ba8c804ad4b2fb92d5238f36
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-18 13:35:19 -07:00
Cunyin Chang
0482640657 rpc: Rename construct_aio_lun to construct_aio_bdev
Change-Id: Iff2d030b854bfda77ed1e5eeea6f46119a5bb50a
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-18 09:51:31 -07:00
Cunyin Chang
134dce2669 rpc: Rename construct_malloc_lun to construct_malloc_bdev
Change-Id: I72f21881264226499a9cd64c72f3ab1b4808b2ec
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-18 09:51:31 -07:00
Cunyin Chang
f1fcdeb341 script: Add method to construct rbd bdev.
Change-Id: I2c1e083628ac5a1402b8e89bdf05ca2ed55bc1a5
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-13 22:07:53 -07:00
Cunyin Chang
e1f93d26db script: Add method to construct nvme bdev
Change-Id: I0b81fca543783e918eb1cd5f0d1cb0dd0e5de69c
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-10-14 01:54:46 +08:00
Daniel Verkamp
5ec0b3227d nvmf/rpc: make sure NVMe device is found in create
Extend the check added in commit
7552ee5512 ("nvmf_tgt: fail if NVMe
controller is not found") to the RPC interface.

Also remove the default PCI address from rpc.py, since it is not a
useful default - the user must specify a PCI address, which will vary
depending on the configuration of the machine.

Change-Id: If9a4e19ef2a84c9d839b467abc011046613f7168
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-13 08:50:03 -07:00
Daniel Verkamp
4afe9d1acb nvmf/rpc: make hosts parameter optional in create
Instead of a magical "All" value for allowing all hosts, allow the
caller of construct_nvmf_subsystem to omit the "hosts" parameter.

Change-Id: I97c7ae806a0be7142fb59708d47023e42e127fcc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-13 08:50:03 -07:00
Daniel Verkamp
45c041449f nvmf/rpc: don't allow namespaces in direct mode
create_nvmf_subsystem should not allow the user to specify any
namespaces in direct mode.

Also remove the default Malloc0 namespace in rpc.py; the user
should be required to specify the list in virtual mode.

Change-Id: I3aaf7c64b9ceee89a3f7db15760a669527adb29d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-13 08:50:03 -07:00
Daniel Verkamp
1a37acda67 eofnl: check for extra trailing newlines
Enforce exactly one trailing \n, and fix all of the existing cases.

Change-Id: I6218e4700e90aeb647eaee78089530c79993c8c8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-11 13:30:33 -07:00
Ben Walker
6b1e4e732d Drop libpciaccess and switch to DPDK PCI
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>
2016-10-04 15:59:00 -07:00
Daniel Verkamp
d31df7042a test/cpp_headers: autogenerate header test files
Rather than requiring changes to a static list of header files, use the
GNU Make wildcard function to generate a .cpp file per header.

This also tests whether each header includes all of the system headers
for the types it uses.

Change-Id: I05b82510b194533672568019e138d7d1aad2e86b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-10-03 10:24:18 -07:00
Cunyin Chang
d20b90b21e nvmf: Add support for RPC interfaces.
Change-Id: I6f0fe35bf2876df181ad11294b62d64d97dcac2c
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-09-26 16:07:30 -07:00
Daniel Verkamp
1a9974ed1d test: don't ignore error code in killprocess
Make sure any failing commands are detected and fail the test.

Change-Id: Ibdafe78ac68632cd3f5ea42b4f653b969715cbc0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-14 09:24:25 -07:00
Daniel Verkamp
0d61bf4b50 autotest: move NVMe device cleanup to startup
Make sure any partition tables or other random data on the disks is
cleaned up before running the tests, rather than trying to clean it up
on failure when the system is in a potentially bad state.

Change-Id: Ia2119485aee6a50243744328dff2314d7a72adad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-17 09:04:16 -07:00
Ben Walker
1e92d78a10 iscsi: Add an iscsi target application
Similar to our NVMf target, this is an iSCSI target that
can interoperate with the Linux and Windows standard iSCSI
initiators.

Change-Id: I6961c5ef99f7b161c396330ed5b543ea29b0ca7b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-08-04 13:15:33 -07:00
Ben Walker
e660e677b8 nvmf: Delete partitions when tests end
Change-Id: Ia30e037e98df8b0c781ce769453bbf891091334d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-26 09:24:31 -07:00
Daniel Verkamp
b9f3538e5c setup.sh: use 256 MB FreeBSD contigmem buffers
Allocate larger contiguous regions (but the same amount of total
memory).

Change-Id: I54d09c11afdc7bdf232cc3b0864719c063a74b1a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-21 09:56:41 -07:00
Daniel Verkamp
3f80d55199 CONFIG: rename CONFIG_NVMF to CONFIG_RDMA
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>
2016-07-14 12:58:17 -07:00
Daniel Verkamp
806eb493ca genconfig: undef bool options so #ifdef works
Instead of always defining config values, only #define options that are
enabled, so that #ifdef/#ifndef can be used.  Generate #undef lines for
the disabled variables so the names are still visible in config.h.

Change-Id: Iaf56597ea6ae57b384387cc8a292d63960b611e4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-24 10:42:18 -07:00
Daniel Verkamp
92a02f580c build: generate config.h and implicitly include it
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>
2016-06-08 10:26:50 -07:00
Daniel Verkamp
91330eb5c8 nvmf: add automated fio and mkfs tests
Change-Id: I499ae29155b8f053babf18750cecb5c8d210d59c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-07 10:16:01 -07:00
Daniel Verkamp
0f912a0eaf nvmf: add NVMe over Fabrics userspace target
Change-Id: I739916824d033bd1a8f8b7f5def09e58f23d13cb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-06 15:21:25 -07:00
Daniel Verkamp
b7095d7b00 setup.sh: get hugepages in 64 MB chunks on FreeBSD
This increases the largest contiguous region available for any single
object (e.g. DPDK mempools) from 32 MB to 64 MB.

Change-Id: I46633b246bcf7843053ab9d0d92993a784287a57
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-26 09:27:16 -07:00
Daniel Verkamp
83aa00649c check_format.sh: check C++ files (.cpp)
Change-Id: Id3b2fb95b2770ff28c9a6561531ae787b54bdaeb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-11 14:10:58 -07:00
Cunyin Chang
7b25f04c43 spdk: Enable vfio for non-privileged user.
Change-Id: I72498ed727058e472b14c8ca8ee95b5858947afe
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-04-14 14:24:23 -07:00
Daniel Verkamp
c83f9378da scripts: merge hugepage config into setup.sh
For now, drop the option to configure the number of hugepages (just use
the default 1024).

Change-Id: I686b6151e4a32ffa4ae9a9cf2694693369e03f49
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-04-14 13:36:44 -07:00
Daniel Verkamp
21173cd036 setup.sh: factor out Linux driver binding
Change-Id: I7d0d919bc8b2ffbc8856648fe746468d9b9f6702
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-04-14 13:10:30 -07:00
Daniel Verkamp
42e10f3e01 autotest: only run NVMe AER test in nightly tests
Change-Id: I39c54db5474ec5fe56f83f1297aa2d0c0445baaf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-28 15:11:55 -07:00
Daniel Verkamp
6887721802 scripts/check_format: use git to find text files
Use 'git grep -I' to determine the list of files that git considers to be
text (rather than hardcoding a list of known text file extensions) and
check all of them for newline at end of file.

Change-Id: I9b947176af2792c139a2782856e3c41061e18f10
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-28 10:24:57 -07:00
Daniel Verkamp
55d9ff6a66 config: make -Werror optional and off by default
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>
2016-03-18 10:42:28 -07:00
Daniel Verkamp
57a1e89303 check_format.sh: enforce newline at end of file
Change-Id: I4fd1338ec3d95ffcd8a0727e87b845399676ccfa
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-16 15:35:17 -07:00
Zeng Linggang
5096b4e033 build: remove redundant MAKEFLAGS set
Change-Id: I4596284950c491acc576192d8e9b3a31241fbe49
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-03-07 13:25:18 -07:00