Commit Graph

8830 Commits

Author SHA1 Message Date
yidong0635
17c006a7c3 lib/jsonrpc: Fix memory leaks about connection request.
There're outstanding requests in spdk_jsonrpc_parse_request which caused by
	connection close.
There are methods to call spdk_jsonrpc_server_conn_close, including
	spdk_jsonrpc_server_conn_remove and spdk_jsonrpc_server_shutdown,
Some rpc methods call these functions to terminate connections ,that leads to
	memory leaks.
Try to free outstanding requests after deciding to terminate a connection.
And do this follwing with close(conn->sockfd).

Fix issue #784, and can resolve other similar memory leaks about this.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: Icd287bd0c5670ee8ec32750b999f82b0fa89cf84
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458438
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-26 06:26:50 +00:00
Or Gerlitz
6629202cbd nvmf/tcp: Use the success optimization by default
By now (5.1 is released), the Linux kernel initiator supports the
success optimization and further, the version that doesn't support
it (5.0) was EOL-ed. As such, lets open it up @ spdk by default.

Doing so provides a notable performance improvement: running perf with
iodepth of 64, randread, two threads and block size of 512 bytes for 60s
("-q 64 -w randread -o 512 -c 0x5000 -t 60") over the VMA socket acceleration
library and null backing store, we got 730K IOPS with the success
optimization vs 550K without it.

IOPS           MiB/s    Average       min      max
549274.10     268.20     232.99      93.23 3256354.96
728117.57     355.53     175.76      85.93   14632.16

To allow for interop with older kernel initiators, we added
a config knob under which the success optimization can be
enabled or disabled.

Change-Id: Ia4c79f607f82c3563523ae3e07a67eac95b56dbb
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457644
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-26 06:24:03 +00:00
JinYu
2224554eec test/nvme: check_io after reset without setting long time
Make it easier to reproduce issue #819 without setting long time.
To decrease the UT time.

Change-Id: I3dd0268a894113e1a12395618721afee6137588d
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457914
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>
2019-06-26 04:18:50 +00:00
Changpeng Liu
cf5c4a8a2e nvmf: add ptpl activated flag to Namespace
If users set the persist through power loss configuation file,
that means the Namespace has the capability to support ptpl
feature, here we added a ptpl_activated flag to indicate that
the users enable the feature or not.  Users can use Set features
or Reservation Register commands to change the value.

Change-Id: Iae3fd44085c5be5bf9574e49efa567e8212dee20
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455906
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-06-26 01:54:10 +00:00
yidong0635
d2c169d51c vm_setup: change spdk source from gerrithub to github.
Our test destination code of spdk is rsynced from host.
former link address of spdk "https://review.gerrithub.io/spdk/spdk"
is not very fast and always failed .
So changed to "https://github.com/spdk/spdk.git" ,this spdk just for
excuting start testing command.

Change-Id: I26b5c1556d8068becd5c5a94067cc64d9d32b5e6
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459223
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@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-06-25 14:05:08 +00:00
Chunyang Hui
863f17d609 reduce: check pmem buf before unmap
Fixed issue #831

Change-Id: Id589290f3aa729572fa81daf735cecdc8e2adb84
Signed-off-by: Chunyang Hui <chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458563
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-25 13:39:09 +00:00
Hailiang Wang
73a171a07c rdma: assert ibv_send_wr is not NULL
Vhost testing crashed from Nightly testing, because a member
access within null pointer of type 'struct ibv_send_wr'.

Change-Id: If8f34f23864883ea73516d2d1fe3b30137c04316
Signed-off-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458913
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-06-25 13:37:15 +00:00
Karol Latecki
0c939301cb scripts/Vagrant: update vagrant boxes
Removing Fedora 26 and 27 which are long past their EOL date.
Adding Fedora 29 and 30.

