Message ID | 0f85e2dc8c8cdeb25a14113b279ec44441112867.1620343860.git.metze@samba.org (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | rdma/siw: fix a lot of deadlocks and use after free bugs | expand |
-----"Stefan Metzmacher" <metze@samba.org> wrote: ----- >To: "Bernard Metzler" <bmt@zurich.ibm.com> >From: "Stefan Metzmacher" <metze@samba.org> >Date: 05/07/2021 01:38AM >Cc: linux-rdma@vger.kernel.org, "Stefan Metzmacher" <metze@samba.org> >Subject: [EXTERNAL] [PATCH 12/31] rdma/siw: add some debugging of >state and sk_state to the teardown process > >That makes it easier to understanf where possible problems come from. > >Fixes: 6c52fdc244b5 ("rdma/siw: connection management") >Signed-off-by: Stefan Metzmacher <metze@samba.org> >Cc: Bernard Metzler <bmt@zurich.ibm.com> >Cc: linux-rdma@vger.kernel.org >--- > drivers/infiniband/sw/siw/siw_cm.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > >diff --git a/drivers/infiniband/sw/siw/siw_cm.c >b/drivers/infiniband/sw/siw/siw_cm.c >index 3cc1d22fe232..ed33533ff9e6 100644 >--- a/drivers/infiniband/sw/siw/siw_cm.c >+++ b/drivers/infiniband/sw/siw/siw_cm.c >@@ -111,6 +111,14 @@ static void __siw_cep_terminate_upcall(struct >siw_cep *cep, > int reply_status) > { > bool suspended = false; >+ int sk_state_val = UINT_MAX; >+ >+ if (cep->sock && cep->sock->sk) >+ sk_state_val = cep->sock->sk->sk_state; >+ Please put this 'sk_state_val' logic into the single debug statement, if we need that information at all. >+ siw_dbg_cep(cep, "[QP %u]: state: %d sk_state: %d\n", >+ cep->qp ? qp_id(cep->qp) : UINT_MAX, >+ cep->state, sk_state_val); > > if (cep->qp) { > struct siw_qp *qp = cep->qp; >@@ -118,9 +126,14 @@ static void __siw_cep_terminate_upcall(struct >siw_cep *cep, > if (qp->term_info.valid) > siw_send_terminate(qp); > >+ siw_dbg_cep(cep, >+ "with qp rx_suspend=%d tx_suspend=%d\n", >+ qp->rx_stream.rx_suspend, >+ qp->tx_ctx.tx_suspend); > if (qp->rx_stream.rx_suspend || qp->tx_ctx.tx_suspend) > suspended = true; > } else { >+ siw_dbg_cep(cep, "without qp\n"); > suspended = true; > } > >@@ -1307,7 +1320,7 @@ static void siw_cm_llp_state_change(struct sock >*sk) > } > orig_state_change = cep->sk_state_change; > >- siw_dbg_cep(cep, "state: %d\n", cep->state); >+ siw_dbg_cep(cep, "state: %d sk_state: %d\n", cep->state, >sk->sk_state); > > switch (sk->sk_state) { > case TCP_ESTABLISHED: >-- >2.25.1 > >
diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c index 3cc1d22fe232..ed33533ff9e6 100644 --- a/drivers/infiniband/sw/siw/siw_cm.c +++ b/drivers/infiniband/sw/siw/siw_cm.c @@ -111,6 +111,14 @@ static void __siw_cep_terminate_upcall(struct siw_cep *cep, int reply_status) { bool suspended = false; + int sk_state_val = UINT_MAX; + + if (cep->sock && cep->sock->sk) + sk_state_val = cep->sock->sk->sk_state; + + siw_dbg_cep(cep, "[QP %u]: state: %d sk_state: %d\n", + cep->qp ? qp_id(cep->qp) : UINT_MAX, + cep->state, sk_state_val); if (cep->qp) { struct siw_qp *qp = cep->qp; @@ -118,9 +126,14 @@ static void __siw_cep_terminate_upcall(struct siw_cep *cep, if (qp->term_info.valid) siw_send_terminate(qp); + siw_dbg_cep(cep, + "with qp rx_suspend=%d tx_suspend=%d\n", + qp->rx_stream.rx_suspend, + qp->tx_ctx.tx_suspend); if (qp->rx_stream.rx_suspend || qp->tx_ctx.tx_suspend) suspended = true; } else { + siw_dbg_cep(cep, "without qp\n"); suspended = true; } @@ -1307,7 +1320,7 @@ static void siw_cm_llp_state_change(struct sock *sk) } orig_state_change = cep->sk_state_change; - siw_dbg_cep(cep, "state: %d\n", cep->state); + siw_dbg_cep(cep, "state: %d sk_state: %d\n", cep->state, sk->sk_state); switch (sk->sk_state) { case TCP_ESTABLISHED:
That makes it easier to understanf where possible problems come from. Fixes: 6c52fdc244b5 ("rdma/siw: connection management") Signed-off-by: Stefan Metzmacher <metze@samba.org> Cc: Bernard Metzler <bmt@zurich.ibm.com> Cc: linux-rdma@vger.kernel.org --- drivers/infiniband/sw/siw/siw_cm.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)