Commit Graph

4240 Commits

Author SHA1 Message Date
Darek Stojaczyk
5db247abfc test/spdkcli/tcp: don't override the ERR trap
That test used to call an inexistent function in its
ERR trap. That's for one. Second, none of the SPDK tests
should set the ERR trap themselves - it's set once in
autotest_common.sh and prints the backtrace. What test
scripts should do is setting SIGINT/EXIT traps - fix it now.

Change-Id: I46c82651be78eeaec16ac52396c5e80a0405e5ff
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1331
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Michal Berger <michalx.berger@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-06 07:48:43 +00:00
Darek Stojaczyk
df9660df7b lib/event: fix printing non-null-terminated strings
%*s prints at least * characters and may add padding to the string.
%.*s prints at most * characters.

In a few places we used the first instead of the second and
printed some garbage to screen (in the best case...).

Change-Id: I97a862be61a5e43aa61e8230044dbd64a9db33bd
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1569
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-06 07:48:37 +00:00
Richael Zhuang
e9063d4da1 test/blobfs: rocksdb building error with gcc9
There's a small error when building rocksdb in blobfs db_bench
with gcc9:
"strncpy output truncated before terminating nul copying as many
bytes from a string as its length [-Werror=stringop-truncation]"

It's not a real bug for in the code "strncpy" truncates the null
terminator but set it later, which has been reported here:
https://github.com/facebook/rocksdb/issues/4017
Just adding "-Wno-error=stringop-truncation" to silent the compiler.

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Change-Id: I95993605f0376f5c101fb487596721b384319bcb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1594
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-06 07:48:25 +00:00
Shuhei Matsumoto
3af1adb8aa ut/compress: Use SPDK thread library
Use SPDK thread library in unit tests for compress bdev. This will
enable us to write unit tests for refactoring.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iac3867cca460b998c9b3953aae5241ffddc3168b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1451
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-04-03 06:31:10 +00:00
Shuhei Matsumoto
e92a77b148 ut/compress: Remove unused MOCK for spdk_bdev_io_get_io_channel()
Removing MOCK for spdk_bdev_io_get_io_channel() caused no difference.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic91bff0f163ff5ad607abc8fa4d5eef10215b043
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1450
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-04-03 06:31:10 +00:00
Karol Latecki
9fc706f4b6 test/vhost: improve run_fio --local option
When using --local acutally wait for fio processes
to finish and then gather results back to the host
system.

--local allows to run independent fio instances
on guest systems, avoiding fio client-server mode.
This will come in handy when trying to run fio bdev
plugin with virtio bdevs in guest systems.
At the moment fio plugin does not work in client-
server mode, so "local" must be used"

Change-Id: I2020c1b636fbf4ab1fe8ef590639e0dbfd905414
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1533
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-02 14:51:48 +00:00
Pawel Kaminski
7cf4602d11 test/vm_setup: Add module dependency for freebsd
Change-Id: Ied1da9dba02f9ff735ce603fee95aacd2981930d
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1140
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-02 14:51:24 +00:00
Maciej Wawryk
ae22c0019a test/vm_setup: Change cloning qemu submodule via git to https for avoiding proxy issues
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I4dab0b15234f0772356f79884867ac23fb319837
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1414
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-02 14:51:24 +00:00
Maciej Wawryk
9f6acc9a75 test/vm_setup: Update spdk git repository url
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I1f0f191ccbaa3e9464cd1b788599935d1bc994c2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1413
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-02 14:51:24 +00:00
Maciej Wawryk
051d3fe016 test/vm_setup: Fix permision error in Centos7
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ic704e9ae97bb68d96401818fb52940e86eaa36a3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1409
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-02 14:51:24 +00:00
Pawel Kaminski
add06ac392 test/vm_setup: Add packages needed for centos7.
Nbd package will enable tests that uses them.
Python2 is outdated. Python3 should be available.

Change-Id: I244c82b8ab2b8e4217dfb814f69882b2963fac70
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1079
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-02 14:51:24 +00:00
Pawel Kaminski
ebbcd7d9bc test/vm_setup: Add newer version of git for centos7
Git package from yum doesn't support -C parameter.