Change-Id: I35bc8b7a5ac693b7a5af0e6abb35869b18ed5777
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457924
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-06-25 08:27:53 +00:00
Darek Stojaczyk
29093c7f01 event/app: don't call start_fn twice when json config is used
When JSON config was used, app layer was calling the
app start callback twice - once from internally-sent
"start_subsystem_init" RPC, and once from the app layer
itself.

In case of JSON configs, the callback from within the
RPC was actually called prematurely, as the real RPC
server was still starting in the background at that
point. We still need to start the app from that RPC in
case of `--wait-for-listen` option, but for JSON configs
it doesn't make sense. Just ignore it now and rely on
json config load completion callback to start the app.

Fixes #816

Change-Id: Ib54d624f3167137216c910b2d947bbd1dc5023b1
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458351
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-06-24 15:54:49 +00:00
Darek Stojaczyk
a7d9fc4a4d event: fix segv on json config read failure
If reading the JSON config file has failed, we entered
spdk_app_json_config_load_done(-ERRNO) and tried to
close a client connection that was never initiated,
which resulted in NULL dereference.

To fix it, just check if client_conn != NULL before
attempting to close it.

Change-Id: I7340567c45e795f77110c2914e94ba83fa8d1bff
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458350
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-06-24 15:54:49 +00:00
Chunyang Hui
7bf3ac17f7 Opal: close dev in nvme_manage
free resources when error was triggered in nvme_manage

Change-Id: Ibdc020ffb5abd3d614fe85e54788b1818ef5af1e
Signed-off-by: Chunyang Hui <chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458342
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>
2019-06-24 13:13:30 +00:00
Wojciech Malikowski
8233a5a8e1 event/subsystems/vmd: Added VMD subsystem
Added new VMD subsystem to enumerate
devices behind VMD when event framewrok
is used.

To enable VMD, user need to provide Enable
flag via config file.

Change-Id: I89bfe22b127c00d358dac7336ffb44b0c0f426ea
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458443
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-06-24 09:59:00 +00:00
yidong0635
98cc02fd05 identify: Fix gcc9 unaligned warning.
Warning: taking address of packed member of 'struct spdk_nvme_health_information_page'
and 'spdk_nvme_ctrlr_data' may result in an unaligned pointer value [-Waddress-of-packed-member]

So add __attribute__((aligned)) following with  __attribute__((packed)) to avoid this kind of
GCC9 warning.

This related to issue #822.

Change-Id: I6117c1e50a137d29cd60ebbad5c15d9093d21670
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458535
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-06-24 09:45:08 +00:00
Shuhei Matsumoto
1750a0859b dif: Process unaligned end of data buffer in spdk_dif_generate_stream()
NVMe/TCP target may split a whole data payload into multiple H2C
or C2H PDUs with any alignment. Hence to insert or strip DIF correctly
to the split H2C or C2H PDUs, we have to bring the interim guard
value of the last partial data block of the current H2C or C2H
PDU to the first partial data block of the next H2C or C2H PDU.

So we add last_guard to struct spdk_dif_ctx and use it in
spdk_dif_generate_stream().

API spdk_dif_generate_stream() is not changed and UT code should
pass without any change.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I12636c5ac7f619483402538faff4339a16c0e6b0
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457545
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-06-24 07:02:07 +00:00
Shuhei Matsumoto
f6a91b3b40 dif: Process partial data block properly in _dif_generate_split()
For NVMe/TCP target, data segments which correspond to H2C or C2H PDU
will have any alignment, and _dif_generate_split will have to process
partial data block, particularly the following types:
- start and end are both within a data block.
- start is within a data block, and end is at the end of a block

According to the refactoring done in the last patch, this patch
exposes offset_in_block, data_len, and guard as parameters of
_dif_generate_split() and make _dif_generate_split() process
the above two types of data block properly.

