Commit ca317162 authored by Jacek Kalwas's avatar Jacek Kalwas Committed by Jim Harris
Browse files

nvme/tcp: fix *_req_complete_safe guard check



The issue happens when c2h data is received before cmd capsule
completion being received. With zcopy enabled it is possible for
_sock_check_zcopy to kickoff nvme_tcp_req_complete_safe whereas
sequence might be not yet finished. Fix by improving the guard check
to include in_progress_accel flag.

Change-Id: If8ad27411d9a9c4b2df5c08541bf84b46f7af161
Signed-off-by: default avatarJacek Kalwas <jacek.kalwas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/21951


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent 769fc6de
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -851,7 +851,8 @@ nvme_tcp_req_init(struct nvme_tcp_qpair *tqpair, struct nvme_request *req,
static inline bool
nvme_tcp_req_complete_safe(struct nvme_tcp_req *tcp_req)
{
	if (!(tcp_req->ordering.bits.send_ack && tcp_req->ordering.bits.data_recv)) {
	if (!(tcp_req->ordering.bits.send_ack && tcp_req->ordering.bits.data_recv &&
	      !tcp_req->ordering.bits.in_progress_accel)) {
		return false;
	}