@@ -626,6 +626,8 @@ struct kib_peer_ni {
unsigned char ibp_races;
/* # consecutive reconnection attempts to this peer_ni */
unsigned int ibp_reconnected;
+ /* number of total active retries */
+ unsigned int ibp_retries;
/* errno on closing this peer_ni */
int ibp_error;
/* max map_on_demand */
@@ -2181,6 +2181,9 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
/* connection established */
write_lock_irqsave(&kiblnd_data.kib_global_lock, flags);
+ /* reset retry count */
+ peer_ni->ibp_retries = 0;
+
conn->ibc_last_send = ktime_get();
kiblnd_set_conn_state(conn, IBLND_CONN_ESTABLISHED);
kiblnd_peer_alive(peer_ni);
@@ -2631,6 +2634,11 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
goto out;
}
+ if (peer_ni->ibp_retries > *kiblnd_tunables.kib_retry_count) {
+ reason = "retry count exceeded due to no listener";
+ goto out;
+ }
+
switch (why) {
default:
reason = "Unknown";
@@ -2688,6 +2696,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
break;
case IBLND_REJECT_INVALID_SRV_ID:
+ peer_ni->ibp_retries++;
reason = "invalid service id";
break;
}
@@ -93,7 +93,7 @@
static int retry_count = 5;
module_param(retry_count, int, 0644);
-MODULE_PARM_DESC(retry_count, "Retransmissions when no ACK received");
+MODULE_PARM_DESC(retry_count, "Number of times to retry connection operations");
static int rnr_retry_count = 6;
module_param(rnr_retry_count, int, 0644);