Commit Graph

3202 Commits

Author SHA1 Message Date
GangCao
92577c92b0 vbdev/passthru: introduce the public create_passthru_disk function
The patch here is to have two utility functions that can be
called in the examine path and also through the newly created
create_passthru_disk() public function.

This is also a preparation work to add the RPC method to construct
the passthru vbdev at runtime.

Change-Id: I6cf7ec61ace8b021de19d35ddbd5441618938739
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/406888
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2018-04-20 13:39:21 -04:00
GangCao
b8681aa659 bdev/qos: add the QoS information on RPC get_bdevs interface
Change-Id: I515a08ce95ffd6fea4d5f4fab42e6d09bcdd11f7
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/393278
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>
2018-04-20 13:34:44 -04:00
Daniel Verkamp
f6fa387f5b vhost/nvme: remove pointless task NULL check
task must be non-NULL in blk_unmap_complete_cb - it is retrieved from
child->parent, which is always set to a known good task in the only
call site.

Change-Id: I28dce62d4cb586311dc87f988c01aa0e03665e4d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408393
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>
2018-04-19 18:47:59 -04:00
Daniel Verkamp
8e098e4190 nvme: verify remove_cb is non-NULL before calling
This fixes the VFIO hot-remove path, which called remove_cb without
checking to see if it had been specified by the user.  The normal uevent
removal path already checked for remove_cb.

Change-Id: I0ad8d2c90a77b16800a8b505cb69ea05b0706d70
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408392
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>
2018-04-19 18:47:51 -04:00
Daniel Verkamp
3fa7c33ac1 nvme: require trid to be valid in nvme_ctrlr_probe
This is an internal NVMe driver function, so we don't need to allow for
the case where trid is NULL.  All callers already passed an address of a
local variable except the unit tests, which can be trivially fixed.

Fixes a static analyzer warning about trid being dereferenced in
nvme_transport_ctrlr_construct() before being checked for NULL in the
caller.

Change-Id: I2bfeb5c92a302093b7c7f2949adcd18baa11855a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408395
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>
2018-04-19 17:51:14 -04:00
Ben Walker
0692768e69 vhost: Fix negative array index use in spdk_vhost_set_socket_path
If basename was the string "", with length 0, it would have
resulted in accessing index -1 in dev_dirname.

Change-Id: Ib389f8fe220f5335a54f6a155a20fcca35b94e3e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408253
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>
2018-04-19 15:48:36 -04:00
Ben Walker
6518338fa0 event: Handle invalid lcore passed to spdk_event_allocate
Change-Id: Ib438db398f899946ef7d2f1be3d4c7424ed2fbcf
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408252
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>
2018-04-19 15:48:36 -04:00
Ben Walker
4149205c46 nvmf: Re-lookup sgroup after the array is realloc'd
Change-Id: I81c3f5725dc276717ab3d8316e393349b6a33134
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408251
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>
2018-04-19 15:48:36 -04:00
Ben Walker
1d94536417 nvmf: Bound the maximum number of namespaces that can be configured
Make the bound enormous, but bound it so that we don't run out
of memory.

Change-Id: I014b3df3be92ae8bd85fea95f514225adc3eefe2
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408247
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>
2018-04-19 15:48:36 -04:00
Ben Walker
a00b6819a1 bdev/virtio: Abort on bad index in virtio_dev_queue_get_thread
There is no way to recover from this.

Change-Id: I1667b032bab867d58ad23fa8b1bd59f81620b442
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408246
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-19 15:48:36 -04:00
Ben Walker
7540c61a21 lvol: Make snapshot_lvol_bdev RPC's arguments required
Progress cannot be made without these values.

Change-Id: I40e346f8598dcca8a4028c1c05cfdebdc5a8e4c1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408245
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>
2018-04-19 15:48:36 -04:00
Ben Walker
37ef0cca91 nvme: Don't expose admin qpair in timeout callbacks
This was broken by commit 31bf5d795

Change-Id: I8c81c7b76cd47db347ce9c3f8a0e8296b690cb49
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408240
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>
2018-04-19 15:48:36 -04:00
Daniel Verkamp
ec013016ed iscsi: fix nonsensical poll_group asserts
It doesn't make sense to assert(pg != NULL) after already dereferencing
the pg pointer.

Additionally, pg is pointing into the g_spdk_iscsi.poll_group array, so
it makes more sense to check that the poll_group array is non-NULL.

Change-Id: I167fed2bd73dc6a1894ff5b13d5bf3e5aa835f47
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408234
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>
2018-04-19 15:37:42 -04:00
GangCao
ffba4fdbc3 bdev/qos: add RPC method to set QoS at runtime
This patch adds a new RPC method to configure QoS on bdev
at runtime.

For example:

set_bdev_qos_limit_iops Malloc0 20000 --> Enable QoS on this
block device with 20000 IOPS rate limiting.

Change-Id: I1ee8b313b769fb5a664820f4ba827e0230be4b5d
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/393255
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-19 13:47:54 -04:00
Ben Walker
c1f7f02cfe vhost: Handle null pointer when dumping SCSI JSON config
Change-Id: I4bec75ee2965394edb294a163818925e6a26fb0c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408239
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>
2018-04-19 00:08:21 -04:00
Ben Walker
aa345078c1 vhost: Handle failed memory allocation when dumping config
Change-Id: I929e2a668189c36a8837ce8cb8731e394bcb6d9a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408238
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-19 00:08:21 -04:00
Ben Walker
b31d31b22b vhost: Check for null pointers in vhost_blk
This fixes two flagged Klocwork issues.

Change-Id: I98ac136995ebcdc89aa94c76fec095573e102674
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408237
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>
2018-04-19 00:08:21 -04:00
Ben Walker
87211463a2 bdev: Fix data type mismatch for io_per_sec
Change-Id: I6bf491bd9661d247a70d7ee323c14397cd577636
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407367
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-18 16:48:56 -04:00
Ben Walker
2931d638e7 bdev: Configure max_ios_per_timeslice when QoS is initialized
This value was recalculated on each time slice. Instead, just
set it up right away.

Right now QoS is statically configured at creation time for bdevs,
which means we can get away with this. Once dynamic
configuration is added, events will need to be sent to the QoS
thread.

Change-Id: I8bde4170f2d882d2c0f5e57a6aa7713d045beb7d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407355
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>
2018-04-18 16:48:56 -04:00
Seth Howell
4ca87a01b4 nvmf: make spdk_nvmf_subsystem_remove_ns asynchronous
Update the thread-local caches with new namespace data during each call
to spdk_nvmf_subsystem_remove_ns to handle the case where the user
requested to remove a namespace and then immediately add a different
one at the same namespace id. This makes the call asynchronous.