Change-Id: Ieb5f6e18dbab5d80897c1c5734af60535fb70eaf
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1064
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-02 14:51:24 +00:00
Vitaliy Mysak
dcf0ca15c9 ut: make use of CUnit macro to reduce duplications
CUnit provides a helper macro CU_ADD_TEST() that
simplifies usage of CU_add_test() function.
Test name no longer needs to be provided,
as it will be inherited from function name.

This is a follow up to
https://review.spdk.io/gerrit/c/spdk/spdk/+/931

Change-Id: I8078f02e08b14f12328ae022d7090ba13fbd64e4
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1239
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-02 14:50:12 +00:00
Vitaliy Mysak
78b696bca5 ut: simplify error handling at initialization
This patch changes the way that unittests initialize.
The new way is shorter and simpler.
It assumes that error during initialization is a fatal error,
but in our cases it always is.

This patch is a followp up to
https://review.spdk.io/gerrit/c/spdk/spdk/+/930

lvol_ut.c is the only test that skipped because
it runs same tests multiple times which is not allowed
by new method.

Change-Id: I0baf7ad09a35d5fca2dc4a03b4453c12c14f38a7
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1238
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-02 14:50:12 +00:00
Changpeng Liu
68d3bb2de4 nvme: save separate metadata size to nvme request
Previously the SPDK NVMe driver always set PSDT to 01b for hardware SGLs
which is aligned to the Linux NVMe driver, for this case the metadata length
is not required when filling the NVMe command fields.  There is no alignment
nor granularity requirement for Data Blocks for PSDT 01b case.  And if the
drive reported that it needs dword alignment with SGL, for this case, when
using spearate metadata, it needs a length parameter to fill the SGL descriptor.

Change-Id: I56ffaada775fe66de7637dae15b509ee9556e80a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1351
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-02 07:02:38 +00:00
Changpeng Liu
2cf937fb92 test/nvme: allocate separate metadata buffer when enable PRACT
The specification says when PRACT is 1 and metadata size is 8, the
controller generates and appends protection information to the end
of the logical block data, this looks like only valid for extended
LBA format, but from real test with different drives, for separate
metadata case, some drives require host allocated buffer while some
not, for metadata bigger than 8 bytes cases, they all need host
buffer, so we allocate this buffer in host for all cases here.

Change-Id: I1aca8eb84e089ff5819a5f2680409c193847c40b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1391
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-02 07:02:38 +00:00
Alexey Marchuk
1c5444d623 nvmf: Queue Connect command when subsystem is paused
Currently SPDK rejects Connect command when subsystem is not active.
This change allows to queue Connect command and execute it when
the subsystem goes back to active state. To queue the command we
should know subsystem_poll_group, in current implementation
this poll_group is known only when controller is already created.
To get the poll_group for Connect command we can retrive subsystem
subnqn, find subsystem and get poll_group by subsystem->id.

Increment subsystem_poll_group->io_outstanding even for Connect
cmd in order to prevent subsystem change state during the
connection process. Update spdk_nvmf_request_complete -
decrement io_outstanding for Connect cmd.

Fixes #1256

Change-Id: I724abb911696d7234a9c9d27458eba24739b26fd
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1273
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-01 10:22:25 +00:00
Tomasz Zawadzki
d643b47d9b ut/blob: disable compilation of UT for CUnit other than 2.1-3
This unittest uses CU_add_suite_with_setup_and_teardown()
which was added in CUnit 2.1-3 released over 5 years ago.
This is the most commonly packaged version of CUnit on
not EOL'd distributions.

Unfortunetly there is incorrectly created package on CentOS7.
CUnit-devel-2.1.3-8.el7.x86_64.rpm despite its name
contains CUnit 2.1-2.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5ebf9973b1f3df9ff6cc1f0dc61dcf691096605e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1530
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-01 10:22:17 +00:00
Ziye Yang
c9afbb3ab2 pci_ut: Add the simple bdf parse test.
Make sure that we can parse domain with 32 bit address.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I83ca08d5156c58b97e96b3884b5c6d6afcd1969a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1536
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-01 10:22:12 +00:00
Karol Latecki
a70d47bef0 test/vhost: remove run_fio.py script
run_fio.py was initially added (as the name suggests)
to run fio workloads on VM guests in client-server
mode during vhost tests.
Over time some of it's functionality was moved to
test/vhost/common.sh, so at the moment this script just
creates a command string and starts it. Using separate
Python script is just an overkill.

