Commit a158309c authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

nvmf/tcp: Remove the hd_is_read field.



Previously, this field is used to optimize the code.
When we receive the capsule cmd pdu, we need to allocate
the related buffer, if there is read or write request.
If the related buffer is not valid, then we cannot enter
the next pdu handling phase. So we use this field to mark.

After carefully checking the code, I think that we use
the tcp_req which is assoicated with the pdu, thus it is
efficient.

Change-Id: Ic1634d706dd40a706269bce199bf6031ea0462c0
Signed-off-by: default avatarZiye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/435995


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
parent 9ff6da99
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -93,7 +93,6 @@ struct nvme_tcp_pdu {

	uint32_t                                        ch_valid_bytes;
	uint32_t                                        psh_valid_bytes;
	bool                                            hd_is_read;
	uint32_t                                        data_valid_bytes;

	nvme_tcp_qpair_xfer_complete_cb			cb_fn;
+1 −3
Original line number Diff line number Diff line
@@ -1938,7 +1938,7 @@ spdk_nvmf_tcp_sock_process(struct nvme_tcp_qpair *tqpair)
		/* Wait for the pdu specific header  */
		case NVME_TCP_PDU_RECV_STATE_AWAIT_PDU_PSH:
			pdu = &tqpair->pdu_in_progress;
			if (pdu->hd_is_read) {
			if (pdu->tcp_req) {
				break;
			}

@@ -1977,8 +1977,6 @@ spdk_nvmf_tcp_sock_process(struct nvme_tcp_qpair *tqpair)
				}
			}

			pdu->hd_is_read = true;

			/* All header(ch, psh, head digist) of this PDU has now been read from the socket. */
			spdk_nvmf_tcp_pdu_psh_handle(tqpair);
			break;