linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Gioh Kim <gi-oh.kim@ionos.com>
Cc: linux-rdma@vger.kernel.org, bvanassche@acm.org, leon@kernel.org,
	dledford@redhat.com, haris.iqbal@ionos.com, jinpu.wang@ionos.com,
	Gioh Kim <gi-oh.kim@cloud.ionos.com>
Subject: Re: [PATCH for-next 14/22] RDMA/rtrs-clt: Print more info when an error happens
Date: Thu, 1 Apr 2021 15:46:17 -0300	[thread overview]
Message-ID: <20210401184617.GA1650879@nvidia.com> (raw)
In-Reply-To: <20210325153308.1214057-15-gi-oh.kim@ionos.com>

On Thu, Mar 25, 2021 at 04:33:00PM +0100, Gioh Kim wrote:
> From: Gioh Kim <gi-oh.kim@cloud.ionos.com>
> 
> 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.
> 
> Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com>
> Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
>  drivers/infiniband/ulp/rtrs/rtrs-clt.c | 31 ++++++++++++++++++++++----
>  1 file changed, 27 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> index 1519191d7154..a41864ec853d 100644
> +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> @@ -440,6 +440,11 @@ static void complete_rdma_req(struct rtrs_clt_io_req *req, int errno,
>  	req->in_use = false;
>  	req->con = NULL;
>  
> +	if (unlikely(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)
>  		req->conf(req->priv, errno);
>  }
> @@ -1026,7 +1031,8 @@ static int rtrs_clt_write_req(struct rtrs_clt_io_req *req)
>  				       req->usr_len + sizeof(*msg),
>  				       imm);
>  	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)
>  			atomic_dec(&sess->stats->inflight);
>  		if (req->sg_cnt)
> @@ -1144,7 +1150,8 @@ static int rtrs_clt_read_req(struct rtrs_clt_io_req *req)
>  	ret = rtrs_post_send_rdma(req->con, req, &sess->rbufs[buf_id],
>  				   req->data_len, imm, wr);
>  	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)
>  			atomic_dec(&sess->stats->inflight);
>  		req->need_inv = false;
> @@ -2465,12 +2472,28 @@ static int init_sess(struct rtrs_clt_sess *sess)
>  	mutex_lock(&sess->init_mutex);
>  	err = init_conns(sess);
>  	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));

Coding style is to have new lines after variable blocks.

Jason

  reply	other threads:[~2021-04-01 18:48 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 15:32 [PATCH for-next 00/22] Misc update for rtrs Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 01/22] MAINTAINERS: Change maintainer for rtrs module Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 02/22] RDMA/rtrs: Enable the fault-injection Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 03/22] RDMA/rtrs-clt: Inject a fault at request processing Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 04/22] RDMA/rtrs-srv: Inject a fault at heart-beat sending Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 05/22] docs: fault-injection: Add fault-injection manual of RTRS Gioh Kim
2021-04-01 18:37   ` Jason Gunthorpe
2021-04-01 19:06     ` Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 06/22] RDMA/rtrs-clt: Break if one sess is connected in rtrs_clt_is_connected Gioh Kim
2021-04-01 18:38   ` Jason Gunthorpe
2021-04-06 10:23     ` Gioh Kim
2021-04-06 12:51       ` Jason Gunthorpe
2021-04-06 12:53         ` Gioh Kim
2021-04-06 12:59           ` Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 07/22] RDMA/rtrs-clt: Remove redundant code from rtrs_clt_read_req Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 08/22] RDMA/rtrs: Kill the put label in rtrs_srv_create_once_sysfs_root_folders Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 09/22] RDMA/rtrs: Remove sessname and sess_kobj from rtrs_attrs Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 10/22] RDMA/rtrs: Cleanup the code in rtrs_srv_rdma_cm_handler Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 11/22] RDMA/rtrs-clt: Close rtrs client conn before destroying rtrs clt session files Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 12/22] RDMA/rtrs-clt: Check state of the rtrs_clt_sess before reading its stats Gioh Kim
2021-04-01 18:44   ` Jason Gunthorpe
2021-04-06  8:55     ` Gioh Kim
2021-04-08 12:04       ` Jason Gunthorpe
2021-04-08 12:08         ` Gioh Kim
2021-04-08 13:45         ` Jinpu Wang
2021-04-08 13:50           ` Jason Gunthorpe
2021-04-08 14:44             ` Gioh Kim
2021-04-08 14:51               ` Jason Gunthorpe
2021-04-12  8:41                 ` Gioh Kim
2021-03-25 15:32 ` [PATCH for-next 13/22] RDMA/rtrs: New function converting rtrs_addr to string Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 14/22] RDMA/rtrs-clt: Print more info when an error happens Gioh Kim
2021-04-01 18:46   ` Jason Gunthorpe [this message]
2021-04-01 19:09     ` Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 15/22] RDMA/rtrs-srv: More debugging info when fail to send reply Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 16/22] RDMA/rtrs-srv: Report temporary sessname for error message Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 17/22] RDMA/rtrs: cleanup unused variable Gioh Kim
2021-04-01 18:50   ` Jason Gunthorpe
2021-03-25 15:33 ` [PATCH for-next 18/22] RDMA/rtrs-clt: Simplify error message Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 19/22] RDMA/rtrs-clt: Cap max_io_size Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 20/22] RDMA/rtrs-clt: Add a minimum latency multipath policy Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 21/22] RDMA/rtrs-clt: new sysfs attribute to print the latency of each path Gioh Kim
2021-03-25 15:33 ` [PATCH for-next 22/22] Documentation/ABI/rtrs-clt: Add descriptions for min-latency policy Gioh Kim
2021-04-01 19:04 ` [PATCH for-next 00/22] Misc update for rtrs Jason Gunthorpe
2021-04-06  9:04   ` Gioh Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210401184617.GA1650879@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=bvanassche@acm.org \
    --cc=dledford@redhat.com \
    --cc=gi-oh.kim@cloud.ionos.com \
    --cc=gi-oh.kim@ionos.com \
    --cc=haris.iqbal@ionos.com \
    --cc=jinpu.wang@ionos.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).