The next patch will utilize the updated _dif_generate_split in
spdk_dif_generate_stream().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4211e65ead7fc256a40748412c670e46f83b1731
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457544
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-06-24 07:02:07 +00:00
Shuhei Matsumoto
27707953ec dif: Separate _dif_generate_split into three parts
For NVMe/TCP target, data segments which correspond to H2C or C2H PDU
will have any alignment, and _dif_generate_split will have to process
partial data data block, particularly the following types:
- start and end are both within a data block.
- start is within a data block, and end is at the end of a block

On the other hand, _dif_generate_split had assumed that passed
block is always a complete block.

To process the above types, separating guard computation, DIF generation,
and DIF copy into three parts will be helpful and is done in this
patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0171d9021837b9a4b425370293cef45dbe7500e8
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458225
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-06-24 07:02:07 +00:00
Shuhei Matsumoto
f1344911ea dif: Minor cleanup of spdk_dif_set_md_interleave_iovs
Four variables head_unalign, tail_unalign, num_blocks, and offset_blocks
became unuseful by the last patch. Hence reduce them to buf_len and
buf_offset in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I04fc1e442be6569a96533cdfe36b27fcc78e98d4
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457876
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-24 07:02:07 +00:00
Shuhei Matsumoto
8b24fc4a31 dif: Process unaligned end of data segment in spdk_dif_set_md_interleave_iovs()
For NVMe/TCP target, data segments which correspond to H2C or C2H PDU
will have any alignment. spdk_dif_set_md_interleave_iovs() have allowed
reading data to have any alignment but had required data segment to
be a multiple of block size.

In other words, spdk_dif_set_md_interleave_iovs() had required that both
ctx->data_offset and (data_offset + data_len) must be a multiple of the
data block size.

This patch refines the algorithm to remove the latter requirement.

The update implies that spdk_dif_set_md_interleave_iovs support any
data buffer whose size is less than a single data block.

The update doesn't change parameters of spdk_dif_set_md_interleave_iovs
and existing UT should be passed.

This patch adds additional UT code to test these updates.

Change-Id: I88c7d2a80a8d92b54863b6ad1c3a9d2761a6195d
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457542
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-24 07:02:07 +00:00
Shuhei Matsumoto
2bb4fb4c8c dif: Factor out SGL append opeartion when splitting data buffer
The subsequent patches will refine spdk_dif_set_md_interleave_iovs
to change the data_len parameter to be the remaining length, and
to remove alignment constraint completely. This patch is a
preparation to subsequent patches.

This patch doesn't change any behavior.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0e9be7e66d313f3ec2bd8c55cce8bb18e4fff892
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457721
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-24 07:02:07 +00:00
Changpeng Liu
45f480535b UT/bdev: add IO boundary splitting unit test
Change-Id: If7c74dec31468b2fcd5fb761e5bc4f35a8d52f3a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453195
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-24 04:51:46 +00:00
Changpeng Liu
5d718951a6 bdev: split requests first if the request has data buffer
There is one existing example usage case to describe the issue:
Users(e.g. Vhost-blk target with Windows Guest) call spdk_bdev_readv_blocks()
to submit a 128KiB length data READ request, and the data buffer
provides by vhost isn't aligned, but the backend block device
requires aligned data buffer, so existing function call trace:
spdk_bdev_readv_blocks()-->
    spdk_bdev_io_submit()-->
    spdk_bdev_io_get_buf()
spdk_bdev_io_get_buf() will allocate buffer from large data
buffer pool for 128KiB length, of course, it will return error
with existing logic.

So here, no matter what the data length is, we can go through
the split process first for both READ and WRITE.

However, there is one scenario that for iSCSI READ request,
the iSCSI layer will not allocate data buffer for the request,
so for this case if the IO boundary is required we should keep
the logic as before.

Change-Id: I67661f5fa4c3c7c561b45c86146759aa3477adbf
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453133
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-24 04:51:46 +00:00
JinYu
77290bfe6b nvme: fix the endless loop of aborting trackers
The completion cb of outstanding_tr may submit new requeset to
the outstanding_tr list of the qpair, it's an endless loop.
We only abort the remaining outstanding trackers.

