Commit Graph

3589 Commits

Author SHA1 Message Date
Jim Harris
f3cedcc7fe bdev: set iovs on correct bdev_io in spdk_bdev_io_put_buf
spdk_bdev_io_put_buf() is responsible for reclaiming
bdev-allocated buffers from a bdev_io.  If there are
bdev_ios waiting for one of these buffers, it calls
spdk_bdev_io_set_buf() on the next bdev_io in the queue.
This will set the iov_base and iov_len on the bdev_io
to point to the bdev-allocated buffer.

But spdk_bdev_io_put_buf() was calling spdk_bdev_io_set_buf()
on the just completed bdev_io, not the next bdev_io in the
queue.  So fix that.

Fixes: 844aedf8 ("bdev: Simplify get/set/put buf functions")
Reported-by: Alan Tu
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ibbcad6e35a3db6991bd7deb3516229572f021638
Reviewed-on: https://review.gerrithub.io/424881
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>
2018-09-10 21:16:10 +00:00
Jim Harris
44a43939e8 nvme: add quirk for Intel SSDs without vendor-specific log pages
QEMU emulated NVMe SSDs report themselves with an Intel vendor ID,
but don't support the Intel vendor-specific log pages.  So add
a quirk to avoid confusing error messages.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic41476801ede94d43acb9972217ea7420ca53679
Reviewed-on: https://review.gerrithub.io/423422
Reviewed-on: https://review.gerrithub.io/423928
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@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>
2018-09-05 20:45:06 +00:00
Seth Howell
bbb2989c26 bdev: increment io_time if queue depth > 0
This value is used to calculate the disk utilization of a given bdev.

Change-Id: I4bf101c524b92bdd21573941e17f61db59c5c6b8
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/423017
Reviewed-on: https://review.gerrithub.io/423927
Reviewed-by: Seth Howell <seth.howell5141@gmail.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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: Ben Walker <benjamin.walker@intel.com>
2018-09-05 20:45:06 +00:00
Dariusz Stojaczyk
4baae265ca dpdk/pci: support DPDK 18.08 write combined PCI resources
We used to support it by default in our DPDK forks,
but starting with DPDK 18.08, a new PCI driver flag
RTE_PCI_DRV_WC_ACTIVATE is required.

We enable now it for NVMe and Virtio, but not for I/OAT,
as our I/OAT driver currently assumes strong memory
ordering, which prefetchable resources do not provide.

Change-Id: I1a13356e28535981153b3d3e52bfe9d66b6172ae
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/422588
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: <wenqianx.zong@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: Jim Harris <james.r.harris@intel.com>
2018-08-21 14:31:09 +00:00
Dariusz Stojaczyk
ec611eb485 env/dpdk: link with rte_kvargs by default
Starting with DPDK 18.08, rte_kvargs is a dependency
of rte_eal.

Change-Id: I0cde78f632fc313cec745d41ee519fb8b37de81a
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/422587
Reviewed-by: Jim Harris <james.r.harris@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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: Jim Harris <james.r.harris@intel.com>
2018-08-21 14:31:09 +00:00
Changpeng Liu
4a9ba4ef78 bdev/nvme: fix the error usage of function return value
Fix the issue #379.

Change-Id: Ia953d4ebe232d389ba3264074592ae8d0cff467a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/421078
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-08-02 16:44:31 +00:00
Dariusz Stojaczyk
c9e5777ede virtio: clarify feature negotiation failure
Change-Id: Ifb1566033569af0b3cf4a9dfbc8094a9883c7622
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420980
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-08-01 19:16:54 +00:00
Dariusz Stojaczyk
eeb1650c06 virtio: propagate error codes
Many functions were inconsistent in regard of error codes
they returned. In a couple of places we could print "Operation
not permitted" via strerror() from functions that were
supposed to return negative return codes, but returned
`-1` instead. (-EPERM == -1)

