Commit Graph

3447 Commits

Author SHA1 Message Date
Ziye Yang
75dce8a25c iscsi, initiator: solve the use after issue.
In our current code, when we call the following statement:
spdk_bdev_destruct_done(&lun->bdev, 0);

Actually lun is already freed in bdev_iscsi_lun_cleanup function
(called by iscsi_free_lun). So this patch can be used to
prevent this issue by changing the order.

Change-Id: I5ec02319b8205fafc4d8074511f5a334b9bbb3ad
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/417630
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-03 17:44:39 +00:00
Ziye Yang
abc3bc4f8e bdev/rbd: change the poller to timer poller
Poll it every 50 microseconds.
Reason: Ceph's librbd service is not very fast.
So choose a timer period to poll it, instead of
use the syscall to poll it again and again, it
is unnecessary. And this is a default value,
which can be tuned by customers later.

Change-Id: I91c31442da5ddadf3bef43083bd789d01bb1c952
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/417442
Tested-by: 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-03 16:40:18 +00:00
Dariusz Stojaczyk
a784e88e35 ioat: do not downcast device pointer to void*
This code was created when spdk_pci_device wasn't
available yet. Now we can use spdk_pci_device* instead
of void* for extra code clarity.

Change-Id: I81d440720b22a484ae3d2739e0510a021bebbafe
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/416995
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-03 16:29:42 +00:00
Maciej Szwed
e48f0bf17d bdev: add delete_passthru_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for passthru bdev.

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

Reviewed-on: https://review.gerrithub.io/416535
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-02 22:53:18 +00:00
Maciej Szwed
1a0ce4ded0 bdev: add delete_pmem_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for pmem bdev.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ic526e9ae462f595c4668c2b2612ad074208a7c4e
Reviewed-on: https://review.gerrithub.io/416520
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-02 22:53:18 +00:00
Maciej Szwed
4fd967b22a bdev: add delete_rbd_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for rbd bdev.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ia87459e0cc49a0c408de582bd1f5680c570d42d9
Reviewed-on: https://review.gerrithub.io/416529
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-02 22:53:18 +00:00
Maciej Szwed
2ce9836b17 bdev: add delete_null_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for null bdev.

Changes in spdkcli done accordingly.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I576322257e5cf70ec03d6b20f8ba43bfce222907
Reviewed-on: https://review.gerrithub.io/416505
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-07-02 22:53:18 +00:00
Shuhei Matsumoto
1e5705ee6f scsi: Make scsi_lun_free_io_channel public
IO channel for LUN is used for hot removal as it is emphasized in the
previous patches.

In iSCSI, a SCSI device has multiple LUNs. So freeing only the IO channel
of a LUN must be possible.

Change-Id: I5b355200b4e173512a5aa4b7351534faf8839eef
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/417197
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-02 21:29:50 +00:00
Shuhei Matsumoto
c645cc69ab scsi: Reorder LUN hot removal to check outstanding tasks and then IO channel
Reorder operations of LUN hot removal so that following are satisfied.

Wait for completion of all outstanding tasks first. (After turning lun->removed
on, there will be no new outstanding task.)

Then wait for IO channel being freed. (For VHOST SCSI, IO channel is freed
in the callback handler of hot removal. For iSCSI, IO channel is freed when
the final connection exits. IO channel of LUN is freed only by the allocator.)

Then free LUN finally.

For VHOST SCSI, the callback handler of hot removal will
call spdk_scsi_lun_destruct() in spdk_scsi_dev_destruct(). But lun->removed is
already turned on and spdk_scsi_lun_hot_remove() will be NOP. Hence LUN is
freed safely by the first caller of spdk_scsi_lun_hot_remove().

Change-Id: I276dfed1d4a7767e382003bd9bb389aaff920115
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/417196
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-02 21:29:50 +00:00
Dariusz Stojaczyk
f0501959a0 virtio/user: remove leftover kernel vhost references
We don't support the kernel vhost. Vhost-SCSI is not even
fully implemented in Linux, so there's no point trying.

Change-Id: Ie564d46c497718081dd2a5c28829fdcf88e1c0a0
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/417455
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-07-02 19:20:08 +00:00
Dariusz Stojaczyk
03b12a98b2 bdev/virtio: support event index
This fixes intermittent failures with QEMU's virtio-scsi-pci
device.

