Commit Graph

7941 Commits

Author SHA1 Message Date
Xiaodong Liu
efdd6edba2 nbd: optional nbd_device in start_nbd_disk
Enhance RPC method start_nbd_disk to take nbd_device as
one optional parameter. If it is not assigned, automaticly
choose an available nbd device path from /dev/nbd0 to
/dev/nbdN.
For github issue #324:
https://github.com/spdk/spdk/issues/324

Change-Id: I72c064d8bd476df342f5aa0af4d6120eb021c7ed
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/440453
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-04-04 08:35:50 +00:00
Jim Harris
bfd1e46e6e bdev: deprecate spdk_vbdev_register
This API had good intentions, but as more complicated
use cases came up where base bdevs could come and go,
we've realized that the bdev layer will need another
mechanism to query bdev modules on these types of
relationships between a virtual bdev and its base
bdevs.  We removed all code related to tracking
the array of base bdevs a long time ago.

Change all existing callers to use spdk_bdev_register.
Document spdk_vbdev_register as deprecated for now,
and change its implementation to just call
spdk_bdev_register for simplicity sake.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450076
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-04 08:28:31 +00:00
Ben Walker
a0760b9554 nvmf: Use threads instead of events for shutdown handling
Change-Id: Ib22dcb95810f4ed16beb76769e407d48713d85ad
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447117
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.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-04-04 05:54:42 +00:00
Ben Walker
9603e344ae event: Use threads for shutdown handling instead of events
Change-Id: I841ebf29ddcb46038a07d5b0b7781aac938c5869
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447116
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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-04 05:54:42 +00:00
Ziye Yang
8f3b4a3a6d nvme/tcp: Add a helper function nvme_tcp_pdu_set_data
This function will be exteneded later for multiple SGL
support.

Change-Id: I1f6962ec03c72e335efaa311a12d3891312fcc53
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449968
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-04 04:50:04 +00:00
Shuhei Matsumoto
5a1dc44423 iscsi: Fix LUN ID in Ready to Transfer PDUs
LUN ID is not converted from integer to structure and integer is
set to R2T PDUs.

Popular iSCSI initiators don't check this value and work correctly.

This patch uses the public helper function of the SCSI library
to fix the issue.

Additionally, private helper function to convert structure to
integer for LUN ID is replaced to the public helper function
of the SCSI library.

Change-Id: I9218c5ef7a8bfec43326c6584db7c6929fdd11a8
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449963
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-04-04 04:40:28 +00:00
Shuhei Matsumoto
12ab86e24d scsi: Add helper functions to convert LUN ID between structure and integer
SPDK iSCSI target didn't convert LUN ID from integer to structure
when it sends R2T PDUs. The next patch will fix the issue. Introducing
helper functions into SCSI library and using them will be clean. Hence
this patch adds two helper functions to convert LUN ID between structure
and integer.

The logic of helper functions is derived simply from the current
implementation in SPDK.

Change-Id: I114b546cfcb44109d6cd131a1fa972f4d6bfea38
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449962
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-04-04 04:40:28 +00:00
Seth Howell
9f7582c3a5 rdma: reorder qpair elements to plug hole
Saves 8 bytes

Change-Id: Icb429ba79d7a085978950dd3045aa9ef28351101
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448073
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-04-04 04:34:59 +00:00
Seth Howell
91105e2031 rdma: Don't store ibv_qp_attr in the qpair.
We were only using one enum from this whole struct, so there is no need
to store it. Plus the queries we use to update it are so infrequent and
only occur during connect and disconnect so I think we can save quite a
bit of space by removing this without compromising performance.

Change-Id: Icf29977a3c10cb289564fa2760a0059f07a0f8cb
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448072
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-04-04 04:34:59 +00:00
Seth Howell
ab79560e65 rdma: simplify spdk_nvmf_rdma_poller_poll.
There was a lot of duplicated code here between states. I'm trying to
minimize the duplicated code without making it confusing.

Change-Id: I13183431e554c8a9f501b3385bbd7b59e2c83161
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448066
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-04-04 04:34:59 +00:00
Seth Howell
a8169c37e0 rdma: add error path for fill_iovs_multi_sgl
Catch an edge case where a multi sgl request is longer than the allowed
transfer size.

Change-Id: I79779050fe951d16f1240e2c3d8cf5037e576ea2
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/440766
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-04-04 04:34:59 +00:00
Seth Howell
6812b63c5f rdma: always allocate buffers for requests upfront
This is important to avoid thrash when we don't have enough buffers to
satisfy a request.