Fix #819

Change-Id: I342f52f4d1836f8ef620ef9e3add0b1986727282
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457755
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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-21 08:34:41 +00:00
paul luse
68fbb33b81 bdev/compress: add 2 recommended flags to the comp operation
Per docs.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I2b520ba9cce2e8914e5003095cdb0be61b417cb2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458836
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-21 08:20:01 +00:00
paul luse
8d2455caa3 bdev/compress: always use QAT if available
The next patch in this series introduces and RPC that makes the
selection more flexible.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I55617d3c37b51cf9474c358cb92f5218397c0c58
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457157
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-21 07:53:39 +00:00
paul luse
5d55704d66 bdev/compress: adjust vol parms
There were some TODO items in here that were incorrect if using
an underlying block device that had a 4K block size. The values
here will set the compress vol LBA size to match that of the
underlying lvol but the backing IO unit size, the min size that
reduce will use to perform backing device IO is set to 4K as
smaller than this makes little sense given chunk size is currently
at 16K.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ic6a9421a25d947ae7d4dce190d6599eec1d4a05a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458703
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-21 07:53:39 +00:00
paul luse
5cffa4a988 bdev/compress: check PMD shareable flag for transforms
Module only supports shareable transforms, also adjusted the number
to what we need, just 2.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ieb77b5f1221878ac7a4be5176ed459d5165f8430
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458698
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-21 07:53:39 +00:00
Maciej Szwed
38c2a6f8fd blobstore/ut: Add mechanism for power failure simulation in ut
This patch adds mechanism to simulate power failure in
blobstore unit tests at any given moment in time.
This point in time is measured by number of IO operations
occured after triggering power failure with the number
of IO operations given as a parameter. Number of IO
operations parameter can be defined as any type IOs,
writes, reads, unmaps, writes zero or flushes.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I7be45331bb5110f6c16f01fd7c4e7984b2d1977d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454451
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-06-19 08:39:00 +00:00
Maciej Szwed
f27cbce428 blobstore: Fix error path for snapshot creation
In _spdk_bs_snapshot_origblob_sync_cpl function on error
path we should not close snapshot as it will be closed during
volume closing when bs_dev is being destroyed.
This issue was found in unit test (see next patch in series).

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I51c38d1f1f97b134679251b43109b1265e565a17
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455215
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-06-19 08:39:00 +00:00
Shuhei Matsumoto
beefcd1ae5 iscsi: Fix the bug to add wrong size in _iscsi_sgl_append_with_md
This bug was found by code inspection. When PDU read restarts
after data segment, iov_offset must be reduced by data length.
However iov_offset had been reduced by buffer length by mistake.

Lack of UT code was the main reason of this bug. Hence add UT
code to test the fix of the bug together in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I74f2f6ae8dca2e78a64bfdef8080c8031dfabb87
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458530
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-06-19 07:38:46 +00:00
Liang Yan
f240e2bf48 perf/nvmf: add config file path handling codes
Change-Id: I27c8c4a03237c75761c75cce824a65fe3e4776db
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454760
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-19 07:14:06 +00:00
Darek Stojaczyk
8258313465 test/common: refactor waitforlisten to try sending RPC commands
Instead of doing some OS-specific magic to detect if the
spdk app has already initialized, just try to send it an
RPC. This serves mostly as cleanup, but also simplifies
test output in cases where the spdk app could not be fully
initialized. Previous waitforlisten implementation would
return as soon as the rpc subsystem was initialized, but
the app could have still failed on e.g. bdev initialization
later on. Since waitforlisten() returned success, the
script could continue its execution and try to execute
some RPCs. The logs from the SPDK app and the bash script
could easily mix, rendering the entire output not so clear
to the user.