Apparently, from time to time QEMU enters a broken state in
which it doesn't turn off the NO_NOTIFY flag. This flag should
be set only for the period of time virtqueues are being processed,
but QEMU makes it set all the time. This makes us not signal any
I/O submissions - SPDK thinks the device is currently processing
notifications so it will pick up our I/O automatically, but in
realitly it won't and we end up with a deadlock.

I believe kernel virtio driver doesn't hit this issue because of
event index feature. If negotiated, the NO_NOTIFY flag won't be
used at all. Initial tests show that the issue is indeed gone
with this patch.

Event index for SPDK virtio is not particularly useful when using
a poll-mode device, but it doesn't do any harm. It can be further
optimized in the future, but macro-benchmarks don't show any
performance difference compared with the legacy notification
handling so there's no hurry.

Change-Id: I46e8ab0da170780fcdc0dd239208670ee5ed6357
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/415591
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-02 19:17:13 +00:00
Dariusz Stojaczyk
587002f511 virtio: expose virtio descriptors as soon as possible
With upcoming event index patch we will need
to keep track of how many descriptor chains we
have really put into the avail vring. This patch
is a step towards that.

Our virtio layer abstracts away descriptor chains
as "requests". We can start requests, add descriptors
to them, and finally flush them. So far we used to put
any descriptors directly into the virtqueue desc ring,
and made them visible to the device only through
virtqueue_req_flush().

All of our virtio bdev modules currently flush the
virtqueue after adding each single request, but the
docs for the virtio API say it's possible to start
multiple subsequent requests and flush them all at
once. This was conceptually broken so far and only
the last request would be exposed to the device.

It's now fixed and subsequent requests are put
into the avail vring as soon as they're complete
(either the next request is started, or the
virtqueue is flushed).

Change-Id: I76b7db88ab094c38430edd8ff0e65681775dcb31
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/415590
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-07-02 19:17:13 +00:00
Dariusz Stojaczyk
5f14637246 nvme/pcie: merge physically contiguous SGEs
There's no need to split a bufffer if it's physically
contiguous. We can now merge buffers that would be
previously split by the nvme_pcie driver and also
separate SGEs provided by the user that happen to be
physically contiguous.

Change-Id: I9c9de31d52a9dc9e384806555cb94609aff0ccf3
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/417061
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-07-02 19:13:23 +00:00
Dariusz Stojaczyk
3320c06b4c nvme/pcie: split HW SGL entries on 2MB address boundary
This allows NVMe PCIe devices to be used with
physically discontiguous I/O payload buffers.

So far this is just a dumb splitting which
doesn't check for physical contiguity. This is
improved in a subsequent patch.

Change-Id: I0ecc443149225eaa0e4156ddda78613bcf034406
Suggested-by: Daniel Verkamp <daniel.verkamp@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/417060
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-07-02 19:13:23 +00:00
Dariusz Stojaczyk
8681eecd9a env: introduce spdk_memzone_reserve_aligned
This is an spdk_memzone_reserve variant with additional
alignment parameter. Now that memzones must be used for
physically contiguous memory, it will become extremely useful.

Change-Id: Ie48d682217e0e2f5c859a1603bb8a81fd2a7d7df
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/416978
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-02 19:13:23 +00:00
Dariusz Stojaczyk
2044690e6a env: introduce SPDK_MEMZONE_NO_IOVA_CONTIG
Future DPDK versions may drop physical memory contiguity
guarantee for common memzones. DPDK 18.05 introduces
an RTE_MEMZONE_IOVA_CONTIG (0x00100000) flag, which is
documented as follows:

> RTE_MEMZONE_IOVA_CONTIG - Ensure reserved memzone is IOVA-contiguous.
>                           This option should be used when allocating
>                           memory intended for hardware rings etc.

To preserve backward compatibility, SPDK introduces an opposite
flag, SPDK_MEMZONE_NO_IOVA_CONTIG.

Change-Id: I9ea79b096fdb094051f13c9a802740b0e4ccc98e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/416977
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-07-02 19:13:23 +00:00
Ben Walker
9bac3426ae env: Remove unhelpful const in spdk_mempool_put_bulk
This const makes the array passed in immutable, but that
isn't helpful or interesting since it just contains
invalid pointer addresses. It may also make sense in the
future to NULL out the addresses in the array in a debug
build. So drop the const.