Change-Id: I8fd1968f7da78966386de18506b98d403b82d80e
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/408220
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-18 15:41:00 -04:00
Ben Walker
880e3b153e lvol: Make lvol rename RPC arguments required
The RPC can't make progress if the old name and new name
are not specified.

Change-Id: I1a74fb264142fc2ff17cc5b3a2837840509827b5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408221
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>
2018-04-18 15:35:12 -04:00
Ben Walker
4d2e54a635 nvmf: Handle addresses that don't contain a port
Change-Id: I0c0c455ccf6f00ff95e7f1d2f0391fc44c6b4b2a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408219
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>
2018-04-18 15:35:12 -04:00
Ben Walker
63fb2f772c nvme: Close file descriptor if controller fails to initialize
Change-Id: I9fee91ece79b204962a70fc49d9032abe2c55090
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/408218
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>
2018-04-18 15:35:12 -04:00
Daniel Verkamp
37039565d0 io_channel: add asserts in spdk_io_device_register
spdk_io_device_register() doesn't have a return value, but we can at
least catch trivial mistakes like neglecting to pass a valid io_device
or create/delete callback in debug builds.

One invalid unit test case that passed NULL for all parameters is
removed, since there's no way to make that work without adding a return
value instead of asserts.

Change-Id: I3dd4c850bdb14957d2dc03209ea9ea44bbe4e616
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408117
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-18 12:33:25 -04:00
Daniel Verkamp
0f99e7ab9e nvmf: report that namespaces may be shared
The namespaces exposed by the NVMe-oF target may be attached to multiple
(virtual) controllers at once, so we should indicate this via the
Namespace Multi-path I/O and Namespace Sharing Capabilities (NMIC) field
in the Identify Namespace data.

Change-Id: Iecca80f01577422f73d781c05dcb212db55f7ee1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407834
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-18 12:33:15 -04:00
Dariusz Stojaczyk
0a1a4ce116 virtio: rename ops->get_queue_num callback
It actually returns the size of given queue,
so renamed it to get_queue_size to clean up
the API

Change-Id: I88551116b3dc19644764bba78b58444802a1d443
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408174
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-18 12:32:00 -04:00
Ziye Yang
ec5cf8a221 bdev/iSCSI: Make the connection connect in async mode.
Change-Id: I9d3b56ed908273c6853014241a28237f8d077cfa
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/405537
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-18 12:31:31 -04:00
Dariusz Stojaczyk
3ed915618f io_channel: always set dev->unregister_thread under a mutex
Fixes #278

Change-Id: I5689c3c315feea221335ae4b0218b5e64410a3aa
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408194
Reviewed-by: Jim Harris <james.r.harris@intel.com>
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>
2018-04-18 12:29:58 -04:00
Dariusz Stojaczyk
a7aa9d5737 io_channel: ensure io_device is always freed just once
Imagine the following code flow:
1. `spdk_put_io_channel();`
2. `spdk_io_device_unregister();`

Since putting an io_channel is always deferred,
it is likely that spdk_io_device_unregister will
lock the io_channel mutex first. It will set
dev->unregistered flag and then quickly realize
there are still open channels for this device
(refcnt > 0) - so it'll return. All fine here.

However, if the deferred put_io_channel happens to
lock the mutex first from other thread, it will
decrement the refcnt and attempt to free the device.
Both the decrementation and freeing are done under
a mutex, but there is a slight window inbetween
where the mutex is re-locked. spdk_io_device_unregister
is already sleeping on a mutex_lock(), so it might
strike now. It'll see there are no more io_channels
for this device and free the device. Once
put_io_channels regains the lock again, it will attempt
freeing the device for a second time.

This patch removes the slight window mentioned above.

Related to #278

Change-Id: I6c0f6014353529028d658211135196d97f1d8547
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408193
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-18 12:29:58 -04:00
Dariusz Stojaczyk
6c0078300b bdev: defer freeing bdev_io mempool
There might be a couple of mgmt channels still
trying to use the mempool from their destroy
callback (spdk_bdev_mgmt_channel_destroy).

Change-Id: I59247bfa283dc0481923fdd4eaf8e1726e1267ce
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/408192
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-18 12:00:16 -04:00
Ben Walker
2e1dbc4587 bdev: Fix race condition when testing whether QoS is enabled
When testing whether QoS is enabled, the code previously
checked mutable values in the bdev itself. Instead, it needs
to check the flag in the channel.

Right now, QoS can only be configured statically when the
bdev is created. This means that no channels will exist
prior to QoS being turned on, which simplifies setting
the per-channel flag (only need to set it when a channel
is created).

Change-Id: I59e56c64c18c262cc2a7f71a6dde8329edb35db7
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407354
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-17 21:47:12 -04:00
Tomasz Zawadzki
5d94d6d3a5 vpp: add support for vpp comm library
This patch integrates VPP userspace TCP/IP stack,
as optional network framework to be used in SPDK.

Support is done via VPP Communications Library.

Change-Id: I4c2945c76878dbf24ff2f8612e0a21615f7d87e6
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/389566
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>
2018-04-17 20:33:43 -04:00
Daniel Verkamp
0a162815d6 Revert "subsystem.c: make subsystem_remove_ns asynchronous"
This reverts commit 498f9add11.

Making the subsystem removal asynchronous seems to be triggering an
intermittent failure in the NVMe AER test.  Let's revert this for now
until we can diagnose the issue.

Change-Id: Ie1d598f0d5cce07e6869d87cd8388848caa78e46
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408118
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-17 20:17:27 -04:00
Seth Howell
498f9add11 subsystem.c: make subsystem_remove_ns asynchronous
Performing a subsystem update on each poll group after the addition or
removal of a namespace allows us to avoid the case where we pause a
subsystem, perform a removal, then an addition, resume the subsystem and
don't update the channel for that subsystem. This, however requires that
spdk_nvmf_subsystem_remove_ns be asynchronous.

Change-Id: I856572c02e6267f708da3a956accbbedae7260fb
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/407012
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-17 18:23:19 -04:00
Pawel Wodkowski
1a6dac405b bdev/virito: add JSON config dump and generic create RPC
The new construct_virtio_dev allow creating virtio SCSI and blk for both
PCI and user transports.

Change-Id: Ibd79c4fb75e3cbd993b46227d86e915c1b740a18
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/405419
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-17 17:16:06 -04:00
Tomasz Kulasek
0d1c3aefc3 blobstore: clone-snapshot classification
This patch introduces API to get some blobs capabilites:

bool spdk_blob_is_read_only(struct spdk_blob *blob);
bool spdk_blob_is_thin_provisioned(struct spdk_blob *blob);

to be used in upper level in the unified way.