run_fio.py also contained an option to measure
VMEXITS on the guest side, which is never run in tests.
If needed we can re-add it in other commits.

Change-Id: I87a4c824dc09220bb6ce709355ee2d65e0ce3540
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1460
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-31 08:01:17 +00:00
Maciej Wawryk
38fb0e01f7 test/vm_setup: Update QAT driver version
Update QAT link to latest version.
Previous version does not compile on kernels 5.5+ and gcc 9.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I115f6ead9ccc40a08774a1508b19a8ac7572845e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1476
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-31 07:59:16 +00:00
WANGHAILIANG
cdbcc4634e test: add autotest of fuzz_iscsi
Add fuzz_iscsi into autofuzz.sh.

Change-Id: Iff65ce473712da11c878426ea6d2378c7254ead6
Signed-off-by: WANGHAILIANG <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1096
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-31 07:59:03 +00:00
Tomasz Zawadzki
17d77576b6 test/lvol: fix typo in lvol_size parameter
Some of the values were passed as literals rather than
values of variables.

Resulting in following errors:
 08:34:32       # fio --name=fio_test --filename=/dev/nbd0 --offset=0 --size=lvol_size --rw=write --direct=1 --do_verify=1 --verify=pattern --verify_pattern=0xcc --verify_state_save=0
fio: failed parsing size=lvol_size

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If0cd104d83646c1e5c23029cdc27a18340982187
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1458
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-31 07:58:25 +00:00
Seth Howell
cd982ad6ed test/make: properly escape '.' in awk.
The period was being treated as a wildcard by awk so it was improperly
parsing the libspdk_sock*.so library versions.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I37d3cfaf7bf9c29c6d5efb647e68d8a8be715a2b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1513
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-31 07:58:17 +00:00
Karol Latecki
dbb84dd5d6 test/iscsi: run cleanup once before running the tests
Run iscsicleanup once before running the tests. This is
to ensure we delete any stale entries or files if they
were not removed properly in previous test runs.

Fixes #1311

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: Idb415adddfaa7cbb443377a292fae357c1707e79
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1539
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-31 07:58:11 +00:00
Tomasz Zawadzki
99cff8350b test: remove SPDK_TEST_EVENT flag
Test in event.sh take 5 seconds on CI at this time.
For the tests to run both SPDK_RUN_FUNCTIONAL_TEST
and SPDK_TEST_EVENT had to be enabled.

This served as very minor time saver, so removing
this flag shouldn't affter test times more that the
5 seconds.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ie3eaa587daf28b2efbc3cfdff5ad648b7529e7f1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1493
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-31 07:57:40 +00:00
Tomasz Zawadzki
158de0bf8e test: remove unused SPDK_BUILD_DOC flag
Building docs is tested in autobuild_test_suite
when SPDK_TEST_AUTOBUILD is enabled.
SPDK_BUILD_DOC can be safely removed.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ic871febdcaba708e2fbe6a55d31ec3ddb101a818
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1492
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-31 07:57:40 +00:00
Tomasz Zawadzki
a9a9610b4b test: remove unused SPDK_BUILD_SHARED_OBJECT flag
Building "--with-shared" is tested in autobuild_test_suite
when SPDK_TEST_AUTOBUILD is enabled.
SPDK_BUILD_SHARED_OBJECT can be safely removed.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I05b1d04c3e28ce72c0a4a6deb89d0b6d02e2bb67
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1491
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-31 07:57:40 +00:00
Tomasz Zawadzki
d562d2ae4a ut/lvol: simplify UT by using handy CUnit macros
This kind of changes are now done through out the UTs in SPDK.

