Commit Graph

10192 Commits

Author SHA1 Message Date
Maciej Wawryk
4b3a6e876c test: Shellcheck - correct rule: Useless echo
Correct shellcheck rule SC2005: Useless echo?
Instead of echo $(cmd), just use cmd

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I60c05915691a339cced6d4e3694514857b2d1c4e
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470899
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-10-16 15:51:31 +00:00
Maciej Wawryk
f1131f1d19 test: Shellcheck - correct rule: loops over find output are fragile
Correct shellcheck rule SC2044: For loops over find output
are fragile. Use find -exec or a while read loop.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I3fd84ab60daab7c6971769ff4dee8a24d5d3e1bb
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470746
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-10-16 15:51:31 +00:00
Richael Zhuang
644fc12061 nvmf: upgrade to C11 atomics
Replace legacy __sync builtins with C11 __atomic ones to leverage fine
memory order controlling.

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Change-Id: I8a1e976be6a0db73af4451a39a8f544310c72989
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463458
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: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-10-15 17:00:07 +00:00
Seth Howell
1399a42bbc nvme_rdma: put requests when ibv_post_send fails.
Leaving these on the stack outstanding list can cause unnecessary
buildup. If we fail to post the request to ibv, then the upper layer
request will be freed immediately for reuse, but we will keep that
request in the outstanding queue at the RDMA layer.

Change-Id: Ib422dc9fcb50344ce7c01749f3e20ea9310fd5cb
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470255
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>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-15 16:53:59 +00:00
Anil Veerabhadrappa
32e3e269a3 nvmf/rdma: parse listen address directive for rdma and tcp transport
Package ip address parsing code into a separate function. This change
is the first patch in the series to enable FC listen address support.

Signed-off-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Change-Id: Ia86c61d001a091dfb9f825b68f76cdaf94537303
Signed-off-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471024
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-10-15 16:43:17 +00:00
Konrad Sztyber
8ed9e0a187 test/vmd: return zero after sucessful test run
After successful completion the test now returns with zero status code.

Change-Id: Id0ede49d3c7b6bdbcc0603dd65e98f0bad004219
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470663
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-10-15 16:37:40 +00:00
Konrad Sztyber
fd2e51f4c7 test/vmd: fixed fio's configuration
The config had a 'verify=1' which doesn't make sense as the verify
option requires the type of verification to be set (e.g. md5, crc32c).

Change-Id: I0ace5bce86ce3e78d0f58a74edeb314e5d38bdc6
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470662
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
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-10-15 16:37:40 +00:00
Ben Walker
7756ba14e4 sock/posix: Store pointer to group in sock
It was previously impossible to get back to the group
from the socket. This will be needed later.

Change-Id: I7b72c1b3bb9f5f4fda7e94475636e103df409316
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470522
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-15 16:35:09 +00:00
Ben Walker
a0889ece60 sock: Add a function to check if a socket is connected
This is useful for detecting sockets that have been disconnected
by the other end without reading data.

Change-Id: Ieb6529984d282d48373766d9f5555cf11720f19b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470513
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-15 16:35:09 +00:00
Seth Howell
85d9f0a9ab Revert "nvme: call the remove_cb in nvme_ctrlr_fail."
This reverts commit bc4e31d6b2.
This change was accidentally merged after it was decided to go with a
different architecture.

Change-Id: Ifc9d8b08bd1fcbc4ace8dd6fb4bd0014330916ed
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471144
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-10-15 16:33:12 +00:00
yidong0635
2cb14abc95 mk : Fix compiling error.
Add DEPDIR in module Makefile for blobfs.
Avoid compiling blobfs_bdev before blob_bdev.

This is to fix issue: #982

Change-Id: I7f7bd35ec56cb5a7d0545d9966aaeb7249ffb4f4
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471019
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-10-15 16:32:24 +00:00
Ziye Yang
d9561c444f env/dpdk: Exclude the orig cpuset in spdk_unaffinitize_thread
The patch of this purpose is to exclude the CPU cores
occupied by the DPDK thread. To mitigate the corner
case, we only do it when the number of online CPU cores
is larger than then DPDK thread occupied cpu cores.

The purpose is uset to improve the performance and avoid the
contention between DPDK thread and user's own thread.

