Commit Graph

1627 Commits

Author SHA1 Message Date
Dariusz Stojaczyk
fb4b23b50b vhost: introduced spdk_vhost_free_reactor()
g_num_ctrlrs can now be fully encapsulated in vhost.c

Change-Id: I812c9ec0a21fec37025665104172ff5ac71ff3bc
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/361951
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-05-25 18:30:44 -04:00
Dariusz Stojaczyk
aa72cafd8b vhost: introduced spdk_vhost_dev_unregister()
Separated new function spdk_vhost_dev_unregister() out of
spdk_vhost_scsi_dev_remove().

Change-Id: Ic604f10233ca3f7998774595c10d6c120dd43e2e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/361948
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2017-05-25 18:30:44 -04:00
Dariusz Stojaczyk
2f1cfc7be0 vhost: introduced spdk_vhost_dev_backend struct
Added new struct and separated new function spdk_vhost_dev_register()
out of spdk_vhost_scsi_dev_construct().

Change-Id: I97c303e40759426fa68a097c7ba47c62fbc97bd0
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/361882
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-05-25 18:30:44 -04:00
Dariusz Stojaczyk
53a452d228 vhost: removed dpdk_vid_mapping
As a consequence MAX_VHOST_DEVICE define was removed, which was a
copy of a private DPDK define. Using it was more likely a hack.
Also renamed MAX_SCSI_CTRLRS to MAX_VHOST_DEVICES.

Instead of dpdk_vid_mapping, a new function
spdk_vhost_dev_find_by_vid is used. It simply iterates through
all the controllers.

Since this patch required to move the definition of spdk_vhost_ctrlrs
array, it has been renamed to g_spdk_vhost_devices.

Change-Id: I9b70ccb97ffaa90a22c6a1c90850b3205a9b9b27
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/361881
Tested-by: 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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2017-05-25 18:30:44 -04:00
Dariusz Stojaczyk
c6745bc2b8 vhost: generalized spdk_vhost_dev struct
Moved controller-related variables from spdk_vhost_scsi_controller to
spdk_vhost_dev. Generalized vhost to operate on non scsi-specific
controller struct.

Now spdk_vhost_scsi_dev contains direct spdk_vhost_dev field instead
of a pointer. This means there is no more allocation/deallocation
on poller start/stop.

Change-Id: I99739d58833ee023a75cb530cc80294e02f28090
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/361880
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-05-25 18:30:44 -04:00
Dariusz Stojaczyk
78360d5646 vhost: extracted alloc/free out of vhost_dev constructor/destructor
* spdk_vhost_dev_create() operates on **existing** vhost_devs, rather
than allocates and returns them.
 * spdk_vhost_dev_destruct() no longer deallocates devices

This is a preparation for making vhost_dev a direct field of
vhost_scsi_dev (no longer a pointer). That patch would be too massive
to contain this one.

Change-Id: Idec84cee22795ad88e8499eb933664c4b8c7d101
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/362187
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2017-05-25 18:30:44 -04:00
Jim Harris
e045a02ca0 blobfs: cleanup cache pool
Keep a global counter of the number of opened
blobfs instances.  Allocate the cache pool when the
first instance is opened, and free the cache pool
when the last instance closes.

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

Reviewed-on: https://review.gerrithub.io/362606
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-05-25 16:55:03 -04:00
Jim Harris
8933ba2119 bdev/error: do not submit an I/O that will be failed
If error injection is enabled and we choose an I/O to
fail, do not submit the I/O and fail it when completed -
just fail it immediately.

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

Reviewed-on: https://review.gerrithub.io/362386
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>
2017-05-25 13:53:06 -04:00
Pawel Wodkowski
5fafd5c277 env: remove element size from spdk_ring_create
It is unused an misleading.

Change-Id: Idb2e3c1b244dfb4aa99bcecee8a3dba6efbc33aa
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/362335
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: 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>
2017-05-25 13:52:49 -04:00
Pawel Wodkowski
8557b1c2c5 env: add single-producer, single-consumer ring type
This case will be used in incoming vhost patches.

Change-Id: I62d569c01e9b8bf25c9293dff827d1b4406cea04
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/362334
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
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: Ben Walker <benjamin.walker@intel.com>
2017-05-25 13:52:49 -04:00
Jim Harris
24e0f710cf bdev/nvme: only enable hotplug in primary processes
Only DPDK primary processes can initiate device probe.

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

Reviewed-on: https://review.gerrithub.io/362452
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-05-25 13:52:09 -04:00
Jim Harris
41d477cfa3 iscsi: free mempools on exit
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia3b3afc1a5331fe2b89d75eeddfd6e4430567cff

Reviewed-on: https://review.gerrithub.io/362450
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-05-25 13:52:09 -04:00
Tomasz Zawadzki
216901dbd7 vhost: close remaining memory region FDs during backend cleanup
After changes done in commit f325e71c, closing old FD is delayed until
VHOST_USER_SET_VRING_ADDR. If VM is closed before this call, original FDs
remain during vhost_backend_cleanup. This resolves issue #162.

This patch closes second set of FDs during vhost backend cleanup.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ieb9d123c987009ac451b6214bb74d2720d852781
Reviewed-on: https://review.gerrithub.io/361787
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-05-24 11:53:47 -04:00
Changpeng Liu
2e28ef9d02 scsi: fix scsi compliance issue for inquiry VPD NAA identifier
NAA locally assinged designator(3h) format was defined in SPC4,
as SPDK claimed can only support SPC3, so we used NAA IEEE
extended identifier format instead.

Change-Id: Ia4c153263c6b89ae8160488deaf16fd0e5cac8dc
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/361904
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-05-24 11:51:00 -04:00
Pawel Wodkowski
5b392ecdd1 vhost: fix deadlock on VFIO registration failure
Move mutext locking to API functions to prevent deadlock when memory
registration fail. Fixes #163.

Change-Id: I4804f671ed9d82ede87bc9439c36368b94e2d636
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/361934
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>
2017-05-24 11:49:11 -04:00
Jim Harris
2e3f07ac40 bdev: add spdk_io_channel parameter to spdk_bdev_reset
This ensures that all spdk_bdev_io structures now have
an attached channel, simplifying some future work around
things like counting the number of outstanding IOs for
a given channel (which otherwise would have had to
account specially for resets).

Reset semantics are still that they affect the entire bdev
and not just the channel it was submitted on.

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

Reviewed-on: https://review.gerrithub.io/362251
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>
2017-05-24 11:42:15 -04:00
Jim Harris
1a2cd90c98 scsi: simplify lun task mgmt path
1) Consolidate the checks for a null LUN
2) Eliminate a bunch of static functions that are no
   longer needed due to #1

This prepares for some upcoming bdev reset changes.

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

Reviewed-on: https://review.gerrithub.io/362262
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-05-24 11:42:15 -04:00
Jim Harris
fa1429ba02 bdev/nvme: clean up return codes
This prepares for translating -ENOMEM from the NVMe
driver into an associated bdev status code.

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

Reviewed-on: https://review.gerrithub.io/362234
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>
2017-05-24 11:42:15 -04:00
Daniel Verkamp
a02c0062bd nvme/host: use spec-compliant PSDT value 01b
Resolves GitHub issue #165.

Change-Id: If214bdfbe5b92faf2a6611d25e36c3c8876e3190
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/362239
Tested-by: 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>
2017-05-23 17:10:50 -04:00
Daniel Verkamp
b9bcc3531e bdev: make enum spdk_bdev_io_status private
The user should not see the bdev_io status directly; the NVMe and SCSI
error code wrappers provide the ability to translate to the desired
format regardless of what kind of error is stored inside the bdev_io.

Replace the spdk_bdev_io_completion_cb status parameter with a bool
simply indiciating whether the I/O completed successfully.

Change-Id: Iad18c2dac4374112c41b7a656154ed3ae1a68569
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/362047
Tested-by: <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-23 16:30:10 -04:00
Daniel Verkamp
54cfee2e84 iscsi: replace magic numbers with SCSI constants
Change-Id: I9b33b038a019576d162c868e2021db1c6589b4f4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/362061
Tested-by: <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-05-23 16:29:34 -04:00
GangCao
afbb5ceec2 nvme: remove NVME_IO_TRACKERS to use hardware and user specified size
Change-Id: Ie6946343314a62e4416d8cd7dadd98c20a1c1e3a
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/361700
Tested-by: <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-23 16:01:52 -04:00
Ben Walker
305cb239d2 io_channel: Remove unique flag
This is no longer used anywhere. For the places where we previously
used it, we've since found alternate solutions that do not
require it.

Change-Id: I738a80b95ef50348ce1c14969a3812b0a625b3fd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362064
Tested-by: <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-22 19:27:17 -04:00
Ben Walker
267a4e1ebd blobfs: Add separate I/O target for md
This isn't strictly necessary, but follow the
pattern for sync and I/O devices.

Change-Id: I34b1bd6f9da06008e419f55ee9810022f5fed3d5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/361674
Tested-by: <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-22 19:27:17 -04:00
Ben Walker
a3ab7610f6 blobfs: Use a separate io_device for sync channels
This allows us to no longer use the unique=true flag as well
as assign sync channels different queue depths.

Change-Id: I0b3129a3139bf39d745c2a4dc1d9f402c0a8faa8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/361673
Tested-by: <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-22 19:27:17 -04:00
Ben Walker
3b683c188e blobfs: Use a separate io_device for io channels
This allows us to have a different queue depth
on I/O channels than on metadata/sync channels

Change-Id: I30dfc95af550082efffec4b12ed6c4cd4b8c11cf
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/361672
Tested-by: <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-22 19:27:17 -04:00
Ben Walker
345f3d7ddb blobfs: No longer use unique_ctx when creating channels
This temporarily increases the size of the sync channel
to 512 (like all of the other channels). This will be
fixed in a later patch.

