Commit 7f08d977 authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Tomasz Zawadzki
Browse files

nvme/tcp: change recv_state after append_crc32() succeeds



Otherwise, if accel returns ENOMEM (i.e. is out of tasks) and we
calculate the digest on the CPU, we would set the same recv_state
(AWAIT_PDU_READY) for the second time in _nvme_tcp_pdu_payload_handle()
resulting in an ERRLOG from nvme_tcp_qpair_set_recv_state().

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ie859ae470831cab3f2f8de302a5b3be1adf97917
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19894


Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <jim.harris@gmail.com>
parent 6f3b59be
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1443,7 +1443,6 @@ nvme_tcp_accel_recv_compute_crc32(struct nvme_tcp_req *treq, struct nvme_tcp_pdu

	if (tgroup->group.group->accel_fn_table.append_crc32c != NULL) {
		nvme_tcp_req_copy_pdu(treq, pdu);
		nvme_tcp_qpair_set_recv_state(tqpair, NVME_TCP_PDU_RECV_STATE_AWAIT_PDU_READY);
		rc = nvme_tcp_accel_append_crc32c(tgroup, &req->accel_sequence,
						  &treq->pdu->data_digest_crc32,
						  treq->pdu->data_iov, treq->pdu->data_iovcnt, 0,
@@ -1458,6 +1457,7 @@ nvme_tcp_accel_recv_compute_crc32(struct nvme_tcp_req *treq, struct nvme_tcp_pdu
			treq->rsp.status.sc = SPDK_NVME_SC_COMMAND_TRANSIENT_TRANSPORT_ERROR;
		}

		nvme_tcp_qpair_set_recv_state(tqpair, NVME_TCP_PDU_RECV_STATE_AWAIT_PDU_READY);
		nvme_tcp_c2h_data_payload_handle(tqpair, treq->pdu, &dummy);
		return true;
	} else if (tgroup->group.group->accel_fn_table.submit_accel_crc32c != NULL) {