Change-Id: I1a4a28074df97c55ac531440aea41059a75543f6
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471000
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: JinYu <jin.yu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-10-15 16:31:33 +00:00
yidong0635
912ddafe94 test/ceph : Update script to fix some issues.
1. Remove created dir name with "/".
2. Compatible with upper version of ceph-authtool without --set-uid, let it run as default.
3. Fix error on ceph 12.*.*

This is to fix issue #980 which blocks by ceph-authtool.
If there's still other issue, should append fix.

Change-Id: Icd7fb4177a75a731ae3d4d5fc51cef16eeab282f
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470915
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-15 16:30:30 +00:00
Pawel Kaminski
1c2291bab9 test: Shellcheck - move rule SC2206 to permanent exception list
Quote to prevent word splitting/globbing,
or split robustly with mapfile or read -a.

Change-Id: I8d971216056580921ce07baa24e6ceaceffcceae
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467679
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
2019-10-15 16:28:00 +00:00
Pawel Kaminski
f62c4d23f2 test: Shellcheck - move rule SC2207 to permanent exception list
Prefer mapfile or read -a to split
command output (or quote to avoid splitting).

We know the behaviour of commands that break the SC2207 rule.
They shouldn't invoke the shell's sloppy word splitting and glob expansion.
E.g. Code: stats=($(cat /sys/block/$dev/stat))
according to SC2207 rule could look like:
IFS=" " read -r -a stats <<< "$(cat /sys/block/$dev/stat))"
Stat file contains one simple line with entries separated by commas
so present code is enough to define statistics for dev.

Change-Id: Ia929d76461c9fcff425f69d2faf4405631e60239
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467325
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
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-15 16:28:00 +00:00
Pawel Kaminski
4d6ff5a868 test: Shellcheck - remove rule SC2231 from exception list
There was no occurrences in code that doesn't meet this rule