Change-Id: I679f1cb7c9f7afdad0acf9a3a26f9632f60cc510
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/361670
Tested-by: <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-22 19:27:17 -04:00
Ben Walker
60e8fb4979 blob: Use a separate md and I/O target
This allows us to allocate different size channels and
not require the unique flag.

Change-Id: I4b1ffd244b60e9e9ab06f9ab4da8161ab57e1169
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/361668
Tested-by: <sys_sgsw@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-22 19:27:17 -04:00
Daniel Verkamp
5f3841f0e3 nvmf: allow NQN to be 223 bytes + null terminator
An ECN to the NVMe 1.3 specification has clarified that the NQN may
contain 223 bytes before the null terminator.  Make all of our NQN
length checks consistently enforce this behavior.

Change-Id: Iebfd57d11abea64964c7a6ad9d886e40efa243c3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-18 14:36:39 -07:00
Ben Walker
4eda4fd245 Fix incorrect free in blob/blobfs
The channel memory isn't allocated by these
libraries, so they can't free it.

Change-Id: I30909fa4e77bc5a41b45230f04ba5fe75b172dbf
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-18 14:36:11 -07:00
Ben Walker
4a3182b891 blob: Add a separate config parameter for channel ops
Separate the maximum metadata operations from the
maximum channel operations.

Change-Id: I1bbd440ab094a2a2e19c9a5b71724ac91ba88e42
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-18 14:36:11 -07:00
Ben Walker
bea2e2308f blob: Remove per-channel queue size configuration
This will need to be configured globally for all channels.

Change-Id: I773252f220373617f8d09d1f24243db8095cf8a4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-18 14:36:11 -07:00
Daniel Verkamp
f66a0c9e34 scsi: pass management function as a parameter
Specify the function as a parameter to spdk_scsi_dev_queue_mgmt_task.
This makes the API clearer by making it explicit that the management
function is required for management tasks.

Change-Id: I92d893aadb6faebea81dd79729894d2c2fddf088
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-18 13:47:42 -07:00
Daniel Verkamp
1e7e6a618b scsi: automatically set spdk_scsi_task::type field
The type of a task is known due to the function used to submit it:
- spdk_scsi_dev_queue_task() for normal SCSI command tasks
- spdk_scsi_dev_queue_mgmt_task() for management tasks

Change-Id: I183a1f89ab85f3fce1de2491e77d95d4b147fd72
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-18 13:47:42 -07:00
Daniel Verkamp
de5ffac4ec scsi: factor out read/write LBA range check
The SCSI read and write functions use the same LBA range check, so move
it up to spdk_bdev_scsi_readwrite().

spdk_bdev_scsi_read() previously passed task->transfer_len / blen rather
than xfer_len to the LBA range checking function, but this should
actually be using the transfer length field from the CDB (which is the
xfer_len parameter).

Change-Id: I8285abf936a18a0baf7cc25709945637e4e6b87d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-18 13:47:42 -07:00
Jim Harris
af781ee003 bdev/nvme: print errno on spdk_nvme_ns_cmd submission failure
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I785bfd663a2921f5e4c0630bce7906a928f26376
2017-05-18 10:23:43 -07:00
Cunyin Chang
32b4ab71a2 bdev/error: Add new bdev/error to inject errors in bdev layer.
Change-Id: I3c68cb5911b3662dbb35f551dc291d5ebdd84bf6
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-05-18 07:56:14 -07:00
Dariusz Stojaczyk
679e2831bd vhost: added rpc commands to remove vhost controllers and devices
Added new rpc commands together with underlying vhost API and tests.

Change-Id: Ib9c6a530d0909193ea5115aaac4920c44f39613c
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-05-18 01:01:46 -07:00
Pawel Wodkowski
82d26c4f20 vhost: track VFIO mappings
If more than one controller is added to guest the same memory table is
set multiple times making VFIO registration/unregistration failures

Change-Id: Ib55c38e292495e549c070beb0234e73f269e63d5
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-05-18 00:47:55 -07:00
Dariusz Stojaczyk
709d5453a3 vhost: obey VIRTIO_F_NOTIFY_ON_EMPTY
It'll trigger interrupts even if VRING_AVAIL_F_NO_INTERRUPT is present.
Also delegate notifying check to separate function vq_should_notify. It
will be expanded even more once we implement VIRTIO_RING_F_EVENT_IDX
support.

Change-Id: Ic41fd18c9c005c6266b109b0eda4a6dfaef5f06a
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-05-17 10:24:48 -07:00
Dariusz Stojaczyk
7463bf6d2a vhost: add negotiated_features field in spdk_vhost_dev
Added new struct field and an rte_vhost_get_negotiated_features() call.

Change-Id: I5937026720b5341c7377c27fee682996b51e836e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-05-17 10:24:48 -07:00
Daniel Verkamp
a591161cb2 bdev: make struct spdk_bdev contents private
Change-Id: If203e82f8cd10d5998a565ad490ef11e2916687f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-17 09:45:42 -07:00
Daniel Verkamp
9d1e05d2f2 bdev: add getter for write cache enable status
Change-Id: I93656deda8956c77e9565ee1f271795642e62ac9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-17 09:45:42 -07:00
Daniel Verkamp
0d56499d3a scsi_bdev: use max unmap descriptor getter
Change-Id: Id67b158c36b2b879849b18909bc9bb9a5273f8c7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-17 09:45:42 -07:00
Daniel Verkamp
76e67baf28 blob_bdev: use bdev block size getter
Change-Id: Id22f904fdb71798ef2369415d38f468b06d7ac07
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-17 09:45:42 -07:00
Daniel Verkamp
133dc1e6ae iscsi: clean up iSCSI/SCSI task conversions
Add a helper function to find the iSCSI task given its nested SCSI task
structure, and use it to remove all casting between spdk_scsi_task and
spdk_iscsi_task.

Change-Id: Idc7c6d0a3b4d53041916d25a1bdecedfb56b94f9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-16 16:45:22 -07:00
GangCao
b347d551e8 nvme: detach the pci device with calling process's own devhandle
Change-Id: I2693b4bd29e0500379d5e399723aec7e44bffca3
Signed-off-by: GangCao <gang.cao@intel.com>
2017-05-16 10:35:29 -07:00
Ziye Yang
644678258f blobfs: move the location of next buffer check.
This patch address the issue:
https://github.com/spdk/spdk/issues/151.

For cache_append_no_cache in cache_ut testcase,
there is resource contention for buffer among two
threads in the following two functions.
Thread 0: cache_free_buffers
Thread1: __file_flush_done

When the thread1 execuctes __file_flush_done,
it calls the call back: __sem_post defined in
following statement in spdk_file_sync

_file_sync(file, channel, __sem_post, &channel->sem);

Thus Thread 0 will execute next function
cache_buffers, and it frees the buffer.

Then Thread 1 continues executing the remaining statements
in __file_flush_done with the assert function, and touches
the space already freed.

So it will be safe to move ahead the next buffer check.

Change-Id: Ic007b3481f4e3a17d47eeca5c9c802001949a5ab
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-05-16 10:51:26 +08:00
Jim Harris
4eafea0360 bdev: add a null bdev module
Also change the discovery/nvmf.sh test to use it.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I56bce9a84bd46f13b6d4f34da81abf23413f2598
2017-05-15 14:00:37 -07:00
Daniel Verkamp
7455910d1b scsi_bdev: simplify scsi_readwrite helper function
Factor out the common data direction Check Condition logic from read
and write.

Change-Id: Ia2fbd5f69eefd826ebb5ab2a8e99aeb380f1b7ea
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-15 13:35:18 -07:00
Daniel Verkamp
8e379851ab scsi_bdev: clarify block count variable names
What was previously called "maxlba" was actually the block count
of the device, which is the maximum LBA plus one.

Change-Id: I5e141a3eb0c79b2aa70006739c5586cb50744d3d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-15 13:35:18 -07:00
Daniel Verkamp
19a9871495 scsi: remove spdk_scsi_task::owner_task_ctr
The SCSI library already provides a callback when the task is released
(free_fn), so the user can update their own task counter.

Change-Id: I7fb13f6fff66dbba2315fd03fb06e49f793be123
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-15 10:12:42 -07:00
Daniel Verkamp
7145cf62c6 scsi: set free_fn in spdk_scsi_task_construct()
The task free callback function is required, so make its assignment part
of task construction.