To fix it, just try to send some RPC commands inside
waitforlisten().

Change-Id: I33eaf362e3cc645f8ea3ee22fd48db1643442129
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457562
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-06-19 03:54:58 +00:00
Darek Stojaczyk
fe2d4b0274 test/iscsi/sock: add separate waitfortcp() function
The test used waitforlisten() from autotest_common.sh to
wait for a socat instance and happened to work only by
a coincidence. As we can see in all the messages that
waitforlisten prints, that function is meant for SPDK
applications running an RPC server.

We're about to simplify waitforlisten a lot, so for now
just copy its current version to sock.sh and name it
waitfortcp(). Note that it already had to be stripped of
some rpc references.

Change-Id: Ibbe7cf67d20fbc277d407b20073154a96ddaaade
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458221
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-06-19 03:54:58 +00:00
Darek Stojaczyk
b5bdc850cc test/spdkcli: cleanup common.sh
Functions in this file already expect some variables
to be set by the calling script, so do the same with
$testdir and functions from autotest_common. We'll start
using `set -u` soon, so that variable expansion failure
will produce a clear error message (and will trigger ERR).

Change-Id: I3795af498639ad73a99cd03c6b5e72717fe5fd75
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458177
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-06-19 03:54:58 +00:00
Darek Stojaczyk
d77b0a6720 test/spdkcli: cleanup includes
autotest_common.sh used to be sourced from
test/spdkcli/common.sh (and it still is - we'll clean
it up in a separate patch). Let's source that file in
each spdkcli test script, just like we do in every
other test script.

Change-Id: I2e021bcda7402ee0c5a4a5f45f921bb0142b6783
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458176
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-06-19 03:54:58 +00:00
Darek Stojaczyk
012804ebcf test/pmem: cleanup common.sh
This file is meant to be just sourced somewhere, so
don't include autotest_common.sh inside. Also, don't
hardcode the default pool file path. Expect
$default_pool_file to be defined already. We'll define
`set -u` soon, so that we'll get a clear error if it's
not defined.

Change-Id: Ie9bb86f8a65d05c9fb2d3e56b8682cab8dd569d6
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458175
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-06-19 03:54:58 +00:00
Darek Stojaczyk
ae884c7c41 test/pmem: remove hardcoded paths
This test defines a variable for "default_pool_file" path,
but keeps using the hardcoded path anyway. Fix that.

Change-Id: I767fdff1eb6a4638a0e028ca8f04bd94582664e7
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458174
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-06-19 03:54:58 +00:00
Darek Stojaczyk
9844c43ec0 test/pmem: remove legacy BASE_DIR globals
Replace them with `testdir` and `rootdir` that we use
in every other test. What was a BASE_DIR before is now
a testdir and what was a TEST_DIR is now a rootdir.

While here, also replace all "$rootdir/test/pmem"
occurences with "$testdir".

Change-Id: I9e5b867bbc481c9c9d6ff25378b6eda60690dd08
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458173
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-06-19 03:54:58 +00:00
Darek Stojaczyk
887aff4d09 test: remove duplicated set -ex from tests
It's always set in autotest_common.sh, there's no need
to set it again in each test script.

Change-Id: Ib14c4189c553dad54a3065c1a1d413a5fc5a5347
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457466
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-06-19 03:54:58 +00:00
Darek Stojaczyk
ef33878dd5 test/iscsi_target.sh: cleanup includes
Change-Id: I64f91706ec91c49ef26b670764296ce64101225a
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457465
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
2019-06-19 03:54:58 +00:00
Darek Stojaczyk
fb4ed96728 test/lvol: remove legacy BASE_DIR globals
Replace them with `testdir` and `rootdir` that we use
in every other test. What was a BASE_DIR before is now
a testdir and what was a TEST_DIR is now a rootdir.

While here, also move autotest_common.sh include to the
top of the file.