Patch here just adds them here as well.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I66fc06bbea038e328ba27bdea58b6e6479eee122
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1487
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-31 07:57:10 +00:00
Tomasz Zawadzki
85fc691478 ut/lvol: remove duplicate UTs
lvs_load, lvols_load and lvol_open were already added to the suite.

Commit 2f22884 mistakenly added those three when adding lvol_refcnt.

To remove those UT actually fixes earlier in the series were required,
as incorrect errnos were checked before and this specific order of
UTs set the right errno between them.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I7188be49171b6254146c6d144f9a54a689151b60
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1486
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-31 07:57:10 +00:00
Tomasz Zawadzki
4028b671d2 ut/lvol: replace functions with DEFINE_STUB
Simply some of the functions can be replaced with the stub
defines, so they were.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3095855c02c605fe0d66ee720a5025cdd8933873
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1485
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-31 07:57:10 +00:00
Tomasz Zawadzki
764cede766 ut/lvol: consolidate callbacks to op_complete()
There are three types of callbacks in lvol library:
- void(cb_arg,lvs,errno)
- void(cb_arg,lvol,errno)
- void(cb_arg,errno)
First two are used in cases where result of operation is
either lvs or lvol.
Last one is used for any operation that does not produce
either.

There is no need to keep more than one callback function
for last one, since they all are doing the same thing.

lvol_op_complete(), lvol_store_op_complete(), close_cb() and
destroy_cb() are now replaced with op_complete().

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Idd8fcf327ef56ad7d27e2e31cad9ddc44c80e5c8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1484
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-31 07:57:10 +00:00
Tomasz Zawadzki
b8645ac8da ut/lvol:use only single global variable to account for errors
There were two variables (g_lvserrno and g_lvolerrno) to
assign and check after operations.
This caused issues when developer mistakenly created callback
that assigns one and then checks the other.

This UT is ran to completion each time and only single operation
is done at once. There is no need to account for both.

This patch removes g_lvolerrno.
Next one will simplify callbacks.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I7d16b1913c13de56e1df2f5e36db11f15430979b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1483
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-03-31 07:57:10 +00:00
paul luse
37e56dd83b test/blockdev: enable multi-thread per target on bdevperf verify
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I8b289bd5fe8766bf78b6ad9f6c1b16654ea8376b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1220
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-31 07:56:28 +00:00
paul luse
15033b81f9 test/compress: enable multi-thread on single compress bdev
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I776d48d5b81a843048dbfdd9965f318ec9fb99a2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1216
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-31 07:56:28 +00:00
paul luse
58ec54b0ba bdevperf: enable multiple cores on same bdev with verify
Still testing to do both basic functionality as well as use of
various combinations of options.

Instead of using LBA range locking to protect the threads from
each other, this solution assigns a specific LBA range per target.
The LBA ranges are based on how many threads are working on any
one target.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I6a6588506a43292969fffe1baf060148d6772ee5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1207
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-03-31 07:56:28 +00:00
Seth Howell
f3bea41181 test/common: add shebang to autotest_common.sh.
Without the shebang, the builtin file command assumes autotest_common.sh
is a c file. This is obviously not the case, but it messes up file type
checking when we are confirming that all files are checked against scanbuild.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I45f32b23ef01b07ce9b72caed743e6670b99055e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1311
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-03-31 07:56:15 +00:00
Seth Howell
24add7e1e4 test/vhost: remove test_vhost.c
This file is not included in any other test files and it isn't compiled.

It appears to be a remnant of when we had distinct vhost_blk and vhost_scsi
unit tests.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I0b29d9e601f9d86b51cf8ba52ec5dc96bd02eef9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1310
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-03-31 07:56:15 +00:00
Michal Berger
85cda93b8d test/bdev: Call rbd_cleanup() only if rbd test was run
This is to avoid spammy stderr comming from ceph/stop.sh:

  + umount /dev/loop200p2
  umount: /dev/loop200p2: not mounted.
  + losetup -d /dev/loop200
  losetup: /dev/loop200: detach failed: No such device or address

