@@ -541,6 +541,8 @@ struct kib_tx { /* transmit message */
bool tx_gaps;
struct kib_fmr tx_fmr; /* FMR */
int tx_dmadir; /* dma direction */
+ /* time when tx added on ibc_active_txs */
+ ktime_t tx_on_activeq;
};
struct kib_connvars {
@@ -821,6 +821,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
*/
tx->tx_sending++;
list_add(&tx->tx_list, &conn->ibc_active_txs);
+ tx->tx_on_activeq = ktime_get();
/* I'm still holding ibc_lock! */
if (conn->ibc_state != IBLND_CONN_ESTABLISHED) {
@@ -3169,6 +3170,8 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
static int
kiblnd_check_txs_locked(struct kib_conn *conn, struct list_head *txs)
{
+ bool active_txs = strcmp(kiblnd_queue2str(conn, txs),
+ "active_txs") == 0;
struct kib_tx *tx;
list_for_each_entry(tx, txs, tx_list) {
@@ -3179,13 +3182,28 @@ static int kiblnd_resolve_addr(struct rdma_cm_id *cmid,
LASSERT(tx->tx_waiting || tx->tx_sending);
}
- if (ktime_compare(ktime_get(), tx->tx_deadline) >= 0) {
- CERROR("Timed out tx: %s, %lld seconds\n",
+ if (ktime_compare(ktime_get(), tx->tx_deadline) < 0)
+ continue;
+
+ if (!active_txs) {
+ CERROR("Timed out tx: %s, outstanding RDMA time: %lld sec\n",
kiblnd_queue2str(conn, txs),
+ *kiblnd_tunables.kib_timeout +
+ (ktime_ms_delta(ktime_get(),
+ tx->tx_deadline) / MSEC_PER_SEC));
+ } else {
+ CERROR("Timed out tx: %s, time in internal queue: %lld sec, time in active queue: %lld sec, outstanding RDMA time: %lld sec\n",
+ kiblnd_queue2str(conn, txs),
+ ktime_ms_delta(tx->tx_deadline,
+ tx->tx_on_activeq) / MSEC_PER_SEC,
ktime_ms_delta(ktime_get(),
- tx->tx_deadline) / MSEC_PER_SEC);
- return 1;
+ tx->tx_on_activeq) / MSEC_PER_SEC,
+ *kiblnd_tunables.kib_timeout +
+ (ktime_ms_delta(ktime_get(),
+ tx->tx_deadline) / MSEC_PER_SEC));
}
+
+ return 1;
}
return 0;