Change-Id: I4411bb3f4dd0c64826ae16a66141b2911cbaab79
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/405022
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>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2018-04-17 17:05:53 -04:00
Maciej Szwed
208748b423 lvol: Creating 2 lvols simultaneously with same name
This patch fixes issue where user creates 2 lvols
with the same name simultaneously. New solution
builds list of names of lvols that are currently
being created and when new request comes it compares
name against existing lvols and lvols that are in the
process of creation.

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I31b59ee13b5b9bae531866925dd409b143f08ad4
Reviewed-on: https://review.gerrithub.io/407408
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-17 14:03:22 -04:00
Pawel Wodkowski
f34fae94fe bdev/lvol: add dump config mock
Change-Id: I0e081b17071bb5d906676c1b509bf8e0fc528b8e
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/407745
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-17 13:30:32 -04:00
Ben Walker
979d9997c9 io_channel: Fix race between put channel and get channel
Previously, there was a period of time where the user
had put the last reference to a channel, but when
calling to get a new channel would end up with the
previously created channel and channel destruction
would never execute.

This causes a number of unexpected issues to pop up,
as often the creation and destruction of a channel
is a key event.

Change-Id: Ie68135f6efdf45093a5a227f8c51cd11b971fcff
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407602
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-17 11:47:09 -04:00
Ben Walker
ade146b966 bdev: Wait for io device to unregister in bdev_part
Change-Id: I6627fd4253094548816c50bd97e13b22dc245df1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407838
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-17 11:47:09 -04:00
Ziye Yang
27d47b9a10 nvmf: make the qpair disconnnect in the right order.
Reason: Initiator sends the qpair deletion in wrong order.
The correct order should be all io qpairs deletion and then
the admin qpair deletion. However, nvme perf does not follow
this since we did not catch ctrlr + c. If we catch ctrlr + c,
we need to use the spdk app framework, or other methods. We should
support this in another patch.

Morever, to prevent the incorrect behavior causing the coredump
of target, we need also consider such case in our NVMe-oF target
design. And this patch, can solve this issue, it will defer the
admin qpair deletion when there are still active io qpairs.

Change-Id: Iec9b88c1d6254f36963c92402ebfe8bd99abaea5
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/407771
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-17 01:58:36 -04:00
Pawel Wodkowski
a3f8876777 vhost: add JSON config dump
Change-Id: If6c9ea6f9959b6c34ef90b8e382ceba9889040ee
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/404373
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-16 19:27:33 -04:00
Ziye Yang
b332897a04 nvmf: add the assert in spdk_nvmf_ctrlr_disconnect
Change-Id: I41c9946e6c30c3eda1abf3669270a9b9533e3a50
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/407612
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-16 19:23:18 -04:00
Pawel Wodkowski
5f6c428dbc bdev/iscsi: initialize g_iscsi_lun_head staticly and make iqn per bdev
Change-Id: I3cdf920a937209fd03cf3998c7927e505504b5f9
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/407767
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>
2018-04-16 19:14:54 -04:00
Jonathan Richardson
ce70f29662 nvme: Remove calls to getpid() when submitting nvme requests
As of glibc version 2.3.4 onwards getpid() is no longer cached. SPDK
makes calls to it in nvme_allocate_request() which is called for each
nvme request received. This results in a system calls up to millions of
times per second which slows down nvme submissions. Since the pid never
changes, it only needs to be called once in initialization per process.
This improves the performance of nvme_allocate_request() signficantly.

Change-Id: Idee0f06484d459906b9ce1d9b7360a33119c7e56
Signed-off-by: Jonathan Richardson <jonathan.richardson@broadcom.com>
Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-on: https://review.gerrithub.io/407599
Reviewed-by: Scott Branden <sbranden@gmail.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>
2018-04-16 16:19:44 -04:00
Shuhei Matsumoto
e5c5740911 app: Add "NoPci" to command line options
Add "NoPci" to command line options as '-u' to avoid lost of
compatibility when JSON config file is supported.

Change-Id: I8ee429f4f66f8837da22ef8e259a1a011edd9257
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407036
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-16 12:42:15 -04:00
Shuhei Matsumoto
67f2fb6363 app: Fix scan-build errors due to optarg handling
Change-Id: Ia952f0a962ee63d25ac5297498bffb7e70e5204b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/407029
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-16 12:42:15 -04:00
Daniel Verkamp
fa6f7a166d nvme: improve error messages in set_num_qpairs
The functions they were referring to have been renamed; rather than
fixing up the function names, use the spec-defined NVMe command names so
it's more understandable. (The second message was also incorrectly
referring to "set" instead of "get", which is fixed as well.)

Change-Id: Id140a91c837d8c913760d2f55318472689c00f45
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407593
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>
2018-04-16 12:31:26 -04:00
paul luse
a4a497d5b0 bdev: add new optional bdev i/f entry point
Add new optional bdev module interface function, init_complete, to notify bdev modules
when the bdev subsystem initialization is complete. Useful for virtual bdevs that require
notification that the set of initialization examine() calls is complete.

Change-Id: I0997fb5749d430f2fd3a40172ec8a1d5caa96964
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/407222
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-13 17:46:33 -04:00
Daniel Verkamp
453c804d1b nvme: continue initialization even if NN=0
Similar to the previous patch, some controllers may report 0 namespaces;
we should still be able to send admin commands in this situation.

Change-Id: Ia14e3ce773c63e645199e1c40ba5b37095da2473
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407497
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>
2018-04-13 15:59:00 -04:00
Daniel Verkamp
c9ef7642c9 nvme: make set_num_qpairs failure non-fatal
A controller that fails the Set Features/Get Features - Number of Queues
won't be able to create I/O queues, but it may still accept admin
commands.

Change-Id: Iec79d641f7d460448a8d8e1295764f1f03f98594
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407378
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>
2018-04-13 15:59:00 -04:00
Ziye Yang
31bf5d795e nvme: make timeout function per process
Change-Id: I6e58baaeb09580b5f70e1acf5323376ca0b26bbf
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/407382
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-13 12:30:51 -04:00
Tomasz Kulasek
2da6293e85 lvol: add UUID to lvols snapshots and clones
See commit 8887697f8c ("bdev/lvol: add UUID to lvols")

Change-Id: I8b0c2678678588fc9ab85bfcf19fefffc0e26b0c
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/407300
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>
2018-04-12 19:29:00 -04:00
Daniel Verkamp
be0eef0a0d nvmf: check for missing NQN in conf parsing
Avoid dereferencing a NULL pointer if NQN wasn't specified in the
configuration file.

Change-Id: Ie43111fce2c5fcf06bad00af10413a665dfbc45f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407484
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>
2018-04-12 17:56:21 -04:00
Dariusz Stojaczyk
6820d312e1 vhost: move memory registration to DPDK thread
Moved it to the DPDK thread, so that we don't stress
SPDK I/O reactors on device start/stop. This is mandatory
if we want to maintain hundreds of simultaneous connections.

This patch also fixes various memory registrations leaks
in cases where further device initiation fails.