Change-Id: Id1ecfc5da1a530c63d454bfacc8fb36c29549f8e
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1006
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-03-31 07:55:58 +00:00
Michal Berger
b3b45f1659 test/bdev: Cleanup old ini pieces
Change-Id: Id3aae79de36f4be415d77a2641bc1bf6050c0753
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1023
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-03-31 07:55:58 +00:00
Michal Berger
6b8f9a0f81 test/bdev: Convert setup_rbd_conf() to RPC calls
Change-Id: Icfbb571d1cd2a2539cd9026f1437c75450b77512
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1022
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-31 07:55:58 +00:00
Michal Berger
9176ac1efa test/bdev: Convert setup_pmem_conf() to RPC calls
Change-Id: I48217a4e855fd903a378e188e70b41efbe10db5d
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1021
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-31 07:55:58 +00:00
Michal Berger
102731bd40 test/bdev: Split crypto test and convert it to RPC calls
Split is done based on the crypto driver type:
  - crypto_aesni
  - crypto_qat

Change-Id: I47610eea7dd69defcbda9aa801a8bd8eeab820ee
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1020
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-31 07:55:58 +00:00
Michal Berger
9fd5bccc97 test/bdev: Convert setup_gpt_conf() to RPC calls
Additionally, part_dev_by_gpt() is dropped in favor of having entire
gpt setup done from within the setup function.

Change-Id: If026215138f2de20176ebc920a2427c18de991b5
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1019
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-03-31 07:55:58 +00:00
Changpeng Liu
8065ab2c27 nvme/pcie: pass dword aligned requirement based on controller flag
We only set the flag to false when the controller reports SGL supported
and can use byte contiguous buffer.  Also check the data block's alignment
for hardware SGL.

Change-Id: Id936c49823963000d0543fc95fbb6edba3118feb
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1352
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-25 07:54:40 +00:00
Karol Latecki
ec42f1a81f test/nvmf: use waitforserial instead of waitforblk
Use serial number to identify connected nvme subsystem.
/dev/nvmeX might be taken by some other device which is
not even a part of the tests.
It also might be affected by previous tests and not
always show up with the expected name.

Fixes #1308

Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Change-Id: I8d0e1b05f22a1263340014abdaf557f0fef5ad82
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1408
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-03-25 07:53:00 +00:00
Shuhei Matsumoto
2139be1598 lib/thread: spdk_thread_poll() measures run time per call by reading end TSC
Update spdk_thread_poll() to count SPDK thread stats correctly on multiple
SPDK threads per reactor configuration.

spdk_thread_poll() gets start time and reads TSC at end as end time,
and then gets delta between them as run time. Run time is added to idle
time or busy time according to the result of polling.

Reactor overhead is included into the next thread which calls
spdk_thread_poll() now.

spdk_thread_poll() saves the end time to the current thread to use it
as the start time of the next thread.

Unit test framework for this patch and the next patch need to access
thread->tsc_last. In the next patch, reactor will use the end time of
the current thread to the start time of the next thread in reactor_run()
to realize the idea.

Hence add an new API spdk_thread_get_last_tsc(). The corresponding
variable is named as tsc_last and it is good and is aligned with
DPDK (DPDK has used tsc_start and tsc_end as variable name). But
last_tsc will be better as API name because the last TSC value is
easier to understand.

Then add necessary unit test and update the unit test framework.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5e465e9283c032acb427576d0c90f9e1414f2271
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1048
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2020-03-25 07:52:53 +00:00
Ben Walker
e7615cbe51 bdevperf: Rename end_run bdevperf_job_end
More descriptive name.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ib3c716176b8862df53616e37572ce53f5adb9023
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1389
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-25 07:52:43 +00:00
Ben Walker
de747f08d6 bdevperf: Move g_job_count in struct bdevperf
Group the global parameters into the global structure

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I552b536869221efb58bc30820b7adfc01c74c293
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1388
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-25 07:52:43 +00:00
Ben Walker
992fd76dc7 bdevperf: Rename g_every_core_for_each_bdev to g_multithread_mode
Shorter name.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I08916b652c0b2f263baf18032537bfc108b06438
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1387
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-03-25 07:52:43 +00:00