Commit Graph

3081 Commits

Author SHA1 Message Date
Shuhei Matsumoto
b2982b7d44 nvme/tcp: Add UT to nvme_tcp_build_iovs
There was no UT to process SGL for PDU, and add UT in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Icd07683ba94b584cd3c6e5a88fee78d512d5832d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458541
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-07-04 08:58:40 +00:00
Shuhei Matsumoto
16b8519660 nvmf/tcp: Add unit test to test SGL handling in C2H and H2C
This patch adds UT code to test nvmf_tcp_send_c2h_data,
nvmf_tcp_calc_c2h_data_pdu_num, and nvmf_tcp_h2c_data_hdr_handle,
and verifies if the last changes works expectedly.

Change-Id: Idba21a4739635b7828049f1d71c3bc1595deaab0
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455626
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-07-04 08:58:40 +00:00
Ziye Yang
b09bd95ad3 sock: update spdk_sock_group_add_sock
And also add spdk_sock_group_get_ctx function

Change-Id: I2a2a58b0588ff7d99d3538ea0a633a3b8c7a234b
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454538
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: Maciej Szwed <maciej.szwed@intel.com>
2019-07-04 08:21:05 +00:00
yidong0635
90513d3c5f bdev_ut.c: Fix scanbuild issue about potential memory leak.
Issue reports:
bdev_ut.c:1486:2: warning: Potential leak of memory pointed to by 'histogram'
        poll_threads();
        ^~~~~~~~~~~~~~
1 warning generated.

Add Tear down the channels like other tests in this file.

Change-Id: Iaeff93ec6f17716dfb7638cf4dd5f6cfe2c2de06
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459939
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-07-04 00:41:01 +00:00
Shuhei Matsumoto
666a0b5cb4 iscsi: Assign not pointer but instance of spdk_cpuset in struct spdk_iscsi_portal_grp
This will reduce pontential malloc failures.

Change-Id: I9b1965e0be95af4c0496dfbae80c86b25c460c94
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459718
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-07-04 00:30:22 +00:00
Tomasz Zawadzki
dae8e89253 test/ut: initialize spdk_bdev_desc to NULL
This fixes error on scan-build on Fedora 30, which assumes spdk_bdev_open()
is called from non-SPDK thread - failing before allocating spdk_bdev_desc:

bdev_ut.c:1766:17: warning: The left operand of '!=' is a garbage value
        CU_ASSERT(desc != NULL);

This is related to issue #822.