Change-Id: I435062108fe96d7e67e2a078a3547acb1f73ad11
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/406960
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-12 16:06:31 -04:00
Ben Walker
aedbb3b81a nvme: Rmove all uses of strncpy
strncpy is going to be added to the list of banned functions because
it does not guarantee strings are null terminated.

Change-Id: Ic18623c281cca7c3d87732bc7677b284d57685c8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407023
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-12 13:45:04 -04:00
Ben Walker
9611db82a3 lvol: Remove all uses of strncpy
strncpy is going to be added to the list of banned functions because
it does not guarantee strings are null terminated.

Change-Id: Iabd65cc703f56e8bc561344893aaeb6dc5f25fb8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407022
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-12 13:45:04 -04:00
Daniel Verkamp
3b62b84f41 lvol: use uint64_t to represent lvol sizes
Replace the few existing uses of size_t as lvol size with uint64_t for
consistency.  size_t is meant to represent the size of an object in
memory, and it may be smaller than uint64_t (e.g. on 32-bit platforms).

Change-Id: Ifed8959625e18be67e98070f7fea1f2a09e4e791
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407008
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
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>
2018-04-12 11:42:06 -04:00
Pawel Wodkowski
e548df4ed1 iscsi: do static initialization of globals that allow it
Change-Id: If6db1fbdcf45f689e315c769ded0e0d8cd90aafd
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/407206
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-12 11:26:44 -04:00
Pawel Wodkowski
b066126b0b jsonrpc: convert send queue to singly linked tail queue
Prepare to use RPC server before env initialization when we can't use
struct spdk_ring yet.

Change-Id: I0d37fcdd7bf162d6a25baa050efa0421fdcf9599
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/407207
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-12 00:11:35 -04:00
Dariusz Stojaczyk
ffb4d54a79 vhost: unaffinitize rte_vhost thread
rte_vhost_driver_start() can start a new posix thread
that polls for incoming socket connections and calls
backend->start/stop_device. Soon we're going to put
more work on this thread, so we need to make sure it
doesn't collide with SPDK reactors.

This patch also fixes vdev memory leaks in case the
rte_vhost_driver_start() fails.

Change-Id: I16fdff228176a245c478251b39aa244a49bd124b
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/406959
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-11 16:49:57 -04:00
Jim Harris
1831b086d0 blobfs: sync length if append occurs after cache eviction
Intermittent failures with the RocksDB tests pointed to
corruption in the MANIFEST file.  Further debug showed that
the MANIFEST file would be corrupted when its cache was
evicted.  Blobfs was partly handling append after cache
eviction - it would write the data to the correct position
within the blob.  But the sync path would not write the
updated file length xattr when the cache had been evicted.

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

Reviewed-on: https://review.gerrithub.io/407232
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>
2018-04-11 16:03:14 -04:00
Yanbo Zhou
c149736596 include/net.h: remove non public functions to private header file
Change-Id: I83102439d837e5b38ebcd0f19a802bfa26da0a9c
Signed-off-by: Yanbo Zhou <yanbo.zhou@intel.com>
Reviewed-on: https://review.gerrithub.io/406941
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-11 12:10:14 -04:00
Ben Walker
c0d6eb9d11 iscsi: Remove all uses of strncpy
strncpy is going to be added to the list of banned functions because
it does not guarantee strings are null terminated.

Change-Id: I5fe2f9e717bb65caf6fa26dca075aa974c7f7173
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407021
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-11 10:23:09 -04:00
Slawomir Mrozowicz
7552707ef1 bdev: Enable lvol resize RPC
Enable test functions for lvol resize.

Change-Id: Ia4583af211350054797d2d8441083e582e6e2ab7
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Reviewed-on: https://review.gerrithub.io/395043
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
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>
2018-04-10 19:24:04 -04:00
Slawomir Mrozowicz
f3e13c95d9 bdev: Change vbdev lvol resize function
Change vbdev_lvol_resize() char name argument
to struct spdk_lvol lvol.
Add spdk_bdev_notify_blockcnt_change() after
succesfull spdk_lvol_resize().
Some code clean up and refactoring.

Change-Id: Idaa5bd4707e2479dfee50459a9844319b8c35d3a
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Reviewed-on: https://review.gerrithub.io/394521
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>
2018-04-10 19:24:04 -04:00
Daniel Verkamp
72b7f73c26 lvol: remove free cluster check on resize
spdk_blob_resize() already checks for free clusters as needed (as well
as handling the thin provisioning case).

Change-Id: I445cc0f4ce15b67253bdfa15c2d703ff0fcb49b3
Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407010
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
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>
2018-04-10 19:24:04 -04:00
Daniel Verkamp
5a79fdc6ef lvol: convert size to clusters in spdk_lvol_resize
This fixes the units when calling spdk_blob_resize(), which wants
clusters, from spdk_lvol_resize(), which takes sz in bytes.

Change-Id: Ie6863b7569a43cfe181645e2776ea17b28ad5677
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407007
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
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>
2018-04-10 19:24:04 -04:00
Ben Walker
e433001a47 bdev: Put 3 types of channels in a hierarchy
The bdev layer has three types of channels:

* bdev channels - one per bdev per thread
* module channels - one per bdev module per thread
* management channels - one per thread

Arrange this in a hierarchy where bdev channesl point to
module channels which point to management channels. Rely
on the channel mechanism to reference count and release
resources at the correct time.

Change-Id: I9341068f95ec2a3897c5a1d897895a4f5cc49299
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406854
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-10 19:12:15 -04:00
Ben Walker
150a5898cb bdev: Reorder functions in the spdk_bdev_module_finish path
This is code movement only. This minimizes an upcoming
diff.

Change-Id: If2af99fdd86ca3c8ce672b9d8f5bc44a2f30cc8e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407218
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-10 19:12:15 -04:00
GangCao
9bad29c18c bdev: update the name of Passthru section
Change-Id: I28fa033378649f9cf02bf216698b9d2058f77c9d
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/406883
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-10 15:44:54 -04:00
Daniel Verkamp
565932d27a nvmf: fix non-deallocate Dataset Management status
If the host sends a Dataset Management command that does not specify the
Deallocate attribute, the NVMe-oF target should return success; the spec
says that this command is advisory, and all combinations of attributes
may be set.

Change-Id: I5d87d93ec61d27c8d65a17bbe4accc12ba26bbd3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406995
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-10 15:44:38 -04:00
Changpeng Liu
2d192cf8fb nvme: use AER configuation structure when starting controller
Change-Id: I79dad84d1dc58e61eb36b461b41fbd7ee73631fc
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/406899
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-10 15:43:38 -04:00
Daniel Verkamp
7bdd103b3d vhost: fix indentation in vhost_user.h
Change-Id: Ib77a219e02a5cde69293eb1f7002507cf4930ae3
Fixes: 90c0e24410 ("vhost_user_nvme: add vhost user nvme target to SPDK")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/407193
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>
2018-04-10 15:43:26 -04:00
Daniel Verkamp
af9c9a415a scsi: validate dev name length
Instead of silently truncating overly-long SCSI dev names, add an
explicit check and return an error if the name is too long.

