Commit Graph

10416 Commits

Author SHA1 Message Date
Maciej Wawryk
a69df7ea94 test: Shellcheck - correct rule: Use find...
Correct shellcheck rule SC2012: Use find instead of ls to better handle non-alphanumeric filenames

Change-Id: Ibfc54ac06ae4cecadd22954159d259295f99912f
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475712
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>
2019-11-27 07:08:57 +00:00
Maciej Wawryk
fdc82d3bc8 test: Shellcheck - correct rule: Double quote array
Correct shellcheck rule SC2068: Double quote array expansions to avoid re-splitting elements.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Iefc4f0104249f4d437a66c3d9c7a195f4f6f6da3
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475690
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>
2019-11-27 07:08:57 +00:00
Maciej Wawryk
25f601cfb8 test: Shellcheck - correct rule: Expanding an array
Correct shellcheck rule SC2128: Expanding an array without an index only gives the first element.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I0e7c335af678114dc78dfb12a02369a69158e435
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474989
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: Seth Howell <seth.howell@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2019-11-27 07:08:57 +00:00
Ben Walker
97b0f7733f env: Check supported iommu address width before using iova-mode=va
DPDK by default guesses that it should be using iova-mode=va
so that it can support running as an unprivileged user. However,
some systems (especially virtual machines) don't have an IOMMU capable
of handling the full virtual address space and DPDK doesn't
currently catch that. Add a check in SPDK and force iova-mode=pa
here.

Change-Id: Ib3a5691a584190feaab4b9064b5a500e361328f2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475149
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>
2019-11-27 07:08:32 +00:00
Maciej Wawryk
1aace53675 Add bdev_raid.sh to per-patch tests
The tests were made nightly with this patch:
85bedfac7a
It is no longer applies for two reasons:
    bdev_raid has seen and will see more changes in the future
    test take few second on the CI, meaning that they do not take up any
    meaningful part of CI time

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I5360c945549c08c81891bc733bb731ea9b93727e
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475677
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-25 14:34:30 +00:00
Maciej Wawryk
40e4e420b8 Fixed nightly error in bdev_raid.sh
In nightly tests there was error:
    rpc.py: error: unrecognized arguments: Base_2"
caused by patch: 029251878d
The problem was caused by chars escapes.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: If6ebce1de5845bc14a957f4b68250da163309a05
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475676
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-25 14:34:30 +00:00
Ben Walker
b0472ac853 test/sock: Limit sleep to only FreeBSD
There is a sleep in a test to allow a socket close to
propagate through the kernel stack. This is only required
on FreeBSD, so limit it's use to FreeBSD.

This results in slightly faster unit test run times on Linux.

Change-Id: I495d8b91e7247d0757650c4993d18f707c524a22
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475312
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>
2019-11-22 13:54:58 +00:00
Ben Walker
f56f15cc28 sock/posix: Release socket memory even if close() fails
Close can't fail. And if it did, we still want to release
the sock memory.

Change-Id: I0e4f4d23d49f32132f4526fef8587823ace0a774
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475311
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>
2019-11-22 13:54:58 +00:00
Ben Walker
f1d0c5aba0 sock: Simply spdk_sock_close
When this was originally implemented, it only accessed
*sock once or twice. As more stuff is added, it becomes
worthwhile to dereference the first level of **sock.

Change-Id: Ie31bb0210008f6341b071ba472aaedf897fa459a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475310
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>
2019-11-22 13:54:58 +00:00
Tomasz Kulasek
88808c5ab7 lib/nvme: cuse device avoid using signals
This patch uses lowlevel fuse functions to process messages to
eliminate the need to use signals to interrupt blocking read
operation in fuse_session_loop().

  Fixes #1032

