Commit Graph

20 Commits

Author SHA1 Message Date
Michal Berger
b80667550f scripts/setup remove flakiness from tests
This removes all the sleeps called after setup.sh reset. These
sleeps were meant to wait for devices given tests depend on.

Change-Id: Ibb86c9f6f8d5f1b05d165e84d9019530af84f9ea
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4035
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-09-09 07:19:43 +00:00
Tomasz Zawadzki
ccdbd2ed51 nvme/cuse: fix nblocks and block_size in rw path
nblocks is zero based, so read path was missing the increment.

NVMe device that cuse represents can be of any block_size,
so rather than hardcoding 512 - actually verify it.
Both paths didn't request enough of a buffer from cuse.

Reported-by: Niklas Cassel
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I228dc2572bc94ecbcb913e950d912a7ab5be9434
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4037
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
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-09-04 08:13:56 +00:00
Tomasz Zawadzki
ba3c468647 test/cuse: do not disable exit on error
Originally the idea was to disable error checking,
to match output from Kernel and SPDK NVMe cuse.
This includes passing test commands and failures.

Any discrepancy would be caught by log output diff
at the end.

Flaw in this logic is that test command itself might
be incorrect. We shouldn't depend on that, nor
attempt to cover up some of the failures even if
they occur on both interfaces.

Most probable cause for this at all, was NVMe emulated
in QEMU not really working with all the nvme-cli commands
from this test.

Since the original creation of this test, CUSE executes
on physical devices (to be able to support namespace management).

The behavior there is predictable and works with current
test commands, thus the test exits on any error with this patch.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I086faf38b2cbbb6225935cc50d4fad14e81f1972
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3032
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2020-08-17 08:28:56 +00:00
Tomasz Zawadzki
102f6256b8 test/cuse: replace sleep with waitforfile
We can do better than "sleep 5". Instead use waitforfile(),
that will wait until the namespace is available.

Moved around the variables with names and checks for the ctrlr/ns
existence after all the tests complete.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I8326c2cec0d0cf5aec88b5f80c1126c81eb09436
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2951
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@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-08-12 10:39:29 +00:00
Tomasz Kulasek
549b9f31c6 lib/nvme: implement SPDK_NVME_DATA_NONE data transfer in CUSE
Change-Id: Ifb2a53bdbaabd74b7f412923a97d79b44afde861
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1744
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2020-08-12 10:39:29 +00:00
Tomasz Zawadzki
14ce25ab00 test/cuse: wait for device after reset
This patch adds waitforblk() after rebinding the driver.
If timing was unfortunate, it was possible to issue
id-ctrlr command to a device that was not yet ready.
Meaning the support for fw command was not read properly.

No error was reported due to "set +e", so this patch moves
it till after id-ctrlr.

Example of the error:
# get_nvme_ctrlr_from_bdf 0000:82:00.0
# readlink -f /sys/class/nvme/nvme9
# grep 0000:82:00.0/nvme/nvme
# bdf_sysfs_path=/sys/devices/pci0000:80/0000:80:03.0/0000:82:00.0/nvme/nvme9
# [[ -z /sys/devices/pci0000:80/0000:80:03.0/0000:82:00.0/nvme/nvme9 ]]
# basename /sys/devices/pci0000:80/0000:80:03.0/0000:82:00.0/nvme/nvme9
# printf '%s\n' nvme9
# nvme_name=nvme9
# [[ -z nvme9 ]]
# set +e
# ctrlr=/dev/nvme9
# ns=/dev/nvme9n1
# /usr/local/src/nvme-cli/nvme id-ctrl /dev/nvme9
# grep oacs
# cut -d: -f2
/dev/nvme9: Resource temporarily unavailable

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5728a5062cd553eb39d18d9869fdf56319a27777
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2950
Community-CI: Mellanox Build Bot
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>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2020-07-08 07:55:33 +00:00
Karol Latecki
8e8864f27e test/cuse: use 512B block size on namespace revert
Use 512B block size when running nvme_namespace_revert
routine. Need to use this block size because of
vhost_boot.sh test case.

Fixes #1452

Change-Id: I5f41cf2bf9d63b811849a99de6cba9b7b5a1d97d
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3003
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-06-23 08:04:05 +00:00
Tomasz Zawadzki
f2f1060ed2 test/cuse: run namespace managment test if device supports it
In case when no device supporting Namespace Managment was found,
the test case exits without producing an error.
For example QEMU NVMe emulated device does not support it, thus
only physical devices have to be used right now.

This goes against design of "run_test" function, that when executed
should always run and never silently skip.

This patch adds check whether there is a device support and triggers
the test case only then.

Note that original code for selecting the device is still in original
script. This is to enable running nvme_ns_manage_cuse.sh on its own.

Right now CUSE tests are only enabled on VMs so nvme_ns_manage_cuse,
was added to exception list.

