Commit 74542bae authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Tomasz Zawadzki
Browse files

tcp: Rename readv_offset to rw_offset in nvme_tcp_pdu



In the next patch this member will be used to track
both read and write offsets

Change-Id: I852125ff35257f9821ddf4a641d96afb29ebf0a0
Signed-off-by: default avatarAlexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5924


Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
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 a5b3a7de
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -121,7 +121,7 @@ struct nvme_tcp_pdu {
	uint32_t					data_iovcnt;
	uint32_t					data_len;

	uint32_t					readv_offset;
	uint32_t					rw_offset;
	TAILQ_ENTRY(nvme_tcp_pdu)			tailq;
	uint32_t					remaining;
	uint32_t					padding_len;
@@ -440,7 +440,7 @@ nvme_tcp_build_payload_iovs(struct iovec *iov, int iovcnt, struct nvme_tcp_pdu *
	}

	sgl = &pdu->sgl;
	_nvme_tcp_sgl_init(sgl, iov, iovcnt, pdu->readv_offset);
	_nvme_tcp_sgl_init(sgl, iov, iovcnt, pdu->rw_offset);

	if (spdk_likely(!pdu->dif_ctx)) {
		if (!_nvme_tcp_sgl_append_multi(sgl, pdu->data_iov, pdu->data_iovcnt)) {
+3 −3
Original line number Diff line number Diff line
@@ -1496,13 +1496,13 @@ nvme_tcp_read_pdu(struct nvme_tcp_qpair *tqpair, uint32_t *reaped)
				break;
			}

			pdu->readv_offset += rc;
			if (pdu->readv_offset < data_len) {
			pdu->rw_offset += rc;
			if (pdu->rw_offset < data_len) {
				rc =  NVME_TCP_PDU_IN_PROGRESS;
				goto out;
			}

			assert(pdu->readv_offset == data_len);
			assert(pdu->rw_offset == data_len);
			/* All of this PDU has now been read from the socket. */
			nvme_tcp_pdu_payload_handle(tqpair, reaped);
			break;
+3 −3
Original line number Diff line number Diff line
@@ -1975,16 +1975,16 @@ nvmf_tcp_sock_process(struct spdk_nvmf_tcp_qpair *tqpair)
			if (rc < 0) {
				return NVME_TCP_PDU_FATAL;
			}
			pdu->readv_offset += rc;
			pdu->rw_offset += rc;

			if (spdk_unlikely(pdu->dif_ctx != NULL)) {
				rc = nvmf_tcp_pdu_payload_insert_dif(pdu, pdu->readv_offset - rc, rc);
				rc = nvmf_tcp_pdu_payload_insert_dif(pdu, pdu->rw_offset - rc, rc);
				if (rc != 0) {
					return NVME_TCP_PDU_FATAL;
				}
			}

			if (pdu->readv_offset < data_len) {
			if (pdu->rw_offset < data_len) {
				return NVME_TCP_PDU_IN_PROGRESS;
			}