Commit Graph

142 Commits

Author SHA1 Message Date
Daniel Verkamp
8eef5183d3 bdev: remove spdk_bdev_poller_start() lcore option
Always start bdev pollers on the calling core.

This removes the lcore concept from the bdev poller abstraction and
simplifies the job of spdk_bdev_initialize() callers providing their own
poller and event implementations.

All callers except the NVMe bdev hotplug poller already used the current
core as the parameter.  The NVMe HotplugPollCore option was undocumented
and unused in any of the tests or example configuration files, so it
should be safe to remove.

Change-Id: I93b466e1e58901b8785c40cbe296fa46c157850f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382857
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-18 20:28:29 -04:00
Jim Harris
94bc8cfdba bdev: add ENOMEM handling
At very high queue depths, bdev modules may not have enough
internal resources to track all of the incoming I/O.  For example,
we allocate a finite number of nvme_request objects per allocated
queue pair.  Currently if these resources are exhausted, the
bdev module will return failure (with no indication why) which
gets propagated all the way back to the application.

So instead, add SPDK_BDEV_IO_STATUS_NOMEM to allow bdev modules
to indicate this type of failure.  Also add handling for this
status type in the generic bdev layer, involving queuing these
I/O for later retry after other I/O on the failing channel have
completed.

This does place an expectation on the bdev module that these
internal resources are allocated per io_channel.  Otherwise we
cannot guarantee forward progress solely on reception of
completions.  For example, without this guarantee, a bdev
module could theoretically return ENOMEM even if there were
no I/O oustanding for that io_channel.  nvme, aio, rbd,
virtio and null drivers comply with this expectation already.
malloc only complies though when not using copy offload.

This patch will fix malloc w/ copy engine to at least
return ENOMEM when no copy descriptors are available.  If the
condition above occurs, I/O waiting for resources will get
failed as part of a subsequent reset which matches the
behavior it has today.

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

Reviewed-on: https://review.gerrithub.io/378853
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-10-01 21:57:00 -04:00
Dariusz Stojaczyk
3595fc5f40 bdev: allow allocating custom-length buffers for bdev_io
This is required for upcoming UNMAP
implementation in bdev_virtio.

While here, also added documentation for
spdk_bdev_io_get_buf().

Change-Id: Ia769ee9b8b132f31208ae66598b29a1c9ed37312
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/379721
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-09-28 17:08:34 -04:00
Daniel Verkamp
d565f549b9 bdev/nvme: support large (> 2TB) unmap requests
spdk_bdev_unmap_blocks() accepts a 64-bit number of blocks, which can
exceed the NVMe Dataset Management range's 32-bit number of blocks,
which can represent up to 2 TB with 512-byte blocks.

We can support up to 0.5 PB unmap requests by using the maximum number
of descriptors in a single Dataset Management command, which should be
sufficient for now.

Change-Id: I0a4ee77a9be148355991e1a081007ffa020a3ee5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/379202
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-09-28 14:17:15 -04:00
GangCao
4f1ba029b3 bdev/nvme: handle the case for no valid ns when creating bdev
Change-Id: I46d564523ea20bc7c79a3896dfb024d3d5172a93
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/379911
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-26 17:44:32 -04:00
Jim Harris
49cf3861d1 bdev/nvme: clean up submit_request return codes
Some of the internal functions used to return the
number of bytes associated with a successfully submitted
IO, but that was changed a while ago to just return 0
for success.

So change some of the callers of these functions to
just look for != 0 for failure rather than < 0.  This
preps for some upcoming ENOMEM handling changes.

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

Reviewed-on: https://review.gerrithub.io/378856
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-25 13:56:29 -04:00
Dariusz Stojaczyk
dcb7db965d bdev: unify all direct bdev_io I/O types
Since all direct bdev_io types have the same layout,
there is no need to keep them differentiated.

Change-Id: If8bb85e43c9922c0ebfc39837e3a45006e508b56
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/377686
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-22 13:44:25 -04:00
Seth Howell
66ae375c3d bdev/bdev_nvme.c: correct order of args in unmap call
I inadvertently misordered the arguments in a call to spdk_bdev_unmap.
This call is unused as of this patch, but is used by future patches.

