From 9153049bdc7ec8217691481df64551e2768455a9 Mon Sep 17 00:00:00 2001 From: Cyril Bordage Date: Thu, 9 Jun 2022 23:41:54 +0200 Subject: [PATCH] LU-15925 lnet: add debug messages for IB If net debug is enabled, information about connection, when tx status is ECONNABORTED, is collected (only for IB). Test-Parameters: trivial Signed-off-by: Cyril Bordage Change-Id: I44a33703931630b85cc0e847e2a038217b7967c6 Reviewed-on: https://review.whamcloud.com/47583 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Frank Sehr Reviewed-by: Serguei Smirnov Reviewed-by: Oleg Drokin --- lnet/klnds/o2iblnd/o2iblnd_cb.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lnet/klnds/o2iblnd/o2iblnd_cb.c b/lnet/klnds/o2iblnd/o2iblnd_cb.c index c0bc6db..d3b3eec 100644 --- a/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -286,6 +286,13 @@ kiblnd_handle_completion(struct kib_conn *conn, int txtype, int status, u64 cook if (tx->tx_status == 0) { /* success so far */ if (status < 0) { /* failed? */ + if (status == -ECONNABORTED) { + CDEBUG(D_NET, "bad status for connection to %s " + "with completion type %x\n", + libcfs_nid2str(conn->ibc_peer->ibp_nid), + txtype); + } + tx->tx_status = status; tx->tx_hstatus = LNET_MSG_STATUS_REMOTE_ERROR; } else if (txtype == IBLND_MSG_GET_REQ) { @@ -897,6 +904,8 @@ __must_hold(&conn->ibc_lock) /* I'm still holding ibc_lock! */ if (conn->ibc_state != IBLND_CONN_ESTABLISHED) { + CDEBUG(D_NET, "connection to %s is not established\n", + conn->ibc_peer? libcfs_nid2str(conn->ibc_peer->ibp_nid): "NULL"); rc = -ECONNABORTED; } else if (tx->tx_pool->tpo_pool.po_failed || conn->ibc_hdev != tx->tx_pool->tpo_hdev) { @@ -1259,6 +1268,9 @@ kiblnd_queue_tx_locked(struct kib_tx *tx, struct kib_conn *conn) LASSERT(conn->ibc_state >= IBLND_CONN_ESTABLISHED); if (conn->ibc_state >= IBLND_CONN_DISCONNECTED) { + CDEBUG(D_NET, "connection with %s is disconnected\n", + conn->ibc_peer? libcfs_nid2str(conn->ibc_peer->ibp_nid): "NULL"); + tx->tx_status = -ECONNABORTED; tx->tx_waiting = 0; if (tx->tx_conn != NULL) { @@ -2245,6 +2257,8 @@ kiblnd_finalise_conn(struct kib_conn *conn) /* Complete all tx descs not waiting for sends to complete. * NB we should be safe from RDMA now that the QP has changed state */ + CDEBUG(D_NET, "abort connection with %s\n", libcfs_nid2str(conn->ibc_peer->ibp_nid)); + kiblnd_abort_txs(conn, &conn->ibc_tx_noops); kiblnd_abort_txs(conn, &conn->ibc_tx_queue); kiblnd_abort_txs(conn, &conn->ibc_tx_queue_rsrvd); -- 1.8.3.1