Commit 42cdc190 authored by Gioh Kim's avatar Gioh Kim Committed by Jason Gunthorpe

RDMA/rtrs-srv: More debugging info when fail to send reply

It does not help to debug if it only print error message
without any debugging information which session and connection
the error happened.

Link: https://lore.kernel.org/r/20210406123639.202899-3-gi-oh.kim@ionos.comSigned-off-by: default avatarGioh Kim <gi-oh.kim@ionos.com>
Signed-off-by: default avatarJack Wang <jinpu.wang@ionos.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 2f37b017
...@@ -518,8 +518,9 @@ bool rtrs_srv_resp_rdma(struct rtrs_srv_op *id, int status) ...@@ -518,8 +518,9 @@ bool rtrs_srv_resp_rdma(struct rtrs_srv_op *id, int status)
if (unlikely(sess->state != RTRS_SRV_CONNECTED)) { if (unlikely(sess->state != RTRS_SRV_CONNECTED)) {
rtrs_err_rl(s, rtrs_err_rl(s,
"Sending I/O response failed, session is disconnected, sess state %s\n", "Sending I/O response failed, session %s is disconnected, sess state %s\n",
rtrs_srv_state_str(sess->state)); kobject_name(&sess->kobj),
rtrs_srv_state_str(sess->state));
goto out; goto out;
} }
if (always_invalidate) { if (always_invalidate) {
...@@ -529,7 +530,9 @@ bool rtrs_srv_resp_rdma(struct rtrs_srv_op *id, int status) ...@@ -529,7 +530,9 @@ bool rtrs_srv_resp_rdma(struct rtrs_srv_op *id, int status)
} }
if (unlikely(atomic_sub_return(1, if (unlikely(atomic_sub_return(1,
&con->sq_wr_avail) < 0)) { &con->sq_wr_avail) < 0)) {
pr_err("IB send queue full\n"); rtrs_err(s, "IB send queue full: sess=%s cid=%d\n",
kobject_name(&sess->kobj),
con->c.cid);
atomic_add(1, &con->sq_wr_avail); atomic_add(1, &con->sq_wr_avail);
spin_lock(&con->rsp_wr_wait_lock); spin_lock(&con->rsp_wr_wait_lock);
list_add_tail(&id->wait_list, &con->rsp_wr_wait_list); list_add_tail(&id->wait_list, &con->rsp_wr_wait_list);
...@@ -543,7 +546,8 @@ bool rtrs_srv_resp_rdma(struct rtrs_srv_op *id, int status) ...@@ -543,7 +546,8 @@ bool rtrs_srv_resp_rdma(struct rtrs_srv_op *id, int status)
err = rdma_write_sg(id); err = rdma_write_sg(id);
if (unlikely(err)) { if (unlikely(err)) {
rtrs_err_rl(s, "IO response failed: %d\n", err); rtrs_err_rl(s, "IO response failed: %d: sess=%s\n", err,
kobject_name(&sess->kobj));
close_sess(sess); close_sess(sess);
} }
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment