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: Alexey 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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Alexey Marchuk 2021-01-14 19:54:17 +03:00 committed by Tomasz Zawadzki
parent a5b3a7ded5
commit 74542bae77
3 changed files with 8 additions and 8 deletions

View File

@ -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)) {

View File

@ -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;

View File

@ -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;
}