Spdk/lib/nvme
Ziye Yang 3a1f5364d2 nvme/tcp: Fix nvme_tcp_req free conflict between cmd sending and incoming pdu receiving
This patch tries to solve the out of order
call back handling for cmd sending and the incoming pdu handling.

Normally, the cmd call back will be called before
receving the next PDU from the target if the application
uses the sync manner.

With the uring implementation, after sending the
cmd to the target, we may have the following scenerio:
(1) Firstly receive the incoming pdu(e.g., CapsuleResp pdu, C2hdata pdu)
due to the group polling read event.
(2) Secondly execute the callback function related with NVMe command sending.

This means that the data from the initiator is really sent out to the target,
and the target receives, then sending back the data to the initiator. But the
uring io_uring_cqe event is not handled, thus if we execute
(1) first, it will clean the data structures related with nvme_tcp_req, and the
nvme_tcp_req will be used for other purpose. Then causes wrong behaviour like
the following:

"Rand Write test failed at QD=128 because fio hangs with the following error:
nvme_tcp.c: 971:nvme_tcp_capsule_resp_hdr_handle: *ERROR*:
no tcp_req is found with cid=66 for tqpair=0x7f23d8001710".

And this patch can address this issue.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I5043aaa8adf5033d93dedac15f633f0850e0b9f2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2818
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-06-22 07:47:31 +00:00
..
Makefile mk/nvme/nvmf: Add deps for RDMA libs 2020-06-18 07:28:04 +00:00
nvme_ctrlr_cmd.c lib: net, notify, nvme, rocksdb remove spdk_ prefix. 2020-05-21 09:19:00 +00:00
nvme_ctrlr_ocssd_cmd.c ocssd: hold lock when calling nvme_ctrlr_submit_admin_request 2019-02-15 21:27:58 +00:00
nvme_ctrlr.c nvme: solve the spdk_nvme_connect compatibilty issue. 2020-06-05 09:04:11 +00:00
nvme_cuse.c lib/nvme: update io msg producers on ns manage 2020-06-05 09:01:44 +00:00
nvme_cuse.h lib/nvme: add RPC for interacting with CUSE devices 2019-10-24 23:43:59 +00:00
nvme_fabric.c lib/nvme: remove spdk prefix from internal headers. 2020-06-01 13:07:30 +00:00
nvme_internal.h lib/nvme: remove spdk prefix from internal headers. 2020-06-01 13:07:30 +00:00
nvme_io_msg.c lib/nvme: update io msg producers on ns manage 2020-06-05 09:01:44 +00:00
nvme_io_msg.h lib/nvme: update io msg producers on ns manage 2020-06-05 09:01:44 +00:00
nvme_ns_cmd.c lib: net, notify, nvme, rocksdb remove spdk_ prefix. 2020-05-21 09:19:00 +00:00
nvme_ns_ocssd_cmd.c nvme: save separate metadata size to nvme request 2020-04-02 07:02:38 +00:00
nvme_ns.c lib/nvme: remove spdk prefix from internal headers. 2020-06-01 13:07:30 +00:00
nvme_opal_internal.h nvme/opal: deprecate spdk_opal_supported() 2020-05-20 14:16:44 +00:00
nvme_opal.c lib/nvme: Remove inclusion of SPDK event library 2020-06-01 09:20:41 +00:00
nvme_pcie.c all: Fix warnings found by gcc 9.3.0 and 9.3.1 2020-06-02 09:51:57 +00:00
nvme_poll_group.c lib/nvme: switch poll group to use connect/disconnect semantics. 2020-04-22 19:06:26 +00:00
nvme_qpair.c lib/nvme: split request resubmission into function. 2020-05-28 07:13:44 +00:00
nvme_quirks.c nvme: add a quirk for QEMU emulated NVMe SSD 2020-05-20 14:16:52 +00:00
nvme_rdma.c rdma: Add new API spdk_rdma_qp_accept 2020-06-18 07:28:04 +00:00
nvme_tcp.c nvme/tcp: Fix nvme_tcp_req free conflict between cmd sending and incoming pdu receiving 2020-06-22 07:47:31 +00:00
nvme_transport.c lib/nvme: rdma poll group with shared cq. 2020-06-04 07:20:16 +00:00
nvme_uevent.c lib/nvme: remove spdk prefix from internal headers. 2020-06-01 13:07:30 +00:00
nvme_uevent.h lib/nvme: remove spdk prefix from internal headers. 2020-06-01 13:07:30 +00:00
nvme.c nvme: solve the spdk_nvme_connect compatibilty issue. 2020-06-05 09:04:11 +00:00
spdk_nvme.map nvme/cuse: add spdk_nvme_cuse_update api 2020-06-05 09:01:44 +00:00