Spdk/lib/nvmf
Evgeniy Kochetov 87ebcb08c1 nvmf/rdma: Handle completions for destroyed QP associated with SRQ
IB Architecture Specification vol.1 rel.13. in ch.10.3.1 "QUEUE PAIR
AND EE CONTEXT STATES" suggests the following destroy procedure for
QPs associated with SRQ:
- Put the QP in the Error State;
- wait for the Affiliated Asynchronous Last WQE Reached Event;
- either:
  * drain the CQ by invoking the Poll CQ verb and either wait for CQ
    to be empty or the number of Poll CQ operations has exceeded CQ
    capacity size; or
  * post another WR that completes on the same CQ and wait for this WR
    to return as a WC;
- and then invoke a Destroy QP or Reset QP.

Without the drain step it is possible that LAST_WQE_REACHED event is
received and QP is destroyed before the last receive WR completion is
polled from the CQ.

In SPDK there is no risk of resource leakage in this case. So, instead
of draining we can destroy QP and then just ignore receive completions
without QP and post receive WRs back to SRQ.

Fixes #903

Signed-off-by: Evgeniy Kochetov <evgeniik@mellanox.com>
Signed-off-by: Sasha Kotchubievsky <sashakot@mellanox.com>
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ice6d3d5afc205c489f768e3b51c6cda8809bee9a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465747
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-09-12 17:04:48 +00:00
..
ctrlr_bdev.c nvmf: Add BDEV IO pending statistics 2019-07-12 12:46:29 +00:00
ctrlr_discovery.c nvmf: don't keep a global discovery log page. 2019-09-03 00:30:59 +00:00
ctrlr.c nvmf: Delay sending AER until subsystem resumes 2019-08-14 21:24:27 +00:00
fc_ls.c nvmf/fc: Move pending_data_buf_queue from fc_conn to fc_poll_group 2019-09-09 00:42:22 +00:00
fc.c nvmf: Move pending_data_buf_queue to common struct spdk_nvmf_transport_poll_group 2019-09-09 00:42:22 +00:00
Makefile lib/nvmf: extract RPCs from the subsystem directory 2019-08-21 17:20:28 +00:00
nvmf_fc.h nvmf: Move pending_data_buf_queue to common struct spdk_nvmf_transport_poll_group 2019-09-09 00:42:22 +00:00
nvmf_internal.h nvmf: Move pending_data_buf_queue to common struct spdk_nvmf_transport_poll_group 2019-09-09 00:42:22 +00:00
nvmf_rpc.c rpc/nvmf: add tgt_name options to relevant RPCs. 2019-08-21 17:20:28 +00:00
nvmf.c nvmf: don't keep a global discovery log page. 2019-09-03 00:30:59 +00:00
rdma.c nvmf/rdma: Handle completions for destroyed QP associated with SRQ 2019-09-12 17:04:48 +00:00
subsystem.c nvmf: spdk_nvmf_subsystem_remove_ns is no longer asynchronous 2019-07-11 11:19:53 +00:00
tcp.c SPDK: changing TREQ value from 'not specified' to 'not required'. 2019-09-10 17:51:26 +00:00
transport.c nvmf: Move pending_data_buf_queue to common struct spdk_nvmf_transport_poll_group 2019-09-09 00:42:22 +00:00
transport.h NVMe-oF Target: Add FC transport. 2019-07-26 22:17:17 +00:00