Change-Id: I2f5fdf73b064653ee85b4e7961cb1653a0a4107d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-15 10:12:42 -07:00
Daniel Verkamp
1aea6c5b6f bdev: add getter for maximum unmap descriptors
Change-Id: Ifbdd29e2081600bf0d860582d80696546107cf1b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-15 10:11:23 -07:00
wenzhong wu
8651c2eb47 nvmf: call function spdk_nvmf_valid_nqn to check the host_nqn.
Change-Id: I035fe2538b46d0a19eb00fd829fae9e735c1ded9
Signed-off-by: wenzhong wu <wenzhongx.wu@intel.com>
2017-05-16 03:19:54 +08:00
Daniel Verkamp
326786a943 bdev: add getters for block size and block count
Change-Id: I6fad28da43c163ea4e2c4a04ced356b67d63652f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-12 10:34:58 -07:00
Daniel Verkamp
1bcf22cde1 bdev: add getters for bdev name and product name
Change-Id: I6a75fada94fa845ecedd4cd8afc78f4259df14fe
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-12 09:36:30 -07:00
Dariusz Stojaczyk
6973898164 vhost: wrap vhost_user_read_cb with vhost_user mutex
This fixes spontaneous vhost hangs on SIGINT shutdown.
Apperently during vhost_destroy_device(conn->vid) from
line #284 another QEMU message might arrive, causing
vsocket->conn_mutex deadlock. (line #286)

Change-Id: I4f1c31a52facffd1eb1e1192591095f00da55031
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-05-12 08:05:37 -07:00
Pawel Wodkowski
66894635fa vhost: obey VRING_AVAIL_F_NO_INTERRUPT
If VRING_AVAIL_F_NO_INTERRUPT flag for queue is negotiated, guest can
set this flag in avail ring to suppress interrupts from host.

Change-Id: I2043067de33da009a974be5915ae81b1343fc424
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-05-12 07:53:59 -07:00
Paul Luse
bf31637789 nvme: add timeout value to multi-process driver init
Unit tests will be added as part of a separate patch updating all UT for
nvme.c.  Global used for timeout value so it can be easily overwritten
by the upcoming unit tests for this function.

Change-Id: I7fc15aab91601ac57c94cae266b212c0998d2495
Signed-off-by: paul luse <paul.e.luse@intel.com>
2017-05-12 07:53:48 -07:00
Changpeng Liu
c7f6f553b9 env/dpdk: use the new *rte_pci* API for DPDK 17.05
Change-Id: I1091a9556bbd42349dd8d26f238a54a5b55610a1
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-05-12 07:53:42 -07:00
Changpeng Liu
6c0d4c552b env/dpdk: return value changed of API rte_ring_mp_enqueue_bulk for DPDK 17.05
Change-Id: I44f1c1fc75fd343d30c602ca77940ebde3ed184a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-05-11 12:45:31 -07:00
Ben Walker
58afa58a00 bdev: Simplify spdk_bdev_get_io_buf
This was implemented as two functions, but it
is much simpler as one. Also, the public function
was way at the bottom of the file instead of near
spdk_bdev_put_io_buf.

Change-Id: I3a90688910b0542cc77b6333bab15132cf514eeb
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-11 10:48:58 -07:00
Ben Walker
812ffaf1a3 bdev: Simplify spdk_bdev_finish
This was implemented as 3 separate functions but
it is simpler as 1.

Also, this wasn't previously freeing the buffer pools.

Change-Id: Ic1b2b3a0596e745a223099cb2a79bea6ef5c69cc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-11 10:48:58 -07:00
Ben Walker
f2132bfd8a bdev: Simplify spdk_bdev_initialize
This was broken into three functions, but it is
a lot simpler as one.

Change-Id: If58ad50fe7d4f65c598b62f24e9e1ce7a64fdd8e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-11 10:48:58 -07:00
Ben Walker
ba17fd1bf2 bdev: Move all globals into a single struct
This is better organizationally, but also will serve as
an io_device in the future.

Change-Id: I6d65cf39df59e874d13f5fccc5a489720e86c48f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-11 10:48:58 -07:00
Xiaofan Yang
d8369fee70 iscsi/conn: Fix the bug when iterates the read command subtasks.
Change-Id: Ib11e804977b6057bcb9cc6d3a2d21ec43b45a99a
Signed-off-by: Xiaofan Yang <xiaofanx.yang@intel.com>
2017-05-11 08:09:23 +08:00
Daniel Verkamp
6a8cd333a9 bdev: add API function to get buffer alignment
Change-Id: I4c7eff4c903411994fc6bb9fae98f967eb14669c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-10 13:16:27 -07:00
Ben Walker
68be2e2842 bdev: Fix formatting issues
Return types should be on a separate line for definitions.

Change-Id: Iaa38dd00042359fc6640fc67053bd69ebbb7af03
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-10 13:12:18 -07:00
Ben Walker
58734f5222 bdev: Generalize buffer allocation
Make the buffer allocation work for all types of
commands, not just read.

Change-Id: I72d8f67a724566630e7c4a74759fcb08449f7de4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-10 13:12:18 -07:00
Changpeng Liu
6de5c05556 scsi/bdev: fix wrong condition check for inquiry VPD page
Change-Id: I435825dbd6a7f990d702db9e0965a489f452cdc3
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-05-11 15:01:03 +08:00
Ben Walker
42491fb8fc env: Add wrappers for a lockless ring
Change-Id: I9679e4bcfc10e38672d1851f7e9f16b6adf7de9b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-09 14:02:15 -07:00
Ben Walker
1ad673a9dd copy: Replace rte_memcpy with regular memcpy
Eliminate rte_memcpy dependency by replacing it with
regular memcpy. This may impact performance, but the only
use of rte_memcpy was in the malloc bdev which is for
testing only.

Change-Id: I3e8592cb08262272518ec3d29ea165b4e8f48a5c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-09 13:11:39 -07:00
Ed Rodriguez
2d2fde0d7f log: Use SPDK_ERRLOG in lieu of fprintf(stderr
Change-Id: Ic87d62516324b9c388a932b268714255b15a9a57
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-09 11:28:28 -07:00
John Meneghini
70f8a8e2f4 bdev: Use env mempool wrappers
Change-Id: I22f4f7894462c576c447346684a780bbc34f7ba3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-09 11:26:34 -07:00
Daniel Verkamp
22b6098965 bdev: remove spdk_bdev thin_provisioning flag
Blockdevs already indicate support for unmap via
spdk_bdev_io_type_supported(bdev, SPDK_BDEV_IO_TYPE_UNMAP).

Change-Id: I634f27a281fd900bb3a6da2e4ff8a74e43579578
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-09 08:42:10 -07:00
Ziye Yang
4c9645b555 blobstore: Add the size check of length field in desc_xattr
Change-Id: I522b29b3a603b1e83c866486d036137ee4fafcbd
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-05-09 08:41:53 -07:00
Ben Walker
9ed75e4dab bdev: Rename rbuf to just buf
We plan to use these buffers for more than just reads.

Change-Id: I8fa6cb432a6cfe4406fbf240cd3aa2ae4ab5f3d5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-09 08:14:31 -07:00
Ben Walker
ed159eae1b bdev: Eliminate spdk_bdev_io::ctx
The user can get there via the bdev, so this didn't
have a purpose.

Change-Id: I7f85bb71d5ee238d37ba3624d0ac68a161c95e49
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-09 08:14:31 -07:00
Ben Walker
3415ce1227 bdev: Pass correct channel to bdev modules
Change-Id: I38911e70303f66f479c1495d4dbe02b2205cab8a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-09 08:14:31 -07:00
Daniel Verkamp
6d3a4cd2a4 vhost: define VIRTIO_F_VERSION_1 if it is missing
Older kernel headers don't have the definition of this macro, so define
it if necessary.

This is the same workaround as used in rte_vhost/vhost.h.

Change-Id: I01e0661db05de517adf8e24a47c63d32853cd385
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-08 20:12:19 -07:00
Pawel Wodkowski
8d7acdaaef vhost: upgrade SPDK vhost code to DPDK 17.05
Also replace the internal DPDK v17.02-based rte_vhost
library with the patched DPDK v17.05-based version.

Change-Id: Ibec0b0746592a1a3911c31642a945ab65495e33e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-05-08 17:04:29 -07:00
Pawel Wodkowski
d391647bd0 vhost/rte_vhost: fix scan build and comment formatting issues
vhost_net.c file is not needed and fail scan build so remove it.

Change-Id: I5817201373f7253cc8bc1a9bdc5884197e166a14
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-05-08 17:04:29 -07:00
Daniel Verkamp
c2683a8e42 vhost_scsi: access VhostUsrMsg via packed struct
Fixes unaligned access to fields.

Change-Id: I43cff0c1cca7829da8f0d90774970e5feaa95515
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-05-08 17:04:29 -07:00
Dariusz Stojaczyk
0cf6cc7b54 vhost: free virtio_net::guest_pages in vhost_backend_cleanup()
guest_pages is being allocated in vhost_setup_mem_table(), reallocated
in add_one_guest_page(), but never freed. This patch fixes a memory
leak.

Change-Id: Ie381c43bafea5cdea2ac9f057c0282044a340dce
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-05-08 17:04:29 -07:00
Dariusz Stojaczyk
13657c7d75 vhost: fix malloc in rte_vhost_get_mem_table
Amount of allocated memory was too small, causing buffer overflow.

Change-Id: Ib43e0a9040f594fed0a8c5660a45aeb07e4400c7
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-05-08 17:04:29 -07:00
Dariusz Stojaczyk
2542779301 vhost: close callfd on VHOST_USER_GET_VRING_BASE message
This prevents from destroying & recreating user device in "incomplete"
vring state. virtio_is_ready() was returning true for devices with
vrings which did not have valid callfd (their VHOST_USER_SET_VRING_CALL
hasn't arrived yet)

Change-Id: Idc4b41efd544ff5c6b093a5a48798b41c55bbe06
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-05-08 17:04:29 -07:00
Dariusz Stojaczyk
52b10970c4 vhost: added API for getting/setting last descriptor indices of vrings
vhost-net devices might keep track of last descriptors indices by
themselves, and assuming they initially start at 0, but that is not the
case for vhost-scsi. Initial last descriptor indices are set via
VHOST_USER_SET_VRING_BASE message, and we cannot possibly predict what
will they be. Setting these to vqueue->used->idx is also not an option,
because there might be some yet unprocessed requests between these and
the actual last_idx. This patch adds API for getting/setting last
descriptor indices of vrings, so that they can be synchronized between
user-device and rte_vhost.

The last_idx flow could be as following:
 * vhost start
 * received SET_VRING_BASE msg, last_idx is set on rte_vhost side
 * created user-device, last_idx pulled from rte_vhost
 * requests are being processed by user-device, last_idx changes
 * destroyed user-device, last_idx pushed to rte_vhost
 * *at this point, vrings could be recreated and another SET_VRING_BASE
 message could arrive, so last_idx would be set*
 * recreated user-device, last_idx pulled from rte_vhost

Change-Id: I247ba4e461a2a2b524ccade364f5b7bf260f7538
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-05-08 17:04:29 -07:00
Dariusz Stojaczyk
8457b98cf2 vhost: defer setting up new mem table
There is an issue when QEMU sets new memory table just after guest OS
starts booting. Then, if guest OS tries to issue any I/O to device (e.g.
using BIOS INT13h - EDD) it will get stuck because previous addresses of
mmaped memory might change.

To fix this issue, defer using the new mem table until after we receive
the first SET_VRING_ADDR message. SET_VRING_ADDR will be sent by QEMU
when guest OS virtio (e.g. virtio-scsi) driver starts initialization.
At this point it is safe to invalidate the old mem tables because there
will be no more outstanding IO at this point.

Change-Id: I24772be87a8b6c8781868b9b7773317761499748
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-05-08 17:04:29 -07:00
Dariusz Stojaczyk
fab374a7c6 vhost: destroy vhost device before updating public vring data
For now DPDK assumes that callfd, kickfd and last_idx are being set just
once during vring initialization and device cannot be running while DPDK
receives SET_VRING_KICK, SET_VRING_CALL and SET_VRING_BASE messages.
However, that assumption is wrong. For Vhost SCSI messages might arrive
at any point of time, possibly multiple times, one after another.

QEMU issues SET_VRING_CALL once during device initialization, then again
during device start. The second message will close previous callfd,
which is still being used by the user-implementation of vhost device.
This results in writing to invalid (closed) callfd.

This patch destroys vhost device before setting callfd, kickfd and last
vring indices. It will be recreated right after (with updated vring
data).

Change-Id: I293bd91106f53f6c2f65d8b8a41f47ae7548cddc
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-05-08 17:04:29 -07:00
Jim Harris
a191eedb19 vhost: import copy of dpdk rte_vhost v17.05
This will be decoupled from the build to start.  Next
patches will modify this code to prepare it for use with
SPDK vhost-scsi.  The final patch will replace the existing
v17.02-based code with this version, and make the necessary
SPDK vhost changes to use it.

This enables to better track the differences between upstream
DPDK and our internal copy, while not breaking the build at
any point in the git history.

While here, expand the POSIX include file check to exclude
any directory starting with lib/vhost/rte_vhost (which would
include this new directory).

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icf1202c1b7a898edff12aa226943a08b578cf962
2017-05-08 14:39:55 -07:00
Ben Walker
1b2764421c build: Automatically detect use of POSIX includes
Scan the source for POSIX includes outside of the
allowed locations in check_format.sh. This only
tests for POSIX headers - not Linux Standards Base.

Also, fix one bug that was caught by this addition.

Change-Id: Ib0ca93fe6ac552dc49d95b27b4803e40282027e8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-08 13:20:37 -07:00
Ben Walker
b961d9cc12 include: Move the remainder of the code base to stdinc.h
Change-Id: I6a142feeaad3117bd3c75e7c5cb7231a1cfa78ae
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-08 13:20:36 -07:00
Ben Walker
ba1e1d5308 vhost: Rename LOG_DEBUG to VHOST_LOG_DEBUG
LOG_DEBUG is a symbol defined by POSIX, so if sys/log.h
is included the symbols conflict.

We'll need to push this patch to upstream DPDK too.

Change-Id: Ib263731864aca4791226ea6e3abb5ddfe42e97d8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-08 13:19:20 -07:00
Dariusz Stojaczyk
328bc32f31 env/dpdk: allow compiling with DPDK 17.05-rc0 and rc1
FOREACH_DEVICE_ON_PCIBUS macro has been defined since rc2.

Change-Id: Iad61401520735dfde4e5715c32e74a54a2dff7da
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-05-08 13:01:53 -07:00
Vishal Verma
578c0d550d env: Adding socket variants for malloc and zmalloc
Signed-off-by: Vishal Verma <vishal4.verma@intel.com>
Change-Id: I2399842cf7bb80aefb6c511e167157502ba9018a
2017-05-08 09:41:47 -07:00
Ziye Yang
e48e569d83 nvmf/rdma: Replace the queue empty check
Replace with it with check the returned req
via spdk_unlikely macro

Change-Id: I1202b3955af9a68496d8ced7cf66c20cf26f7fff
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-05-08 09:40:15 -07:00
Daniel Verkamp
730a63d02b scsi: remove unreachable read iovec copy path
The SCSI layer always passes task->iovs to spdk_bdev_readv(), so there
is no way for task->iovs != bdev_io->u.read.iovs to be true.

Change-Id: I4c0a2075c6e50e4304d62707a29bededa37b4e5c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-05 09:39:49 -07:00
Daniel Verkamp
15fcb1020c bdev: make struct spdk_bdev_io contents private
Change-Id: I24ff52a7375d54df06b9769bc53ddf84691e1cb1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-05 09:39:49 -07:00
Daniel Verkamp
825379870b bdev: add accessor function to get an I/O's iovec
Change-Id: I09321abe93303d6225fbcce4065b0024dd541b19
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-05 09:39:49 -07:00
Daniel Verkamp
91b13bd105 scsi: don't change bdev_io status in spdk_scsi_task_put()
The SCSI task bdev I/O should never be pending when spdk_scsi_task_put()
is called, and just setting the status to failed is not correct (when
the bdev eventually completes the I/O, it will write into the now-freed
bdev_io, which may be reused by someone else).

Change-Id: Iaad6ce9ab41539652abc40147fed47c5012109dc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-04 14:59:12 -07:00
Changpeng Liu
fa511620c4 vhost: eliminate loop log print when no available requests
Change-Id: I3cd72317392b15bad888391b7bc7e1bc5e69385c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-05-04 13:21:27 -07:00
Daniel Verkamp
2621c7bdc4 scsi: move bytes_completed to iSCSI task
Change-Id: Iff345f555f94a34fa4a6f86bc11efea704e39735
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-04 10:10:47 -07:00
Daniel Verkamp
7e7ed7ec10 scsi: move data_out_cnt to iSCSI task
Change-Id: I550de37d5088e2273b9d53ab8a2d6134c486fba0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-04 10:10:47 -07:00
Daniel Verkamp
d4da788057 scsi: move desired_data_transfer_length to iSCSI task
Change-Id: I425f9cc7c572b4d819d0aae370f7a96c57d6eac1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-04 10:10:47 -07:00
Daniel Verkamp
414b754579 scsi: remove SCSI task id and add iSCSI task tag
The SCSI layer was not using the task ID for anything; the iSCSI layer
was using it to store the task tag, so move it there and rename it to
"tag" to make its purpose clear.

Change-Id: Ibda4f4e215056116b9be4a3a0264f98bc4c29535
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-04 10:10:47 -07:00
Daniel Verkamp
4ccf74ab3b scsi: move subtask_list to spdk_iscsi_task
The SCSI layer doesn't use subtasks; these are an iSCSI layer concept.

Change-Id: I83871f02362f10fd4ecd4b2a1544eb76bfa53595
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-04 10:10:47 -07:00
Daniel Verkamp
7fb6b33488 bdev: convert set_scsi_status into a bdev_io completion function
In the pattern set by spdk_bdev_io_complete_nvme_status(), allow
blockdev modules to complete a bdev_io with a SCSI status code.

Also move it to the internal bdev header file, since only bdev modules
should be setting bdev_io status codes.

Change-Id: I8b6afad2c02d7c010c5e60f06a7c7e0785eb87ca
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-04 09:11:42 -07:00
Daniel Verkamp
dc9e11163e bdev: add API to translate to SCSI status
Move the scsi_nvme translation code from the SCSI library into bdev, and
provide a generic way to translate any bdev_io status into a SCSI
status.

Change-Id: Ib61a6209387c24543e31574e2b5ca249e2ac8b74
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-04 09:11:42 -07:00
Changpeng Liu
95d9ffc26a vhost/lib: remove dependency on DPDK vhost library
Since we keep a copy of DPDK vhost library, the header file don't
have dependency on DPDK vhost library.

Change-Id: I14d48e10227633547231e4f429e7375ffa76128d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-05-04 09:11:31 -07:00
Ziye Yang
08e6f94226 blobfs: separate cache tree related definitions into tree.h
The code will locks clear to put those definitions into tree.h header

Change-Id: Ib1a34f19d9849acd7ea979eb0a6e153b0e8e39de
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-05-04 09:11:28 -07:00
Daniel Verkamp
2990f869a1 scsi: make spdk_scsi_port definition private
Change-Id: Ib2c17a4dd4ce680161be92f76b831df792f9ff4d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-04 09:05:53 -07:00
Changpeng Liu
2eb9a35323 env/dpdk: remove rte_eal_device_remove API call since DPDK 17.05
Since DPDK 17.05 API rte_eal_device_insert is only used for
virtual device scan and initialization, for PCI devices
which use Domain:Bus:Dev:Function, this API is no longer
valid.

Change-Id: I1ab63dfc3af188d01836e67cd8db745e035fc450
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-05-05 09:40:31 +08:00
Ben Walker
3d62b39b0d bdev: The bdev layer now generically creates io_channels
These channels can handle generic bdev context.

Change-Id: I61f41884ddf4cf86fa156e9051421b354bbb349d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-03 15:16:02 -07:00
Jim Harris
5343c22f8d iscsi: do not free io channel refs if login failed
When destroying a connection, we need to check if we got to
full feature phase before freeing any io channels.  This is because
the io channels are only allocated as part of a successful login.

The Calsoft iSCSI test suite has tests which will fail login.
Since the test system was just using a malloc backend with memcpy,
so even though a channel was NULL in some cases, it was never used
since the memcpy engine doesn't need it.

This prepares for some future patches which extend the use
of io channels in the bdev layer.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2fb7b18a781caa0aadca319aa1e61a6ccf2c55fd
2017-05-03 14:44:39 -07:00
Daniel Verkamp
a3738d9031 scsi: make spdk_scsi_dev definition private
Change-Id: I62b36a22e11e845045f190886ae00aa644f96ec6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-03 12:34:57 -07:00
Daniel Verkamp
46af047ae7 json/util: simplify if (p) free(p) -> free(p)
Change-Id: I874b9893afcf2bdf333b14557feedcacad47d355
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-03 10:57:51 -07:00
Changpeng Liu
e9bfc11043 env/dpdk: additional library required for DPDK 17.05 ring based mempool
Change-Id: I2ef4a330a5628c84657f516cb2e4fad609b6c6d8
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-05-02 15:18:15 -07:00
Daniel Verkamp
fa81bdb3fe iscsi: drop redundant parentheses in rsph casts
This allows astyle to format the cast of address-of operations
correctly.

Change-Id: I9c8a4545c44601e769acc712ec7acf3a96f45ebb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-02 15:15:39 -07:00
Daniel Verkamp
cce22074a7 iscsi: fix ISID interpretation in login requests
The ISID field is a 6-byte field in network (big-endian) byte order.

The previous code was casting the uint8_t isid[6] value into uint64_t,
which was actually casting the address of the first byte of isid (not
the contents of the array), and it was also not correctly converting
byte order.

Change-Id: Idd114e06d30040cf28931d7da7ffdc8d6c45e82a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-02 15:15:39 -07:00
Liang Yan
b0091cfe5c bdev/nvme: Increase maximum controllers to 1024
Change-Id: I5a7a5f40b0d3c8c21e26f5358bc84f538a62bff4
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
2017-05-02 13:51:39 -07:00
Daniel Verkamp
6b4da26449 bdev/nvme: dynamically allocate probe_ctx
Avoid allocating a large amount of stack space when increasing
NVME_MAX_CONTROLLERS.

Change-Id: I7017e5ed9f4d4f5c860dac608c3e5ae3c35864e7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-02 13:51:39 -07:00
Daniel Verkamp
d0290b6525 scsi_internal.h: remove duplicated min/max macros
Use the ones from spdk/util.h instead.

Change-Id: Icd8416d1b3cb0cde35ac46ea8b1ba7a1ea8994c6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-02 09:41:43 -07:00
Daniel Verkamp
12965bb6ce scsi: make spdk_scsi_lun definition private
The contents of struct spdk_scsi_lun don't need to be part of the public
API.

Change-Id: I101b77871054557380610fd901ab38bada463202
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-02 09:41:43 -07:00
Jim Harris
13f8cf1536 nvme: add NVME_QUIRK_DELAY_AFTER_QUEUE_ALLOC
The VirtualBox emulated NVMe device will intermittently
hang on the first read/write command after an I/O
qpair has been allocated.  The frequency of the hang
diminishes if a delay is added after allocating the I/O
qpair - until it disappears completely with a 100us delay.
So add a quirk to insert this delay.

Note - the 100us delay was tested by running
the hello_world example app 50000 times.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I237e31b1b8a1a1e28262851ae0a21cd7345f0f1a
2017-05-01 10:22:18 -07:00
Changpeng Liu
80e4f5ae8b env/dpdk: make SPDK can compile with DPDK 17.05
Change-Id: Id69a162b6f2abfdcd4d41b368cfcde52665eb904
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-04-28 09:22:09 -07:00
Pawel Wodkowski
1bc2c5ab57 rpc: add bool-type decoder
Allow passing booleans in JSON.

Change-Id: I0b8f6c1579d8382b5b19a987ef5d913b4423c954
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-04-26 21:52:11 -07:00
Daniel Verkamp
50cc397d6f nvme: simplify nvme_ctrlr_destruct qpair loop
Fixes a scan-build warning about using qpairs after they have been
freed.

Change-Id: I263eabd6b784acf540c66136965f7705ef110a78
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-26 06:40:17 -07:00
Daniel Verkamp
5639b965ac scripts/check_format.sh: catch misaligned comments
Fix up the existing comment blocks misaligned in the first column.

Also add line numbers to the comment checks.

Change-Id: I9d28c365271df36e7013d74cbb02d0023ab4f581
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-26 06:39:58 -07:00
Tomasz Zawadzki
9879b50769 scsi: fix page control page field in MODE SENSE
This patch assigns correct value to page control.
Now that page control value is correctly taken from CDB,
error via sense data is reported when processing "saved values".
"Changeable values" are not supported, so all parameters
are reported as not changeable when requested.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I41378c96b1e8c716b5d0ce4b72777065fb122228
2017-04-24 15:26:39 -07:00
Cunyin Chang
bee8c04a4b nvmf: Move the check of NVMe remove from session layer to subsystem layer.
Change-Id: Icf2f7122c9af0cd6420384c93813d2e79ed9c69e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-04-24 13:57:25 -07:00
Jim Harris
95487138e3 event: add spdk_trace instructions if event group mask specified
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I022bdccf502c6e63e6e8f5a80c5b5ec493262db9
2017-04-24 13:57:06 -07:00
Daniel Verkamp
6b91943209 scripts/check_format.sh: check spaces in comments
Fix up all existing spacing errors in comments and add an automated
check for patterns like /*comment*/.

Change-Id: I28f61c93612dc0f8aed66bd509da78e91ea9737e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-24 13:37:41 -07:00
Pawel Wodkowski
9aaccfe3d7 vhost: enable VFIO
Vhost needs to register memory given by guest in VFIO container to be
able to do any DMA using this memory.

Currently DPDK doesn't provide any interface to handle guest memory, so
for now lets find container fd in /proc/self/fd/ directory and provide
some VFIO internal API that finally should extend DPDK API.

Change-Id: Iee9d496367ccd61219068fc0eadc17e786ff0731
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-04-24 12:20:04 -07:00
Ziye Yang
e15bd00711 nvme: support new format in spdk_pci_addr_parse
The new format is: domain.bus.device.function

For this format, since we use '.' as separator,
to avoid misusing, we only support the following:

1 domain.bus.device.function ( 4 values provided)
2 bus.device.function  (3 values provoided with domain = 0)
3 bus.device  (2 values provided with domain = 0, function = 0)

Change-Id: Ide03db38b4ac7802cf36f0e536e8b997101d6cd3
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-04-21 09:38:45 -07:00
Ziye Yang
e02d0bbd5f nvme: add the '=' separator support in spdk_nvme_transport_id_parse
Thus, we can support both ':' and '='.

Change-Id: I4400ba770912a2b20e49432c2e6e2a1bd45c28ed
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-04-21 09:38:45 -07:00
Dariusz Stojaczyk
154323ab51 scsi: Include null terminator in Unit Serial Number VPD Page
According to the scsi standard, all ASCII data fields "may be
terminated with one or more ASCII null (00h) characters"
[7.6.10, 4.4.1]. Windows SCSI Compliance tests expect a null terminator
there, so let's include it.

Change-Id: I18fa35295233a163cea711a5c4ff8e3d3e80c4f1
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-04-21 08:12:04 -07:00
Piotr Pelplinski
c2c995c5b0 vhost: make SPDK compile with dpdk-17.05 with vhost patches
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Change-Id: Iff659bb3df9df92c4b6aa9aeaef7244bdf5b3211
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-04-19 20:46:36 +02:00
Jim Harris
b5b9410da3 nvme: remove DELAY_BEFORE_ENABLE quirk and always wait 100us
A 100us is so small that applying the quirk to the specific
SSDs that require the delay is more trouble than it is worth.
So remove the quirk and always wait 100us before re-enabling
the NVMe SSD during initialization.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id6a8cc6e35d103fffdf135580301fc3e5b27e722
2017-04-17 11:56:36 -07:00
Jim Harris
fd5d6901f2 nvme: use spdk_likely/unlikely macros in I/O path
Also avoid an spdk_get_ticks() call in the default
case where a timeout_cb_fn is not defined.

On my Intel(R) Xeon(R) E5-2699 v3 system with an
Intel(R) P3700 SSD, these modifications reduce software
overhead per I/O by 3-5% (as measured by the SPDK
overhead tool).

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5bb5a87747b15d9e27655fabcd2bc1a40b0b990e
2017-04-17 11:56:36 -07:00
Daniel Verkamp
5742e9b9e7 nvme: allocate requests on a per-queue basis
Change-Id: I7bec816e518a0a6f2e9fb719128c83d4b908d46c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-12 21:05:24 -07:00
Daniel Verkamp
cd13f280f4 nvme: track qpair within nvme_request
Change-Id: Ia40a1e79db6327c4693731e9bb7a57810795429d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-12 21:05:23 -07:00
Ben Walker
15f910ece7 bdev/nvme: Improve names of fields in config file
Remove the "Nvme" from several field names. The parser
will still accept the old name for backward compatibility.

Change-Id: I6fa86ec359b23fb63960d0aa479a845b36a0977a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-12 13:11:01 -07:00
Ben Walker
acd0b4573d bdev/nvme: Allow the user to control the I/O timeout behavior
The user can now not only specify an optional timeout for
commands, but also the action to take when a timeout is
detected.

Change-Id: I7d7cdd846d580e0b3a5f733d398ee9b19d6fe034
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-12 13:11:01 -07:00
Ben Walker
193f4f8392 nvme: Queue aborts beyond the abort command limit
Queue aborts that would exceed the abort command limit
in software as a convenience for the user.

Change-Id: I8c1f0380984cc6c0cdb453db961939a7f571b336
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-12 13:11:01 -07:00
Ben Walker
ee460db71f nvme: Don't pass admin qpair through timeout callback
Instead, pass NULL when an ADMIN command times out.
We don't expose the admin queue to the user.

Change-Id: If0768d329a689f6f7c3734c9d419e680d7378ed1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-12 13:11:01 -07:00
Ben Walker
b9feeb03c1 nvme: Call the timeout callback only a single time
For each command that times out, call the timeout
callback one time if the user registered one.

Change-Id: Iaad39a886468e89bef63fe292c5cad1dce97a57c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-12 13:11:01 -07:00
Ben Walker
c97ea5ad8d bdev: Modules no longer register bdevs as io_devices
Instead, they register some internal structure of
their choosing.

Change-Id: Id1f8c563d0a2c6f1066d741f86b8aa6fe09b6319
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-07 11:19:36 -07:00
Ben Walker
9d73eed8a6 bdev: Consistently pass user context to fn_table calls
Some calls were passing bdev->ctxt, some calls just
bdev. In most of our implementations those are the
same pointer, but they aren't necessarily.

Change-Id: If2d19f9eef059aded10a917ffb270c1dc4a8dc41
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-07 08:14:34 -07:00
Ben Walker
7f7c03a935 env: Remove all use of RTE_LCORE_FOREACH
Replace with an env abstraction.

Change-Id: I706374d265a270890e1f3ca920a10a0dc09624b0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-05 11:16:37 -07:00
Ben Walker
c80454a283 event: Eliminate reactor mask
The DPDK mask and the reactor mask are always the same.

Change-Id: I83d3ab87cdfb405574f6472cfc222d3f311abdb1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-05 11:16:29 -07:00
Ben Walker
16ae587966 env: Move lcore functions into env layer.
They were previously in the event library.

Change-Id: I24ffd8f771e895ccf5395c8120423cd114893139
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-04 09:19:01 -07:00
Dariusz Stojaczyk
86840974dc iscsi: dont create portal group from partially invalid portal list
Changed spdk_iscsi_portal_grp_create_from_portal_list so that it fails
if any given portal is invalid.

Change-Id: I708621a538a52abfed4dce01668d26602a5ada59
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-04-03 13:28:42 -07:00
Ben Walker
cf90e4de16 bdev/nvme: Simplify logic in remove_cb
This was doing an extra loop iteration.

Change-Id: Iaf1a1e4d5faaa3100d3c0fca6c7c3a8d1cd77101
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-03 13:26:07 -07:00
Ben Walker
36a793ad63 nvme: Add a quirk to delay before enabling
It has been discovered that some devices require
a very small delay before writing CC.EN to 1 after
CSTS.RDY goes to 0.

Change-Id: I73d31726d17ebf5bbec7ee528e2f98fcd05234dd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-03 11:18:15 -07:00
Ben Walker
652d48d5f5 nvme: Fix up long lines in nvme_quirks.c
This isn't the indentation pattern I would have chosen, but
it's a complicated negotiation between what I want and what
astyle will let me get away with.

Change-Id: I4909587823931842ac3f227134e1d05e7d80da74
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-03 11:18:15 -07:00
Ben Walker
f190418231 nvme: Simplify latency page quirk
Any Intel device reporting device ID 0x0953 needs this quirk.

Change-Id: I690b01ecf05105df00ec8cf6f2da7f7c0a601aa8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-03 11:18:15 -07:00
Ben Walker
2efe9aa7bf nvme: Add all known DIDs for striping quirk
Update the list to include all new DIDs.

Change-Id: Ib00da939587010d44c097da07ec0625890e4c8cc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-03 11:18:15 -07:00
Daniel Verkamp
7f957f56c1 bdev/nvme: add HotplugEnable option
Change-Id: I53fb7c3b469d5d5bb5b86c095bf1efc914299ec7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-03 11:17:47 -07:00
Daniel Verkamp
edbca2a676 conf: add Boolean value helper function
Change-Id: Ie86745fe397167416aee356dc773a1bf8387b492
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-03 11:17:47 -07:00
Daniel Verkamp
f390a2aad6 bdev/nvme: unregister hotplug poller at shutdown
Change-Id: Ic6a51f5e61ffd2d57e561fd1d3019b5a69a09048
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-03 11:17:47 -07:00
Daniel Verkamp
d55c3b8f8a bdev/nvme: convert probe messages to TRACELOGs
Also add a message when a controller is attached and assigned a name.

Change-Id: I54f2d711d55ba7ae99913fdfea652770b1f8931d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-03 11:17:47 -07:00
Pawel Wodkowski
5109f56ea5 vhost: add info that using VFIO with vhost is not supported
As VFIO does not work with vhost library print warning during vhost
initialization

Change-Id: Iaa31808c7007f1840a6a441e2591f0a3986b0c29
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-03-30 10:45:36 -07:00
Piotr Pelplinski
425b902bc0 scsi: use SOFT reset when reseting bdev
This fixes multiple SCSI reset issue.
This patch does not remove sleep in iSCSI tests.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Change-Id: I5e9f3705e5dc34004b9d1b9e40fbdcb04a3bee4e
2017-03-30 16:09:33 +02:00
Ben Walker
2e82b58684 nvme: Release lock before calling remove_cb
This prevents a deadlock if the user immediately
calls spdk_nvme_detach.

Change-Id: I79f28abe163cbbf184bea907692c44aa4e1c8893
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-29 21:07:21 -07:00
Jim Harris
913257cba5 Revert "scsi: use SOFT reset when reseting bdev"
Some intermittent issues still observed with multiple
resets in quick succession.  Reverting for now while the
issue is more fully root caused.

This reverts commit 7fa7f91ee3.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I493b564e8a110bbfb7a6cc47107d53d6eca40053
2017-03-29 15:42:11 -07:00
Daniel Verkamp
14cc383fb0 test/iscsi: build iSCSI unit tests on FreeBSD
Change-Id: Ie640069b831eba4eada9ff0955dca41af852d3a5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-29 15:27:50 -07:00
Jim Harris
f325e71c9d vhost: defer setting up new mem table
First step is do not destroy an existing device in
vhost_user_set_mem_table().  This is because we may
still be processing I/O via INT13 while QEMU is setting
up the mem tables for OS boot.

The primary part of this patch though is to defer
using the new mem table until after we receive the
first SET_VRING_ADDR message.  SET_VRING_ADDR will be
sent by QEMU when guest OS virtio-scsi driver starts
initialization.  At this point it is safe to invalidate
the old mem tables because there will be no more
INT13 I/O at this point.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I45fb5910f45e7fd2cf4a325341ad105a57d8ea40
2017-03-29 09:43:36 -07:00
Pawel Wodkowski
7fa7f91ee3 scsi: use SOFT reset when reseting bdev
This fixes multiple SCSI reset issue.

Change-Id: Ie62e0c1850faff17d383bcea00071d63d6bfa7f4
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-03-29 09:17:26 -07:00
Cunyin Chang
321d28ef02 bdev/nvme: Shorten the name of hot inserted NVMe device.
Make sure the name will not exceed the length of SPDK_BDEV_MAX_NAME_LENGTH.

Change-Id: I33a3f10c836e650fdcb578c7d9e58169d9bb766a
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-03-29 09:17:08 -07:00
GangCao
e5a3193b80 blob: remove duplicate call to _spdk_blob_free
Change-Id: Iecb7f28474861043e6d4971c78ed5764b60181af
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-29 09:16:45 -07:00
Ben Walker
57e6e0c8be blob: Initialize new metadata pages after allocation
The descriptor type must be 0 to break out of the loop,
so we need to initialize this.

Change-Id: I5fdb24dcfece01332c487364d5694c4fb8412e1b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-28 16:51:29 -07:00
Ben Walker
9cdb51d693 blob: Free blob memory on error
Change-Id: I67d3c359b7d432fa06660175a4d533115236d640
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-28 16:20:09 -07:00
Ben Walker
97b3efa349 blob: Verify parsing does not run off end of page
Change-Id: I2663e0518705ffd23afbb69c7ae5bf5aff001c85
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-28 16:17:54 -07:00
GangCao
1aaa9475ce iscsi: check invalid flush timeout parameter
Change-Id: Icb0c97511f2c45b06a4f4af88cff3fa464a6fc74
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-28 13:05:10 -07:00
GangCao
57986fb884 blob: check memory allocation in check_readahead
Change-Id: I80a1b19570aab8145e8d8d2c544ed46576a89e60
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-28 10:38:26 -07:00
Dariusz Stojaczyk
55d8cca428 scsi: Use parameter alloc_len instead of task->alloc_len in
spdk_bdev_scsi_inquiry

It was causing false-positive error checks.

Change-Id: I6145152abc65bb80cfdfc68ce3b32e6f41d69348
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-03-28 10:25:25 -07:00
Ziye Yang
7f11df67ea lib/trace: replace strncpy with snprintf
Change-Id: I07fe37a33e336217fbd31748c60337df7399fe1b
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-28 09:14:17 -07:00
Dariusz Stojaczyk
3907139e34 iscsi: fixed crash on invalid add_portal_group call
Fixed double free in spdk_rpc_add_portal_group()
spdk_iscsi_portal_create() now takes string arguments as const char* and makes internal copies of them.
This patch also fixes potential memory leak when id == NULL

Change-Id: I4d0efb101471fb2368ceb8ceecb0e40614e3585d
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-03-27 15:19:38 -07:00
Ben Walker
abc73f6995 blob: Handle failure to alloc xattr on parse
Or rather, at least assert that the allocation failed.
This is not a recoverable error in general.

Change-Id: I9bc325066e829fc311ce84ce83536e9933ac5473
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-27 15:15:24 -07:00
Ziye Yang
66aabffcae blob: free the blob in error case
Change-Id: I645e01123949fc4707509d0626f8a5327b7bdd3c
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-27 14:38:25 -07:00
Ben Walker
d827cfbde6 blob: Handle allocation failures in set xattr
Change-Id: Ida9361066e8b3117d1022379d75e290b11f86b52
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-27 13:54:54 -07:00
Cunyin Chang
01922c74d1 bdev/nvme: Make sure the bdev/nvme increment by 1 for new inserted device.
Change-Id: I691bb567c9fbfdb7e41f5602fe58645f232a0ee8
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-03-27 13:26:38 -07:00
Ziye Yang
ef91841763 (i)scsi: check strlen before copy
Make sure that we have space for termination char '\0'

Change-Id: Iaebdad3b4278ee322bd78247acc7f0997c3f4b44
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-27 11:37:15 -07:00
Ziye Yang
2abea9da4e lib, vhost: check the numbers of reqs
Change-Id: I567b9a330aa284f08dd16993686200dd1dd7990f
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-27 10:45:56 -07:00
Ziye Yang
e439020961 vhost: check the strlen of basename
Change-Id: I0f0eb7edbec71609754a4cda80c578b75c84c87f
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-27 10:26:43 -07:00
Changpeng Liu
fa9d3466aa scsi/bdev: assert on failed data buffer malloc
Change-Id: I4f698d7c35e3315c86a6dc15b930c349ba6b105f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-03-27 10:08:12 -07:00
Daniel Verkamp
c3f109f91e trace: Increase the size of trace name
According to the analysis, the largest name size is
24 not including '\0' (NVMF_RDMA_WRITE_COMPLETE),
so change the the size of name. Also add a check
to avoid the str exceeding our defined name size.

Change-Id: Iddf2cb52a3f5358306a59fc66bb997fa8098cde0
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-27 09:50:09 -07:00
Jim Harris
38f91be52b blobfs: cache_insert_buffer() - check count before allocating buffer
This avoids corner case where a buffer gets allocated on the 100th
try.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If65053d539d458d9a53c8850bbb4cbe4ee84f604
2017-03-24 16:06:37 -07:00
Jim Harris
7079a18f21 blobfs: add assert in fs_open_blob_create_cb to satisfy static checker
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia67d8a42825f7287c48729ec4d88d94a9efe430e
2017-03-24 16:06:37 -07:00
Jim Harris
f2e4d641a5 blobfs: fix use after free in init failure path
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7709c08abc103023363bede99e06bf07984c04ca
2017-03-24 16:06:37 -07:00
Cunyin Chang
e5b62c126a bdev/nvme: assign names to hot-inserted devices.
this patch fix the potential possibility of coredump when
we have NVMe device hot inserted.

Change-Id: Idac255f25f42b4746c2d3ae6dfc57a19b7001160
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-03-24 15:50:40 -07:00
Jim Harris
1edd9bf3e4 blobfs: Add a lightweight filesystem built on the blobstore
This is the initial commit for "blobfs", a lightweight
filesystem built on top of the SPDK blobstore.

Also included in this patch:

1) a shim for using SPDK bdevs as the backing store for
   SPDK blobstore/blobfs
2) documentation for using blobfs as the storage engine
   with RocksDB
3) scripts for running a set of workloads and collecting
   profiling data with RocksDB and blobfs

