From 3bfc791c8ca4d8bdf2a7257cc035b37220765533 Mon Sep 17 00:00:00 2001 From: Wen Gu Date: Fri, 12 Jan 2024 11:39:34 +0800 Subject: [PATCH] anolis: net/smc: detach sndbuf when connection is killed ANBZ: #7893 A hung was found in SMC-D loopback scenario. When sndbuf is attached to peer DMB and link group is terminated, the sndbuf won't be detached from peer DMB in smc_conn_free() since conn->lgr is invalid, thus DMB can't be unregistered and hung in smc_buf_free(). So this fixes the issue by detaching sndbuf from DMB in smc_conn_kill(). Fixes: 1735d403d3da ("anolis: net/smc: Avoid data copy from sndbuf to peer RMB in SMC-D") Signed-off-by: Wen Gu --- net/smc/smc_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index f572ab736175..5f00aa5485cc 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c @@ -1560,6 +1560,8 @@ static void smc_conn_kill(struct smc_connection *conn, bool soft) smc_sk_wake_ups(smc); if (conn->lgr->is_smcd) { smc_ism_unset_conn(conn); + if (smc_ism_dmb_mappable(conn->lgr->smcd)) + smcd_buf_detach(conn); if (soft) tasklet_kill(&conn->rx_tsklet); else -- Gitee