Commit Graph

10216 Commits

Author SHA1 Message Date
Tomasz Zawadzki
3ea70d336a Revert "test: Fix a few instances of errant cd"
This reverts commit 0b9931516d.

"cd $dir && ..." in single line does switch directory for
the following commands.

The patch being reverted, broke the nightly (autopackage.sh) tests.
It was only fixing couple of instances of SC2164,
which is being excluded either way.
https://github.com/koalaman/shellcheck/wiki/SC2164

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Id4f134ad98953b92fdc69cd0d0b80c02660cf7a9
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473220
Reviewed-by: Seth Howell <seth.howell@intel.com>
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-05 15:59:17 +00:00
Karol Latecki
c650e14434 test/vhost: fix respecting additional params for vhost_run
Reinstating "shift" removed in commit a2ab5eb as it was actually
needed.

Change "cmd" command string to use $@ instead of $2 so that we're
able to use more than one additional param for vhost instance.

Change-Id: If656c4319d7acfecddd2ff73104d3c79b799689f
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472681
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-05 12:31:42 +00:00
Tomasz Zawadzki
456d60a744 changelog: add RPC rename entry
Added info on new names of RPC.

Moved rest of the RPC section to the top to acompany it.

Change-Id: I3ee265ab2f163d0bf01b74ca87d4510835041c3a
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472991
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-05 12:14:04 +00:00
Shuhei Matsumoto
6de3ac79ea test/iscsi_tgt: Call remove_backends after iscsicleanup in the trap handler
In the trap handler, iscsicleanup had been called after remove_backends.
This ordering found a bug in SCSI library but is not different from
normal path, and had created LVOL hotplug test unintentionally.

Fix the ordering first and consider an independent test case for
LVOL hotplug + iSCSI target separately later.

The failure which invoked the trap handler will be also investigated
regardless of this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6b2a0d7d38348fcbf7ccc272063dc8408f15315a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473156
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: yidong0635 <dongx.yi@intel.com>
2019-11-05 12:10:08 +00:00
Shuhei Matsumoto
7cef60b657 lib/scsi: Close block device on the thread which opened it
All connections to a single LUN run on a single thread but
this thread may not be the same as the one which opened the backed
bdev. So hold pointer to the thread which opened the backed bdev
to struct spdk_scsi_lun and use it when calling spdk_bdev_close().

All resource of LUN are accessed on a single thread after getting
I/O channel, and so lock is not still necessary.

    Fixes issue #1024.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ifc1e238d333afcde0cdf9e9b4af3b56ef65a4f7d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473002
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
2019-11-05 12:10:08 +00:00
Richael Zhuang
9889ab2dc8 spdk: Upgrade isa-l to add support for aarch64
The ISA-L integrated in SPDK doesn't include aarch64's implementation/
optimization in pass 6 months, upgrade it to achieve better performance
on aarch64. The upgrade includes the commit f3993f5c0(crc: Fix dynamic
relocation link failure on Arm), without which there will be link errors
on aarch64. That's the reason for not upgrading to the latest released
version of ISA-L(2.28.0).

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Change-Id: Ifbf2a3ccc3f88689e6ea11ab30fa7a771b13b5ec
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472762
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-04 12:26:00 +00:00
Chunyang Hui
6ed832db34 bdev/nvme: Check error when init Opal
Change-Id: I53034e591a2c549cbc7591bf61ba90be22ddeba5
Signed-off-by: Chunyang Hui <chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472893
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-01 20:11:53 +00:00
Liang Yan
6eab1c1608 test/nvme: disable startup test for FreeBSD
The startup tool needs more than 1s to finish in FreeBSD
OS. So disable this test for FreeBSD.

Change-Id: Ibd59cb7d8ed4e27b5df5171888676be9bc37fa8a
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472660
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-01 17:56:52 +00:00
Ben Walker
34385d80a3 nvmf/tcp: Add pointer to qpair from PDU
It's important to be able to recover full context from just
the PDU in the future.

Change-Id: I3d1f3c326299b1237b42dbe33d340a282c3bc5bb
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470531
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2019-11-01 17:56:16 +00:00
Ben Walker
83ffb2075e nvme/tcp: Rename pdu->ctx to pdu->req
This is always the request pointer, so rename it for clarity.

Change-Id: Ifbda7db7787c65f0deb190a1e94f0676b2c0d99a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470530
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
2019-11-01 17:56:16 +00:00
Ben Walker
78a11548da nvmf/tcp: Move duplicated disconnect code to a function
Change-Id: Ib3daec83ec518a0934911e04d771c19cb34b6167
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470529
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-01 17:56:16 +00:00
Ben Walker
811a66e97e nvmf/tcp: Use the new sock_is_connected function during shutdown
Change-Id: I3cf8765bbbcddaeda731188c7911b1966b953bc4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470514
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
2019-11-01 17:56:16 +00:00
Ben Walker
5f856f4d65 nvmf/tcp: No longer set sndbuf size
Use whatever size the socket layer thinks is best. In practice,
this is the same size as before.

Change-Id: I4820e16d8da6e566d1f8f078a75d345399f64ab5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470511
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
2019-11-01 17:56:16 +00:00
Ben Walker
81a47d9820 sock/posix: Move repeated socket allocation code to a function
Change-Id: I71726be5dbe2bb112b7569869dd456ef38f84d9d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472649
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-01 17:56:16 +00:00
Ben Walker
913f780e10 test: Add mocks for sendmsg and recvmsg
These will be used from the posix sock layer.

Change-Id: I6427d9e9aee889e11ba7e36876112a5aba449e31
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471751
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-01 17:56:16 +00:00
Jim Harris
e58deb0257 test/raid: remove unused spdk_thread_send_msg stub
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7fc128a82b3d1d1f780c1c396644f331306de600

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472437
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-11-01 17:46:42 +00:00
Konrad Sztyber
73f8438874 lib/vmd: use TAILQs for bus / device lists
Instead of manually implementing lists/queues, use the API provided by
sys/queue.h.

Change-Id: I06b9f5df2312ed0b6c1e35ecf857eabe5ba107c3
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472739
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-11-01 14:38:46 +00:00
Ben Walker
0b9931516d test: Fix a few instances of errant cd
Don't change the directory of the script if at all possible.

Change-Id: I5e20784694cb61fac2cf148628de566361e2673e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472650
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-11-01 14:38:18 +00:00
Maciej Szwed
9c64110700 bdev/nvme: Change NVMe controller unregister flow
This patch moves around code related to unregister
flow. This is a preparation for upcoming changes.
It also changes IO device for NVMe bdev to
nvme_bdev_ctrlr to make code clearer.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ic97a5b1973923a0cf44ed6c2d51b707dd7628d2c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468980
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.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>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-11-01 14:37:54 +00:00
Maciej Szwed
63c2e95c42 bdev/nvme: NVMe probe ctx free change for async bdevs creation
If specific NVMe mode requires asynchronous bdevs
creation we cannot free probe ctx until all bdevs
are created.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ie758f2fa8068c4090b7ce76c73967483441166cd
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468453
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-11-01 14:37:54 +00:00
Maciej Szwed
81d6bcd02c bdev/nvme: Make bdev_nvm_create_bdevs asynchronous like
With this change the new callback create_bdevs_cb
is introduced. This callback may be used by future
NVMe controllers which require asynchronous creation
of bdevs. This will make future implementation easier
because we will only have to call callback function.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ib46a38cf71bc783db58be9021efd06fcd547c4d9
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469699
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
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-01 14:37:54 +00:00
Ziye Yang
b577d89297 scripts/ceph: unmount the right dev.
According to my check, I found that we should
umount /dev/loop200p2. The name of the dev used in the
start.sh and stop.sh is not same.

Then there an issue reported in the script:

umount /dev/loop200
umount: /dev/loop200: not mounted.
I think that this is an issue happens in our every
test. And it may influence the further test.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I10c460b4e7760f321fd1a1cd87caa69d2911037b
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472514
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: Ben Walker <benjamin.walker@intel.com>
2019-11-01 14:36:56 +00:00
Maciej Wawryk
27ef3373a6 test: Shellcheck - ignore SC2164 warnings
Add to permanently excluded in shellcheck:
	SC2164: Use cd ... || exit in case cd fails.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ic8091de0cdc7bba441ea1715699ca5bd170ece59
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472176
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-01 14:36:25 +00:00
Artur Paszkiewicz
445e667f41 module/raid: make raid_level an enum instead of plain integer
Also add functions to convert it to/from string.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I6f7964d832c308b815150fff39eb3dc5c5ae5853
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471079
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-11-01 14:34:32 +00:00
Artur Paszkiewicz
fc9ca1d0d6 module/raid: move raid0 functions to separate file
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Icf74bda40303b3c38a7c58a5331589f3ec229634
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471078
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-11-01 14:34:32 +00:00
Artur Paszkiewicz
6e6d04b683 module/raid: move duplicated error handling code
Both callers of raid0_submit_rw_request() perform the same error
handling. Put it inside the function and change its return value to
void. After that, raid0_get_curr_base_bdev_index() becomes unused, so
remove it.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Ifbe88700e413c3af9bb513538b3026c19e857d74
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471077
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>
2019-11-01 14:34:32 +00:00
Artur Paszkiewicz
1d246e97ab module/raid: remove a redundant function
The raid_bdev_io_submit_fail_process() and
raid_bdev_base_io_submit_fail_process() functions both do essentially
the same thing, so remove the former and replace its usages and rename
the other.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I8eda933e23d4bc840a6740e21a48d9c411998f6d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471076
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>
2019-11-01 14:34:32 +00:00
Artur Paszkiewicz
ef775d6453 module/raid: remove struct raid_fn_table
Something similar will be re-introduced in the upcoming patches, but
remove this for now to simplify refactoring.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I6b520a63ecfe9a1ae0c855507601c8aeeca03e8a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471075
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>
2019-11-01 14:34:32 +00:00
paul luse
f614a7014c module/crypto: reduce session mempool size
The initial implemenation of the module used a unique crypto
session per operation.  Later an optimization was made to use shared
session, 1 for encrypt and 1 for decrypt. The size of the session pool
and assocaited cache were not adjusted at the time.  This patch reduces
the session pool size to just 2 and uses 0 for session pool cache size.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ief3e867ec6bf4ff9c90d8ea60427ed8b85345275
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471692
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-11-01 14:33:45 +00:00
paul luse
88e48baaaf module/crypto: fix some typos & clean up comments
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I21b6992d2a3a914e44c61d489633b5c3741e70cb
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471690
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-11-01 14:33:45 +00:00
Tomasz Zawadzki
583f40632f version: 20.01 pre
Change-Id: Ia607bb44078c9311e7e3ed727530edc24c630e20
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472986
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-10-31 19:26:35 +00:00
Shuhei Matsumoto
cd654cc512 lib/iscsi: Remove iSCSI task left in PDU receive process due to connection exit
Previously iSCSI task was created after allocating data buffer
and reading all data, and hence creating iSCSI task and processing
iSCSI task were not separated.

However, the recent refactoring separate PDU header handling and
PDU payload handling, and then inserted allocating data buffer and
reading data segment in the middle.

If any critical error occurs during allocating data buffer or
reading data segment, PDU payload handling is not done, and hence
created iSCSI task is left in PDU receive process.

If any critical error occurs, the current connection starts exiting
and there is no way to continue PDU receive process.

The task left in PDU receive process is never freed, and hence
LUN hotplug or exiting connection never complete.

This patch do the following:
- Consolidate freeing pre-allocated PDU to spdk_iscsi_conn_destruct()
  because this is the only path to exit connection.
- Abort SCSI task of the task left in PDU receive process if found
  when freeing pre-allocated PDU. If the task is not SCSI or Data Out,
  remove it simply.

    Fix issues #1018.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8a2464c446c43bf4cfb5afbc0cd78b5bdef7d080
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472896
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>
2019-10-31 17:26:26 +00:00
Shuhei Matsumoto
832d90c1e2 Revert "lib/iscsi: Close the being hot-removed LUN even if connection is in exiting
This reverts commit Iad6ecdc37493fa9f2d7ccab262a2c75dac2fcd48.

Both estimated cause and code change were wrong and didn't fix
the issue.

