numam-spdk/lib
Shuhei Matsumoto 71da42e953 lib/nvme: Add spdk_nvme_ctrlr_cmd_abort_ext() to abort commands whose cb_arg matches
A new API spdk_nvme_ctrlr_cmd_abort_ext() gets cmd_cb_arg as a
parameter, and use it to abort requests whose cb_arg matches cmd_cb_arg.

The caller can set the parameter qpair to NULL if it wants to abort
requests on admin qpair.

Hold ctrlr->ctrlr_lock throughout because abort request is submitted
to admin qpair.

The API is not critical for performance, and so initialize parent
data first.

The API is for a specific qpair, and so hold SQID in the parent,
and it is copied to the children. On the other hand, CID is set
to child when request to abort is found.

Use an new helper function nvme_transport_qpair_iterate_requests()
to add abort request for each outstanding request which has
cmd_cb_arg as its callback context.

The case is possible such that the request to abort is not outstanding
yet but queued. Hence abort queued requests which has cmd_cb_arg
as its callback context too, but it is done only if there is no error
so far.

If only queued requests are aborted and there is no outstanding
request to abort, complete with success synchronously.

If there is no outstanding or queued request to abort, return -ENOENT.

When any abort request is submitted, the difference between success
and failure is only bit 0 of CDW0 according to the NVMe specification.

We cannot the existing helper functions nvme_request_add_child() and
nvme_cb_complete_child() but can use nvme_request_remove_child().
nvme_qpair_submit_request() may use only nvme_request_remove_child()
from these three helper functions. Hence we use req->parent as other
types of request do.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3a271c6542f8e2e6b425b3bf6151f41e924bc200
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2039
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-07-14 07:54:42 +00:00
..
accel idxd: add batch capability to accel framework and IDXD back-end 2020-07-10 07:31:09 +00:00
bdev bdev: add allowlist to bdev layer 2020-07-07 07:31:22 +00:00
blob blob: Add a bitmask for quickly checking which blobs are open 2020-07-07 07:30:58 +00:00
blobfs BlobFS: fix the case where configuration field is not set 2020-07-09 07:23:34 +00:00
conf lib/conf: accept entries of form key=value 2020-07-13 08:39:57 +00:00
env_dpdk event: add iova-mode parameter 2020-06-24 08:22:24 +00:00
env_ocf lib/ocf_env: fix incorrect value for free memory estimate 2020-04-29 06:42:33 +00:00
event event: expose base virtaddr as an option 2020-07-09 07:23:40 +00:00
ftl pollers: Fix pollers to return correct busy status 2020-07-07 07:29:31 +00:00
idxd idxd: add batch capability to accel framework and IDXD back-end 2020-07-10 07:31:09 +00:00
ioat pollers: Fix pollers to return correct busy status 2020-07-07 07:29:31 +00:00
iscsi lib/iscsi: Unify outstanding_r2t_tasks array and active_r2t_tasks list into the latter 2020-07-13 08:39:50 +00:00
json lib: json-nbd remove spdk prefix from static functions. 2020-05-21 09:19:00 +00:00
jsonrpc rpc: don't allow starting RPC server on a TCP port 2020-06-08 09:35:16 +00:00
log log: remove backtrace printing 2020-06-03 07:39:08 +00:00
log_rpc lib: json-nbd remove spdk prefix from static functions. 2020-05-21 09:19:00 +00:00
lvol all: Fix warnings found by gcc 9.3.0 and 9.3.1 2020-06-02 09:51:57 +00:00
nbd nbd: Make nbd_poll return real busy/idle status 2020-07-08 07:54:38 +00:00
net lib: net, notify, nvme, rocksdb remove spdk_ prefix. 2020-05-21 09:19:00 +00:00
notify lib: net, notify, nvme, rocksdb remove spdk_ prefix. 2020-05-21 09:19:00 +00:00
nvme lib/nvme: Add spdk_nvme_ctrlr_cmd_abort_ext() to abort commands whose cb_arg matches 2020-07-14 07:54:42 +00:00
nvmf nvmf: suppress scan-build warning 2020-07-10 07:30:59 +00:00
rdma rdma: Add new API spdk_rdma_qp_accept 2020-06-18 07:28:04 +00:00
reduce mk/lib: add a check that major and minor version is set for libs. 2020-05-21 09:19:00 +00:00
rocksdb make: Create variable for event_bdev dependencies 2020-07-08 07:56:46 +00:00
rpc rpc: don't allow starting RPC server on a TCP port 2020-06-08 09:35:16 +00:00
rte_vhost read_fd_message: distinguish prints of log message 2020-05-25 09:08:00 +00:00
scsi pollers: Fix pollers to return correct busy status 2020-07-07 07:29:31 +00:00
sock sock: Save socket subsystem configuration in JSON format 2020-07-13 08:40:15 +00:00
thread thread: add info logs 2020-06-12 15:40:31 +00:00
trace mk/lib: add a check that major and minor version is set for libs. 2020-05-21 09:19:00 +00:00
ut_mock mk/lib: add a check that major and minor version is set for libs. 2020-05-21 09:19:00 +00:00
util lib/util: remove _spdk prefix from functions. 2020-06-01 13:07:30 +00:00
vhost pollers: Fix pollers to return correct busy status 2020-07-07 07:29:31 +00:00
virtio lib/makefile: move vhost_user.c into lib/virtio directory 2020-06-09 07:37:43 +00:00
vmd mk/lib: add a check that major and minor version is set for libs. 2020-05-21 09:19:00 +00:00
Makefile rdma: Intorduce RDMA providers 2020-05-20 12:03:50 +00:00