Change-Id: I7c36e54d449352dbd8036746e4f44a65c9b1d0b3
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/419007
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-08-01 19:16:54 +00:00
Maciej Szwed
83d1bfae41 nvme: Unregister NVMe controller when bdevs creation fails
This patch fixes github issue #385.
We need to unregister previously created NVMe controller
when creation of NVMe bdevs fails otherwise we won't be
able to use NVMe device as it will stay in wrong state.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I28a165aba1a556a2ed2d4cd5ff6fd510e80657d3

Reviewed-on: https://review.gerrithub.io/421006
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-08-01 18:43:53 +00:00
Dariusz Stojaczyk
117fdae94b virtio: fix false-positive assertion failure on virtqueue_req_add_iovs
We need to decrement the free_cnt before checking
if it reached 0.

Note: the vq_free_cnt overflow is asserted at the
beginning of the function.

Change-Id: I655217785e4425d1cd3c704d24321b643be55dcf
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420584
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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-08-01 17:25:24 +00:00
Chen Wang
ea55b03940 nvme/nvme_rdma: free the ctrlr when creating the qpair fails
Release nvme rdma ctrlr before exit the nvme_rdma_ctrlr_construct function
when creating the admin qpair fails.

Fixes GitHub issue #363.

Change-Id: Ib988e0da2f627db06b68bd3fb72c117c52572cf8
Signed-off-by: Chen Wang <chenx.wang@intel.com>
Reviewed-on: https://review.gerrithub.io/420719
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@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>
2018-08-01 17:23:49 +00:00
Ben Walker
6779479067 nvmf: Simplify spdk_nvmf_qpair_disconnect
Asking which thread we're currently on is more expensive
than sending a message.

Change-Id: I9d9007c9f7f30e4cdd9a97de6bf7a10b0e2a0594
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/420933
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
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>
2018-08-01 17:13:48 +00:00
Seth Howell
63528ebc76 bdev: Add read and write latency ticks to stats
These were left out previously.

Change-Id: I4e97068d2f13ca1dd1cfae1b25564641cee794ef
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/419601
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2018-07-31 23:26:07 +00:00
Seth Howell
dd9cd4352d bdev: add tracking for time spent processing I/O.
Two extra fields are added to the iostat rpc.
1. io_time. The amount of time since queue depth tracking was
enabled that has been spent on I/O processing.
2. weighted_io_time. Incremented each time this bdev's queue depth is
polled by the amount of time spent processing I/O since the last polling
event times the measured queue depth.

Change-Id: Ie70489ec24dee83f3eeac8f4f813ec7074ff458f
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/419031
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
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>
2018-07-31 23:26:07 +00:00
Dariusz Stojaczyk
ee5e898a86 bdev/nvme: check against strdup failure
Change-Id: I161859fafbcb5f649990641887d6edc914343946
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420902
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@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>
2018-07-31 23:15:40 +00:00
Maciej Szwed
f4369b9eed nvme: fix memory leak on NVMe bdev creation failure
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: If90434452dba51fbb72c8c486e3c1e4691549c34

Reviewed-on: https://review.gerrithub.io/420845
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2018-07-31 16:14:50 +00:00
Seth Howell
b0171f79c3 nvmf_tgt: delete connections accepted during shutdown
With the reordering of the nvmf_tgt states, we need to remove any
connections accepted during the shutdown pahse of the target.

Change-Id: I768484366da8273df74b8d52a3e8de6158b6995f
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/420681
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-31 16:14:29 +00:00
Seth Howell
3f6041bce4 nvmf_tgt: reverse states during shutdown
Now that the acceptor poller is also checking for asynchronous rdma
events at the transport layer, we need to make sure that this is running
until all of the poll groups are deleted.

Change-Id: I34973047fcb247b8a5a36cc7db681ab0b3cb0779
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/420680
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-31 16:14:29 +00:00
Seth Howell
e5a6540777 nvmf: disconnect qpairs before freeing i/o channel
Previously, qpair deletion was synchronous and handled by the
io_channel_destroy_cb for the target. However, with the new asynchronous
qpair deletion api, these qpairs need to be completely removed before we
free the i/o channel and the poll group.

