numam-spdk/lib/nvmf
Ben Walker e1dd85a5b7 nvmf: Don't increment current_recv_depth for dummy RECV
When a connection goes to close and has no I/O outstanding,
the current_recv_depth was being decremented beyond 0 and rolling over.

If the poll group then finds a successful receive completion on the next
poll (for a command that arrived prior to starting the disconnect but
hadn't been processed yet), it would trip the max queue depth check
added recently and start another disconnect process. If only one command
arrives in this window, everything actually works out ok.

However, if there are two receive completions sitting in the completion
queue after the disconnect process is started, the first one does the
double disconnect and the second one does another disconnect which ends
up dereferencing a null pointer.

Since there is always a special reserved slot for the dummy recv, don't
do decrements or increments of the current_recv_depth for the dummy
recv. This allows the code to still enforce the actual max_queue_depth
on recvs without underflowing or overflowing the counter.

Change-Id: I56c95b2424e956a3b007b25c50cbf47262245b8f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/442642
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell5141@gmail.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-01-30 19:03:46 +00:00
..
ctrlr_bdev.c ctrlr_bdev: change spdk_nvmf_bdev_ctrlr_identify_ns to return void 2018-10-15 17:29:30 +00:00
ctrlr_discovery.c nvmf: Only present subsystem if it is ready 2019-01-07 06:02:26 +00:00
ctrlr.c nvmf: set default KAS value to 10 seconds 2019-01-25 18:52:45 +00:00
Makefile nvme: Add the NVMe over fabrics TCP/IP transport support 2018-11-19 20:36:05 +00:00
nvmf_fc.h lib/nvmf: fix a typo error 2018-10-12 17:40:16 +00:00
nvmf_internal.h nvmf: Add the Keep Alive feature 2019-01-24 04:24:11 +00:00
nvmf.c nvmf: abort I/O from pg queued list when destroying qp 2019-01-24 20:27:21 +00:00
rdma.c nvmf: Don't increment current_recv_depth for dummy RECV 2019-01-30 19:03:46 +00:00
request.c nvmf: add free_req function pointer. 2018-07-27 20:50:36 +00:00
subsystem.c nvmf: save the NSID when adding a new Namespace 2019-01-14 03:35:04 +00:00
tcp.c nvmf/tcp: remove the timeout handling code 2019-01-25 16:38:13 +00:00
transport.c nvmf/transport->add per-pg cache 2019-01-18 16:57:37 +00:00
transport.h nvmf/transport: move buffer_pool to generic struct. 2019-01-17 19:42:01 +00:00