nvme: save icreq_timeout in tcp qpair
Needed to make this code path asynchronous. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I6b18d4e9fc1a29b30c78f7f087b80913d00f9726 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8598 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
This commit is contained in:
parent
3ada37faa3
commit
f02e2328ae
@ -110,6 +110,8 @@ struct nvme_tcp_qpair {
|
||||
|
||||
TAILQ_ENTRY(nvme_tcp_qpair) link;
|
||||
bool needs_poll;
|
||||
|
||||
uint64_t icreq_timeout_tsc;
|
||||
};
|
||||
|
||||
enum nvme_tcp_req_state {
|
||||
@ -1793,7 +1795,6 @@ nvme_tcp_qpair_icreq_send(struct nvme_tcp_qpair *tqpair)
|
||||
{
|
||||
struct spdk_nvme_tcp_ic_req *ic_req;
|
||||
struct nvme_tcp_pdu *pdu;
|
||||
uint64_t icreq_timeout_tsc;
|
||||
int rc;
|
||||
|
||||
pdu = tqpair->send_pdu;
|
||||
@ -1811,7 +1812,7 @@ nvme_tcp_qpair_icreq_send(struct nvme_tcp_qpair *tqpair)
|
||||
|
||||
nvme_tcp_qpair_write_pdu(tqpair, pdu, nvme_tcp_send_icreq_complete, tqpair);
|
||||
|
||||
icreq_timeout_tsc = spdk_get_ticks() + (NVME_TCP_TIME_OUT_IN_SECONDS * spdk_get_ticks_hz());
|
||||
tqpair->icreq_timeout_tsc = spdk_get_ticks() + (NVME_TCP_TIME_OUT_IN_SECONDS * spdk_get_ticks_hz());
|
||||
do {
|
||||
if (tqpair->qpair.poll_group) {
|
||||
rc = (int)nvme_tcp_poll_group_process_completions(tqpair->qpair.poll_group, 0,
|
||||
@ -1820,7 +1821,7 @@ nvme_tcp_qpair_icreq_send(struct nvme_tcp_qpair *tqpair)
|
||||
rc = nvme_tcp_qpair_process_completions(&tqpair->qpair, 0);
|
||||
}
|
||||
} while ((tqpair->state != NVME_TCP_QPAIR_STATE_RUNNING) &&
|
||||
(rc >= 0) && (spdk_get_ticks() <= icreq_timeout_tsc));
|
||||
(rc >= 0) && (spdk_get_ticks() <= tqpair->icreq_timeout_tsc));
|
||||
|
||||
if (tqpair->state != NVME_TCP_QPAIR_STATE_RUNNING) {
|
||||
SPDK_ERRLOG("Failed to construct the tqpair=%p via correct icresp\n", tqpair);
|
||||
|
Loading…
Reference in New Issue
Block a user