From 3e59431d9ceb3610d9565376d59bd3d967618d2b Mon Sep 17 00:00:00 2001 From: Li Xi Date: Tue, 13 Jul 2021 17:22:39 +0800 Subject: [PATCH] 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. Lustre-change: https://review.whamcloud.com/42109 Lustre-commit: 65e3e4050ec5bb371c1c343fca49a605286a086e Change-Id: Ifaf14bc3ada2e2469669285917e366af669817e2 Test-Parameters: trivial Signed-off-by: Li Dongyang Reviewed-by: Serguei Smirnov Reviewed-by: Chris Horn Reviewed-by: Amir Shehata Reviewed-on: https://review.whamcloud.com/44222 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lnet/klnds/o2iblnd/o2iblnd_cb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c index 2d2e5f4..a2512d1 100644 --- a/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -2835,6 +2835,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); @@ -2846,6 +2847,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); @@ -2956,7 +2958,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 -- 1.8.3.1