Change-Id: I921551c7cb1dbf6c765fb301c31906b8b93b7f16
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/417362
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-02 19:12:45 +00:00
Dariusz Stojaczyk
962b15d0c4 ioat: split FILL tasks on hugepage boundary
This was obviously omitted in the original implementation.

Change-Id: Ifba049cdb8d1c1f24e30adb542946a2fa83c7464
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/416655
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-07-02 18:23:15 +00:00
Chunyang Hui
8b38468db4 bdev/iscsi: Add unmap support for iscsi initiator
Change-Id: I6dc83322385ecd332f6898f182192773824375cf
Signed-off-by: Chunyang Hui <Chunyang.hui@intel.com>
Reviewed-on: https://review.gerrithub.io/417086
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-28 18:19:52 +00:00
Ben Walker
a4d22f7bdc bdev: Make an internal version of spdk_bdev_io_type_supported
Within the bdev layer, we want to know specifically what I/O
types the module supports. However, the bdev module may elect
to emulate some commands and report additional support via
the public API.

The bdev layer already emulates WRITE_ZEROES, so correctly
report that fact.

Change-Id: I79bfb1aee1b3e6048f951bb1b2c7d4f7c9ef184d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/416464
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-28 18:17:02 +00:00
Piotr Pelplinski
2c91e91907 blobstore: Save the original size of the disk.
Save the original size of the disk to metadata when it is first created.
On load verify that the disk did not change size.

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I535940ee188425ee3b394effd99653cc073d541e

Reviewed-on: https://review.gerrithub.io/410896
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-28 17:58:31 +00:00
Piotr Pelplinski
cf930a450b blobstore: postpone all superblock writes to first metadata sync
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I49d23d2af40ff909757a5fd15b80a7a8cbbff399

Reviewed-on: https://review.gerrithub.io/416922
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-28 17:58:31 +00:00
Seth Howell
dd7b90fac9 bdev: add null check to spdk_bdev_unregister:
Newer versions of scan-build complain about cb_fn potentially being null
in spdk_bdev_unregister.

Change-Id: Ib5607234557f2104ee30398a620fa595389a33e9
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/417064
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-28 17:47:08 +00:00
Changpeng Liu
4c4e2b4d80 bdev/nvme: update NS bdevs after NS attribute notice event
Change-Id: I7c42696c09a3a4d35e0339ecfdf68c256c935a76
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/415117
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-28 17:46:41 +00:00
Daniel Verkamp
8e5eef8ebc thread: send message for completion with no channels
When spdk_for_each_channel() was called on an io_device with no
channels, the completion function would be called immediately in the
context of the spdk_for_each_channel() caller.  This is different than
the normal completion when channels are present, which is always called
asynchronously via spdk_thread_send_msg(), causing problems for callers
that did not expect to get the completion callback before
for_each_channel returned.

