[lustre-devel] [PATCH 12/29] lnet: o2iblnd: Use REMOTE_DROPPED for ECONNREFUSED

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


From: Chris Horn <chris.horn at hpe.com>

ECONNREFUSED means that we received a response from the remote end,
so setting the LNet health status to REMOTE_DROPPED is more
appropriate than setting LOCAL_DROPPED. Using REMOTE_DROPPED will
decrement the peer NI health and allow us to try other peer NIs for
future sends.

Decrementing the peer NI health will also result in routes being
marked down, as appropriate, for cases where a router has refused the
connection request.

HPE-bug-id: LUS-9853
WC-bug-id: https://jira.whamcloud.com/browse/LU-14540
Lustre-commit: f9d837b479232bfc ("LU-14540 o2iblnd: Use REMOTE_DROPPED for ECONNREFUSED")
Signed-off-by: Chris Horn <chris.horn at hpe.com>
Reviewed-on: https://review.whamcloud.com/42114
Reviewed-by: James Simmons <jsimmons at infradead.org>
Reviewed-by: Alexander Boyko <alexander.boyko 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 | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
index 5066c93..6445f0a 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -2105,6 +2105,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 {
 	LIST_HEAD(zombies);
 	unsigned long flags;
+	enum lnet_msg_hstatus hstatus;
 
 	LASSERT(error);
 	LASSERT(!in_interrupt());
@@ -2150,12 +2151,20 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 	CNETERR("Deleting messages for %s: connection failed\n",
 		libcfs_nid2str(peer_ni->ibp_nid));
 
-	if (error == -EHOSTUNREACH || error == -ETIMEDOUT)
-		kiblnd_txlist_done(&zombies, error,
-				   LNET_MSG_STATUS_NETWORK_TIMEOUT);
-	else
-		kiblnd_txlist_done(&zombies, error,
-				   LNET_MSG_STATUS_LOCAL_DROPPED);
+	switch (error) {
+	case -EHOSTUNREACH:
+	case -ETIMEDOUT:
+		hstatus = LNET_MSG_STATUS_NETWORK_TIMEOUT;
+		break;
+	case -ECONNREFUSED:
+		hstatus = LNET_MSG_STATUS_REMOTE_DROPPED;
+		break;
+	default:
+		hstatus = LNET_MSG_STATUS_LOCAL_DROPPED;
+		break;
+	}
+
+	kiblnd_txlist_done(&zombies, error, hstatus);
 }
 
 static void
-- 
1.8.3.1



More information about the lustre-devel mailing list