Change-Id: Ie15b7ec14bfb7536bcc7b3787eed930798d24c78
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457464
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
2019-06-19 03:54:58 +00:00
Darek Stojaczyk
fafd4ec9fe test/nvmf: don't use set +e
In fio.sh we used `set +e` for bdev deletion RPCs
and for `wait $fio_pid`. Disabling errors from those
RPCs doesn't make sense. We expect FIO to fail due
to bdev hotremoval, but the bdev hotremoval itself
must succeed.

Besides, it's easy to forget to undo `set +e` so
don't use it. For `wait` we can use the following
paradigm instead:

```
rc=0
wait $pid || rc=$?
```

The same applies to nmic.sh, where we expect some
RPC to fail.

Change-Id: I66ce3504a0c6b5da497759f0688b6c0ea6480b61
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457463
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2019-06-19 03:54:58 +00:00
Konrad Sztyber
e2918289a1 lib/bdev: clear metadata when emulating write_zeroes
If bdev is configured to use separate buffers for metadata transfer,
but it doesn't support the write zeroes command, pass empty zeroed
buffer to make sure the metadata is cleared out as well.

Change-Id: If6f024266067e5764a28a276296f651d31da4792
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457628
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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-19 03:53:02 +00:00
Pawel Kaminski
6e4ea8fdb4 rpc.py: add --dry-run option to print the json request and exit
Change-Id: If20c10cb74e3825fc29b9d45524353f77b832e4f
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457145
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-19 03:50:30 +00:00
Tomasz Zawadzki
5468acd898 bdev: directly use spdk_bdev_desc_get_bdev() where needed
The function spdk_bdev_desc_get_bdev() was added,
but remained unused. Couple places done the exact same thing,
so now they just use it directly.

Change-Id: I018f57b7b4bcfe22ec6a97cf5261b9a257ba93de
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456957
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-19 03:49:53 +00:00
JinYu
5446c541d3 examples/nvme: fix memory leaks of arbitration case
The ns_ctxs of worker_thread are organised as a list, so they
should be freed totally.

Change-Id: I348cacb12c338dfe0df100e1dc3de7b9f95bfda1
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458036
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-19 03:48:16 +00:00
GangCao
c3d1e498d5 iscsi: update the error message for the login init
Change-Id: Ic6baf284753c625d9f1d3110149f67ce4b48c0e7
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458406
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-19 03:43:45 +00:00
Konrad Sztyber
6a75bb948e bdev/part: separate buffer metadata support
Allow requests using separate buffer for metadata IO if base bdev
supports it. Copy base bdev's metadata configuration (separate /
interleaved, size, DIF type and location).

Change-Id: I89996f89cad805e696cacf0bba486b4cc1f617e6
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458407
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-19 03:43:11 +00:00
Tomasz Zawadzki
9b96749f66 fio_plugin: Use CLOCK_MONOTONIC for FreeBSD
In order for fio_plugin to compile a replacement is needed
for CLOCK_MONOTONIC_RAW, since FreeBSD does not support it.
In that case CLOCK_MONOTONIC is used.

Change-Id: I234ce4d932baf9c5399a46f9f4676315351e720c
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458072
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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-19 03:39:04 +00:00
Tomasz Zawadzki
7d6705f833 test/blockdev: run bdevio tests via RPC
With this change, bdevio tests are not ran immediately
after starting the application.
This will allow to configure new bdevs via RPC and
run tests on demand during script's execution.

Change-Id: I9740fca92c26cb2a39fbdc7cfb132ad53cec3787
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455235
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-19 03:39:04 +00:00
Tomasz Zawadzki
1599301b7b test/blockdev: add trap for bdev_svc process
There was a gap where nbd tests could fail, but without
trap set the app would still be present.

When here removed trap from end of the script since,
no part of the script set it up.

Change-Id: I0c435c7cd603410c2cd7a034bf955ab424e413f0
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457615
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-06-19 03:39:04 +00:00