Change-Id: I42c62391df62825d53e158306c4372523403ad27
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/420208
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-31 16:14:29 +00:00
Seth Howell
e4c1e5f866 nvmf: destroy_poll_group uses disconnect_qpair asynch api
Change-Id: I47eff0db1ab33be23881f694d104e903706f1c28
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/417371
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-31 16:14:29 +00:00
Seth Howell
f2b22d68d6 subsystem: defer channel iter until pg functions return
The poll group pause, resume, remove, and add functions are only called
from the subsystem_state_change_on_pg function. Previously, they would
return immediately and the state change would move on to the next
channel. However, some of these functions (specifically remove) kick off
asynchronous APIs and we should not iterate past them until those
asynchronous operations complete.

Change-Id: I78804273b39f2d171ba26ac4478ad515356833f3
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/419289
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-31 16:14:29 +00:00
Dariusz Stojaczyk
b326e51219 bdev/virtio_blk: defer bdev destruct completion
Even after the bdev is removed, the underlying virtio
device may be still alive for some time. The user may
then try to recreate the virtio bdev and could technically
initialize a second simultaneous connection to a vhost
target. It does not cause any technical problems, but the
target may reject such connection if it reached a connection
cap or doesn't support more than one connection per target
(like SPDK vhost does as of today).

Since the fix is straightforward, here it is.

Note:
Virtio SCSI is already safe, because it uses a separate
completion callback to indicate virtio device destruction.

Change-Id: I2989780ef9b13c19d0432224ff4602a14be48315
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420576
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-07-31 01:13:07 +00:00
Ben Walker
a1ec258ac7 Clean up some incorrect Copyright statements
Daisuke Aoyama originally contributed to istgt, the
iSCSI target in FreeBSD. The SPDK iSCSI code is
originally derived from that. Due to copy and paste,
some incorrect copyright attributions have been added
to other files that do  not derive from istgt, so
this patch removes those.

It is doubtful, at this point, that there is any code
whatsoever that remains from the original istgt, but
we can revisit that at a later time.

Change-Id: I207e1e6b99d271e2f12690be90a96f7d0c113af7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/420679
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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-30 16:29:38 +00:00
Shuhei Matsumoto
e67338d464 bdev/raid: Factor out add raid bdev config operation
Change-Id: I79abce53526fa71981a969cc5599f496f4606f35
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/420327
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Kunal Sablok <kunal.sablok@intel.com>
2018-07-30 15:44:27 +00:00
Shuhei Matsumoto
eff04f8e4c bdev/raid: Factor out delete raid bdev config operation
Change-Id: I71f98a7cfd49f391ce9880c42f53072c6264ef1d
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/420326
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Kunal Sablok <kunal.sablok@intel.com>
2018-07-30 15:44:27 +00:00
Shuhei Matsumoto
e923c66a07 bdev/raid: Free all strings allocated by JSON decoder on all paths in RPC
Use strdup for all strings allocated by JSON decoder and free them on
all paths.

Change-Id: Ia30d32c2fd6bd79f62588ca19bd3bb093d38a502
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/420325
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Kunal Sablok <kunal.sablok@intel.com>
2018-07-30 15:44:27 +00:00
Shuhei Matsumoto
90f54670bc bdev/raid: Use TAILQ to manage RAID bdev configuration
Change-Id: I971df38c577284916212e58b77c73499127a980a
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/420217
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-30 15:44:27 +00:00
Shuhei Matsumoto
32cc0199d1 bdev/raid: Use single character variables to index and loop iterator
Change-Id: I1023a509f938fcbe6ac0c35dca5192c36990de91
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/420216
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Kunal Sablok <kunal.sablok@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-30 15:44:27 +00:00
Dariusz Stojaczyk
47f1db1344 bdev/null: free global resources on module finish
Also, don't try to remove any bdevs. The bdev layer
does that before module fini is even started.

Change-Id: I869f4b9e6d8590bfae2504a96d971c4f8866aeb9
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420577
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-30 15:38:07 +00:00
Jim Harris
c60ae3c356 raid: get buffer on reads before sending child ios
For front-ends like iSCSI (and NVMe-oF in the future)
which want the backend to specify the data buffer, the
RAID module doesn't copy the pointer to the allocated
buffer from the child IO back to the parent IO.  It
really can't copy the pointer - the child IO owns it
and will free it.