Change-Id: I6042a3f4e05bded21b0ceb4d3b104856bcbf8c12
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/377961
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>
2017-09-11 19:08:22 -04:00
Cunyin Chang
0bd8e75199 bdev/nvme: remove the nvme_bdev from list safely.
There remove callback function will remove the nvme_bdev from the global
list, we do not need to remove the device in the function bdev_nvme_destruct().
just make sure to remove it from list when the app exit.

Change-Id: I1859bfd696ed9c0ca3ac1cd8ffadfd9488df0fcd
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/375941
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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-08 17:11:28 -04:00
Daniel Verkamp
7394f69054 bdev: convert bdev module APIs to use blocks
The bdev modules now take all read, write, unmap, and flush requests in
terms of blocks rather than bytes.

The public bdev APIs still accept offset and length in bytes for now.

Change-Id: I57f0955d52272f57755f0ff4dbc56721fdc2ef51
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376037
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2017-09-06 13:01:13 -04:00
Daniel Verkamp
d92f0f75ca log: rename SPDK_TRACELOG to SPDK_DEBUGLOG
This matches the name to the behavior and prepares for addition of a new
log macro for "info" log level.

Change-Id: I94ccd49face4309d3368e399528776ab140748c4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/375833
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>
2017-08-29 13:25:58 -04:00
Jim Harris
2a75143441 bdev: change bdev_io flush "length" to "len"
This makes it consistent it with other parts of this structure.

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

Reviewed-on: https://review.gerrithub.io/375494
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-08-28 13:06:37 -04:00
Daniel Verkamp
45d4b1973a bdev: add API to get optimal I/O boundary
Allow passing the NVMe namespace optimal I/O boundary through the bdev
layer.

Change-Id: I27a2d5498df56775d3330e40c31bd7c23bbc77a5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/374532
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>
2017-08-17 17:56:18 -04:00
Changpeng Liu
e36f83d64e bdev_nvme: disable hotplug feature by default
When users don't enable hotplug option in their configuration
section, SPDK will enable it by default. DPDK will print probing
messages continuously for NVMe devices which don't belong to SPDK.

Change-Id: I8c43335a282ecba206b4b5305bd881d2bd07836e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/374486
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-17 13:38:02 -04:00
Seth Howell
c9dc522ba9 bdev_nvme: add support for write_zeroes
In this iteration, we only support write_zeroes in the form of a
deallocate call that returns all zeroes.

Change-Id: Ica837ce70672174df63012719de60463fdb799cf
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/372005
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-15 15:27:09 -04:00
Daniel Verkamp
df36f4effd bdev/nvme: add missing newline in warning message
Change-Id: Ia2202eadfb8140b7a51dd64d4241e85aceff361c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/373408
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-09 16:52:27 -04:00
Daniel Verkamp
50cbc74a82 bdev/nvme: simplify I/O command block size math
Remove the redundant sector size check; the generic bdev code already
checks for this.

Also use the bdev blocklen field for both offset and size calculations.
The bdev blocklen is the same as the namespace sector size.

Change-Id: Ia8061eb4cfc229d4b6fbe2caabf2dd81656bc697
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/372862
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-07 17:48:22 -04:00
Ben Walker
60c38d4022 bdev: Change unmap to use offset/len instead of descriptors
This is far simpler, although it does limit the bdev
layer to unmapped just one range per command. In practice,
all of our code reports limits of just one range per command
anyway.

Change-Id: I99247ab349fe85b9925769e965833b06708d0d70
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/370382
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>
2017-08-04 20:03:37 -04:00
Dariusz Stojaczyk
73358c99e1 util/nvme: added io_device unregister callback
Patch afe860ae deferred freeing the io_device. However, for nvme, the
io_device context (spdk_nvme_ctrlr) is still being destructed before
io_channels are destroyed, causing segfaults on hotremove.

This patch defers io_device context destruction and fixes nvme
hotremove.

Fixes: afe860aeb1 ("channel: Correctly defer unregisters if channels exist")
Fixes: 5533c3d208 ("util: defer put_io_channel")