Change-Id: I8ee2112bb4d71aafc93d63bddca083c009ec11f3
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459755
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: Changpeng Liu <changpeng.liu@intel.com>
2019-07-04 00:26:17 +00:00
yidong0635
58f7449e15 rdma:Fix gcc9 compile warning on Fedora30.
Compile reports that device->map is not initialized.
In file included from rdma_ut.c:37:
/home/vagrant/spdk_repo/spdk/lib/nvmf/rdma.c:1542:44: warning: 1st function call argument is an uninitialized value
                        wr->sg_list[i].lkey = ((struct ibv_mr *)spdk_mem_map_translate(device->map,
                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/vagrant/spdk_repo/spdk/lib/nvmf/rdma.c:1545:26: warning: 1st function call argument is an uninitialized value
                        wr->sg_list[i].lkey = spdk_mem_map_translate(device->map,
                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So add this to initialize memory map.

Change-Id: Ia6f6153a1558861b4283637dac47439651b043c7
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459927
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-07-04 00:23:35 +00:00
Hailiang Wang
9c3774681b test/bdev_raid_ut: fix a warning of a null pointer dereference
Compilation Warning on fedora30.
bdev_raid_ut.c:659:13: warning: Array access
(via field 'base_channel') results in a null pointer dereference
CU_ASSERT(ch_ctx->base_channel[index] == g_io_output[index].ch);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
bdev_raid_ut.c:2181:14: warning: Array access
(via field 'base_channel') results in a null pointer dereference
CU_ASSERT(ch_ctx->base_channel[j] == (void *)0x1);
      ^~~~~~~~~~~~~~~~~~~~~~~
This is related to issue #822.

Change-Id: I9fd066b16e9f4c1fedc95403d2ac6e609f862c65
Signed-off-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460094
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-07-04 00:21:43 +00:00
Seth Howell
c3f051f832 unit/nvme_tcp: add some missing stubs.
The missing stubs were causing failures on the nightly tests.

Change-Id: Ibee8afb0edc7b77e241aa8e97ed459d45b17b1ea
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460108
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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-07-03 04:34:22 +00:00
Ziye Yang
f3d742a6fd test/nvmf: Add one NVMe-oF perf test for Big I/O
Purpose: Currently, there are many patches related with
NVMe-oF, especially related with big I/O. We need to
add a test case to guard this.

Change-Id: Iddd4070976fe6bf4926ca489d9c97f64a108a422
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460065
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-07-03 04:30:28 +00:00
Ben Walker
4a770fa9f1 test/vhost: Export default VM_IMAGE from common.sh
Also, construct this path by grabbing the home directory
of the current user.

Change-Id: Ia8d5cc2be40c0c3ac693c80a3132b970f7124183
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456704
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-03 04:15:18 +00:00
Ben Walker
97df5bcc63 test/vhost: Use sshpass instead of generating keys
This is much easier.

Change-Id: I4ae5f2f5b9393f65d07f39f03fa30628a40b01cf
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459304
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
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-07-03 04:15:18 +00:00
Ziye Yang
404d27263f sock: add get_placement_id function.
Placement_id is related with getsockopt with the optname=
SO_INCOMING_NAPI_ID. For some testing platform,  it is not
supported with this macro, so use ifdef to avoid send this
to the kernel.

Change-Id: I9e49e6e15810af0cd5085b92469c15a53ac09ada
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454468
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-02 06:47:36 +00:00
Changpeng Liu
196d4f704a nvmf: enable ptpl feature with reservation register command
Add file based reservation information definition, the data structure
can be used to store all the reservation information to a json
based configuration file, and enable this feature with REGISTER
command.

Change-Id: Ic93cfc5934a4ad96f11b96ec77bacb877edf6c10
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455909
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-07-02 00:06:59 +00:00
Tomasz Zawadzki
46f3260a69 ut/lvol: fixed scan-build error on spdk_bs_init
Scan-build didn't get that spdk_bs_init() assigns the blobstore to dev.bs
and there was no point at which it could fail (without *_FATAL) before checking it.
Additional assert added to make sure scan-build is aware.

lvol_ut.c:1105:27: warning: Access to field 'get_super_status' results in a dereference of a null pointer (loaded from field 'bs')
        dev.bs->get_super_status = -1;
            ~~                   ^

This is related to issue #822.

Change-Id: Id44d12ced4bc25490ca4e0949cbdfb89508a6e06
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459756
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-07-01 13:08:33 +00:00
Seth Howell
6e4f5e0b53 test/nvmf: don't use full disk size in host perf.
When we have a really large disk, setting up a nested lvol across the
entire drive can actually be quite time consuming. When trying to run
this test on an 800G p3700 I was actually getting timeouts on the rpcs
when creating the nested lvolstore. By only taking the first 20G of the
drive to set up the stores, we end up with a much quicker test and
conveniently get rid of the timeouts I was facing.

Change-Id: Ifd43c21c66bc77b615da9b0f421e95337b4c7019
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459849
Tested-by: SPDK CI Jenkins <sys_sgci@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-07-01 12:57:55 +00:00
Darek Stojaczyk
ccdc0b615f vhost: operate on poll groups instead of lcores
With all the pieces in place we can finally remove
the legacy cross thread messages from vhost.

We replace spdk_vhost_allocate_reactor() with
spdk_vhost_get_poll_group(). The returned poll_group
has to be passed to spdk_vhost_session_send_event(),
where it will be assigned to the session. After the
session it started, that poll group will be used for
all the internal vhost cross-thread messaging.

Change-Id: I17f13d3cc6e2b64e4b614c3ceb1eddb31056669b
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452207
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-07-01 12:50:57 +00:00
Shuhei Matsumoto
7401986896 nvme/tcp: add unit test to verify the bug in nvmf_tcp_pdu_set_data_buf
This patch adds UT code to test if the bug in nvmf_tcp_pdu_set_data_buf
is fixed by the last patch.

Change-Id: I0b504ba37652de8300c85eea2f85218c837dd503
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455624
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-07-01 08:28:20 +00:00
Shuhei Matsumoto
f341e69a50 iscsi: Use not malloc'ed but fixed size string for portal porta number
Using malloc'ed string for string in iSCSI target has caused
scan-build error.

Define maximum port number of portal to be 32 and use fixed size string
whose size is 33 for spdk_iscsi_portal_grp::port.

This change will reduce the potential malloc failure.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ie1fcdbd45ce000a9c1c53761195697555b8d030a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459709
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-07-01 05:03:07 +00:00
Shuhei Matsumoto
8f64724e86 iscsi: Use not malloc'ed but fixed size string for portal IP address
Using malloc'ed string for string in iSCSI target has caused
scan-build error.

Define maximum IP address of portal to be 256 and use fixed size string
whose size is 257 for spdk_iscsi_portal_grp::host.

This change will reduce the potential malloc failure.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iceeae94e250ea426f72ff72355a213606308da51
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459708
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-07-01 05:03:07 +00:00
Shuhei Matsumoto
d1961b5e41 iscsi: Use not malloc'ed but fixed size string for target name and alias
Using malloc'ed string for string in iSCSI target has caused
scan-build error.

Maximum size of target name is already defined to be MAX_TARGET_NAME,
and hence use fixed size string whose size is MAX_TARGET_NAME + 1 for
spdk_iscsi_tgt_node::name.

Change psdk_iscsi_tgt_node::alias together.

This change will reduce the potential malloc failure.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iac4cd6e9d60173ddeb68ca21ce712126c13bc3c4
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459707
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-07-01 05:03:07 +00:00
Shuhei Matsumoto
975e48ae8a iscsi: Use not malloc'ed but fixed size string for initiator address
Using malloc'ed string for string in iSCSI target has caused
scan-build error.

Maximum size of initiator address is already defined to be
MAX_INITIATOR_ADDR, and hence use fixed size string whose size
is MAX_INITIATOR_ADDR + 1 for spdk_iscsi_initiator_mask::mask.

This change will reduce the potential malloc failure.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic39e08986c9377800ce58a1cb5b8401c6b71cf96
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459706
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-07-01 05:03:07 +00:00
Shuhei Matsumoto
4a3ad8371c iscsi: Use not malloc'ed but fixed size for initiator name
Using malloc'ed string for string in iSCSI target has caused
scan-build error.

Maximum size of initiator name is already defined to be
MAX_INITIATOR_NAME, and hence use fixed size string whose size
is MAX_INITIATOR_NAME + 1 for spdk_iscsi_initiator_name::name.

This will also reduce the potential malloc failure.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic6bc172125fc6c9c0896499704d2a9b522106da0
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459705
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-07-01 05:03:07 +00:00
Changpeng Liu
efd7b514d4 bdev: rewind child offset to last block size aligned iov
Here is the an example to describe existing issue:

There is a Write request with 64KiB data length, and this IO is cross the IO
boundary.  We assume that the parent IO will have 2 children requests, one is
33KiB length, the other one is 31KiB.  Here is the view of parent iovs, the
first 33KiB length data has 33 iovs:

iov.[0].iov_length = 1024;
.
.
iov.[31].iov_length = 256;
iov.[32].iov_length = 768;
.
.
iov.[64].iov_length = 1024;

In function _spdk_bdev_io_split(), then you can see that for the 33KiB length
child request, exiting code will run out of child child_iov space and return
error due to last one data buffer is not block size aligned.

Here we can rewind the existing offset to last block size aligned buffer to
avoid the error case, for backend which need aligned data buffer such as
AIO backend, the request will go through spdk_bdev_io_get_buf() again to
do the data copy, otherwise for those backend devices such as NVMe with
hardware SGL support, 256 data segment is fine for them.

Change-Id: I96ebdf29829d86f9b38fab28a7406eedc9fa44ef
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453604
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-07-01 04:20:21 +00:00
Wojciech Malikowski
a3b763c5cc test/bdevio: Optional VMD enumeration
VMD section with Enable flag set to true
need to be defined in config file to
enumerate devices behind VMD.

Change-Id: I009926f41465298e3072a3cca1452e9808095c9b
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459764
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-01 03:53:06 +00:00
Wojciech Malikowski
46b04d9523 test/blobfs/mkfs: Optional VMD enumeration
VMD section with Enable flag set to true
need to be defined in config file to
enumerate devices behind VMD.

Change-Id: Ic830ec69149dcb80f9bf5ac7bd95ecc93d4b6f74
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459763
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-01 03:53:06 +00:00
Wojciech Malikowski
110906e8a8 test/blobfs/fuse: Optional VMD enumeration
VMD section with Enable flag set to true
need to be defined in config file to
enumerate devices behind VMD.

Change-Id: Ib4d6fad99979d2e8ab61e18feb04661f388eb4c1
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459762
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-01 03:53:06 +00:00
Wojciech Malikowski
f5e121fee0 app/bdev_svc: Optional VMD enumeration
VMD section with Enable flag set to true
need to be defined in config file to
enumerate devices behind VMD.

Change-Id: If0bf702dcdc19bfaec44fb8867205f29f562097e
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459640
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@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-07-01 03:53:06 +00:00
Wojciech Malikowski
a74b79dc74 lib/ftl: Drop relocation for empty bands immediately
Added check if band that is added to reloc
have any valid blocks. Return immediately
if there is no valid blocks.

Change-Id: I2bce088e0ad71479c6899fff96845397d12e2e92
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457625
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-01 03:29:00 +00:00
Wojciech Malikowski
2cc6bd2a26 lib/ftl: Skip block with ongoing write during relocation
In case ANM event occurs on open band there
can be situation that reloc will try to read
block on which there is ongoing write.
This is happening because lba valid map is
updated before write  submission to allow sent
consistent metadata to disk before all user
writes are completed.

Added write offset to the each chunk and
add check to reloc if particular ppa is written
on that chunk.

Change-Id: Ic95a06e69381d2152a86984b65a0975afaff955d
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458056
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-01 03:29:00 +00:00
Wojciech Malikowski
bf4973087f lib/ftl: Allow for relocating open band
In case ANM event occurs on open band
reloc need to be able to process such
event.

If band is not in closed sate do not
alloc lba map for it and do not set
it to free state after relocation.

Change-Id: I2f4a5770fef08271d222936ca19f3cc98e5e5be1
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457612
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: Konrad Sztyber <konrad.sztyber@intel.com>
2019-07-01 03:29:00 +00:00
Wojciech Malikowski
f8a9112292 lib/ftl: Mark all lba map segments as cached for open bands
Open bands need to have lba map segments
set to cached state to prevent read lba
map from disk during relocation events.

Change-Id: Ib4f1ed19131fad174c1d2f70e4c02e83701e2a0a
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457853
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-07-01 03:29:00 +00:00
Hailiang Wang
5b80a5505c test/iscsi_ut: fix a warning of rsp_pdu garbage value
Compilation Warning on fedora30.
iscsi_ut.c:184:31: warning: The left operand of '==' is a garbage value
        CU_ASSERT(rsph->status_class == ISCSI_CLASS_INITIATOR_ERROR);
                  ~~~~~~~~~~~~~~~~~~ ^
This is related to issue #822.

Change-Id: I221aa6601bae4a2d55bd557fcd1d001fbc616149
Signed-off-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459723
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-28 12:26:51 +00:00
Hailiang Wang
94c06a68de test/dif_ut: fix a warning of iov_base garbage value
Compilation Warning on fedora30.
dif_ut.c:151:24: warning: The left operand of '==' is a garbage value
        return (iov->iov_base == iov_base && iov->iov_len == iov_len);
                ~~~~~~~~~~~~~ ^
This is related to issue #822.

Change-Id: Ie050c65d3747c551e2c26e84d3879742eaf86fd8
Signed-off-by: Hailiang Wang <hailiangx.e.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459712
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-28 12:26:51 +00:00
Tomasz Zawadzki
bef870c6d0 test/fio: fail the tests when fio is not available
When possible we should make sure that no silent failures or
skipped tests.
Since some of the tests use fio, autotest should fail
in those places when it is missing.

Change-Id: I97581e2df30a02445b560e3b88d03ce92986d0fd
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456316
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.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-06-28 12:26:12 +00:00
Changpeng Liu
485a2dcfa9 UT/blobfs: add asynchronous Writev/Readv unit tests
Change-Id: I8c0961e78afff367f6fc8b1a97d5ec5c635e3224
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457455
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-06-28 09:50:50 +00:00
Ziye Yang
fd22bfcc2b iscsi/test: destruct all malloc devices by one time
Just use a for loop, then we can delete all malloc
devices.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I34fb06c0d49333ab1b5bce0ea2e2b7ced7c50eb2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458045
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-28 05:28:09 +00:00
Shuhei Matsumoto
1d1c60e53d dif: Add helper function to convert buffer range to extended LBA based
This will be used to get extended LBA based range or length in NVMe/TCP
target later.

Change-Id: Id0f08bdaeea634dbc05b34a0f7914be21aef9aae
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458706
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-28 04:13:02 +00:00
Shuhei Matsumoto
767c046e77 dif: Add spdk_dif_update_crc32c_stream to update CRC32C by stream fashion
Add spdk_dif_update_crc32c_stream to update CRC32C by stream fashion.
spdk_dif_update_crc32c_stream utilizes the updated _dif_update_crc32c_split.

A minor bug was found in UT for spdk_dif_update_crc32c and is fixed
together in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I92358e845e8e2e17c6f288aa718b947e71e6e1fb
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458919
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-28 04:13:02 +00:00
Shuhei Matsumoto
4c2e52b935 dif: Process partial data block properly in _dif_update_crc32c_split
For NVMe/TCP target, data segments which correspond to H2C or C2H PDU
will have any alignment, and _dif_update_crc32c_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

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

This patch exposes offset_in_block, data_len, and guard as parameters
of _dif_update_crc32c_split() and make _dif_verify_split() process
the above two types of data block properly.

The next patch will utilize the updated _dif_update_crc32c_split to
add spdk_dif_update_crc32c_stream().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iee29377ad49d4f209673fffb4de4a23a54f31766
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458918
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-28 04:13:02 +00:00
yidong0635
310fc0b5d5 scsi_bdev_ut: add SPDK_CU_ASSERT_FATAL before put task.
Like other test, need to add SPDK_CU_ASSERT_FATAL(TAILQ_EMPTY(&g_bdev_io_queue)).
To avoid issue:
scsi_bdev_ut.c:956:2: warning: Address of stack memory associated with local
variable 'task' is still referred to by the global variable 'g_io_wait_queue'
 upon returning to the caller.  This will be a dangling reference
        ut_put_task(&task);
        ^~~~~~~~~~~~~~~~~~
waiting exit from while loop in ut_bdev_io_flush.

This is related to issue #822.

Change-Id: If390f5076582a0149646f0c2a408c3bcd3b4fab6
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/459534
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-27 12:09:56 +00:00
Tomasz Kulasek
9c9709b9b1 test/iscsi_tgt: run vpp with gdb
Change-Id: Ibffdc0d198451d7ef891b4062205c5e0eaf79bee
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457471
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-27 08:23:08 +00:00
Tomasz Zawadzki
ef489303b4 net/vpp: include VPP into iSCSI test scripts
Tests that were thus far performed using posix net framework
can now be run with VPP. This patch adds network interface
configuration for VPP to work in iSCSI tests.

Some tests are disabled on purpose:
- IP Migration, RBD and NVMe-oF due to their tests lacking network
  namespace support
- rpc_config adding/deleting IP, as VPP has separate utility for that

calsoft.sh doesn't handle TCP stream properly and fails decoding iSCSI
requests when are divided by TCP segmentation. This is very common
situation for VPP and causes that calsoft.sh never PASS.

Change-Id: I7c80427ca1675a1789ce7440796cc8d9956f1c9e
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
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/+/394174
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-27 08:23:08 +00:00
Tomasz Kulasek
29408ebaa9 test/vm_setup: install VPP 19.01.1
NOTE:

Due to some changes in VPP two cherry-picks from newer version of VPP
(at least 19.04):

	"sock api: allow to start client with no rx_thread"
		commit: 97dcf5bd26ca6de580943f5d39681f0144782c3d

	"dlmalloc: honor 8 byte alignment requests"
		commit: f5dc9fbf814865b31b52b20f5bf959e9ff818b25

These commits are already merged in VPP 19.04.

This patch includes also workaround for VPP 19.01.1 to prevent closing
sessions to already closed applications after timeout. It causes
intermittent segfaults.
This is temporal solution and should be solved with next releases of
VPP, but is required now to create more stable VPP environment.

Change-Id: If4b45b7159819cfd836dd7d50f333dbab2b38eab
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456462
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-06-27 08:23:08 +00:00
Tomasz Kulasek
14a62d67ac net/vpp: allow to compile with vpp
This patch prepares environment to allow compile applications and
libraries with VPP.

Change-Id: Icc067c17b57932062afa5e6a67791bd58de3a2cc
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456461
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2019-06-27 08:23:08 +00:00
Tomasz Kulasek
a44c743417 test/iscsi_tgt: make sure iscsi devices are ready
We have no guaranty that iscsiadm -m session shows all required iscsi
devices at some point of time after login. It may cause that not all
devices are used in further tests (e.g. in fio).

This patch allows to wait for a certain number of sessions after login.

Change-Id: I868cb8f1235dd04d88572bc8518e97de99a2c5e6
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458236
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-27 08:23:08 +00:00
Andrey Kuzmin
0972838f83 bdevperf: provide unregister callback when opening target bdev.
Bdevperf up to now didn't use unregister callback when opening target
block deice. This is unsafe if test scenario involves target bdev
unregistering voluntarily, although with recent bdev layer update
not registering hotremove callback has become safer.

To be on the safe side, this patch registers a callback to transit
gone target into the I/O drain mode in case the target unregisters
during runtime.

Changes wrt previous versions of the patch:

	- incorporated review comments
	- updated callback functionality
	- updated patch description.

Change-Id: I0dad2f4a7cf4acb22b363e23e4b670ca73d8c6f2
Signed-off-by: Andrey Kuzmin <akuzmin@jetstreamsoft.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447956
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-27 06:16:11 +00:00
Shuhei Matsumoto
6db126c24c dif: Add spdk_dif_verify_stream to verify DIF by stream fashion
Add spdk_dif_verify_stream to verify DIF by stream fashion.
spdk_dif_verify_stream utilizes the updated _dif_verify_split.
spdk_dif_verify_stream is very similar with spdk_dif_generate_stream().

UT code demonstrates how it is realized.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1c5d197cf4c0bbc82c8e7f4fa45ddc0b94051058
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458330
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-27 00:36:25 +00:00
Shuhei Matsumoto
80f2ca0d90 dif: Process partial data block properly in _dif_verify_split
For NVMe/TCP target, data segments which correspond to H2C or C2H PDU
will have any alignment, and _dif_verify_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

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

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

The next patch will utilize the updated _dif_verify_split to
add spdk_dif_verify_stream().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ic371d3ccefbd5fe8147a948a624013be2702128e
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458329
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-06-27 00:36:25 +00:00
JinYu
83f3785bc4 test: fix the nvme reset test time
As have updated the NVMe reset case, the check_io() must be executed
after ctrlr reset. It's easier to reproduce #819, so we can set a
short time.

Change-Id: I9ba867a6c2aa1a3921bace2e77acd28a069d9016
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457761
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>
2019-06-26 08:39:14 +00:00