Since we now calculate the length of name up front, this also allows
simplification of the copy into dev->name.

This also ensures that dev->name will always be zero-terminated, so we
can simplify the strnlen() in spdk_bdev_scsi_pad_scsi_name() to a
strlen() and remove the invalid unit test case for padding names longer
than SPDK_SCSI_DEV_MAX_NAME.

Change-Id: I54de00bac062a142a10c41cfa2aec19d7969dff0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406990
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>
2018-04-10 15:43:03 -04:00
Tomasz Zawadzki
97934c5291 lvol: add snapshots and clones
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Change-Id: Ibc43e3ee65d85a83d78d6e15457ae57992a1188a
Reviewed-on: https://review.gerrithub.io/395059
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-10 13:46:09 -04:00
Ben Walker
38d75b56f4 blobfs: Remove all uses of strncpy
strncpy is going to be added to the list of banned functions because
it does not guarantee strings are null terminated.

Change-Id: I14e2ce65401bbdb77260627e94aa936797c20ce0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407020
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>
2018-04-10 12:58:34 -04:00
Ben Walker
7b822323e8 bdev: Remove all uses of strncpy
strncpy is going to be added to the list of banned
functions because it does not guarantee strings are
null terminated.

Change-Id: I6657471f5771489b5004e48d08e79cebb860b069
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407019
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-10 12:58:34 -04:00
Ben Walker
a615ae7e26 bdev/nvme: Fix descriptor leak in apply firmware RPC
Change-Id: I1a82e1c248d573f3a99e661bc7fef0871cfcc7f4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406993
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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-10 12:58:34 -04:00
Ben Walker
96fcdf93e7 vhost/nvme: Check for NULL nvme on public functions
Due to the check on line 153 in t_nvme_dev, Klocwork
thinks nvme can be null. Therefore, we must check that
it isn't null before dereferencing it. We can either
solve this the way I have here, or remove check
that causes to_nvme_dev to return null.

Change-Id: I86d4939664704ff1117a7c1b7dada7e1ae479c6f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406992
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-04-10 12:58:34 -04:00
Ben Walker
a28294b0b4 bdev/nvme: Fix use after free in apply firmware RPC
Change-Id: I7ffe73e803ef416ce698df2d8403e32fa94ebccd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406988
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-09 16:33:19 -04:00
Daniel Verkamp
d9135820c5 blob: copy xattr name with memcpy()
We know exactly how long the name is, so there is no need to use a C
string function to copy it.

Change-Id: I21b5f1e318555b46729582ab6a1e6bd163c85205
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406984
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>
2018-04-09 15:35:36 -04:00
Xiaodong Liu
6684c3b5ac nvmf: correct args order to get bdev_io status
Change-Id: Ib0b5e75f33ed22801a564a89651caa28ebe2b4f6
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/406890
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-09 13:13:41 -04:00
Ben Walker
7eac6d9b3e bdev: Remove _spdk_bdev_finish_unregister_bdevs
This is a one line static function called from one place.

Change-Id: Ie00bbedfabf54d40a2f571bbc8d30f0ac8cbbdd6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406853
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-04-09 12:41:44 -04:00
Ben Walker
fe53e5330c bdev: Move definition for spdk_bdev_module_channel up
Move this definition between the management channel and
the bdev channel struct since that's where it fits in
the logical hierarchy.

This is just code movement. No other changes.

Change-Id: I80b9909b14cad473a7768780ac9ab74a2f1309e5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406852
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: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-09 12:41:44 -04:00
Ben Walker
03717822c5 bdev: Change spdk_bdev_get_io to take a bdev channel
We'll need the bdev channel inside this function in
an upcoming change.

Change-Id: Iadb07700ba57b23d37b7c373d0e9c5063aaed57b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406851
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-04-09 12:41:44 -04:00
Ben Walker
ddde2c74f2 bdev/nvme: Fix memory leak of command in apply firmware RPC
The command can be allocated on the stack safely instead.

Change-Id: Iab412e91c1a06f80f1d86d7f9a6d88be2a759b09
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406859
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-09 11:39:18 -04:00
Jim Harris
218dcd840a bdev/pmem: change all NVML strings to PMDK
NVML (Non Volatile Memory Library) changed its name to
PMDK (Persistent Memory Development Kit), so make the
necessary changes to the SPDK repository.

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

Reviewed-on: https://review.gerrithub.io/406256
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-07 00:07:57 -04:00
Ben Walker
26dd844d8a nvmf: Detect bdev additions and removals on subsystem resume
Change-Id: Icd365143bafe259526e303e74618908d2c52f146
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406663
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-06 18:41:59 -04:00
Daniel Verkamp
d7f842a7c6 copy/ioat: reduce log level of informational messages
Change-Id: I9c4fc8dfc8ca960f6d30a29a9c129fae815ffec5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406632
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>
2018-04-06 18:31:54 -04:00
Daniel Verkamp
bf41a94216 lvol: use per-lvol uuid as unique_id if available
For old lvols that were generated before the per-lvol uuid was added,
the original lvolstore uuid + blob ID unique_id will still be used.

Change-Id: Id0f23836ff6fc8886d313f9e3d03e8b7204de2a2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/404033
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>
2018-04-06 18:31:31 -04:00
Daniel Verkamp
be4ac912a1 nvme/rdma: improve nvme_rdma_get_event() message
Add the event status code to assist in debugging, and reorder the
message so it is easier to read.

Change-Id: I2a1fb900471a482707fbfb6db84bc81cb3b0cdad
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406636
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>
2018-04-06 18:30:58 -04:00
Daniel Verkamp
72509206dd bdev/malloc: num_blocks parameter should be uint64_t
Change-Id: Ib88b797da168290ac07564cae46e544cb037f575
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406672
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>
2018-04-06 18:22:22 -04:00
Daniel Verkamp
415933c879 bdev/null: fix RPC string memory leak
The uuid string was not freed.  Factor out the free() calls into a
helper function and add a free of uuid.

Change-Id: I2f5f794e240fcdb07f346b892ea4dec46dc9bdb6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406665
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
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>
2018-04-06 18:22:22 -04:00
Daniel Verkamp
aa3345346c bdev/null: num_blocks parameter should be uint64_t
Change-Id: Ie60989f157d20119dd24488688d527f607b585f1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406660
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>
2018-04-06 18:22:22 -04:00
Ben Walker
0b5fb0921f bdev: Consistently refer to the module channel as module_ch
It was called module_ch and shared_ch throughout the code.
The name module_ch is better, so use that everywhere.