Change-Id: Ie9c9ea76cc135c383f5757864aa2d84ac9eb3da3
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473233
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-22 13:53:38 +00:00
Maciej Wawryk
1d95f22d62 scripts/vagrant: Add automatic emulated disk create
Current scripts/vagrant allow us to manual create every emulated device.
This patch allow to automatic create whole emulated disk while we
create virtual machine.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: If772adc282c4f6d94dab5eb7337f097a08f708e9
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475070
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-22 13:52:11 +00:00
Maciej Wawryk
029251878d test: Shellcheck - correct rule: Consider using { cmd1; cmd2; }
Correct shellcheck rule SC2129: Consider using { cmd1; cmd2; } >> file instead of individual redirects.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ic692e9f78f2d3d8a3b27d702884cbe97c880727c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474959
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2019-11-22 13:51:15 +00:00
Seth Howell
5816421572 test/ocf: kill -9 bdevperf in stats.sh
We have encountered several latent failures in test/ocf/stats.sh because
we fail to kill bdevperf with sigterm. We really need to figure out why
we can't always kill bdevperf, but in the meantime we can get this test
passing consistently by sending sigkill to bdevperf.

Change-Id: I6f233f4da79293283e3afaf01fd4baf5e60048bd
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475315
Reviewed-by: Jim Harris <james.r.harris@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>
2019-11-22 13:50:56 +00:00
Ben Walker
07ca02210a env: Force iova-mode=pa on ppc
In DPDK, the ppc iommu support does not currently allow for
iova-mode=va, but DPDK doesn't detect ppc and so still attempts
to guess iova-mode=va in some modes. Force iova-mode=pa from
SPDK to fix this.

Change-Id: I6a1ee25ab74873826ac211c3e0dfdf54afc74502
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475148
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: JinYu <jin.yu@intel.com>
2019-11-21 14:34:42 +00:00
Wojciech Malikowski
93402cd144 lib/ftl: Keep state of single band relocation
Added states for keeping track on which reloc
queue band actually is.

Change-Id: Ib05ac4e925002728ddfed3195891f5328eebb0d0
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465072
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-11-21 14:34:11 +00:00
Wojciech Malikowski
7012a2760e lib/ftl: Minor cleanup in reloc module
This patch removes some unused variables from
ftl_reloc_init().

Change-Id: I483b28ad2f6331088c44bb5b215b4db50546a06b
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472044
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>
Reviewed-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-21 14:34:11 +00:00
Seth Howell
a816afaaaf bdev_nvme: check for admin queue failures.
This will allow us to reset the controller when we get disconnect events
from the underying transports.

Change-Id: I825985219f98ff65cfcf7581757bd26db5bd08ba
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473762
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>
2019-11-21 14:33:44 +00:00
Seth Howell
d786a7eccf bdev_nvme: always use bdev_nvme_reset.
When doing a controller reset on an nvme bdev, we should always use the
bdev_nvme_reset function which ensures that we destroy all of the I/O
qpairs before performing the reset. This prevents us from performing a
reset and leaving the I/O qpairs in a disabled state preventing I/O from
being processed.

Change-Id: I6309421322f6c884327ade4515fc9402b25c0c1a
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473743
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>
2019-11-21 14:33:44 +00:00
Seth Howell
f57b098e7c bdev_nvme: add synchronization to reset.
The generic bdev layer currently has a lot of snychronization built into
spdk_bdev_reset. However, in a couple patches I am going to introduce a
few instances where I call bdev_nvme_reset directly from this module.
The reason I call bdev_nvme_reset directly from this module is so that I
don't have to open a descriptor to the bdev in the module itself.

In order to be able to call bdev_nvme_reset from both this module and in
response to a bdev_io, we need to synchronize and queue reset requests.

Change-Id: I7ece41119cba705a7481d365d20a1eb746a80f64
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473754
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>
2019-11-21 14:33:44 +00:00
Seth Howell
a4d9919b67 test/nvmf: fix check_ip_is_soft_roce
A recent change to the way we grep to determine whether an IP is
soft_roce caused this functions return value to flip. This is causing
the multiconnection.sh tests to fail on nightly.
This change flips the return value back.

fixes: f924c94b

Change-Id: If524ff695593365bb7b26bab8efe71213737858b
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475318
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-21 14:33:01 +00:00
Seth Howell
b529dbb1d0 test/nvmf: don't skip tcp tests over soft roce
In the test pool, if a vm has previously had the soft-roce rxe module
loaded, it will report up that the NIC is using Soft-RoCE. If we are
doing the nvmf_tcp tests, then we should not exit prematurely.

Change-Id: I67683632b0457a488826e207e77a4813bac982c9
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475316
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-11-21 14:33:01 +00:00
Ben Walker
1a903f9c52 opal: Don't use set +e to ignore errors.
For errors that we do want to ignore, use || true after the commands.
This allows crashes in the background target application to fail
the tests.

