iscsi: change timeout from int to uint64_t
Avoid the running converting timeout from sec to TSC, thus make the behaviour same as last_nopin, i.e., initialize when constructing the connection. Change-Id: Ibc120fed24d2208cab9ae8a876856e9d05363075 Signed-off-by: Ziye Yang <ziye.yang@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475711 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
0951fc4fea
commit
3ad192e3b5
@ -214,7 +214,7 @@ spdk_iscsi_conn_construct(struct spdk_iscsi_portal *portal,
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&g_spdk_iscsi.mutex);
|
||||
conn->timeout = g_spdk_iscsi.timeout;
|
||||
conn->timeout = g_spdk_iscsi.timeout * spdk_get_ticks_hz(); /* seconds to TSC */
|
||||
conn->nopininterval = g_spdk_iscsi.nopininterval;
|
||||
conn->nopininterval *= spdk_get_ticks_hz(); /* seconds to TSC */
|
||||
conn->nop_outstanding = false;
|
||||
@ -1201,7 +1201,7 @@ spdk_iscsi_conn_handle_nop(struct spdk_iscsi_conn *conn)
|
||||
/* Check for nop interval expiration */
|
||||
tsc = spdk_get_ticks();
|
||||
if (conn->nop_outstanding) {
|
||||
if ((tsc - conn->last_nopin) > (conn->timeout * spdk_get_ticks_hz())) {
|
||||
if ((tsc - conn->last_nopin) > conn->timeout) {
|
||||
SPDK_ERRLOG("Timed out waiting for NOP-Out response from initiator\n");
|
||||
SPDK_ERRLOG(" tsc=0x%lx, last_nopin=0x%lx\n", tsc, conn->last_nopin);
|
||||
SPDK_ERRLOG(" initiator=%s, target=%s\n", conn->initiator_name,
|
||||
|
@ -164,7 +164,7 @@ struct spdk_iscsi_conn {
|
||||
uint32_t data_out_cnt;
|
||||
uint32_t data_in_cnt;
|
||||
|
||||
int timeout;
|
||||
uint64_t timeout;
|
||||
uint64_t nopininterval;
|
||||
bool nop_outstanding;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user