See doc/blobfs/getting_started.md included in this commit
for more details on blobfs, including some of the current
limitations.


Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I2a6d3d4b87236730051228ed62c0c04e04c42c73
2017-03-24 14:15:45 -07:00
Ziye Yang
dc1a2f814e bdev,nvme: check the return value of spdk_nvme_ctrlr_get_ns
Change-Id: Icae49d87562b07e80099622681cdf83fa6930b30
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-24 12:18:51 -07:00
Daniel Verkamp
0d752e42f8 scsi: ensure LUN name is null terminated
Change-Id: I2c0d0d9dd4f4b852401f21b65142ee85c29f3c62
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-24 10:52:48 -07:00
Daniel Verkamp
2b0b705fb1 reactor: make sure socket_count isn't zero
Avoid division by zero in the event mempool cache size calculation.

Change-Id: Ic117ef2dc3a798fb0a57572f1178233e83e73849
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-24 10:52:28 -07:00
Ziye Yang
31b81b0dd6 bdev, split: check the memory allocaton of spilt_base
Change-Id: I4cc3d6e5397143b0b98d4a222c01a76128093191
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-24 10:52:05 -07:00
Cunyin Chang
b6671531ad event: Verify log_facility is not NULL before using it.
Change-Id: Ia20d8764c2c91c200d06b7017ed06060e40cc2ed
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-03-24 12:33:00 +08:00
Ziye Yang
fea78497a1 lib/vhost: Handle realloc failure
Change-Id: I47157e33e306205fa261e65e4b99fa13c1f1148d
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-23 16:04:27 -07:00
Cunyin Chang
1bbb43c544 nvme: Replace some strcpy with snprintf
Change-Id: If80ae64fa672ae6b847ad985be6862e5d2b3729b
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-03-23 15:26:07 -07:00
Dariusz Stojaczyk
0e2ea8797f bdev/nvme: remove dangling pointer from g_nvme_bdevs list on bdev_nvme destruction
It was causing segfaults and infinite looping.