Change-Id: I7af699174cac0c6c6a6faa2cc65418c47347eb9a
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/370459
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-07-20 16:07:02 -04:00
Daniel Verkamp
ce4fcbce71 nvme: add I/O qpair creation options
Add a new struct spdk_nvme_io_qpair_opts to allow the user to override
controller options on a per-I/O qpair basis.

Existing callers with qprio == 0 can be updated to:

  ... = spdk_nvme_ctrlr_alloc_io_qpair(ctrlr, NULL, 0);

Callers that need to specify a non-default qprio should be updated to:

  struct spdk_nvme_io_qpair_opts opts;
  spdk_nvme_ctrlr_get_default_io_qpair_opts(ctrlr, &opts, sizeof(opts));
  opts.qprio = SPDK_NVME_QPRIO_...;
  ... = spdk_nvme_ctrlr_alloc_io_qpair(ctrlr, &opts, sizeof(opts));

Change-Id: I8ac3ea369535cfde759abbe75e1d974b6450a800
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369676
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-18 18:33:20 -04:00
Roman
5b53b568e4 add VTune support: spin-wait stat
Change-Id: Ie25a87c4b3f781299fa744fdcff6c9a63d473935
Signed-off-by: Roman <roman.sudarikov@intel.com>
Reviewed-on: https://review.gerrithub.io/365723
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-07-18 15:33:56 -04:00
Jim Harris
f71447e80d bdev: remove differentiation between bdev and vbdev modules
We still will sort the bdev_module list so that modules
with an examine() callback are initialized first.  This ensures
they have a chance to initialize before later modules start
registering physical block devices.

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

Reviewed-on: https://review.gerrithub.io/369486
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-07-14 13:31:30 -04:00
Jim Harris
7fefd60fab bdev: make module init synchronous again
Module initializaiton was made asynchronous recently
to support bdev modules like gpt which need to do
asynchronous I/O.  But all modules now do any
asynchronous I/O in their examine() routines, and
init functions only do very basic operations to be
ready to handle examine() callbacks.

So simplify the bdev code and modules to go back to
a synchronous init procedure.

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

Reviewed-on: https://review.gerrithub.io/369485
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-07-14 13:31:30 -04:00
Jim Harris
dd06e98d4a bdev: rename blockdev instances to bdev
This includes file names, functions, #defines, etc.
There are still a few uses of "blockdev" outside of
include/ and lib/ - these can be handled later.

This preps for a future patch to consolidate vbdev
modules and bdev modules into just bdev modules.

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

Reviewed-on: https://review.gerrithub.io/369325
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-07-14 13:31:30 -04:00
Jim Harris
8bf4c089f6 bdev: initialize vbdev modules first
This allows vbdev modules to be ready for examine
calls for (physical) bdev modules when the latter
initialize.

This requires the following modifications to existing
bdev modules:
1) error and split now search their config sections
   at examine time (instead of init) to see if the
   bdev should be consumed by the vbdev module
2) gpt is simplified considerably - it no longer
   needs to save bdevs to examine when
   gpt initializes later
3) nvme must register its io device before registering
   the bdev, since vbdevs may immediately start trying
   to send I/O to the new nvme bdev

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

Reviewed-on: https://review.gerrithub.io/368598
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-12 12:42:56 -04:00
Jim Harris
4794c791de bdev: add pointer to module structure
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic3051b63942770e45be22af0ae03a78a7c543f81

Reviewed-on: https://review.gerrithub.io/368597
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-07-12 12:42:56 -04:00
Jim Harris
908cab3f1c bdev: populate module_name
Add a name parameter to the MODULE_REGISTER macros, and then
modify each bdev module to pass a string for its name.

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

Reviewed-on: https://review.gerrithub.io/368596
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-07-10 19:17:08 -04:00
Daniel Verkamp
2bdec64fbf jsonrpc: modify API to pass request to handler
This will enable asynchronous request handling in a future patch, and it
also removes the need for the RPC handlers to know about request id and
the JSON-RPC rules about notification-only requests.

Change-Id: I25aaa8e48bff8d5594ffcccecb61842b1e31ec3c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368225
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-07-06 13:48:12 -04:00
Ziye Yang
a9428cb39e blockdev, nvme: do not probe local nvme device if not configured.
Change-Id: Icdb017d7e6b0a38f8ff3aa78ea60117936dfe178
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/366702
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>
2017-06-30 18:21:49 -04:00
Daniel Verkamp
37a7ff0fd7 nvme: add API to convert trtype and adrfam to string
Also add adrfam to the NVMe bdev JSON config output.

