Change-Id: Ia0ef86c281af8abeb311b4f15512ab5762f99095
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382724
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>
Change-Id: I77ed68cb07f66511907a44a24fce6263a192cdd9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382723
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>
the function of spdk_iscsi_find_init_grp() is duplicated with
of spdk_iscsi_init_grp_find_by_tag(). The later one should be kept.
Hence delete former one.
Change-Id: I8d397648bd400550445de49c8a7731f0932f5324
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/381244
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1ec1ac16a2a49aa352c48c70408d5a8683972869
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382510
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I270e6aac90f6bca9f5b047fba61f08fea16c6315
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382508
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
sprintf() has no bounds checks, and in this case it is actually
overwriting a buffer allocated with spdk_sprintf_alloc(), which isn't
guaranteed to be big enough for the name we want to place in it.
Rather than trying to rewrite the name in place, just free the old one
and allocate a new one.
Change-Id: Ia6ea17c2f0c8e4ed4995946356b8a09ba2a02cbf
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382507
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Virtqueues now have to be "acquired"
by a logical CPU core in order to
perform any traffic on them. The
acquire mechanism is thread-safe to
prevent two reactors accessing the
same virtqueue at the same time.
For now a single virtqueue
may be used by only one io_channel.
Support for shared virtqueues will
be implemented in future.
Added new param "Queues" to the
virtio config file for VirtioUser
bdevs. VirtioPci will use the
max available queues num -
negotiated during QEMU startup.
Change-Id: I3fd4b9d8c470f26ca9b84838b3c64de6f9e48300
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/377337
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>
Previously two spdk_events were allocated in spdk_app_start().
Now app allocated spdk_event for function to be called after
initialization is complete. Meanwhile subsystem allocates
its own spdk_event.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I4822f76d30cc2f7b95a86a4ffbfc61b80c0a903e
Reviewed-on: https://review.gerrithub.io/382673
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>
Previously vbdev_lvs_destruct() was only tested without lvols
created, so only simpler path was tested.
spdk_lvol_close/destroy() in unit tests now properly finishes
removing lvs and unregistering the device.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5f0f1feee4642aa01554aa0b7781f5cd0e22a4e6
Reviewed-on: https://review.gerrithub.io/382283
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
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>
Similar to blobstore unload, lib/lvol assumes that unloading
lvol store is only possible after no lvols on it are open.
Before spdk_lvs_unload() is possible, for each lvol
on that lvol store spdk_lvol_close() or spdk_lvol_destroy()
has to be called.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I86bae67ec322a61fdc0045d799854eecd1f36407
Reviewed-on: https://review.gerrithub.io/382252
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>
Useful in the case of drives that don't indicate this in their
information.
Change-Id: I128fb613cbc4638b9dcbe234b6bae6d056e48f71
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/379689
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>
This is required for adding
optional params for vdevs.
Since virtio-initiator README.md
had to be changed, some outdated
entries from TODO section has
been removed as a part of this
patch as well.
Change-Id: I472a966d8e4166305fb19ad3ab20e53289a1e071
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/382347
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>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I68a56666d30a550de4a2dc5a66fb669dfbad12dd
Reviewed-on: https://review.gerrithub.io/379659
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>
scsi_dev's port management became a little complex by supporting
delete port operation. Bugs were detected by code review. Hence
UT code were added. Submit UT code to master.
Change-Id: I7449dab9032683311268fcccc20513ee78fc981b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/381913
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>
The construct_malloc_bdev RPC method now takes an optional "name"
parameter to request a specific name for the created bdev, rather than
using the auto-generated Malloc%d-style name.
scripts/rpc.py is updated to add the new optional parameter, and it uses
-b/--name to match the corresponding parameter to construct_nvme_bdev.
Also update one of the test scripts to use the new parameter to get test
coverage.
Change-Id: I1f5bf76f406b8ea8a709d856f7624a38fbfa0d5f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/381728
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>
bdev_opened field in spdk_bdev structure is no longer required.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Ie4a368425b11b1c2e1a3a48b5858857b3935498b
Reviewed-on: https://review.gerrithub.io/381375
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>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Idd19b8be38a843dfd50710c09d0c6c31773c2f0c
Reviewed-on: https://review.gerrithub.io/380014
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
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>
If there is no lvol on lvol store in destroy bs_dev in
vbdev unit tests.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5b4783c98bb1b6bba011118f46f708ad0f0fb222
Reviewed-on: https://review.gerrithub.io/382018
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>
Change-Id: Ifa6d8cc512942d35aecffd29f5b7e2a85f69f431
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/365065
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
spdk_app_fini() changed to void, as no operation within it
can fail with meaningful return code.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If77cbf745a8e3fcba4ea24411aa1816f3910cde7
Reviewed-on: https://review.gerrithub.io/381537
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>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Every descriptor may now contain
a separate descriptor table.
This increases the maximum number
of concurrent IO in a virtqueue
from about (vq->size / 3) to
(vq->size * SPDK_VHOST_IOVS_MAX).
Knowing that SPDK_VHOST_IOVS_MAX
is 128, and assuming that vq->size
is 128 (current hardcoded limit
for QEMU), this gives us over 16k
concurrent possible iovectors
on the fly
Change-Id: I0853d80f6f90d53f8774231972b430a5bf05460e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/373703
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>
Also squashed function has_next_desc
into get_next_desc to simplify the
code.
We can't just mask indexes with
(desc_table_size - 1), since in
indirect descriptors case
desc_table_size might not be a
power of 2.
Change-Id: I8053b0e37c553548d76c7a9cfe6b4dbc11c28cfc
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/373744
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>
With this new API, callers can attach one specific ctrlr identified by
the transport ID directly along with optional ctrlr opts. If connecting
to multiple controllers, it is still suggested to use spdk_nvme_probe()
and filter the requested controllers with the probe callback.
Two primary use cases:
1) connecting to the NVMe-oF discovery controller
2) more straightforward way to connect a specific controller (avoiding
the probe callback)
A typical usage of this API with specific ctrlr_opts:
1. struct spdk_nvme_ctrlr_opts user_opts = {}
2. Call spdk_nvme_ctrlr_get_default_ctrlr_opts(&user_opts, sizeof(user_opts))
3. Modify the content of the initialized user_opts with user required value like
user_opts.num_io_queues = 8
4. Call spdk_nvme_connect(&trid, &user_opts, sizeof(user_opts))
Change-Id: Idf67ee5966f6753918c12604342c892d2f3bbe3a
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/370634
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>
This change is relating to add a new public API spdk_nvme_connect() under
include/spdk/nvme.h. This new spdk_nvme_connect() API will connect the user
specified trid and have a user optional ctlr opts. Rename this API and make
it as public.
A typical usage of this API as following:
1. struct spdk_nvme_ctrlr_opts user_opts = {}
2. Call spdk_nvme_ctrlr_get_default_ctrlr_opts(&user_opts, sizeof(user_opts))
3. Modify the content of the initialized user_opts with user required value like
user_opts.num_io_queues = 8
4. Call spdk_nvme_connect(&trid, &user_opts, sizeof(user_opts))
Change-Id: Ideec8247365ebf7dd15069e29821be8ea27b08be
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/380849
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>
Change-Id: I48b59deb9d119963961427db75e79609060777b9
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/372290
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>
Add a field to the unit test mocked version of struct spdk_blob_store to
avoid having an empty struct.
Fixes build warning with scan-build:
lvol_ut.c:86:7: warning: Call to 'calloc' has an allocation size of 0
bytes
bs = calloc(1, sizeof(*bs));
^~~~~~~~~~~~~~~~~~~~~~
Change-Id: If7e48b4cce167ad12f475861bbd6ed4c751febfd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/380816
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>
A few foundational change to support safe removal of portal.
- global login poller -> login poller per portal
- Caching portal data for active connection
Change-Id: I62f4d90c9ac11a433ad47421b2b0c69bfc3c70b7
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/379930
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>
Group the code fragments of open/close portal procedure
and create spdk_iscsi_portal_open/close() function.
Change-Id: Id6e291f3f6e5a926f3ea0d01741a200fa64db81b
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/379934
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>
Possible to create iSCSI target with multiple LUNs via RPC command
after a fix.
Increasing the number of created lvol LUNs for the test.
Also decreasing FIO blocksize and iodepth parameters as more LUNs
will spawn more processes.
Change-Id: Ie3c953d3bff08db612f072aff6920b8624d4d3df
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/381623
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>
When constructing a SCSI device, LUN 0 must be assigned to some LUN.
However, the current code was assuming that LUN 0 had to be in the first
array element of lun_id_list in spdk_scsi_dev_construct(). Combined
with the scripts/rpc.py implementation that uses a Python (unordered)
dictionary object to generate the lun_ids array, there could be cases
where LUN 0 exists in the list but isn't first.
Fix the check by allowing LUN 0 in any position of the lun_id_list
array.
Change-Id: I39f387ec238fcecca8d2d786d3d42c42a4790637
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/381611
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Add possibility to attach lvol bdevs to controllers running
on varying CPU cores
Change-Id: I8d9eec854b2d0ee6c3b8863cefe30d24de138d40
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/380441
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>
The newly added UT code will exercise the cases that opts_size is
smaller and equal to the current version of spdk_nvme_io_qpair_opts.
This is for the backward compatibilty when SPDK components are built
as the shared library later.
Change-Id: Ic906d765f5b638070e3d9c8e38827577c625b679
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/380893
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>
Currently there is no way to know total space availible on lvol store or
how much is left after creating lvol bdevs.
Four new fields should were added to get_lvol_stores:
- total number of blocks
- number of free blocks left
- block size (currently always 4096, but should be known to user)
- cluster size
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I93dec2d4b2843f0ee51dc9883c8451cf55353f7b
Reviewed-on: https://review.gerrithub.io/381131
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Fixes github issue #29.
Because of how we handle the blobid and pagenum in blobstore,
it was possible to have blobstore inadvertently open the wrong
blob if open is provided a blobid where the lower 32 bits match
an existing blob but the upper 32 are clear.
Patch does the following:
- removes assert() that caught this on MD load and replace with
an error given that this condition can be induced via the API
- cleanup of pagenum and blobid conversion/handling to make it
clearer how they're related and converted
- new UTs that would have failed w/o the new check in place
Change-Id: I2b49b237922b3b8cfc4df296f5bc20195e41dc41
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/380872
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>
Add a new parameter for the default ctrlr opts initialization.
This is to make sure future compatibility when SPDK components
are built as a shared library. User's version and SPDK's version
may be in different size.
The change here is to make sure the backward compatibility when
new fields are added in the struct spdk_nvme_ctrlr_opts.
Change-Id: Icfc9640993cb06063b825d4df5835d920dd374e5
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/380846
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>
Now that the bdev layer handles ENOMEM errors internally, we can restore
the original fio queue depths that were reduced to avoid test pool
failures.
This reverts commit 26a40ff914.
Change-Id: Ib7f1bd1e0251f4b2a6370cfd84e2f60e8ee15428
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/380855
Reviewed-by: Changpeng Liu <changpeng.liu@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>
New optional parameter -c or --cluster_sz in construct_lvol_store() RPC,
as well as in vbdev_lvol and lvol lib API.
This parameter allows to configure cluster size of blobstore that lvol store
is build upon.
When this parameter is not specified, default of 1GiB is used.
spdk_lvs_opts struct was created to facilitate any future options when
creating lvol store.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ibfe8765ede3e78ff19c36f46043e4cec2e5c9f97
Reviewed-on: https://review.gerrithub.io/379356
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Piotr Pelpliński <piotr.pelplinski@intel.com>
Also add a unit test that reproduces the original issue and passes
with the one line fix.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I120d42ba7b6cfa4a2cb11e6cc08885d95316fe81
Reviewed-on: https://review.gerrithub.io/380703
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
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>
Change-Id: I8662806c462a47ec389c96c5a233cce48cc11944
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/372554
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>
A random host ID is generated per SPDK application startup if the user
doesn't specify a host ID during controller startup.
This also changes the default host NQN for NVMe-oF connections to a
random UUID NQN based on the host ID.
Change-Id: Ib0f70dd63e53087716842b412a1f134a9991d4da
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/380528
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>
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>
This makes the async event body non-blocking
and also fixes potential deadlock scenario:
* call_external_event() enqueues vhost_event
* destroy_device() locks g_spdk_vhost_mutex
* destroy_device() enqueues it's vhost_event
* reactor dequeues events
* cb from call_external_event is dequeued first
* g_spdk_vhost_mutex is locked (deadlock)
* destroy_device() times out, abort()
Change-Id: If8f51ada3ee5c47ba126f74187a40a285c001c77
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/380634
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>
This is in preparation for ENOMEM handling in the SPDK
bdev layer.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6f5cdc63e4c1c903faa64c3eb61ea4aee0290ec1
Reviewed-on: https://review.gerrithub.io/380512
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>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I58c14300b900709b20fed245cb4a9ae8d1677918
Reviewed-on: https://review.gerrithub.io/378577
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This is in preparation for enabling hot remove of logical volumes when
their underlying blobstore device is hot-removed.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I310a3f64f0de5d628609c20a1a3b4d38df0755aa
Reviewed-on: https://review.gerrithub.io/377041
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>
Previously incorrectly it was assumed that cluster size
was always to be 1MiB. For most evident example of this
please see spdk_lvol_create() sz > free_clusters comparison.
This is now fixed and lvol->sz was changed to lvol->cluster_num.
It was done to increase readability - only dealing with
number of clusters when creating or resizing lvol.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If8cdbad18978319e57b6952dbf5a55d56785f108
Reviewed-on: https://review.gerrithub.io/380467
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>
Three checks are added to options passed to spdk_bs_init,
with appropriate errors returned:
- whether any of the options is set to 0
- device size has to be bigger than cluster size
- pages reserved for metadata exceed total number of clusters
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Idee3c194b653e737ec7c7a768f1973ff72452c5b
Reviewed-on: https://review.gerrithub.io/379676
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>