Change-Id: I4c19b5d3af1ba1360250cd5f6aa573a27003409f
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-03-23 14:40:35 -07:00
Cunyin Chang
118c08154e lib/env_dpdk: exit if allocating dpdk_args fails
Change-Id: Ib7268d679ed73e73b5bc20f08dc381315ee4fd9d
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-03-23 14:33:10 -07:00
Daniel Verkamp
6e2d7be8a1 vhost: add copy of virtio headers
This enables the vhost library to build on systems missing the (fairly
recent) linux/virtio_scsi.h header.

Change-Id: I680863b26961ec3cbe4ad4e575555454f6461bbf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-23 13:51:04 -07:00
Ziye Yang
74da2fade4 Replace sprintf with snprintf in several files
Change-Id: I2a46433e81e605e57df4b2a1a9c1c27097333d0c
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-23 13:33:21 -07:00
Ziye Yang
228a81f1bc lib/net: Replace sprintf with snprintf
Change-Id: I86999b8f8ad4363e163c7e3f8d46dd49fb7c848c
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-23 13:30:09 -07:00
Ziye Yang
0c0582d3ce event: Verify lcore is valid when registering poller
If we do not do a bounds check, this can run off the end
of an array.

Change-Id: I43cc4848fca7d68218e507db20e33823f8b550e4
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-23 13:30:04 -07:00
Daniel Verkamp
4b887a8cbc nvmf: start even if no transports are available
Attempting to add a listen address for an unavailable transport will
fail with a better error message.