This will soon be reverted as the tests are moved to job that
runs on physical machines.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ie784696c2628b5fe45ce751b3978abcc03118cd9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2828
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2020-06-17 07:20:55 +00:00
Tomasz Zawadzki
2c47df9419 test/cuse: cleanup and better describe ns_manage test script
Added more comments for clarity.
Moved namespace size calculation to the clean_up() function.

Changed size calculation from nvmcap (id-ns) to tnvmcap (id-ctrlr).
There is noneed to cache the size before deleting namespace,
if we assume that all devices had single namespace encompassing the
whole device.

Changed blocksize from 512 to 4k. All devices in CI should support that,
and usually thats the default.
This could be further improved by reading LBAF and checking the Relative
Performance (RP), but that would convolute the test scripts. This
is good enough.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I8a38d00ae1442edf5480e4e72a8a8aa90380cd79
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2827
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2020-06-17 07:20:55 +00:00
Tomasz Zawadzki
933ba7f710 test/cuse: move nvme reset to reset_nvme_if_aer_unsupported() function
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I99925974b6004484a0d308ccd56120360b89b8ec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2826
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2020-06-17 07:20:55 +00:00
Tomasz Zawadzki
4883aeb218 test/cuse: remove superfluous setup.sh
It is already assumed that enviroment was prepared,
setup.sh ran binding the drives.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I864590b57db880b33c7b32deba8d38e4d5637b5b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2825
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-06-17 07:20:55 +00:00
Tomasz Zawadzki
256f554d9e test/common: add get_nvme_ctrlr_from_bdf()
This is used couple times in cuse test, so move it to common script.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1e9f973e7fb53b0024fb320d37632e1e011ba3e9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2824
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2020-06-17 07:20:55 +00:00
Tomasz Zawadzki
4e0eb251f7 test/cuse: move all nvme-cuse tests under single script
This will help with managing the test execution and preparation.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I0bd3612381d031a4015335d162f1296fd6dd213d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2823
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-06-17 07:20:55 +00:00
Tomasz Zawadzki
24260d2a0d test/cuse: fix conflicting name for cuse tests
"nvme_cuse" name for run_test was already used by one
of the tests in nvme.sh.

This removes the naming conflict and will prepare for further
restructure of nvme-cuse tests, where "nvme_cuse" name will
encompass all cuse tests.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If141fe0ef492e0cde8e68490550de5d48fecb5e7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2822
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-06-17 07:20:55 +00:00
Ben Walker
6b9b448e53 build: Output executables from the app directory to build/bin
Automatically place binaries produced from the app directory
into build/bin. This matches with the output in build/lib
that already exists.

Change-Id: I13cd2da71d2f88592e22308fe8a907bf458458b5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2379
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2020-06-15 15:27:16 +00:00
Tomasz Kulasek
2b9a331d0b test/nvme: dynamic nvme cuse devices update test
This test changes the range of active namespaces and checks
if apropriate CUSE devices for namespaces was stopped/started
properly on CUSE update.

Change-Id: I9683a0ab6ff28328d4788c49a834cef31c0582cc
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/780
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-06-05 09:01:44 +00:00
Tomasz Zawadzki
7fbdeacc9e nvme: do not allow the same nvme_io_msg_producer to register twice
Previous to this change it was possible to register
same nvme_io_msg_producer twice. This kind of functionality does
not make sense in current scope of it, as each message to/from
io_msg_producer does not have identifier other than this pointer.

In case of nvme_cuse this allowed creation of multiple /dev/spdk/nvme*
devices and caused an infinite loop when detaching an nvme controller.

This patch disallows that and adds test for nvme_cuse.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5f56548d1bce878417323c12909d6970416d2020
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1938
Community-CI: Mellanox Build Bot
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-23 20:29:46 +00:00
Tomasz Zawadzki
5772521a84 test/cuse: refer to "/dev/spdk/nvme" as base for cuse devices
Instead of refering to single controller, allow to point
and check different ones.

Next patch in series will verify lack of existance
of "/dev/spdk/nvme1".

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9656ac06e86c8946b45b2ffc93119d31a1ccc5ca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1979
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-23 20:29:46 +00:00
Tomasz Zawadzki
d9a11fd5b1 cuse: fix nvme_cuse unregister segfault
Unregistering nvme_cuse when the device did not exist
resulted in SEGFAULT within nvme_io_msg_ctrlr_unregister().

To prevent that, when no nvme_cuse is registered for the
ctrlr do not unregister nvme_io_msg_producer.

RPC and spdk_nvme_cuse_unregister() now return an error.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Id77cebe23ff91023a24cfe091f5f62a76a9175fd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1921
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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-23 20:29:46 +00:00
Tomasz Zawadzki
63db535f14 test/cuse: move cuse specific tests outside of nvme-cli
Couple of nvme_cuse RPC operations were done as part of
nvme-cli test cases. This patch moves those out to separate
script.

Next patches in series will expand those.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ia3123939901368af3570b127230f828437f39ef6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1920
Community-CI: Mellanox Build Bot
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-23 07:27:36 +00:00