Change-Id: Id030f72c878f44ea4dc8ca14b936719e26e891e3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406825
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>
2018-04-06 16:30:49 -04:00
Tomasz Kulasek
f0aacaf6ae lvol: verify lvol name rework
This commit moves the name verification function out of the
spdk_lvol_create.

Also changes return value from -EINVAL to -EEXIST when name
already exists in lvol store, as more informative. It implies
that spdk_lvol_create also returns -EEXIST error code for
this case.

Change-Id: Ie0f642b316ba8c5cc42657334d35e539be56e830
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Reviewed-on: https://review.gerrithub.io/406745
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-06 16:30:24 -04:00
Piotr Pelplinski
3eb5130de6 blobstore: allow creating clones out of read-only snapshots
Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Change-Id: Iad67be79d0ddd8c498950c4f7b1b3203e47a7a41
Reviewed-on: https://review.gerrithub.io/393936
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-06 16:30:24 -04:00
Piotr Pelplinski
777627e024 blobstore: add snapshot functionality
This patch adds new feature of blobstore.
New call creates a read-only snapshot of specified blob with provided options.

NOTE:

This patch doesn't cover recovery operation if snapshotting fails. This operation
will be implemented and added later.

Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com>
Signed-off-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>
Change-Id: I470ca13525638fa6df485d508b3adf71b6b69c0b
Reviewed-on: https://review.gerrithub.io/393935
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-06 16:30:24 -04:00
Paul Luse
8988543dbf bdev: cleanup passthru vbdev
A few small changes for readability and one changed examine
error returns to breaks to assure examine_done() is called
in those cases.

Change-Id: If21ecdfa9ce1d6dbeeff4ced4e73425cec5940e1
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/406818
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-06 16:29:54 -04:00
Jim Harris
463925ff0f blob: make spdk_blob_resize an async operation
To support resize operations during I/O, we will need
to send messages to each thread to quiesce I/O while
the resize operation is in progress to guard against
the cluster map memory changing while another thread
is accessing the cluster map.

Therefore, spdk_blob_resize needs to be asynchronous.

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

Reviewed-on: https://review.gerrithub.io/404616
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-05 18:43:11 -04:00
Pawel Wodkowski
33aad6ee8d bdev/nvme: add JSON config dump
Change-Id: I0f22e6051e291b3eac8589fe0f686f7db445d71c
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/406587
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>
2018-04-05 18:26:16 -04:00
Daniel Verkamp
9689e6cca5 nvmf: use standard types in spdk_nvmf_valid_nqn()
Change-Id: Ia1b26b35a5befbd6e3775bce224a8a9f473426e9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406442
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-05 15:57:34 -04:00
Daniel Verkamp
8cad9604bd nvmf: verify that serial number is an ASCII string
Don't allow the user to specify an invalid ASCII string for the
controller serial number field.

Change-Id: I1c3acf6997a0afcdbfc03caf9e8d9b5fab429106
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406441
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>
2018-04-05 15:57:34 -04:00
Dariusz Stojaczyk
20d8fec039 bdev/virtio/scsi: fix bdev->name memory leak
This must have been overlooked before.

Change-Id: I631c7b926970d045e9e91cada535acd605e05b6e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/406334
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-05 15:56:21 -04:00
Pawel Wodkowski
be98deff3e bdev/rbd: add missing block_size in RPC config dump
Change-Id: Ic918f7b95598631432a67508735324c6be7af21d
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/406588
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-05 14:57:43 -04:00
Ben Walker
fe54959b62 nvmf: Queue incoming requests to a paused subsystem
Subsystems enter the paused state when their internal
data representation is changing (i.e. namespaces are
being added, etc.). Queue incoming requests while
in this state.

Change-Id: I51e0c687b5b0f98351faa20dffa57110eb4a9df4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406449
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-05 12:54:31 -04:00
Ben Walker
2b79861deb nvmf: Make spdk_nvmf_tgt_listen asynchronous
This was internally asynchronous already, but make it
explicitly asynchronous so other code can properly
wait on the operation to complete.

This fixes an intermittent CI crash.

Change-Id: I81c9b19673566047dcffa94796236ca9fd7fa7d0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/406226
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-05 12:54:31 -04:00
Daniel Verkamp
9770ee7817 nvmf: reduce log level of informational messages
Change-Id: I595f0ec871174557a35811fe3b102c33a5a60ab0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405931
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>
2018-04-05 12:06:45 -04:00
Daniel Verkamp
c27c2c0674 vhost: reduce log level of informational messages
SPDK_NOTICELOG should only be used for significant but non-warning/error
messages, such as notifications of deprecated config file sections.

Change-Id: I885dfe839c9cbc9eceabee234e4d0eb74c6910df
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405923
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2018-04-05 12:06:45 -04:00
Seth Howell
105dcc0bd9 bdev.c: defer destroy until dev_unregister returns
by placing the destroy function in the callback of the
io_device_unregister, we ensure that all channels associated with a bdev
will be freed before the bdev is destroyed. This eliminates the
possibility of an io_channel callback referencing a destroyed bdev.

Change-Id: I0dd6f53dcfa9c9c5a3c6e98a7e2ad8687da17c3f
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/406248
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>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-04 17:05:22 -04:00
Pawel Wodkowski
46fee78e20 bdev/split: add JSON config dump
Change-Id: I5d12dfb4227441bc147b9356f874fe0051b3ba0b
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/401224
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-04 16:03:00 -04:00
Pawel Wodkowski
a5dbccf02b bdev/split: add RPC support
Split bdevs now can be create using "create_split_bdev". To keep
backward compatibility, this call will not fail if base bdev is not
available yet instead will add base bdev name to its live configuration
and create splits when base bdev will be created (during examin
process).

Change-Id: Ie26ffc0e947f6d88ff56830dd50999795283df2e
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/404164
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-04 16:03:00 -04:00
Daniel Verkamp
61d379fd7e nvmf: move Command Effects log page to ctrlr.c
No code change - the existing code is moved as-is.

This is the only place it is used, and it is conceptually part of the
virtual controller implementation.

Change-Id: I863f5931225c4d78e515341445e91b29a73da64d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406251
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>
2018-04-04 15:10:30 -04:00
Daniel Verkamp
1ec2c81bbc nvmf: report support for multiple ports and controllers
The NVMe-oF subsystems that our target exposes may have multiple
subsystem ports and multiple controllers; report these in the Identify
Controller data structure Controller Multi-Path I/O Capabilities field.