SC2231: Quote expansions in this for loop glob
to prevent wordsplitting, e.g. "$dir"/*.txt .

Change-Id: I9293459dd6bea401f675a7af379db25f48664f25
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469106
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-10-15 16:28:00 +00:00
Pawel Kaminski
117710eed1 test: Shellcheck - move rule SC2223 to permanent exception list.
This rule won't be used in bash scripts and will be added to exception list.
SC2223 - This default assignment may cause DoS due to globbing. Quote it.

Change-Id: I0d4b0bc697e42bb4bc1d77db5b28a469cdb887ec
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466836
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-10-15 16:28:00 +00:00
Xiaodong Liu
9c6e742679 blobfs: add blobfs_mount RPC as FUSE
This RPC method will mount blobfs on bdev to one host
path through FUSE. Then on the host path, user can
directly do some file operations which will be mapped
to blobfs.

Note:
* The FUSE mount of blobfs can be umounted directly by
SHELL umount or fusermount command.

Change-Id: I7c322d978b39bbc7255fced345a749ad5bfa7077
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468777
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-10-15 16:25:09 +00:00
Xiaodong Liu
4c10e0bbca blobfs/fuse: put FUSE code in module blobfs_bdev
FUSE operations in blobfs_fuse.c are extracted from
test/blobfs/fuse/fuse.c to blobfs_fuse.c in module blobfs_bdev.
And it is extended to create one new thread dedicatedly for one
FUSE mountpoint to handle FUSE requests by blobfs sync API.

spdk_blobfs_bdev_mount is implemented as the export API. So
related code can be utilized by other modules/apps.

Now test/blobfs/fuse/fuse.c is much simplified with function
spdk_blobfs_bdev_mount.

Change-Id: Iefa16977fabbae2008c8f65fe1b69d650b6fd18d
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469347
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-10-15 16:25:09 +00:00
Shuhei Matsumoto
108c373f7c lib/iscsi: Move checking header digests before handling payload
If PDU header digest error is detected, it indicates that the length
field of the header may have been corrupted. Hence it's may not be
possible to identify the location of the beginning of a later PDU.

So move checking header digest before handling payload and then
close the connection if header digest error is detected.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I56f6bc082dc0b244e71ad996b4da08e0203f8cdd
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471014
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>
2019-10-15 16:23:19 +00:00
Shuhei Matsumoto
52e2b86b33 lib/iscsi: Move spdk_iscsi_execute() from iscsi_conn_handle_incoming_pdus() to spdk_iscsi_read_pdu()
Move spdk_iscsi_execute() from iscsi_conn_handle_incoming_pdus()
to spdk_iscsi_read_pdu() and then strip the prefix spdk_ from
spdk_iscsi_execute() and make it private.

This is to introduce state machine into receive incoming PDU processing.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5d5b3e55ece0994532e924d3c75d898cb373875c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470287
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>
2019-10-15 16:23:19 +00:00
Shuhei Matsumoto
349b772415 lib/iscsi: Get IO trace ISCSI_TASK_EXECUTED before PDU is freed
IO trace ISCSI_TASK_EXECUTED was taken after PDU was freed.
spdk_trace_record() doesn't dereference the passed pointers and it's fine,
but get the trace before PDU is freed to make the coder clearer.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I53a19dbd85e9599c4fa9d7458b5344cff9c76ea2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471203
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-15 16:23:19 +00:00
Shuhei Matsumoto
d7c4a20f52 lib/iscsi: Save LUN ID into iSCSI task when handling Task Management Function Request
LUN ID was not saved in iSCSI task, and it didn't work when we attached
more than one LUN.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I75388ee6c1e69bb567cf7c5c691315c51cab70eb
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471202
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
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-15 16:23:19 +00:00
Shuhei Matsumoto
5f37368f19 lib/iscsi: Unify error log of spdk_iscsi_execute()
We can unify several error logs of spdk_iscsi_execute() failure
into a single error log.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1dd6a7312e5c615c478771beb89fd44fdb1710c1
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470286
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-12 01:20:09 +00:00
Shuhei Matsumoto
df46a0b893 lib/iscsi: Move Logout check from iscsi_conn_handle_incoming_pdus() to spdk_iscsi_read_pdu()
Move logout check from iscsi_conn_handle_incoming_pdus() to
spdk_iscsi_read_pdu() to introduce state machine into receive
incoming PDUs processing.

Besides, remove a debug log because similar debug log is already
collected in spdk_iscsi_conn_read_data().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I11ee800eb1fd60796669d5390bd3cd1031066ca7
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470285
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-12 01:20:09 +00:00
Shuhei Matsumoto
83a4890158 lib/iscsi: Remove iscsi_check_data_segment_length()
iscsi_check_data_segment_length() is NOP now and can be removed.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3ba473c2989d1adf7f0fcbaef026f0b60bc1beb7
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470726
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-12 01:20:09 +00:00
Shuhei Matsumoto
4427cac695 lib/iscsi: Check data segment length separately for immediate data
We can move data segment length check from iscsi_check_data_segment_length()
to iscsi_op_text() and iscsi_op_scsi().

Task Management Function request, SNACK request, and Logout request
don't have data segment, and so any related check is not added.
Of course we can add check if data segment length is zero though.

This patch also changes the return type of spdk_get_max_immediate_data_size()
and a related variable spdk_iscsi_pdu::data_segment_len to uint32_t to
remove unnecessary casts. They are little to stand as an independent
patch.

The next patch will remove iscsi_check_data_segment_length().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I736ec234d2726de0c70bbae7e748a5b1b5134a32
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470725
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>
2019-10-12 01:20:09 +00:00
Shuhei Matsumoto
dae0c67611 lib/iscsi: Check data segment length separately for SCSI Data-Out and NOP-Out
For SCSI Data-Out and NOP-Out, we can move data segment length check from
iscsi_check_data_segment_length() to iscsi_op_data() and iscsi_op_nopout(),
respectively.

In iscsi_op_nopout(), data_len had been got from reqh->data_segment_len
but reqh->data_segment_len is already copied to pdu->data_segment_len at
spdk_iscsi_read_pdu(). So add a change to use pdu->data_segment_len to
this patch. This is little change to create a single independent patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iff7d763d8ce48bdb483b809a98be82996f73f471
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470724
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-12 01:20:09 +00:00
Shuhei Matsumoto
f8f49eba51 lib/iscsi: Check data segment length separately for login request
During login processing, only login request is accepted. So we
can move data segment length check from iscsi_check_data_segment_length()
to iscsi_op_login().

A few patches from this will inline data segment length check into
each opcode handler and then remove iscsi_check_data_segment_length().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I527ab27e8e0d69a067839b47635584d5262b0e49
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470723
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-12 01:20:09 +00:00
Shuhei Matsumoto
f93770c25d lib/iscsi: Separate allocating data buffer and reading PDU payload
When we introduce state machine, allocating data buffer and reading
PDU payload will be done in the different state. Hence separate
them into the different code block.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic54a31d7da9dbc46f558ad0f0ad26bf8b99a3ea7
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470101
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-12 01:20:09 +00:00
Shuhei Matsumoto
af8f50e9d4 lib/iscsi: Move getting data length down in spdk_iscsi_read_pdu()
The subsequent patches will separate handling header and payload.
Move getting data_len down because data_len is for payload.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I654b33e9539ed1dba63f6d303de7955eee9bb200
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469964
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-12 01:20:09 +00:00
Seth Howell
4473732398 nvme: allow fabrics commands during reconnect.
When doing a reset on an NVMe-oF target with active I/O qpairs, we need
to be able to submit fabrics commands on them in order to perform a reset.
Currently, resetting a fabric controller with any I/O qpairs active will
cause the reset to hang indefinitely.

Change-Id: Ic972a301390a4dd64adabedfe01aa4e5253e40b0
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469935
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-10-11 20:13:26 +00:00
Seth Howell
797aa7d813 bdev_nvme: register a remove cb for bdev_nvme.
Change-Id: I68c7e6270e7e2d79abe288a933dd284ed1fdc045
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469906
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: JinYu <jin.yu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-10-11 20:13:26 +00:00
Seth Howell
bc4e31d6b2 nvme: call the remove_cb in nvme_ctrlr_fail.
The remove callback is a built in way of alerting the user application
that we have removed a controller. Once we fail a controller, we never
move it back out of that state so it is in essence removed.

Change-Id: Iaad6bef0994e9ddd5a424f6b83502f9191b2de49
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469637
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-10-11 20:13:26 +00:00
Anil Veerabhadrappa
128bd51ad0 nvmf/fc: Distinguish between IO and LS queue
hwqp->fgroup is valid only for IO queues and this particular function
deals with pending requests for IO queues. Check hwqp->fgroup and
bailout if called in LS queue context.

Signed-off-by: Anil Veerabhadrappa <anil.veerabhadrappa@broadcom.com>
Change-Id: I40bc9d3c576abd145bd6b296c07dbd64fd3dabd1
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470897
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-10-11 20:07:02 +00:00
yidong0635
2dab6e4ab2 test/nvme: Add test_doorbell_buffer_config for nvme_ctrlr_cmd.
Add test_doorbell_buffer_config in nvme_ctrlr_cmd_ut.c to increase
code coverage rate.

Change-Id: If79cca086800dfe18fa041de9262a2e32ff1ebc1
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470707
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-10-11 18:47:06 +00:00
Pawel Kaminski
4c13df5116 test: Shellcheck - apply rule SC2214
This case is not specified by getopts.

Change-Id: Id292af4f926856af849d2f97fd0a570e4505832b
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467288
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-10-11 18:46:21 +00:00
Maciej Wawryk
1220a78c6e test: Shellcheck - correct rule: This loop will only ever run once
Correct shellcheck rule SC2043: This loop will only ever
run once for a constant value. Did you perhaps mean to
loop over dir/*, $var or $(cmd)?"

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: If8de0a81ea889a04b8fea646fedc0a2cfe49d5f7
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470737
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@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-11 18:46:07 +00:00
Maciej Wawryk
ee8299caa0 scripts: fixed failing ceph on fedora29
There was issue with failing rbd_autotest on vm fedora29.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ic8db722903d483d288b62c8b7c54671a4142be01
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470855
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-10-11 18:45:30 +00:00
Seth Howell
2575aaec5a nvme: make sure we queue requests in order.
My recent changes that introduced batching to queued request
resubmission also introduced a regression that can lead to reordering
requests before submitting them to the drive. This change prevents that.

We wait until inside the internal _nvme_qpair_submit_request function to
check for queued entries to avoid queueing a request that has children.

If a request that has children gets queued, when we process completions
and resubmit the parent, it will result in the children being submitted.
Since we only account for the number of requests we completed in the
last iteration, some of the child requests may be requeued out of order,
or worse, none of the child requests will end up being submitted to the
transport and they will all be queued behind previously queued requests.

Change-Id: I58e1c458c25fbf3f9f75364f05b1076b166a6212
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470890
Reviewed-by: Ziye Yang <ziye.yang@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: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-11 18:45:13 +00:00
Alexey Marchuk
225c74e4e7 nvmf/ctrlr: Disable in-capsule data transfer for RDMA controllers when dif_insert_or_strip is enabled
In-capsule data transfer can only be supported by NVME drives with SGL memory layout
Add test to examine new behaviour

Change-Id: Iaef6564c8e5c96c1c5af16ab41d6e3827f6a82b6
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Evgenii Kochetov <evgeniik@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470469
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-10-11 15:36:19 +00:00
Alexey Marchuk
e1101529e5 rdma: Use nvmf_request dif structure
Change-Id: I1f8eb4300f892905f18ccb6327a5abc30dc44de3
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Evgenii Kochetov <evgeniik@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470468
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-10-11 15:36:19 +00:00
Alexey Marchuk
fcd652f5e3 tcp: Use nvmf_request dif structure
Change-Id: I215da84d9f27fbc2614ce70ae36ed024ce107a4d
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Evgenii Kochetov <evgeniik@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470467
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-10-11 15:36:19 +00:00
Alexey Marchuk
5de4274594 nvmf: Introduce common spdk_nvmf_dif_info structure per nvmf request
This structure will replace definitions in rdma and tcp request structures

Change-Id: I541ffb6bdf470a8eb9877f686fa566ad17f31749
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Evgenii Kochetov <evgeniik@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470466
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-10-11 15:36:19 +00:00
Shuhei Matsumoto
3deaf00580 bdev: Fix wrong IO split when child iovs run out
When we ran out of child_iov space, ensure the iovs to be aligned
with block size. However the calculation was wrong.

(to_next_boundary_bytes % blocklen) meant not to_last_block but to_next_block.
So calculate to_last_block_size by reducing to_last_block_size from blocklen.

The data was collected when the issue occured. So add unit test
by using the data.

    Fixes #979

Reported-by: Geoffrey McRae <geoff@hostfission.com>

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I62a50bada450288ea7c60aec0e557c2a53cd8916
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470806
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-10-11 00:35:34 +00:00
yidong0635
b0400403af vhost_rpc: Fix function typo error.
Compiling reports this issue.
Analyzer checks this with ASAN.

Change-Id: Ia01a700b6b3b77dc9e0657fc3d8b28089997a626
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470807
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-10 16:52:44 +00:00
yidong0635
729fa9743f test/nvme : Add test io_cmd_raw_no_payload_build to unittest.
This function has not been tested, add test in nvme_ctrlr_cmd_ut.c
to increase code coverage rate.

Change-Id: Ibe5c98924d9e2f3239d782e7a32b828caaddb04a
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470718
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>
2019-10-10 16:21:09 +00:00
Xiaodong Liu
7fa15e28e4 configure: add --with-fuse option
blobfs_bdev module may contain functions related to
FUSE which will utilize libfuse3.
By default, it is diabled to compile blobfs_bdev module
with FUSE related functions. Running './configure' with
option '--with-fuse' can enable it.

Change-Id: I6552a6c04cc3412c739691630a7a481e0ae6b59c
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470712
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: Changpeng Liu <changpeng.liu@intel.com>
2019-10-10 16:20:46 +00:00
Pawel Kaminski
d7c00c1725 rpc: Rename construct_vhost_blk_controller to vhost_create_blk_controller
Change-Id: I49e5a24f89566ecf95e2df15e43d589f7ef3badb
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469861
Tested-by: SPDK CI Jenkins <sys_sgci@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>
2019-10-10 16:19:56 +00:00
GangCao
8fbf2b687f bdevperf: new parameter to send I/Os to each bdevs from all cores
Add a new parameter "-C" to allow to send I/Os to all specified
bdevs from all allocated cores. This means any bdev will get I/Os
from all specified cores. This is same logic together with the "-T"
parameter to specify one bdev.

Change-Id: I1e38d49824afe8084fcad72b18649657eb5c50cd
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470805
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-10 16:19:43 +00:00