In particular, this causes problems with the set_bdev_qos_limit_iops RPC
method, which holds a mutex around the spdk_for_each_channel() call and
also attempts to lock that mutex again within the completion callback.
(This is GitHub issue #344.)

To avoid this problem and make the completion call consistent between
no-channels and channels-present cases, always send the completion via
spdk_thread_send_msg().

Change-Id: I9e5ec3592462c7b2ed682e665fe62ae3a5b5cc59
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/417068
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-28 17:39:55 +00:00
Dariusz Stojaczyk
70df6cb890 env/dpdk: do not pass raw memzone flags param to DPDK
Same as we do with SPDK_ENV_SOCKET_ID_ANY, memzone
flags should be translated from SPDK defines to their
DPDK equivalents instead of passing those 1:1.

Note that we don't use any memzone flags so far.

Change-Id: I4100dd7ac8825eecd7f323bc21b3b6b8347bfa8d
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/416976
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-27 23:31:00 +00:00
Daniel Verkamp
1d260441b4 nvme/rdma: factor out Connect command
This is a generic NVMe-oF command that may be used for other transports.

Change-Id: Id5fbf1f176ef5f75a221b40eff538e693817bcaf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/416578
Tested-by: 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-06-27 22:59:18 +00:00
Daniel Verkamp
9f5fb75d1f nvme: move cntlid to struct spdk_nvme_ctrlr
All controllers have a controller ID (cntlid), and this will be needed
in other NVMe-oF transports, so move it to the generic controller
structure.

Change-Id: Iaba5b93e1267e7bef3a6eb7c677c549a3d83985c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/416577
Tested-by: 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-06-27 22:59:18 +00:00
Daniel Verkamp
ee9ca4b324 nvme/rdma: factor out NVMe-oF discovery
This can be used for other NVMe-oF transports.

Change-Id: Ic8d2dc483220eb3690cb756bcd750d19c93d98e6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/416576
Tested-by: 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-06-27 22:59:18 +00:00
Daniel Verkamp
d81d3fa935 nvme/rdma: factor out NVMe-oF Property Get/Set
These functions are generic and may be used for other NVMe-oF
transports.

Change-Id: Idb3aa30d9b0b1be7b60b85ab4911b28db35977a4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/416575
Tested-by: 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: Ben Walker <benjamin.walker@intel.com>
2018-06-27 22:59:18 +00:00
Leonid Ravich
2a92c30292 lib: return error in case of start_fn is null in spdk_app_start()
instead of hitting S11 on event

Change-Id: I7af2a1961bf2c05005a23c3f50eadbcd23e7e38f
Signed-off-by: Leonid Ravich <Leonid.Ravich@dell.com>
Reviewed-on: https://review.gerrithub.io/416972
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-27 20:52:37 +00:00
Shuhei Matsumoto
322e50468c scsi: Use not pthread_self but spdk_get_thread for LUN affinity
spdk_thread is recommended to be used in SPDK library.

Change-Id: I5b75f390ddb2069e1266a3fc4f28732b281df725
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/416482
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@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-06-26 23:31:17 +00:00
Shuhei Matsumoto
1e1e0dd70c scsi: Don't free IO channel at LUN removal not by allocator
IO channel is freed unexpectedly at LUN removal. This hides
error due to uncorrect implementation of LUN hot removal.

IO channel of LUN must be freed only by its allocator.

Change-Id: Id3721180422364dfc4d9309f3a22ce0a3f766f82
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/416318
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-26 23:31:17 +00:00
Shuhei Matsumoto
3e9f06281e scsi: Unregister the poller of LUN hot-removal when it is registered
Change-Id: I48e831c235aab825c427892637ca1b4faafef152
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/416317
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
2018-06-26 23:31:17 +00:00
Shuhei Matsumoto
0ba0bbd132 iscsi: Refactor update of datain_flag in spdk_iscsi_transfer_in()
Change-Id: I17c52c6620500959ada0783ef115c62b22c574f0
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/416316
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-26 23:31:17 +00:00
Shuhei Matsumoto
a5e7f17b88 iscsi: Remove duplicated check of scsi status in spdk_iscsi_transfer_in
if the scsi status of the task is not GOOD, iscsi_transfer_in() returns
immediately. Hence checking it again is not necesasry.

Change-Id: I55cb025e97c8dcd51692303d0d21ce48b1185631
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/416315
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-26 23:31:17 +00:00
Daniel Verkamp
d4ef57c072 nvme_spec: add VWC flush broadcast bits (TP 4035)
Also report that the NVMe-oF target does not support Flush with the
broadcast NSID.

Change-Id: Iad761a6f81eb099940463a67074a6dccb8871b70
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/416445
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-26 22:51:37 +00:00
Seth Howell
2c52691b48 bdev: encapsulate members of spdk_bdev_module
Change-Id: Id0f9ba665a7a7fb2ead299b7853074c2e994dbd4
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416462
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-26 20:04:07 +00:00
Seth Howell
86947c8917 bdev: encapsulate private members of spdk_bdev
Change-Id: Ica5abcfe5f9b73217e2d91c33c2cd418e061cf96
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416458
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-26 20:04:07 +00:00
Seth Howell
816c34cbce bdev: move error union to internal spdk_bdev_io struct
Change-Id: Iab755bb1473c404693f84f97c07bbb5c5fefbb49
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416266
Tested-by: 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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-26 20:04:07 +00:00
Seth Howell
e550391ddd bdev: move link to spdk_bdev_io internal struct
I missed this one in the initial series.

Change-Id: Id4dc7574a04cd964455852f1a00084b65ab989b3
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/416253
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-26 20:04:07 +00:00
Liang Yan
8c71c208a2 nvme: check ctrlr process while get ctrlr data in hotplug function.
Fix issue #313.
For multi-process test scenarios, the secondary process may access
controller’s CSTS register in the shared ctrlr list. For this situation,
all the controllers are already in the primary shared ctrlr list, but
then each controller is added one by one in the secondary process, so the
secondary process may access CSTS before it is remapped for the BAR space.

In the rpc_config.sh test case, the spdk_nvme_ctrlr_get_regs_csts function
will be called in _nvme_pcie_hotplug_monitor function before calling
spdk_pci_nvme_device_attach. This step caused the secondary process iSCSI
Target access CSTS before it is remapped for the BAR space.

Change-Id: Ifd62c38adf8624f9877a9a2f965ca4db28839d99
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/412594
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-25 22:05:52 +00:00
Ziye Yang
ff4f94dc5f nvme: Add a break to make error injection more efficient
Change-Id: I3bddbb1caf11e17b2ecfa446adcc221b3aed595b
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/416662
Tested-by: 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: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-25 16:00:34 +00:00
Jakub Radtke
c182da27b5 ocssd: vector commands
This patch adds support for following Open-Channel vector commands:
* Vector Chunk Reset
* Vector Chunk Write
* Vector Chunk Read
* Vector Chunk Copy

Implementation is consistent with Open-Channel specification (rev. 2.0)

This patch provides unit tests for new public NVMe
Open-Channel namespace commands.

Change-Id: Ic71be9357c61c5de82ca672e82a71aa933bd1875
Signed-off-by: Jakub Radtke <jakub.radtke@intel.com>
Reviewed-on: https://review.gerrithub.io/414969
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Young Tack Jin <youngtack.jin@circuitblvd.com>
2018-06-22 21:34:49 +00:00
Tomasz Zawadzki
160850f0a6 rpc/bdev: construct RPC return a string instead array
Construct calls that create single new bdev,
now return a string instead of array with single element.

Change-Id: Iad841b8e5eab0265693efb6be472354ea616c562
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/416081
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
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>
2018-06-22 21:12:43 +00:00
John Barnard
79cffd37ca nvmf: Add Fibre Channel defs and usage to nvme lib
Add FC definitions to nvme header and library functions.

Change-Id: I8980f55d834c1e1d4f415756cb7a46a3ff1c7db3
Signed-off-by: John Barnard <john.barnard@broadcom.com>
Reviewed-on: https://review.gerrithub.io/416434
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-06-22 21:09:09 +00:00
Changpeng Liu
c391fed3e1 nvme: add nvme error injection support
Users can set specified Admin commands or IO commands with
error status, when submitting new commands which are already
set with error status, the commands will return to the caller
with specified error code. So that users can emulate some error
status for their error condition code path.

Change-Id: I4b93c7e4f2b15a659da73b39e26bfa162eb5214e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/410870
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-06-22 17:26:34 +00:00
Vishal Verma
5b822d4c92 event: Add tsc stats to the reactor
This adds tsc statistics (busy, idle or unknown) to the reactor.
It will help measure actual time we are busy vs. idle during
an event run or whenever a poller kicks in.

Change-Id: Ife556a27a30dab842488bacb5fbee0d4297745c3
Signed-off-by: Vishal Verma <vishal4.verma@intel.com>
Reviewed-on: https://review.gerrithub.io/412695
Tested-by: 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>
2018-06-22 17:25:00 +00:00
Tomasz Zawadzki
6be654aad7 bdev: add delete_iscsi_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for iSCSI bdev.

No changes in spdkcli, since it is not implemented yet.
Tests unchanged, because test is only done by running
bdevperf and exiting. Without time to delete_iscsi_bdev.

Change-Id: I8341bfb65932a1deb1fb6463e11ef932d6f6d597
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/415678
Tested-by: 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>
2018-06-22 17:24:18 +00:00
Tomasz Zawadzki
0847ad90fd bdev: add delete_error_bdev call
Since delete_bdev should be used only for debug purpose,
this patch adds delete call specific for error injection bdev.

Changes in tests and spdkcli done accordingly.

Change-Id: I7f0be09cfed582c4d1060871e40c41eff5af7129
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/415502
Tested-by: 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>
2018-06-22 17:24:05 +00:00