Change-Id: Id35fd492078b8e628c2118317f674f07e95d4dba
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449109
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-04-04 04:34:59 +00:00
shahar salzman
21cfc857ff scripts, test: fix python overindent issues
Signed-off-by: shahar salzman <shahar.salzman@kaminario.com>
Change-Id: I52f3b39d1ae7d0454a2a3d5f2564aae2c758cab7
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449992
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-04 03:59:12 +00:00
Karol Latecki
c1dd96ae63 test/iscsi: remove leftover code from fio.sh
Looks like a leftover from hotplug test when it was
done using a NVMe bdev instead of malloc.

Change-Id: Ia71d167b403d7f6d8ee5a621653f4062fce4ba6a
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450035
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-04-04 03:58:56 +00:00
Darek Stojaczyk
728af01741 event/nvmf: allow running without [Transport] in the legacy cfg file
While useful in NVMf target, this is really annoying
in the consolidated spdk target, where NVMe-oF doesn't
even have to be used. OCF tests currently use iscsi_tgt
just because spdk_tgt requires the additional [Transport]
section in the cfg file. Let's remove that requirement.

Change-Id: I418b47d62dcc06b9513f9f0496dc1e39b9d5a554
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450056
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@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>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-04 03:58:22 +00:00
Xiaodong Liu
1468f8dd3b app/trace: check num_entries before referring
For trace file which is generated by spdk trace_record,
if one lcore recorded no entries, there is no space for
it to have idle entries to referring.

Change-Id: I1cd89ec934407fc805bda66c8c87f76cb181679e
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449840
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-04 01:43:44 +00:00
Xiaodong Liu
0c41a7ce95 app/trace: remove redundant memory/pointer
Previously, copying trace-file from disk or page-cache
to memory aims to accelerate disk-read in one large
sequential read.
But it shows no value, since trace-data are originally
retrieved sequentially, and page-cache can handle it
well.

Change-Id: I1c328286686ed05e83f3b7a1bef10dc353c5b653
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449839
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-04 01:43:44 +00:00
Liang Yan
ad08de311e nvmf: fix reservation acquire typo
Change-Id: I91621dd1531eca1737385e4749b8d21152425740
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450026
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@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>
2019-04-04 01:42:05 +00:00
Darek Stojaczyk
0acb123aa4 iscsi: allocate PDU mempools with memory from any socket
Right now they can only use memory from the socket
that performed iSCSI static initialization, which
doesn't make sense. Those mempools can be used from
a different socket as well, so don't restrict them
to any specific one.

Change-Id: I0def1c554ed6227ab0f0a7be107c4c1c61f40c96
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450055
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-04-04 01:15:24 +00:00
Jim Harris
1a2de82456 examples/hello_blob: use io_unit_size instead of page_size
Blobstore now supports 512B reads/writes to blobs, if the
backing device is formatted for 512B LBAs.  The hello_blob
example app was never updated to account for this - so when
running against a backing device with 512B LBAs, it would
fail since it was only reading/writing 1 blob io_unit (512B)
but was comparing a page size (4KB).

Clean up a typo too while we're here.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450069
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: Changpeng Liu <changpeng.liu@intel.com>
2019-04-04 01:10:14 +00:00
Vitaliy Mysak
4fad4b86dd ocf: finish OCF reqs after put_io_channel
Relaunch queue poller on put_io_channel callback of OCF bdev
  to delay thread shutdown. New poller will finish all pending
  OCF requests as there might be some even after all SPDK IOs
  completed.

This solves the issue of OCF not being able to
  complete all its work because of queue poller getting
  unregistered in callback of put_io_channel.

This patch also changes unregister procedure:
  we call ocf_cache_stop in callback of io_device_unregister
  instead of in callback of bdev_unregister.

Change-Id: Ib7e41fc25e71029a73bb76a62e39e6bf4b8189ce
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/444276
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-03 00:00:20 +00:00
Vitaliy Mysak
9977424df1 ocf: make vbdev_ocf_delete function asynchronous
vbdev_ocf_delete function accepts callback now.
RPC delete_ocf_bdev is also updated to adopt this change.