Change-Id: I1fcd711c17ad0a956b6778260b2db8c0b801584f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475156
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-21 10:05:45 +00:00
Shuhei Matsumoto
91cc56ac15 test/bdev: Calculate accurate time interval to verify QoS limit
By using two ticks values and tick_rate, we can get more accurate
time interval to verify QoS limit.  This may get rid of our
anxiety about latency of sleep command and RPC calls.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic7deee8e778fbd653f01e8426640a96245cee437
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475168
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-21 08:05:23 +00:00
Shuhei Matsumoto
ed2a638e89 bdev/rpc: Add current ticks to bdev_get_iostat RPC
This is used to calculate more accurate interval between two
calls of bdev_get_iostat RPC.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib561b056bc8095aa23d04cb5f9ae6f558b157124
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475167
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>
Reviewed-by: GangCao <gang.cao@intel.com>
2019-11-21 08:05:23 +00:00
Hailiang Wang
dd3632975d module/bdev: fix a inconsistent order of parameters
Two parameters' order in deference and definition are inconsistent.

Change-Id: I62c6ef81b8044a75646dd3279ad2e6861436ef41
Signed-off-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475192
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-21 08:04:53 +00:00
Seth Howell
e5d2fdf14a test/rpc_client: remove sem_timedwait calls.
We have been experiencing some latent failures on the test pool relative
to these calls timing out. While they are perfectly reasonable timeouts,
we believe that the scheduling oftest VMs can sometimes cause the calls
to take much longer. We don't want these test failures to confuse people
trying to contribute to SPDK.

fixes issue #1070

Change-Id: Ie0a96a15c593cacf7511028156790e5c285f0e48
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475166
Reviewed-by: Jim Harris <james.r.harris@intel.com>
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>
2019-11-21 08:04:22 +00:00
Richael Zhuang
a95aefc38a test: fix errors in test persistent-metadata.sh
Test failed both on x86_64 and aarch64 on some cases:
1.nvme_cfg=$($rootdir/scripts/gen_nvme.sh)
If the driver haven't been changed to vfio-pci(haven't run
scripts/setup.sh), we got no result from gen_nvme.sh.
2."mountpoints=$(lsblk /dev/$blkname --output MOUNTPOINT -n | wc -w)"
The global variable "blkname" (defined in get_nvme_name_from_bdf) is
always null here. For the scope of shell global variable is current
process. However, "name=$(get_nvme_name_from_bdf $1)" will create a
new process. We use variable "name" here.
3."name=$(get_nvme_name_from_bdf $1)"
If the "$rootdir/scripts/setup.sh reset" above is not ready, $name
will be null. For some non-x86 platforms, the waiting time maybe not
enough. So I adjust it to 5 seconds according to repeated tests.

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Change-Id: Ia91460a3116bc0cc7c6c5f5ee471957caf9d0e06
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474184
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-11-21 08:03:49 +00:00
Seth Howell
e9e3f61525 nvme/rdma: add connect retry in edge case
If the initiator dies without a disconnecting a qpair, the target can
possibly retain the state of the connection. In this case, it will
inform us that the connection is stale, and we need to try again.

Change-Id: I4d349c634aee59ce9ea4af795b07dd8649db56b3
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473063
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>
2019-11-21 08:03:33 +00:00
Chunyang Hui
1f3b2a745f test/opal: disable revert clean up
We don't have opal test running in jenkins for now.
So disable this test and we can re-enable this when
we enable opal autotest.

Change-Id: I19ece0c37e6850c7b633539a402dc4b32c55320c
Signed-off-by: Chunyang Hui <chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475169
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-21 08:03:08 +00:00
Tomasz Kulasek
82a54d29f6 lib/nvme: fix nvme_io_msg_ctrlr_unregister with no io_msg_producer
Change-Id: If2e0d00560311948570a2d7113dc5f730d937c0c
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474257
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-11-21 08:01:57 +00:00
Tomasz Kulasek
9eb0ffa90c lib/nvme: change api for io message
API changes in this patch:

 1) nvme_io_msg_ctrlr_start                         => nvme_io_msg_ctrlr_register
 2) nvme_io_msg_ctrlr_stop with (shutdown == false) => nvme_io_msg_ctrlr_unregister
 3) nvme_io_msg_ctrlr_stop with (shutdown == true)  => nvme_io_msg_ctrlr_detach