Change-Id: I9472bda04947cffc0df9b02eba0035bac01b7d7b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/367292
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-06-30 12:43:18 -04:00
Ben Walker
c224997be5 bdev: Remove direct calls to start/stop pollers
Abstract these through the bdev API to break this
dependency on the event framework.

Change-Id: I108505bf27e94b2985f53d0a4dc0b847ae264d25
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/366340
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-22 10:47:31 -04:00
Ben Walker
0cb7586e13 bdev: Use message passing from io_channel.h instead of events
This breaks one dependency of the bdev library on the
event framework.

Change-Id: I47ac81a3e4e951f94a66b5de2639eb485dc62e41
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/366339
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-06-22 10:47:31 -04:00
Daniel Verkamp
721a4d44ec bdev/nvme: generalize check for NVMe-oF TRID types
Anything that is not a PCIe TransportID is a remote NVMe over Fabrics
address and must have a subsystem NQN.

Change-Id: I1d34ce09a2c4ad7d3ec14fd90b5afccc33eb2bbf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/365917
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>
2017-06-16 20:46:26 -04:00
Ziye Yang
99cad03497 bdev,nvme: make conf can parse NVMe-oF target
Preivously, we can only parse NVMe-oF target by
rpc. Also the handling for local NVMe device and
remote NVMe devices are not consistent. With this
patch, we can handle it in the consistent way.

Change-Id: Id5c25f8b38a38ac997887b78c2321f148b8844ec
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/364348
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-16 15:35:33 -04:00
Ben Walker
e6d5f6c418 bdev/nvme: Delete+Recreate I/O queues around a reset
This ensures all I/O will be aborted and that no I/O
will be submitted while the reset is ocurring.

Change-Id: I0f5c993b91d9be6073c6ddf66ae12010f56f864c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/364682
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>
2017-06-14 19:06:44 -04:00
Daniel Verkamp
eba5c996c8 bdev: add NVMe I/O passthru command
Change-Id: I4d281be99553629563026cc4f9ab890d0a97986c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/364115
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-06 13:07:32 -04:00
Daniel Verkamp
bac4c02bc4 bdev: change name and product_name to char *
Dynamically allocate bdev names to remove the arbitrary 16-character
name length limit.

All of the existing product_names are constant strings, so those can
just use string literals instead of a copy per bdev.

Change-Id: I3280da67a4fcf2e4ec8ee8193362ca1b96a9c0cb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363601
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-06 12:37:39 -04:00
Ziye Yang
7bc1a7d1a6 blockdev_nvme: free name in nvme_ctrlr
Need to free this variable.

Change-Id: I78a7d5b312db6487ed65b9d314590a28408da761
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/363477
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-06 12:37:26 -04:00
Edward Yang
54e16f96b3 bdev: Add spdk_bdev_nvme_admin_passthru
Support passthru for NVMe admin commands.

Change-Id: If926f2ecabb078a553158f544c10a92452dbdb39
Signed-off-by: Edward Yang <eyang@us.fujitsu.com>
Reviewed-on: https://review.gerrithub.io/363294
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-06-05 18:07:10 -04:00
Daniel Verkamp
a0cb1377f6 Update existing fallthrough comments for GCC 7
The stricter warning levels (-Wimplicit-fallthrough=4) require all-caps
FALLTHROUGH, so update the existing comments to match.

Change-Id: I5f8608101cad31d8ea8e84d48604397f98400e87
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363491
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-02 19:48:49 -04:00
Ziye Yang
9104fe73ce bdev: make (v)bdev init in async manner
Change-Id: I93684a004e2ae276734edbb4767b5ba1bac3dd48
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/362111
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-31 15:30:58 -04:00
Ben Walker
d969ac445a io_channel: Remove per-channel priority
This wasn't used anywhere and we currently believe there
are superior software-only techniques for controlling
quality of service.

Change-Id: Icdadd5870ed0629b338c307d2619bbc242c3e7a3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362065
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-26 13:42:19 -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
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
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
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
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
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