Change-Id: I1d357a5e37015268e28c07fd81dc35f48ec80ab8
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449777
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-03 00:00:20 +00:00
Jim Harris
fee323b2ab ut/iscsi/portal_grp: fix license/copyright header
Not sure how it ended up this way, but there are a bunch of
extra # symbols that make the header look really weird.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449936
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-04-02 23:38:40 +00:00
Seth Howell
f4adbc79ce rdma: optimize and move buffers variable.
The buffers are really specific to the request and not the wr or data
object. In the case of multiple wr requests, the maximum number of
buffers per req is equal to the number of SGEs in the NVMe-oF request
*2.

Change-Id: Ic59498bfed461d180adb2fb9a481ac5b11fa9252
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449108
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-04-02 23:26:08 +00:00
Seth Howell
e590f607e6 nvmf: Report that we support more than one SGL element
Change-Id: Idf5aeb1fa3d6a3a83042bd699e0099b95e34f5b9
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/428776
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-02 23:26:08 +00:00
Seth Howell
47fca7c7e8 fio_plugin: add support for mocking SGL entries
FIO is going to always present a contiguous buffer to us. But we can
fake out the nvme driver with a couple of global variables.

Change-Id: I038e70582043e1d7c1800ed065fe126aa091c290
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/439608
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-02 23:26:08 +00:00
Seth Howell
62700dac2e nvmf/rdma: Add support for multiple sgl descriptors to sgl parser
Enable parsing an nvmf request that contains an inline
nvme_sgl_last_segment_descriptor element. This is the next step
towards NVMe-oF SGL support in the NVMe-oF target.

Change-Id: Ia2f1f7054e0de8a9e2bfe4dabe6af4085e3f12c4
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/428745
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-02 23:26:08 +00:00
paul luse
1e6cdc190d bdev/compress: misc comment and log message cleanup
Change-Id: I65ac14f1bcb506b211d129e5e6aa1c8872f3a2f2
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449803
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-02 23:25:27 +00:00
paul luse
a827d07c2b bdev/compress: integrate with DPDK compressdev
Change-Id: I0729f688c72651790ac05f4991c04deebca2af39
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448081
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-02 23:25:27 +00:00
Ben Walker
032920f250 thread: Implement a thread scheduler
Change-Id: Ie1cad80a071f9de066fe18093a4c4c8e726e5a77
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446998
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-04-02 23:24:30 +00:00
Ben Walker
b71bebe88a blobfs: spdk_fs_thread_ctx is no longer a channel
This also means that the RocksDB threads don't need
to be SPDK threads any more.

Change-Id: Icadd6dd446958ebf470ad8ab8239f5390942eb87
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449465
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-02 23:24:30 +00:00
Ben Walker
e9d400d5b9 blobfs: Change channel type for synchronous operations
In the next step, this won't be a channel at all.

Change-Id: Ia8fe4da5b0b283e8dfc5c6477b84cfdd346d89a0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449464
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-02 23:24:30 +00:00
Ben Walker
088c5e04ab blobfs: Simplify sync unit test
Rely on the available threading abstractions to make this
a bit simpler.

Change-Id: If8f028092c057637ff167d2ec7faa3dce009af61
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449463
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-02 23:24:30 +00:00
Jim Harris
1679104edb ut/reduce: use compress algorithm
The unit tests to this point used an algorithm that
just copied the data as-is with no compression.
Change it now to use the actual unit test compression
algorithm.

A few unit tests need to be modified to account
for the compressible buffers - primarily those that
write a single 512 byte LBA in a 16KB chunk.  These
will now be compressed down to a single I/O unit,
so some of the asserts need to be changed to adjust
for this.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449567
Reviewed-by: Paul Luse <paul.e.luse@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-04-02 21:40:21 +00:00
Jim Harris
cdd64c1c8c ut/reduce: modify write_maps test to write full chunks
This test verifies that all of the io_unit_index[] entries
are written.  For that to really happen, the write for
the chunks must not be compressible.  Currently the compress
algorithm just copies the data and doesn't actually
compress - so writing a partial chunk works OK for this test.
But upcoming patches will add a 'real' compression unit test
algorithm - at which point, writing just part of a chunk
will be compressible since the non-written parts will be all
zero.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449566
Reviewed-by: Paul Luse <paul.e.luse@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-04-02 21:40:21 +00:00
Jim Harris
d25f2db94a reduce: account for compressed buffers
When we decompress, pass the size of the compressed
data - not the size of the buffer itself.

We also need to remove an assert that's no longer
true since we can now handle compressed chunks.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449513
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-04-02 21:40:21 +00:00
Jim Harris
27631eb571 ut/reduce: move ut_compress/decompress functions
This just moves code to prepare for these functions
to be used earlier in the file without adding
extra function declarations.