Change-Id: I60153ebbfb0d0b22575128d106f9333c3887213d
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474096
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-21 08:01:57 +00:00
Tomasz Kulasek
b078bc8e42 bdev/nvme: fix handle error on rpc cuse register
Change-Id: Ie746af29026bb6f9fdbcb67fb454a6eb8b9bec11
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473711
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-11-21 08:01:57 +00:00
Tomasz Kulasek
6227a37b0d test/nvme: fix wait for spdk_tgt error code on exit
Just sending TERM signal to the background process doesn't
provide an information about the condition of terminated
process.

To catch failures in the background process killprocess
helper should be used to wait for its termination and
check error.


Change-Id: I294d4493cf69883aa481eb6f5e55b46ea4940c5c
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475017
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-11-21 08:01:57 +00:00
Tomasz Kulasek
8e70c6e320 test/asan: suppress memory leaks in external libfuse3
There are some leaks in libfuse3 that is external to SPDK.
With this patch, any leaks in libfuse3 will be suppressed.


==1944861==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 2 object(s) allocated from:
    #0 0x7fc26a462048 in __interceptor_realloc (/lib64/libasan.so.5+0xf0048)
    #1 0x7fc269bfcfe2 in fuse_opt_add_arg (/lib64/libfuse3.so.3+0x19fe2)

Indirect leak of 10 byte(s) in 2 object(s) allocated from:
    #0 0x7fc26a3ade60 in strdup (/lib64/libasan.so.5+0x3be60)
    #1 0x7fc269bfcfc6 in fuse_opt_add_arg (/lib64/libfuse3.so.3+0x19fc6)

SUMMARY: AddressSanitizer: 42 byte(s) leaked in 4 allocation(s).


Appropriate patch solving this issue was sent to libfuse, but
not merged yet.


Change-Id: I66625e155b78082f2f2c9790bf3f3b48c3c04f33
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475117
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-11-21 08:01:57 +00:00
Tomasz Kulasek
53184430a5 lib/nvme: fix do not use external_io_msg_qpair after free
Change-Id: I20ef8303c2fae6abf43d15ebb025ea368c0dfd67
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473282
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-11-21 08:01:57 +00:00
Shuhei Matsumoto
e79a29b264 lib/iscsi: Make spdk_del_transfer_task() return success/failure
After recent refinement of LUN hotplug, it is possible that
for large write I/O, primary task is freed doubly as a github issue
is reported.

However we could not notice the case because spdk_del_transfer_task()
had not return success/failure, and to make matters worse,
the second call of TAILQ_REMOVE() to the same header and instance
caused no error if the first call succeeded.

This patch changes spdk_del_transfer_task() to return success/failure.

Besides, the next after patch expects the stub of spdk_del_transfer_task()
returns true in the unit test, and hence do that.

The next after patch will fix the issue of double free of primary task
by using this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ibc0b65723050362d5fafa913417b64393feb874e
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475042
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>
2019-11-21 08:01:29 +00:00
Shuhei Matsumoto
fa2dd2722d lib/scsi: Move scsi_task_free_data() in a file to remove function declaration
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9c98ded51bf88cd199bace7b3703b86ed4a9c25b
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472519
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-11-21 08:01:29 +00:00
Shuhei Matsumoto
16dbc19508 lib/scsi: Consolidate error paths in bdev_scsi_readwrite()
This simplifies the code a little.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Idf53616bda21c82b82f9e9438f4dcb87ffaa59a6
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472518
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-11-21 08:01:29 +00:00
Shuhei Matsumoto
ca0972d3b8 lib/scsi: Match parameters of bdev_scsi_readwrite() with bdev_scsi_sync/unmap()
We can pass bdev, lun->bdev_desc, and lun->io_channel to
bdev_scsi_readwrite() as same as bdev_scsi_sync/unmap().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib8b368da4da54b057ae09a91ab60a50388a5c684
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472517
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-11-21 08:01:29 +00:00
Shuhei Matsumoto
84e64cc9d7 lib/scsi: Pass SCSI task to SCSI layer to get DIF context
By the recent refactoring, SCSI task is configured when getting
DIF context from SCSI layer. Passing not CDB and offset separately
but SCSI task to SCSI layer is more concise and do in this patch.