Change-Id: If4cf5b66c16dadcb6e0f0b28cea4aa510ba6a9fc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-23 13:17:52 -07:00
Daniel Verkamp
7035c39136 nvmf: print error if transport name isn't found
Rather than failing silently, let the user know why the listen address
failed.

Change-Id: I41c2a51c6071ee739b282a1a39198a2887a73c4d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-23 13:17:52 -07:00
Daniel Verkamp
2563429809 nvme: convert uevent failure message to TRACELOG
The message about the uevent socket is not a fatal error; it just means
that hotplug monitoring will not work.

Change-Id: I29f6a253e96a86420c0fde9e19135f9f1d229bb9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-21 15:39:21 -07:00
Ben Walker
d89352a95c blob: Add a persistent, power-fail safe block allocator
This is the initial commit for the "blobstore", a lightweight,
highly parallel, persistent, power-fail safe block allocator.

Documentation will be added in future patches.

Change-Id: I20a4daf899f1215d396f7931c3ec9a2e2bb269d0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-21 14:21:21 -07:00
Jim Harris
e2b330e989 nvme: correctly handle valid PRPs with non-block size first/last elements
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I801547126987b1a2c5e8e95d468c30e508a1c3b0
2017-03-21 08:03:29 -07:00
Ben Walker
6d7b6e882c bdev/aio: The user now provides the names of AIO bdevs
The user now must choose the name for each AIO bdev. This
provides consistency for names across restarts.