The next patch will fix the issue.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I00c8bb515ee39522c0e744dccfb839af15e946c4
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472895
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>
2019-10-31 17:26:26 +00:00
Ben Walker
368de579b6 nvme: Document new cuse functions
Change-Id: I2644d7909899fd7aa4e9690eec0fe20de5f17289
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472834
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-10-31 14:05:23 +00:00
Ben Walker
11739f3cb1 nvme/cuse: Poll the io_msg queue when the admin queue is polled
Users already have to poll the admin queue, so embed the io_msg
queue polling there to simplify the API.

Change-Id: I4d4d3be100be0798bee4096e0bbda96e20d2405e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472833
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-31 14:05:23 +00:00
Tomasz Zawadzki
e9b5bef8d4 doc/nvme: nvme character device documentation
Change-Id: Ieab32f3e7aca103a270d88329d4df5fc85302795
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468827
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-31 14:04:38 +00:00
Tomasz Zawadzki
ab1faf3379 dpdk: update submodule to include vhost compile fix
DPDK submodule is now updated to include:
https://review.gerrithub.io/c/spdk/dpdk/+/472258
"b5c9624: vhost: fix compile error"

Change-Id: I898ba6cd3d71874f1d55d363c9efe5263d944562
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472773
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-31 04:54:10 +00:00
Seth Howell
13f30a254e nvme: don't disconnect qpairs from admin thread.
Disconnecting qpairs from the admin thread during a reset led to an
inevitable race with the data thread. QP related memory is freed during
the disconnect and cannot be touched from the other threads.

The only way to fix this is to force the qpair disconnect onto the
data thread.

This requires a small change in the way that resets are handled for
pcie. Please see the code in reset.c for that change.

fixes: bb01a089

Change-Id: I8a39e444c7cbbe85fafca42ffd040e929721ce95
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472749
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>
2019-10-31 04:50:59 +00:00
Tomasz Zawadzki
808ad5f398 changelog: added missing entries for 19.10
Added couple missing entries after comparing changes in public
headers in SPDK.

While here, added backticks around functions
to improve readability in MD.

Change-Id: I3c723a2e76dc02a84e8277e0bd8db96f10ba2222
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472732
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@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>
2019-10-30 22:03:31 +00:00
Tomasz Zawadzki
cc25bd4aa9 changelog: consolidated sections for SPDK 19.10
There were couple sections that were duplicated, so they
are now consolidated.

Moved around sections so that relevant ones are closer
to each other.

No change in content of section/entry was done in this patch.

Change-Id: I1838d9057548c5f65f7304f783ee81e21d3b624c
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472731
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@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>
2019-10-30 22:03:31 +00:00
Shuhei Matsumoto
1ef8449feb lib/iscsi: Close the being hot-removed LUN even if connection is in exiting
_iscsi_conn_remove_lun() which is the callback to LUN hot-removal
returns immediately without closing the LUN if the connecion is
already in exiting, then expects that the LUN will be closed by
after the connection moves to the exited state.

LUN hot removal process doesn't check any R2T task if it is not
pending in SCSI layer but connection close process checks any R2T
task even if it is not pending in SCSI layer.

LUN hot removal will not complete until all LUN accesses are closed.

iscsi_conn_close_lun() checks if the LUN is already closed or not,
and so it will be no harm even if _iscsi_conn_remove_lun() calls
iscsi_conn_close_lun(). If the connection is in exited state,
all LUNs are already closed.

This patch changes _iscsi_conn_remove_lun() to return immediately
if the connection is in exited state.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iad6ecdc37493fa9f2d7ccab262a2c75dac2fcd48
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472507
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-10-30 08:23:53 +00:00
Shuhei Matsumoto
84f59335c2 lib/iscsi: Send R2T in SCSI Data-Out PDU Header handling
Recent patches refactored iSCSI target to separate PDU header
and payload handling. However for SCSI Data-Out PDU, the division
of roles done by refactoring was wrong. Before refactoring, LUN
hotplug was checked after sending R2T, but after refactoring LUN
hotplug is checked before sending R2T. This change stopped PDU
exchange between iSCSI initiator and target and caused timeout of
LUN removal.

This patch restores the original ordering of checking LUN hotplug
and sending R2T by changing the division of roles.

SCSI Write Command PDU handling don't have any issue related with
this.