In iscsi_send_datain(), we have to update task->scsi.offset for the
case that data is split into a sequence, but the update is no harm
because task has completed what it must to do.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I153352dfa7aa7325db4452f03d863df11b3e0cfa
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472510
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: Paul Luse <paul.e.luse@intel.com>
2019-11-21 08:01:29 +00:00
Maciej Wawryk
f924c94b4c test: Shellcheck - correct rule: Use grep -q...
Correct shellcheck rule SC2143: Use grep -q instead
of comparing output with [ -n .. ].

Change-Id: Ibfce9633eda332c64b27914b2fde51c9a26ff7f3
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474957
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-20 10:03:15 +00:00
dongx.yi
94ec4785ef test/unit: Add test_nvme_pcie_hotplug_monitor to nvme_pcie_ut.c.
Add this test to increase code coverage rate.

Signed-off-by: dongx.yi <dongx.yi@intel.com>
Change-Id: I46533dcd1a528ae7385cdaa143aea9c396e2942c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472915
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-20 10:03:00 +00:00
Tomasz Zawadzki
4ea996ce19 nvmf/rdma: dont refer to rtransport when poll_group_create failed
This issue was found by code inspection.
It only occurs when pdk_nvmf_transport_poll_group_create()
itself calls spdk_nvmf_transport_poll_group_destroy().
Other transports at this time do not show this issue.

spdk_nvmf_rdma_poll_group_destroy() depends on
rgroup being assigned a transport, which is only being
done on generic nvmf layer using
spdk_nvmf_transport_poll_group_create()
after successful spdk_nvmf_rdma_poll_group_create().
When failure occurs during create, such assignment was not
performed so any references to rtransport will segfault.

Reported-by: Jacek Kalwas <jacek.kalwas@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Id54482d562bd6d7c71371306cf1de93bc05f4e8a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475002
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
2019-11-20 10:01:43 +00:00
Yao Liu
c8ef5793e3 bdev/uring: add JSON config dump
Signed-off-by: Yao Liu <yotta.liu@ucloud.cn>
Change-Id: Ic060a62f20c97dcc0c52ad761f848074efaade3d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474180
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-20 10:01:07 +00:00
Yao Liu
bc7b39a5f0 bdev/uring: dump filename in driver_specific JSON
Signed-off-by: Yao Liu <yotta.liu@ucloud.cn>
Change-Id: I9a3bf72175d8bf9ede7149fb6ea14dc9931ce1f6
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474179
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-11-20 10:01:07 +00:00
Yao Liu
81b4f2fec2 bdev/uring: add support for bdev_uring_get_spdk_running_config()
Signed-off-by: Yao Liu <yotta.liu@ucloud.cn>
Change-Id: If86ef2dad60260b5261fc05d075625dfa2ed0340
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/474178
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-20 10:01:07 +00:00
Ben Walker
e475586b2a util: Add spdk_iovcpy, an iovec to iovec copy function.
Like memcpy, but works on two iovecs.

Change-Id: Ia1cf462a95690286f0c19325fc10937b9ba6baf3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473976
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>
2019-11-20 09:35:32 +00:00
Ben Walker
063252fa66 pipe: Add a utility for buffering data from sockets
When dealing with sockets most code in SPDK buffers
data into large chunks to minimize the number of
syscalls made. The pipe utility is designed to make
that easy.

Change-Id: Ie29966712bbfb43fb49457e042903cf45864e6c6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465707
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>
2019-11-20 09:35:32 +00:00
Jim Harris
aa4856632e bdev: remove _spdk_bdev function prefix
The _ was supposed to indicate an internal function,
but really leaving off the spdk in the function
is the standard way to denote an internal function.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I74facafb67b793502838b9c1b5f90aec2c88c69b

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475033
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-11-20 09:34:18 +00:00
Jim Harris
0e58d1549b bdev: remove spdk_ prefix from static functions
We try to reserve the spdk_ prefix for functions that
are part of the public SPDK API.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0a95ba0f9db04b588a2e948427f8a9f53a7b5740

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475032
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-11-20 09:34:18 +00:00