Change-Id: I13ced1d02bb28c51d314512d60f739499b0c7d8d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-20 15:18:03 -07:00
Seth Howell
39ad6c3151 bdev/nvme: Fix null terminator checks in trid
The fields are char arrays, not pointers.

Change-Id: Ieb21e7a70853ed582e459d167a66b1aa5b8c93d3
Signed-off-by: Seth Howell <seth.howell@intel.com>
2017-03-20 14:13:10 -07:00
Daniel Verkamp
790bad22c3 nvmf: add discovery controller ops
Simplify code that previously needed to check for subsystem type by
factoring out the discovery controller operations into a new ops
instance.

Change-Id: Id87b498e4623451993fe779ffb765be5a6743fd9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-17 15:55:36 -07:00
Daniel Verkamp
d535f9b7bb nvmf: split discovery service into its own file
No functional change, just rearranging code.

Change-Id: I28328dfefd7de269d326834c484f2c2fca4e6c1f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-17 15:55:36 -07:00
Ben Walker
1f38243914 nvmf/rdma: Combine RDMA WRITE and SEND into single post
When data needs to be transferred from the controller
to the host, do a single ibv_post_send containing
both the data and the completion.

Change-Id: I072c545b31593e0e324c97ed700b42c6a4c358e1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-17 14:42:06 -07:00
Ben Walker
6696fce7ae nvmf/rdma: Manually inline nvmf_post_rdma_send
This call had been reduced to a simple wrapper
around the ibv call. Delete it.

Change-Id: I42926d123db262617119a9cff77bc0d0eb1e8f31
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-17 14:42:06 -07:00
Ben Walker
7488116a78 nvmf/rdma: Manually inline nvmf_rdma_post_[read|write]
These functions were only called from one place and
their functionality has been reduced to a wrapper
around the underlying ibv call. Remove them.

