From 5a871abe32fb493b06b63f2ef75fd2686881f2f3 Mon Sep 17 00:00:00 2001 From: Wen Gu Date: Sun, 18 Feb 2024 14:51:37 +0800 Subject: [PATCH] debug: record cursor update process Signed-off-by: Wen Gu --- net/smc/smc_cdc.c | 8 ++++++++ net/smc/smc_rx.c | 3 +++ net/smc/smc_tx.c | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/net/smc/smc_cdc.c b/net/smc/smc_cdc.c index e938fe3bcc7c..da08c578546f 100644 --- a/net/smc/smc_cdc.c +++ b/net/smc/smc_cdc.c @@ -369,6 +369,10 @@ static void smc_cdc_msg_recv_action(struct smc_sock *smc, smc_tx_sndbuf_nonfull(smc); } + pr_warn("%s: peer consumed %d, cons_cur {%d:%d}, peer_rmbe_space %d\n", + __func__, diff_cons, conn->local_rx_ctrl.cons.wrap, + conn->local_rx_ctrl.cons.count, + atomic_read(&conn->peer_rmbe_space)); } diff_prod = smc_curs_diff(conn->rmb_desc->len, &prod_old, @@ -381,6 +385,10 @@ static void smc_cdc_msg_recv_action(struct smc_sock *smc, atomic_add(diff_prod, &conn->bytes_to_rcv); /* guarantee 0 <= bytes_to_rcv <= rmb_desc->len */ smp_mb__after_atomic(); + pr_warn("%s: peer produced %d, prod_cur {%d:%d}, bytes_to_recv %d\n", + __func__, diff_prod, conn->local_rx_ctrl.prod.wrap, + conn->local_rx_ctrl.prod.count, + atomic_read(&conn->bytes_to_rcv)); smc->sk.sk_data_ready(&smc->sk); } else { if (conn->local_rx_ctrl.prod_flags.write_blocked) diff --git a/net/smc/smc_rx.c b/net/smc/smc_rx.c index 9a2f3638d161..cbb42a203370 100644 --- a/net/smc/smc_rx.c +++ b/net/smc/smc_rx.c @@ -89,6 +89,9 @@ static int smc_rx_update_consumer(struct smc_sock *smc, } smc_curs_copy(&conn->local_tx_ctrl.cons, &cons, conn); + pr_warn("%s: local consumed %ld B, cons_cur {%d:%d}, bytes_to_recv %d\n", + __func__, len, cons.wrap, cons.count, + atomic_read(&conn->bytes_to_rcv)); /* send consumer cursor update if required */ /* similar to advertising new TCP rcv_wnd if required */ diff --git a/net/smc/smc_tx.c b/net/smc/smc_tx.c index 214ac3cbcf9a..f290777d4a43 100644 --- a/net/smc/smc_tx.c +++ b/net/smc/smc_tx.c @@ -538,6 +538,10 @@ static int smc_tx_rdma_writes(struct smc_connection *conn, /* dst: peer RMBE */ smc_curs_copy(&conn->tx_curs_sent, &sent, conn);/* src: local sndbuf */ + pr_warn("%s: local produced %ld, prod {%d:%d}, peer_rmbe_space %d\n", + __func__, len, conn->local_tx_ctrl.prod.wrap, + conn->local_tx_ctrl.prod.count, + atomic_read(&conn->peer_rmbe_space)); return 0; } @@ -713,6 +717,8 @@ void smc_tx_consumer_update(struct smc_connection *conn, bool force) if (conn->killed || conn->local_rx_ctrl.conn_state_flags.peer_conn_abort) return; + pr_warn("%s: notify RMB wnd increase %d, cons_cur {%d:%d}\n", + __func__, to_confirm, cons.wrap, cons.count); if ((smc_cdc_get_slot_and_msg_send(conn) < 0) && !conn->killed) { queue_delayed_work(conn->lgr->tx_wq, &conn->tx_work, -- 2.32.0.3.g01195cf9f