From 79f508b04709d83f2e444a5d578b260926a80734 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Fri, 21 Aug 2020 15:51:33 -0700 Subject: [PATCH] iscsi: set last_nopin when connection is established This ensures we don't send a nopin immediately after a connection is established, in case the nopin poller fires before the connection reaches full feature phase. Fixes #1441. Signed-off-by: Jim Harris Change-Id: Ieba9476bec0e9b7f85e60b9113ae8364eda5bda3 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3902 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Changpeng Liu Reviewed-by: Ziye Yang --- lib/iscsi/conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index 229d1521e..3094b375d 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -229,6 +229,7 @@ iscsi_conn_construct(struct spdk_iscsi_portal *portal, conn->timeout = g_iscsi.timeout * spdk_get_ticks_hz(); /* seconds to TSC */ conn->nopininterval = g_iscsi.nopininterval; conn->nopininterval *= spdk_get_ticks_hz(); /* seconds to TSC */ + conn->last_nopin = spdk_get_ticks(); conn->nop_outstanding = false; conn->data_out_cnt = 0; conn->data_in_cnt = 0; @@ -1626,7 +1627,6 @@ iscsi_conn_schedule(struct spdk_iscsi_conn *conn) /* Remove this connection from the previous poll group */ iscsi_poll_group_remove_conn(conn->pg, conn); - conn->last_nopin = spdk_get_ticks(); conn->pg = pg; spdk_thread_send_msg(spdk_io_channel_get_thread(spdk_io_channel_from_ctx(pg)),