From: Li Dongyang Date: Fri, 19 Mar 2021 09:26:28 +0000 (+1100) Subject: LU-14536 o2iblnd: don't resend if there's no listener X-Git-Tag: 2.14.52~145 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F09%2F42109%2F2;p=fs%2Flustre-release.git LU-14536 o2iblnd: don't resend if there's no listener If there's no listener at remote peer, we will get IB_CM_REJ_INVALID_SERVICE_ID, currently we will try to resend which makes the discovery longer than necessary when connecting to a node which is not up. Use -EHOSTUNREACH instead of -ECONNREFUSED, so we don't end up queued for resend. Change-Id: Ifaf14bc3ada2e2469669285917e366af669817e2 Test-Parameters: trivial Signed-off-by: Li Dongyang Reviewed-on: https://review.whamcloud.com/42109 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Serguei Smirnov Reviewed-by: Chris Horn Reviewed-by: Oleg Drokin --- diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c index e22f946..de5e782 100644 --- a/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -2845,6 +2845,7 @@ static void kiblnd_rejected(struct kib_conn *conn, int reason, void *priv, int priv_nob) { struct kib_peer_ni *peer_ni = conn->ibc_peer; + int status = -ECONNREFUSED; LASSERT (!in_interrupt()); LASSERT (conn->ibc_state == IBLND_CONN_ACTIVE_CONNECT); @@ -2856,6 +2857,7 @@ kiblnd_rejected(struct kib_conn *conn, int reason, void *priv, int priv_nob) break; case IB_CM_REJ_INVALID_SERVICE_ID: + status = -EHOSTUNREACH; peer_ni->ibp_retries++; kiblnd_check_reconnect(conn, IBLND_MSG_VERSION, 0, IBLND_REJECT_INVALID_SRV_ID, NULL); @@ -2969,7 +2971,7 @@ kiblnd_rejected(struct kib_conn *conn, int reason, void *priv, int priv_nob) break; } - kiblnd_connreq_done(conn, -ECONNREFUSED); + kiblnd_connreq_done(conn, status); } static void