Move ut_build_data_buffer as well for similar
reasons.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449512
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: Ben Walker <benjamin.walker@intel.com>
2019-04-02 21:40:21 +00:00
Jim Harris
fa0d54d431 reduce: write uncompressed data when compress returns error
Most typically, the error will be -ENOSPC, meaning the
destination buffer wasn't big enough to hold the compressed
data.  But even for other types of errors, just write the
uncompressed data rather than treating it as an I/O
failure.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449511
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: Ben Walker <benjamin.walker@intel.com>
2019-04-02 21:40:21 +00:00
Jim Harris
c1bab69c61 ut/reduce: add ut_build_data_buffer function
This function can be used to create data buffers
with varying levels of compression - we'll use
this in upcoming patches to test how lib/reduce
actually handles compressed buffers.

Modify the unit tests for the compression algorithm
to use this new function as well.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449500
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-02 21:40:21 +00:00
paul luse
b95d25975d bdev/compress: add unit test mocks and empty functions
Test functions to  be added later in series

Change-Id: I96286b6214b4577df334d180e7c3d641e8ce8f68
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445371
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-02 19:25:28 +00:00
Changpeng Liu
790c47d479 iscsi: fix up segment fault due to failed initialization
My iSCSI target reported segment fault after memory allocation
failure, and add the addtional check here can fix the issue.

Change-Id: Iee3e497d7028fbface6d110c78e73965ef0f178b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449717
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: yidong0635 <dongx.yi@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-02 19:25:00 +00:00
Maciej Szwed
e87e8263df lvol: Fix for lvol failed deletion flow
lvol should not only be freed but also removed
from lvols list when deletion fails.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I3a047e1cc611e71b1544ca77c256a879dd2efdae
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446619
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@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-04-02 19:23:22 +00:00
Darek Stojaczyk
06ec27a54d jsonrpc.md: add cache param to construct_ftl_bdev
The new param was added in a0cb5e9d [1], but never
described in jsonrpc.md.

[1] a0cb5e9d (lib/ftl: retrieve caching bdev from configuration)

Change-Id: I735644ffcf47abdede13a96ffddef8d1ce48c815
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449736
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-04-02 18:12:18 +00:00
Jim Harris
ca44fd6955 nvmf: put \0 at end of default serial number
It's not standard to put a newline here - let's use a null
character instead.

Found while using nvme-cli - when creating a subsystem with
default serial number, the right justified callout text had
an extra newline in it.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449645
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-04-02 13:08:06 +00:00
Claire J. In
3be9febdf9 lib/ftl: check for null
Fixes #726.
This prevents a segmentation fault by checking the pointer
before accessing it.

Change-Id: I18a3776fbcd6242c6efd1b88044debaa88c7342f
Signed-off-by: Claire J. In <claire.in@circuitblvd.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449591
Reviewed-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@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-04-02 08:22:48 +00:00
Vitaliy Mysak
643af88f13 ocf: update OCF submodule
Update OCF submodule to get 2 new API functions:
* ocf_mngt_cache_trylock()
* ocf_cache_has_pending_requests()

Change-Id: I2a1fee104bfd55dfb2e99ec538ec180681bd0f30
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449555
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-02 00:09:22 +00:00
paul luse
cd4de753af bdev/compress: prepare to add some unit tests
Misc cleanup from earlier patches, some naming issues and other
minor things that are needed before adding UT.

Change-Id: Ic76f0e2fd12e48782b048fb8785902b1098cf352
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/436227
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-04-02 00:06:34 +00:00
paul luse
aa3fdd01bd bdev/compress: insert vol unload into base bdev hotremove path
Change-Id: I0c23746fb210a8c209e98276fe0830185ee81407
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447372
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-04-02 00:06:34 +00:00
Wojciech Malikowski
dd54dff78b lib/ftl: Keep DMA buffer for metadata as part of ftl_md structure
This patch is starting point for metadata refactor
which is needed for efficient ANM events support.

Change-Id: I81d864605e69008d8e3922fb61adf504187447a1
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449328
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
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>
2019-04-02 00:04:58 +00:00
Pawel Wodkowski
9b025e17b3 rpc/client: return request ID from send and add_request methods
User should know the request ID that was issued.

Change-Id: If1191f73b31ebe04f23a88a9ca31fa157474056b
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449315
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@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-04-02 00:04:41 +00:00