Change-Id: I5f1d4ce91698fe6abd281fdc022b6e3b37efd3ef
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406244
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>
2018-04-04 14:55:48 -04:00
Daniel Verkamp
3165d0c070 nvmf: report support for NS Attribute notification
Fixes: 26541489ef ("nvmf: implement Get Log Page - Changed NS List")
Fixes: 763ab88884 ("nvmf: add Namespace attribute notice support")
Change-Id: Id015e4d96fe98a7f6c845821395463e341b7066c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406247
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>
2018-04-04 14:55:48 -04:00
Shuhei Matsumoto
0fed4e0704 copy_engine: Support dump config text for IOAT config
IOAT module of copy engine requires config information in the .INI
config file. However dump config text is not supported yet.

Dump config text is legacy feature but this becomes a preparation
for the upcoming JSON config file.

Change-Id: I9b7349cac9c00ca3ce1d944a84cbc445a6f1aec4
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/405845
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>
2018-04-04 12:18:31 -04:00
Shuhei Matsumoto
3f522bfeb0 copy_engine: Hold module configuration to dump it
This patch is a preparation for JSON-RPC and JSON config file.

Change-Id: Ieef3ccfb68405b5d6b98fdfb3f99eafd92bccaf7
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/405844
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>
2018-04-04 12:18:31 -04:00
GangCao
61e8486c10 bdev/qos: add the QoS setting in conf file
For application like vhost/iSCSI target/NVMe-oF target/etc,
a new section as below can be added for the QoS rate limiting.

[QoS]
  Limit_IOPS Malloc0 100000
  Limit_IOPS Nvme0n1 500000

Also added a sample change at test/lib/bdev/bdev.conf.in

Change-Id: I7c7d951fbe1352ca2571f135c657bc4fa43b56c7
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/393221
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-03 19:36:58 -04:00
GangCao
310f324e38 bdev/qos: add the support to reset QoS bdev channel
As there is no I/O channel associated with the QoS
bdev channel, add the specific functions to handle
the reset operation on the QoS bdev channel. The
reset operation will be conducted on the QoS thread.

Related UT code on QoS with reset operation was also
included.

Change-Id: Ibba68ddb132fa926fec6327829157b43ac806713
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/393181
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-03 19:31:50 -04:00
Daniel Verkamp
26541489ef nvmf: implement Get Log Page - Changed NS List
Change-Id: I6219ace8deba0bfc3e3c7f6a4e00c0098584d5ee
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405122
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-03 17:29:56 -04:00
Changpeng Liu
0f15edee2d nvmf: factor out namespace change helper function
Change-Id: Iaeaf308bc2135cf94a3e1fd94c3c5d56f8a2f86e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405130
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-04-03 17:29:56 -04:00
Changpeng Liu
763ab88884 nvmf: add Namespace attribute notice support
Users can use RPC to add/remove a namespace to/from
existing NVMe controller, SPDK NVMeoF target will
generate an asynchronous event as an indication to
host when asynchronous event request is available.

While here, we also set the event with invalid log
identifier, so that the host doesn't need to clear
the event. Users can use Set Feature to disable
such event.

Change-Id: I93c4d752f552d3c86c53e80877aa61c093e167cc
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/398759
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-03 17:29:56 -04:00
Shuhei Matsumoto
22b8b92275 bdev/error: Add config of error vbdev when the base bdev of it doesn't exist
Currently construct_error_bdev() fails if the base bdev doesn't exist.
This patch add configuration of the error vbdev for the base bdev instead,
and the configuration will be parsed at examine() when the base bdev is
created.

This will improve the usability of error injection for bdev and will be
usable for the upcoming JSON config file.

Change-Id: I550b7f6c74fd8ab6cbd424a192f12a0c0099028e
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403914
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@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>
2018-04-03 15:33:14 -04:00
Dariusz Stojaczyk
3cb775b9ae virtio: don't silence vhost-user errors
All errors were being silenced in an upper virtio layer.
This patch makes them properly propagate further.

Change-Id: I289c810ff0f670c4ba1fbcf0804089639fa561a8
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/405918
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-03 15:22:49 -04:00
Dariusz Stojaczyk
91bdec96c7 virtio/vhost_user: set NEEDS_RESET status bit if necessary
This protects against brute-force initialization that virtio
is not really prepared for. Most importantly, this behavior
makes us Virtio spec compliant (3.1 Device Init.).

Change-Id: I6d26f3d8b5cce488a71068777531b78538489662
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/405917
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-03 15:22:49 -04:00
John Kariuki
8ac087613c bdev/passthru: read/write access
Change-Id: I541b5846f2c1c4acd2c7a6771147738112c8f803
Signed-off-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-on: https://review.gerrithub.io/406118
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-03 15:15:30 -04:00
Changpeng Liu
90c0e24410 vhost_user_nvme: add vhost user nvme target to SPDK
Similar with exist vhost scsi/blk target, this commit introduces
a new target: vhost nvme I/O slave target, QEMU will present an
emulated NVMe controller to VM, the SPDK I/O slave target will
process the I/Os sent from Guest VM.

Users can follow the example configuation file to evaluate this
feature, refer to etc/spdk/vhost.conf.in [VhostNvme].

Change-Id: Ia2a8a3f719573f3268177234812bd28ed0082d5c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/384213
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-03 15:01:24 -04:00
Daniel Verkamp
6b5a1d6c24 bdev/pmem: add conf support to test in blockdev.sh
The long-term plan is to use the JSON-based configuration format, but
for now, we need a config file section to be able to test a bdev module
in blockdev.sh.

Change-Id: I2a69f7172693ed6d4939a3b938747e2a1c62ff83
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405908
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-03 14:14:29 -04:00
Changpeng Liu
998b961e75 nvmf: set the subsystem state to inactive when removing it
Since the function call will remove all the active I/O channels,
the pollers don't need to submit all the pending I/O requests any
more.

Change-Id: I93e7b070f5c74b10f67bd1248fa515a29dca5620
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/403759
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-03 14:12:24 -04:00
Daniel Verkamp
e134fa47c2 app: set default print log level INFO, log NOTICE
This causes INFO logs to be printed to screen, but only NOTICE and more
critical logs to be sent to syslog.

Change-Id: I1371cd1485348da82d073d7f929d90609adbc3d8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405932
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-03 13:52:35 -04:00
suman chakraborty
bc9423e229 Segfault occurs during connect to the subsystem when a namespace is added with a nsid smaller than the nsid previously added
Change-Id: I74c7b32e1713d683e5d80818724ed3b19f3dac64
Signed-off-by: suman chakraborty <suman.chakraborty@wdc.com>
Reviewed-on: https://review.gerrithub.io/405373
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-03 13:26:14 -04:00
Shuhei Matsumoto
af7cbd44b0 event/app: Refactor initialization of trace in spdk_app_start()
Refactor spdk_app_start() in lib/event/app.c to support JSON config file.