Change-Id: I65182012dbe6393b9d57f4191fd327bcd025a6c8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-17 14:42:06 -07:00
Ben Walker
a4a3b5e7fd nvmf/rdma: Move all SGL setup to the prep_data step
This keeps all SGL handling in the prep_data function.

Change-Id: I9bfeed3748c1b329288350b85aa87bd604cfce4e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-17 14:42:06 -07:00
Ben Walker
e0bdfb14ee nvmf/rdma: Manually inline nvmf_rdma_post_recv
Now that all of the SGL mappings are static,
this function just called ibv_post_recv. Delete
the function and call ibv_post_recv directly.

Change-Id: I45216170a157709249b08c4cb0ebdb1adb906049
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-17 14:42:06 -07:00
Dariusz Stojaczyk
b276649c98 vhost: check if file is a socket when creating a controller
This patch makes create_vhost_scsi_controller check if given file is a socket before deleting it

Change-Id: I7a37c12913b461f779732e724c85e2f7b5d67442
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-03-17 08:59:02 -07:00
Ben Walker
cc294653ca nvmf/rdma: Send data and completion at the same time
For an NVMe read, send the completion immediately
following the RDMA WRITE, without waiting for
the acknowledgement. RDMA is strictly ordered,
so the WRITE will arrive before the completion.

Change-Id: I7e4e01d7a02c2130b655ef90f5fdaec992d9361a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-16 16:44:45 -07:00
Ben Walker
d0fb728ad2 nvmf/rdma: Don't use in-capsule buffers for READ/WRITE
Except for a CONNECT capsule, always use the central data
pool for RDMA READ/WRITE operations. The in-capsule
data buffer is associated with the receive operation
while the pool data buffers are associated with the
completion, and using the in-capsule data buffer
causes a lifetime mismatch.

Change-Id: Ieb45e521d78daa7c706078a3dd5c5a146f8dc1d6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-16 16:44:45 -07:00
Ben Walker
23f273c0b1 nvmf/rdma: Revert 8fefa7e
After commit b654e9b, this is no longer required.

Change-Id: I0cf1a7059d7fba0303aca5ad5a15afe3890b4172
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-16 16:44:45 -07:00
Ben Walker
1db3a03712 nvmf/rdma: Do not assume acks are ordered.
The RDMA protocol this module uses is strictly ordered,
which means messages are delivered in exactly the order
they are sent. However, we have detected a number of
cases where the acknowledgements for those messages
arrive out of order. This patch attempts to handle
that case.

Separate the data required to post a recv from the
data required to send a response. If a recv arrives
when no response object is available, queue the
recv.

Change-Id: I2d6f2f8636b820d0c746505e5a5e3d3442ce5ba4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-16 16:44:45 -07:00
Ben Walker
d326998ce7 bdev/nvme: Names are now explicitly assigned by the user
Names for the NVMe bdevs are now assigned by the user.
This means the same name will always be assigned to the
same device, even across restarts.

Change-Id: If9825ec9abcb5236b4671bc44a825e4f0d704fe3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-15 17:42:45 -07:00
Cunyin Chang
b7349216b9 nvme: optimization for nvme probe and detachment.
remove the unnecessary rte_eal_pci_probe_one() in function
spdk_pci_device_detach(), this could cause error message when we
terminate the application, it will also not make sense try to probe one
device after we detach it, we could call spdk_pci_nvme_device_attach()
instead of spdk_pci_nvme_enumerate() when we have one given device address,
dpdk will try to scan the device and add it back to pci device list then.

Change-Id: I35f5bb412249bb20da57394f0531c10a49691906
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-03-15 09:00:25 -07:00
GangCao
f75fe7394a nvmf: add an outstanding admin IO tracker in direct mode
Change-Id: I06e0de6dc28115f0cb53151d67138f9271093687
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-15 08:02:39 -07:00
GangCao
7224a42d9d nvmf: add a periodical admin poller for AER event in direct mode
Change-Id: Ib8cba61fe3d531f9228d0c385913d63914ba8093
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-15 08:02:39 -07:00
GangCao
89d10dd80e nvmf: add support of default subsystem identifier
Change-Id: I607e800fea00c21dfd28c8fee0a981ae59e46a5c
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-14 15:33:25 -07:00
Cunyin Chang
e58e56c9c6 nvmf: Add support of hotplug for nvmf virtual mode.
Change-Id: I941d119e6b74eadfccd7eb7675b2f7b46d2b5907
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-03-14 14:53:56 -07:00
Cunyin Chang
39b386a5c5 nvmf: Add interface for transport layer to check if one connection is idle.
Change-Id: I094d5adb85af8279c9823528f40190fa28801b7b
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-03-14 13:29:32 -07:00
Daniel Verkamp
50947d5557 nvmf/rdma: use SPDK_COUNTOF to count SGL elements
This clarifies the relation between the values assigned to sg_list and
num_sge (no functional change).

Change-Id: I8e81d47dd97a033b17cd3b813b06e4887127146c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-14 09:53:53 -07:00
Ziye Yang
b0ad3322f0 bdev/nvme: RPC call can now specify remote NVMe-oF devices
Change-Id: Ief3cf71489f0725249d51851b8d3270cb4e034db
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-14 08:38:04 -07:00
Ben Walker
0829424e19 conf: No longer allow wildcard claiming of NVMe devices
All devices must be specified by BDF. Add support for scripts
to use lspci to grab the available NVMe device BDFs for the
current machine.

Change-Id: I4a53b335e3d516629f050ae1b2ab7aff8dd7f568
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-14 08:38:04 -07:00
Ben Walker
8fefa7e9ee nvmf/rdma: Match queue depth math to Linux kernel initiator
Change-Id: Iffe8c35ae76f5541aa95480f1aaaf654fcdfeffd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-13 15:50:05 -07:00
Ben Walker
75990199ae nvmf: Remove sge log messages. The mappings are static now.
The mappings are all static, so it isn't interesting
to print them out on each I/O.

Change-Id: I85301b4518d4523a7c031f6ca9ff678d91428504
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-13 15:11:13 -07:00
Ziye Yang
5c36cd7481 nvmf/rdma: Use separate ibv_send_wr for RDMA READ/WRITE
This allows pipelining of READ/WRITE with completion.

Change-Id: Ib3ab5bffb8e3e5de8cbae7a3b2fff7d9f6646d2d
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-13 15:11:13 -07:00
Ziye Yang
0239003a72 nvmf/rdma: Initialize SGL for recv work request just once
Change-Id: I22b76cafe1a496f40cf7661daee3361ba1dee324
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-13 15:11:13 -07:00
Ziye Yang
4e74233835 nvmf/rdma: Separate cmd wr from rsp wr
This allows static initialization of the scatter
gather list as well as future optimizations
around pipelining commands with data.

Change-Id: I8af8f3e3425610bc720677c9bc84f163cfb6278a
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-13 15:11:13 -07:00
Ben Walker
b4ed77ef0d nvmf: Remove workaround for kernel initiator queue depth
The first version of the Linux kernel NVMe-oF initiator had
a bug when reporting queue size where it was off by 1. We
had a workaround to deal with this. Now that the kernel
has been fixed, remove the workaround.

Change-Id: I0ad4a5c6db68cfa9683ab93e6f5210772c713b55
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-03-13 14:33:42 -07:00
Pawel Wodkowski
73c95f5476 scsi: remove delete_lun RPC call and move claimed flag
Move claimed flag to struct spdk_scsi_lun and remove RPC call that allow
SCSI LUN to be deleted by user.

Change-Id: I0fe57d33ab017816ab4799bce259807735e0c783
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-03-13 11:27:22 -07:00
Daniel Verkamp
926052d7c7 iscsi: fix typo in error message
Change-Id: I9c3623ff2140766996fb57da75d399dff2f45c0a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-10 15:48:03 -07:00
Daniel Verkamp
83e556534b nvme/rdma: eliminate bounce buffer copy
Register all spdk_malloc() memory regions as ibv_mr in a spdk_mem_map
so we can look up the RDMA key for the user's buffer and pass it in the SGL
directly, rather than copying through a pre-registered bounce buffer.

Change-Id: I7340bc2020b5256750c95dbd24ba67961404e5e7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-10 11:39:28 -07:00
Daniel Verkamp
ee2eda24bc env/vtophys: allow registration of >2MB regions
Change-Id: I4f005ce979a94b07bbaa109795ce0f6708b7fb8c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-10 11:39:28 -07:00
Daniel Verkamp
93982c19bb env/vtophys: expose mem map in public API
Change-Id: I2e96b295fa3943e004e424250c4734e8da9fb796
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-10 11:39:28 -07:00
Changpeng Liu
8482b47d53 nvme: initialize namespace capability flags with correct order
The extended LBA format flag should be initialized after namespace
capability flag.

Change-Id: Iad479b454bb4e31120c17d40ae23937a099c6f8f
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-03-10 11:39:09 -07:00
GangCao
360d3813b0 nvmf: add the unique subsystem id
Change-Id: I0369b7462a12aec76d52dd357d72989886de5a54
Signed-off-by: GangCao <gang.cao@intel.com>
2017-03-10 13:06:55 +08:00
Pawel Wodkowski
c90f57f99f vhost: change SCSI device configuration format
Change SCSI device configuration format from "DevX LUN0" to "Dev X LUN0"
This allow checking configuration against silly errors when device
number is out of range.
Also assert exactly only one LUN is given.

Change-Id: Idccd6878119282fc51947b092bdda7ae06aa94ad
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2017-03-09 15:42:48 -07:00
Daniel Verkamp
60fc74584a event/app: use PID for trace ID if shm_id is unset
Change-Id: If79a09e109a3885e1282f3e834b531c250e59512
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-09 15:33:17 -07:00