So the RAID module needs to allocate the buffer first
and then pass it down.

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

Reviewed-on: https://review.gerrithub.io/420677
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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-30 14:59:45 +00:00
Jim Harris
cabe0203da raid: break out read/write code into separate function
This is needed for next patch which needs to defer reads
when getting an io buf.

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

Reviewed-on: https://review.gerrithub.io/420676
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>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-30 14:59:45 +00:00
Xiaodong Liu
9928e9d98a ocssd: apply ocssd strings into status arrays
Change-Id: If25463ea76e8382c61f10636e1119376a00104dc
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/411594
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-07-30 03:09:31 +00:00
Seth Howell
d3995f6eca nvmf: remove_subsystem now uses qpair_remove asynch api
This is necessary to avoid race conditions when freeing subsystems.

Change-Id: I9b4a7d006cc42cd29e13179e940ced0cc580f548
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/417351
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-07-27 20:50:36 +00:00
Seth Howell
1e2c9afa95 nvmf: always call qpair_delete cb on original thread
This ensures that when we continue to iterate through channels after
deleting the qpair, we will be able to continue iterating through
channels.

Change-Id: I6fba43dc14a3e5e8faac78f8b37e9e0c6aad2687
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/419920
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-07-27 20:50:36 +00:00
Seth Howell
4bee4e03b6 nvmf: free AER resourcess before disconnecting qpair
It is necessary to free the AER without sending a completion to ensure
that the host does not attempt to send an additional AER upon receiving
the first completion.

Change-Id: I2b3f8f286d6396019d8ace97d2376547705b8d9d
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/420661
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-27 20:50:36 +00:00
Seth Howell
388e310150 nvmf: add free_req function pointer.
At times, it may be necessary to free requests without completing them.
For example, when freeing a qpair, one needs to free the AER sent from
the host before deleting the qpair. It is important not to send a
completion for the AER because:
1. According to the spec, this will trigger the host to send another AER
2. No Asynchronous Events have occured, so we should not complete the
AER.

Change-Id: I92e163f0fed0ee2bc942569a647cb3c1967edec9
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/419732
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
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>
2018-07-27 20:50:36 +00:00
Dariusz Stojaczyk
5a5630acb2 bdev/iscsi: unregister io_device on bdev destruction
Fixes a memory leak and a possible data race.

Change-Id: Ib094ca62e66d8d3a88b0acccc92e69214d413e72
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420573
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
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>
2018-07-27 18:58:53 +00:00
Dariusz Stojaczyk
dbd4e57994 bdev/iscsi: properly free pending connections on module fini
Besides the obvious memory leaks, we also need
to call the async completion callback, which may
also free some resources.

Change-Id: Ia80799be4b220053b82dfb4ee2453181c90136a1
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420571
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2018-07-27 18:58:53 +00:00
Dariusz Stojaczyk
b86c6b1704 env_dpdk: delete all unnecessary files created by dpdk 18.05
DPDK 18.05 introduces a new "runtime" directory,
which contains hugepage metadata to be accessed
by secondary processes. There may be multiple
files per each memseg and we cannot easily predict
their count, so this patch deletes all regular
files in that directory.

$ ls -l /var/run/dpdk/spdk_pidX
total 16784
-rw------- 1 root root     4096 Jul 27 15:10 fbarray_memseg-1048576k-1-0
-rw------- 1 root root   188416 Jul 27 15:10 fbarray_memzone
-rw-r--r-- 1 root root 16974144 Jul 27 15:10 hugepage_data
-rw-r--r-- 1 root root    12432 Jul 27 15:10 hugepage_info
srwxr-xr-x 1 root root        0 Jul 27 15:10 mp_socket

The DPDK config file is not located in this directory
yet to preserve some of the backward compability.
Eventually, it will moved there as well.

