diff mbox series

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

Message ID 1619381316-7719-21-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: Update to OpenSFS tree as of April 25, 2020 | expand

Commit Message

James Simmons April 25, 2021, 8:08 p.m. UTC
From: Li Dongyang <dongyangli@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@ddn.com>
Reviewed-on: https://review.whamcloud.com/42109
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

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