[lustre-devel] [PATCH 20/29] lnet: o2iblnd: don't resend if there's no listener

James Simmons jsimmons at infradead.org
Sun Apr 25 13:08:27 PDT 2021


From: Li Dongyang <dongyangli at ddn.com>

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.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14536
Lustre-commit: 67ba3ce23d32266e ("LU-14536 o2iblnd: don't resend if there's no listener")
Signed-off-by: Li Dongyang <dongyangli at ddn.com>
Reviewed-on: https://review.whamcloud.com/42109
Reviewed-by: Serguei Smirnov <ssmirnov at whamcloud.com>
Reviewed-by: Chris Horn <chris.horn at hpe.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
index 6445f0a..e5e5e02 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -2745,6 +2745,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 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);
@@ -2756,6 +2757,8 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 		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);
 		CNETERR("%s rejected: no listener at %d\n",
@@ -2870,7 +2873,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 		break;
 	}
 
-	kiblnd_connreq_done(conn, -ECONNREFUSED);
+	kiblnd_connreq_done(conn, status);
 }
 
 static void
-- 
1.8.3.1



More information about the lustre-devel mailing list