Change-Id: I61cf1a47b306b51b0817c9d870841508f1e5e604
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420659
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-27 16:48:47 +00:00
Dariusz Stojaczyk
2a55d70387 bdev/iscsi: fix lun->mutex leak
It was never destroyed.

Change-Id: If10b23b0a6784994a5aac85968f7efb99fa6ba70
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420570
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-27 16:25:17 +00:00
Dariusz Stojaczyk
244c9ab9eb bdev/iscsi: fix memory leaks on connection failures
create_iscsi_lun freed the provided parameters under
one condition, and did not under some other. The
behavior is now clarified.

When create_iscsi_lun succeeded, the parameters are
passed to an iscsi bdev and will be freed together
with its removal, but if the bdev could not be created,
the params need to be freed manually.

Change-Id: I010421d48461b365a324488029e11c90a4e20a37
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420569
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-27 16:25:17 +00:00
Dariusz Stojaczyk
3d9690a5e5 bdev/iscsi: remove g_iscsi_lun_head
It is not required anymore.

Change-Id: Ic16003311a451a223a626eca63cd9308a196bbdc
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420568
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-27 16:25:17 +00:00
Dariusz Stojaczyk
ab0c11353e bdev/iscsi: simplify module finish
Bdev module fini is triggered after all bdevs get
unregistered - this includes all iscsi bdevs. There's
no need to unregister/free them manually.

A few words for the iscsi_logout_async call, which was
never possibly called, but is now completely removed:
Destroying the iscsi context, which is done at bdev
destruction, will "tear down any existing connection"
as the libiscsi docs say, so there's apparently no
need to perform a manual logout.

Change-Id: Id163668a19a1d4b9bcd7538ecd1c0febae0fe47a
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/420567
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-27 16:25:17 +00:00
Jim Harris
eb8ee073c5 blobstore: recalculate total clusters after reading super block
Blobstore uses 1MB cluster size by default, but logical volumes
override it to 4MB by default.  When an existing lvolstore is loaded,
all cluster calculations were being done based on the 1MB size - not
the 4MB cluster size read from the superblock.  That would result
in asserts (due to mismatched used cluster mask size) and all kinds of
other possible weirdness with subsequent operations.

Fixes: 2c91e91907 ("blobstore: Save the original size of the disk.")

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

Reviewed-on: https://review.gerrithub.io/420582
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.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>
2018-07-27 16:23:50 +00:00
Ziye Yang
db6e1105aa blobfs: add the check for cache_buffer
Though the buffer can be allocated in the normal case,
however we still need to check it.

Change-Id: I483c7bd083c24590295e44473674c7b8ed30e9da
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/420462
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-26 23:56:36 +00:00
Pawel Wodkowski
5f9bdac004 bdev/nvme: add RPC to enable and disable hotplug
Change-Id: Iac7340dd0df427ba4e9df5b1c52cfb732d011ae8
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/419093
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-26 22:12:29 +00:00
Pawel Wodkowski
4bef621e90 bdev/nvme: Add set_bdev_nvme_options
Change-Id: I5ab027d5204f9c4991eacaea631367783d1ad115
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/418723
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-26 22:12:29 +00:00
Tomasz Zawadzki
43fe36672b bdev: add remove_virtio_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for virtio  bdev.
This is generic call for both - blk and scsi.
Scsi specific call has been removed.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I3ed629942e9ef6067b488d94ca508b40e9e74f42
Reviewed-on: https://review.gerrithub.io/417008
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2018-07-26 22:07:50 +00:00
Tomasz Zawadzki
3a56fabce3 bdev: add delete_nvme_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for NVMe bdev.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ib9a0475d735af2616a3005d04530ca825ece8a52
Reviewed-on: https://review.gerrithub.io/416546
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2018-07-26 22:07:50 +00:00
Tomasz Zawadzki
b36face57d lvol: remove destruct_req from lvol store
Since destroy_lvol_bdev was implemented, it is now more convinient
to call destroy/unload for lvol store explicitly.
Rather than using lvs struct to pass a request checked on each
lvol close/destroy.

Change-Id: I56ee626e96f8752909d1584a20fe3345c5607fdc
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/420285
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-26 21:55:36 +00:00