Change-Id: I259f17dd2b2a9c886bae729b40792f04aa638c3a
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/405364
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-03 13:21:22 -04:00
Shuhei Matsumoto
93cb4a311a event/app: Refactor initialization of app environment in spdk_app_start()
Refactor spdk_app_start() in lib/event/app.c to support JSON config file.

Change-Id: Iedcbdeef5cc48c9aab4137735c1eae8daeb63950
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/405363
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-03 13:21:22 -04:00
GangCao
3bce351916 iscsi: enable per-core cache for PDU data-out pool
With the preferred per core operation for the lockless
consideration, having some per core cache instead of
the shared gloal cache will help the performance.

Change-Id: Ib3cfaac5bad7062b15643d5b151d4c7c6051ddf1
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/404533
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>
2018-04-03 11:57:17 -04:00
Ziye Yang
6d4e6ffd08 nvmf: add the assert in ctrlr_delete_qpair
Change-Id: I4c23f83ebaf80f1b62fb4c1144ff864bdfd6efbe
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/406014
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-02 19:57:05 -04:00
Ed Rodriguez
06fbf4b34b nvme: Use active namespace list for enumerating namespaces
- Add support for multi page CNS 0x2
 - Use CNS value 0x02 (SPDK_NVME_IDENTIFY_ACTIVE_NS_LIST)
   to query active namespaces
 - Add an API to iterate the active list

Change-Id: Iea524881fa6e3610a7d85ab02a2005a92fd633df
Signed-off-by: John Meneghini <johnm@netapp.com>
Reviewed-on: https://review.gerrithub.io/401957
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>
2018-04-02 17:17:40 -04:00
Daniel Verkamp
8e56cd4131 env_dpdk: track PCI devices internally for vtophys
Replace the use of the private rte_pci_bus list with our own internal
list of PCI devices inside SPDK.  This fixes linking against the shared
library version of DPDK.

Change-Id: Ia69555e4e7caa1a40974b7969d48773e36ae0fd7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405937
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>
2018-04-02 14:03:05 -04:00
Daniel Verkamp
75ed184a79 env_dpdk: use public function to check VFIO status
DPDK 17.11 added a public API, rte_vfio_is_enabled(), that we can use
instead of declaring and using pci_vfio_is_enabled().  This removes one
of the remaining non-public DPDK symbols we are currently using, getting
us closer to building against the shared library version of DPDK.

Change-Id: Idf4ee66d4868cf542521fa2896ed8c609d42ee29
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405921
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-02 14:03:05 -04:00
Pawel Wodkowski
60e8667261 bdev/split: move config scaning to vbdev_split_init
By this we are abble to produce proper RPC config in next patches.

Change-Id: I1ae9e81bf50bc4fb5e6a9cf7bf9b84df7e6377d1
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/403842
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-30 20:47:08 -04:00
Daniel Verkamp
d2e7daa435 nvmf: add stubs for all mandatory Get/Set Features
Most of these don't actually do anything useful yet, but they are all
required by the NVMe 1.3 specification.

The features are also rearranged in numeric order to make it easier to
match up the cases in the switch statements to the specification.

Change-Id: I5f70ecb0bb38b9e1d8287d32fc2e03bca5f1f8a6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403903
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-30 20:18:54 -04:00
Dariusz Stojaczyk
9728d6b054 virtio: check if setting status bits succeeded
This is required by the Virtio spec. (3.1 Device Init.)
It will also help us with vhost-user error handling.
set_status() doesn't have a way to return an error, so
its internal failures were silenced until now. When we
exceeded max memory region count (8) we only printed
an error message without failing any SPDK initialization.
This patch fixes that. It also removes not-particularly-
useful comments in virtio_dev_reset().

Change-Id: Ibe0010c493ef4e12e1fdd0a1679bf706f298d97e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/405915
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-30 19:34:22 -04:00
Dariusz Stojaczyk
c2520346bf bdev/virtio/blk: fix memory leaks on device init failure
Change-Id: I43dfe7f7067a7344922f4dfbdce34b72754b9c0a
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/405914
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-30 19:34:22 -04:00
suman chakraborty
5e98dfd126 nvmf: add capability to add namespaces dynamically during active connection
1) The user should provide MaxNamespaces during the construction of the subsystem
2) The namespace which is added should have nsid less than or equal to MaxNamespaces
3) If the user does not provides MaxNamespaces then the exsisting behaviour continues where the nisd can grow dynamically when it is not connected.

Change-Id: I54769d9669575a5f6bf56fe5a262191ac51c474d
Signed-off-by: suman chakraborty <suman.chakraborty@wdc.com>
Reviewed-on: https://review.gerrithub.io/405375
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>
2018-03-30 19:24:29 -04:00
GangCao
3709dfd674 bdev: update the function to get the QoS setting
Instead of accessing the qos_channel pointer on the bdev,
always have the QoS parameter on the allocated memory of
qos_channel structure.

The bdev->qos_channel is set to NULL in the destroy operation,
and the destroy is through the async message which could
be executed later after the poller function within which
the bdev->qos_channel is accessed (thus a NULL pointer
dereferenced).

In this case, assign the memory address of the allcoated
qos_channel to the function as the parameter to solve
this issue.

Change-Id: I2fdb53cb0a6a29fb41ab28362f8e068d21ee5d12
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/405438
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-30 17:43:25 -04:00
Daniel Verkamp
cdaf4fd922 nvme/rdma: re-use memory registrations if possible
We don't need to re-register memory with the same ibv protection domain
more than once; maintain a global list of already-registered PDs and
reuse the existing registration for other queues.

Change-Id: I7ec9c35ed93083faa00cca4cb5c61104200a4c66
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405702
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-30 17:37:15 -04:00
GangCao
898bbb660b bdev: properly handle the io_outstanding count for QoS bdev channel
Change-Id: If9e52b9a16ffff7bd4263bfca85bf7cbaf53984c
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/405868
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-30 17:32:01 -04:00
Shuhei Matsumoto
cf4cf8d52a event/app: Refactor read global params of config file in spdk_app_start()
Refactor spdk_app_start() in lib/event/app.c to support JSON config file.

Change-Id: Ia2b36e517b59b6ac1ffb12cb818efc8064fae495
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/405362
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>
2018-03-30 17:31:04 -04:00
Shuhei Matsumoto
a4c86be7f0 event/app: Refactor check config file operation in spdk_app_start()
Refactor spdk_app_start() in lib/event/app.c to support JSON config
file.

Change-Id: I157573eea48b774579158f41a9010e5faa1a3de5
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/405361
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>
2018-03-30 17:31:04 -04:00
Daniel Verkamp
c5008b37a0 nvmf: report support for Command Effects log page
Change-Id: Ia382110fbbadea51d3b454e07e775afc9e286eae
Fixes: c5cd53cce0 ("Support for Commands Supported and Effects Log Page")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405821
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-30 16:26:57 -04:00