Fixes #1004

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7b2866d8394b522fb5420d2936de2fbddc7d1daa
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472308
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-10-30 08:23:53 +00:00
Seth Howell
a4925ba744 nvme: take the lock when disconnecting qpairs.
If we disconnect qpairs without taking the lock, we run the risk of
trying to double free qpair resources before they have been marked as
NULL.
For example, polling on one thread and calling
nvme_rdma_qpair_disconnect from one thread while doing an
nvme_ctrlr_reset on another thread. nvme_ctrlr_reset will call down to
nvme_rdma_qpair_disconnect on the same qpair and without any locking it
can result in trying to destroy the qpair resources multiple times.

Change-Id: I9eef6f2f92961ef8e3f8ece0e4a3d54f3434cff8
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472413
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-10-28 17:19:46 +00:00
Konrad Sztyber
4121477d91 lib/vmd: make sure pcie_cap is not NULL before dereferencing it
Fixes #1006

Change-Id: I761e1cbb49c09318a8d2eda9b4a2ee0bcdcebc37
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472385
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2019-10-28 17:18:54 +00:00
Tomasz Kulasek
efbcd259ac lib/nvme: nvme character device tests
This patch adds new script to verify CUSE functionality for NVMe
devices:

 1) Starts spdk_tgt application
 2) Attaches first found controller
 3) Enables NVMe cuse devices for a controller and namespaces
 4) Retrieves CUSE device names for controller and namespaces
 4) Tests operations on exposed namespace devices
 5) Tests operations on controller devices

NOTE: These tests requires at least one NVMe device with at least one
      namespace available.


Change-Id: I5f5a7c86f8aefa73f12f4727f7520f16a599985b
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468828
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-25 09:07:51 +00:00
Seth Howell
eafc447ecf changelog: add reset handling APIs
Change-Id: I4c3d9c61b4fe4541a985fa0e3104ccc3a2a4a7c2
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471556
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-10-24 23:46:39 +00:00
Seth Howell
eb2dee2444 test/nvmf: add a test case for trid failover.
Modifying the target_disconnect.sh test to include an example of
transport_id failover for an NVMe-oF controller.

Change-Id: I746ed737ab56c7dec6ee99e840c631ba46ee359e
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472230
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-24 23:46:39 +00:00
Tomasz Kulasek
a072421c90 test/vm_setup: add CUSE dependencies
Dependencies required to compile and run nvme-cli tests:
 1) fuse module must be installed,
 2) cuse module must be installed,
    a. Fedora requires to install "kernel-modules-extra" providing
       cuse module for a kernel,
 3) systemd-devel package to compile nvme-cli application

While namespace devices are provided as character devices via cuse
module, this patch also installs nvme-cli version accepting namespaces
as character devices.

Required changes are available for review here:

	https://review.gerrithub.io/c/spdk/nvme-cli/+/472250

After merging the changes will be available on spdk/nvme-cli
repository at 'nvme-cuse' branch.

NOTE: changes above are not required when controller with nsid is
      provided as an nvme-cli option,
      e.g.

          "nvme id-ns /dev/spdk/nvme0 -n 1"

      instead of:

          "nvme id-ns /dev/spdk/nvme0n1"

Change-Id: I413c33d9891c5a39a5388ea7407d798c138b0584
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472024
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-24 23:43:59 +00:00
Tomasz Kulasek
74906b01b6 lib/nvme: add RPC for interacting with CUSE devices
Added RPC commands to register/unregister CUSE devices
to NVMe controllers:

 - bdev_nvme_cuse_register
 - bdev_nvme_cuse_unregister

Additionally two RPC now return CUSE device names:

 - bdev_get_bdevs for namespaces
 - bdev_nvme_get_controllers for controllers


Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I69c4bf41ec8f78a7522894268a67dd733881712f
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/472211
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-24 23:43:59 +00:00
Maciej Szwed
5027dc7184 bdev/nvme: integrate NVMe character device with NVMe bdev
Added spdk_nvme_io_msg_process() in bdev_nvme_poll_adminq()
to process io messages that were passed from non-polled mode
threads to the controller.

This is used as part of nvme cuse support for surfacing
/dev nodes that can be used by standard Linux management
applications like nvme-cli.


Change-Id: If9e2e0b472c332aee54e3c6674bdd5fe616ab07c
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469692
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-24 23:43:59 +00:00