Commit 2f37b017 authored by Gioh Kim's avatar Gioh Kim Committed by Jason Gunthorpe

RDMA/rtrs-clt: Print more info when an error happens

Client prints only error value and it is not enough for debugging.

1. When client receives an error from server: the client does not only
   print the error value but also more information of server connection.

2. When client failes to send IO: the client gets an error from RDMA
   layer. It also print more information of server connection.

Link: https://lore.kernel.org/r/20210406123639.202899-2-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 abdeef3b
...@@ -437,6 +437,13 @@ static void complete_rdma_req(struct rtrs_clt_io_req *req, int errno, ...@@ -437,6 +437,13 @@ static void complete_rdma_req(struct rtrs_clt_io_req *req, int errno,
req->in_use = false; req->in_use = false;
req->con = NULL; req->con = NULL;
if (errno) {
rtrs_err_rl(con->c.sess,
"IO request failed: error=%d path=%s [%s:%u]\n",
errno, kobject_name(&sess->kobj), sess->hca_name,
sess->hca_port);
}
if (notify) if (notify)
req->conf(req->priv, errno); req->conf(req->priv, errno);
} }
...@@ -1075,7 +1082,10 @@ static int rtrs_clt_write_req(struct rtrs_clt_io_req *req) ...@@ -1075,7 +1082,10 @@ static int rtrs_clt_write_req(struct rtrs_clt_io_req *req)
req->usr_len + sizeof(*msg), req->usr_len + sizeof(*msg),
imm); imm);
if (unlikely(ret)) { if (unlikely(ret)) {
rtrs_err(s, "Write request failed: %d\n", ret); rtrs_err_rl(s,
"Write request failed: error=%d path=%s [%s:%u]\n",
ret, kobject_name(&sess->kobj), sess->hca_name,
sess->hca_port);
if (sess->clt->mp_policy == MP_POLICY_MIN_INFLIGHT) if (sess->clt->mp_policy == MP_POLICY_MIN_INFLIGHT)
atomic_dec(&sess->stats->inflight); atomic_dec(&sess->stats->inflight);
if (req->sg_cnt) if (req->sg_cnt)
...@@ -1193,7 +1203,10 @@ static int rtrs_clt_read_req(struct rtrs_clt_io_req *req) ...@@ -1193,7 +1203,10 @@ static int rtrs_clt_read_req(struct rtrs_clt_io_req *req)
ret = rtrs_post_send_rdma(req->con, req, &sess->rbufs[buf_id], ret = rtrs_post_send_rdma(req->con, req, &sess->rbufs[buf_id],
req->data_len, imm, wr); req->data_len, imm, wr);
if (unlikely(ret)) { if (unlikely(ret)) {
rtrs_err(s, "Read request failed: %d\n", ret); rtrs_err_rl(s,
"Read request failed: error=%d path=%s [%s:%u]\n",
ret, kobject_name(&sess->kobj), sess->hca_name,
sess->hca_port);
if (sess->clt->mp_policy == MP_POLICY_MIN_INFLIGHT) if (sess->clt->mp_policy == MP_POLICY_MIN_INFLIGHT)
atomic_dec(&sess->stats->inflight); atomic_dec(&sess->stats->inflight);
req->need_inv = false; req->need_inv = false;
...@@ -2513,12 +2526,33 @@ static int init_sess(struct rtrs_clt_sess *sess) ...@@ -2513,12 +2526,33 @@ static int init_sess(struct rtrs_clt_sess *sess)
mutex_lock(&sess->init_mutex); mutex_lock(&sess->init_mutex);
err = init_conns(sess); err = init_conns(sess);
if (err) { if (err) {
rtrs_err(sess->clt, "init_conns(), err: %d\n", err); char str[NAME_MAX];
int err;
struct rtrs_addr path = {
.src = &sess->s.src_addr,
.dst = &sess->s.dst_addr,
};
rtrs_addr_to_str(&path, str, sizeof(str));
rtrs_err(sess->clt,
"init_conns() failed: err=%d path=%s [%s:%u]\n", err,
str, sess->hca_name, sess->hca_port);
goto out; goto out;
} }
err = rtrs_send_sess_info(sess); err = rtrs_send_sess_info(sess);
if (err) { if (err) {
rtrs_err(sess->clt, "rtrs_send_sess_info(), err: %d\n", err); char str[NAME_MAX];
int err;
struct rtrs_addr path = {
.src = &sess->s.src_addr,
.dst = &sess->s.dst_addr,
};
rtrs_addr_to_str(&path, str, sizeof(str));
rtrs_err(
sess->clt,
"rtrs_send_sess_info() failed: err=%d path=%s [%s:%u]\n",
err, str, sess->hca_name, sess->hca_port);
goto out; goto out;
} }
rtrs_clt_sess_up(sess); rtrs_clt_sess_up(sess);
......
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