Commit 5391b29c authored by Ziye Yang's avatar Ziye Yang Committed by Changpeng Liu
Browse files

nvme/tcp: Fix the issue of handling send pdu failure



Previously, if the return value of nvme_tcp_qpair_process_send_queue
is not zero, we directly return but not continue receiving the pdu.
But this is wrong, we should only handle the case when the
return value is negative.

Reported-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>

Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
Change-Id: I83453733f5a3e3350a0461b4cb0bc409fde32fea
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455899


Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent d7ead054
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -406,7 +406,7 @@ nvme_tcp_qpair_process_send_queue(struct nvme_tcp_qpair *tqpair)
		} else {
			SPDK_ERRLOG("spdk_sock_writev() failed, errno %d: %s\n",
				    errno, spdk_strerror(errno));
			return -1;
			return -errno;
		}
	}

@@ -1589,8 +1589,8 @@ nvme_tcp_qpair_process_completions(struct spdk_nvme_qpair *qpair, uint32_t max_c
	int rc;

	rc = nvme_tcp_qpair_process_send_queue(tqpair);
	if (rc) {
		return 0;
	if (rc < 0) {
		return rc;
	}

	if (max_completions == 0) {