Spdk/test
Shuhei Matsumoto 7cd20dd3f5 lib/bdev: Add spdk_bdev_abort API
Add spdk_bdev_abort function as a new public API.

This goes all the way down to the bdev driver module and attempts to
abort all I/Os which has bio_cb_arg as its callback argument.

We can separate when only a single I/O has bio_cb_arg and when multiple
I/Os have bio_cb_arg, but unify both by using parent - children I/O
relationship. To avoid confusion, return matched_ios by _bdev_abort() and
store it into split_outstanding by the caller.

Exclude any I/O submitted after this abort command because the same cb_arg
may be used by all I/Os and abort may never complete.

bdev_io needs to have both bio_cb_arg and bio_to_abort because bio_cb_arg
is used to continue abort processing when it is stopped due to the capacity
of bdev_io pool, and bio_to_abort is used to pass it to the underlying
bdev module at submission. Parent I/O is not submitted directly, and is
only used in the generic bdev layer, and parent I/O's bdev_io uses bio_cb_arg.
Hence add bio_cb_arg to bdev structure and add bio_to_abort to abort structure.

In the meantime of abort operation, target I/Os may be completed. Hence
check if the target I/O still exists at completion, and set the completion
status to false only if it still exists.

Upon completion of this, i.e., this returned zero, the status
SPDK_BDEV_IO_STATUS_SUCCESS indicates all I/Os were successfully aborted,
or the status SPDK_BDEV_IO_STATUS_FAILED indicates any I/O was failed to
abort by any reason.

spdk_bdev_abort() does not support aborting abort or reset request
due to the complexity for now.

Following patches will support I/O split case.

Add unit tests together to cover the basic paths.

Besides, ABI compatibility check required us to bump up SO version of
a few libraries or modules. Bump up SO version of blob bdev module simply
because it does not have any out-of-tree consumer, and suppress bumping
up SO version of lvol library because the affected struct spdk_lvol
is not part of public APIs.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I515da688503557615d491bf0bfb36322ce37df08
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2014
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-06-08 09:28:27 +00:00
..
app nvme/rdma: Use RDMA provider API to create/destroy qpair 2020-05-20 12:03:50 +00:00
bdev tests: Switch to $SPDK_TEST_STORAGE for writing out bigger tmp files 2020-05-20 14:17:02 +00:00
blobfs test/blobfs: fix a bug that $SPDK_TEST_STORAGE is NULL 2020-06-02 09:52:20 +00:00
blobstore check_format: Reformat the Bash code in compliance with shfmt 2020-05-07 20:52:21 +00:00
common test/common: remove discover_bdevs() 2020-06-05 09:03:50 +00:00
compress test/nvmf: Handle multiple arguments in nvmfappstart() 2020-05-13 07:46:04 +00:00
config_converter test/config_converter: Declare $rootdir, $testdir paths 2020-02-20 09:54:15 +00:00
cpp_headers queue_extras: use SPDK_CONTAINEROF 2019-10-07 15:06:01 +00:00
dpdk_memory_utility test: add test to validate dpdk mem utility 2020-01-24 05:46:43 +00:00
env Revert "env: Use rte_malloc in spdk_mem_register code path when possible" 2020-05-20 14:14:21 +00:00
event lib/thread: Use function name as poller name by using macro SPDK_POLLER_REGISTER 2020-04-15 07:23:09 +00:00
external_code test/external_code: use default HUGEMEM in setup.sh 2020-06-02 09:47:48 +00:00
ftl check_format: Reformat the Bash code in compliance with shfmt 2020-05-07 20:52:21 +00:00
fuzz check_format: Reformat the Bash code in compliance with shfmt 2020-05-07 20:52:21 +00:00
ioat test: move report_test_completion into run_test 2020-01-14 07:49:08 +00:00
iscsi_tgt test/iscsi_tgt: silence shellcheck SC2029 2020-06-02 09:49:06 +00:00
json_config tests: Switch to $SPDK_TEST_STORAGE for writing out bigger tmp files 2020-05-20 14:17:02 +00:00
lvol check_format: Reformat the Bash code in compliance with shfmt 2020-05-07 20:52:21 +00:00
make lib/bdev: Add spdk_bdev_abort API 2020-06-08 09:28:27 +00:00
nvme test/common: remove discover_bdevs() 2020-06-05 09:03:50 +00:00
nvmf rxe_cfg: Drop librxe and port minimal rxe_cfg functionality to Bash 2020-06-05 09:02:27 +00:00
ocf test/ocf: Drop .ini config in favor of json 2020-05-20 14:14:50 +00:00
openstack test/nvmf: Handle multiple arguments in nvmfappstart() 2020-05-13 07:46:04 +00:00
pmem check_format: Reformat the Bash code in compliance with shfmt 2020-05-07 20:52:21 +00:00
rpc rpc: Add test for pluggable RPCs 2020-05-18 10:14:09 +00:00
rpc_client lib/event: fix printing non-null-terminated strings 2020-04-06 07:48:37 +00:00
spdkcli rpc: Deprecate max_qpairs_per_ctrlr parameter 2020-06-04 07:20:45 +00:00
unit lib/bdev: Add spdk_bdev_abort API 2020-06-08 09:28:27 +00:00
vhost test/vhost/initiator: remove unused fio sections 2020-06-05 09:03:50 +00:00
vmd check_format: Reformat the Bash code in compliance with shfmt 2020-05-07 20:52:21 +00:00
Makefile build: add option to disable building unit tests 2020-03-10 09:12:21 +00:00
spdk_cunit.h test: remove leftover spdk_cunit declaration 2018-07-06 22:47:56 +00:00