From: Leon Romanovsky <leon@kernel.org>
To: Haris Iqbal <haris.iqbal@ionos.com>
Cc: Gioh Kim <gi-oh.kim@ionos.com>,
linux-rdma@vger.kernel.org, bvanassche@acm.org,
Doug Ledford <dledford@redhat.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Jinpu Wang <jinpu.wang@ionos.com>,
Md Haris Iqbal <haris.iqbal@cloud.ionos.com>
Subject: Re: [PATCH for-next 04/20] RDMA/rtrs-srv: Add error messages for cases when failing RDMA connection
Date: Mon, 10 May 2021 15:19:42 +0300 [thread overview]
Message-ID: <YJkk3lihskAtbBIv@unreal> (raw)
In-Reply-To: <CAJpMwyjhtNQ+k2NUa7iuDSde_XdG4fBSaxyOuB9jmur013F+1w@mail.gmail.com>
On Mon, May 10, 2021 at 02:16:02PM +0200, Haris Iqbal wrote:
> On Mon, May 10, 2021 at 2:03 PM Leon Romanovsky <leon@kernel.org> wrote:
> >
> > On Mon, May 10, 2021 at 12:55:42PM +0200, Haris Iqbal wrote:
> > > On Sun, May 9, 2021 at 1:27 PM Leon Romanovsky <leon@kernel.org> wrote:
> > > >
> > > > On Mon, May 03, 2021 at 01:48:02PM +0200, Gioh Kim wrote:
> > > > > From: Md Haris Iqbal <haris.iqbal@cloud.ionos.com>
> > > > >
> > > > > It was difficult to find out why it failed to establish RDMA
> > > > > connection. This patch adds some messages to show which function
> > > > > has failed why.
> > > > >
> > > > > Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com>
> > > > > Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
> > > > > Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com>
> > > > > ---
> > > > > drivers/infiniband/ulp/rtrs/rtrs-srv.c | 8 +++++++-
> > > > > 1 file changed, 7 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> > > > > index 3d09d01e34b4..df17dd4c1e28 100644
> > > > > --- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> > > > > +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> > > > > @@ -1356,8 +1356,10 @@ static struct rtrs_srv *get_or_create_srv(struct rtrs_srv_ctx *ctx,
> > > > > * If this request is not the first connection request from the
> > > > > * client for this session then fail and return error.
> > > > > */
> > > > > - if (!first_conn)
> > > > > + if (!first_conn) {
> > > > > + pr_err("Error: Not the first connection request for this session\n");
> > > > > return ERR_PTR(-ENXIO);
> > > > > + }
> > > > >
> > > > > /* need to allocate a new srv */
> > > > > srv = kzalloc(sizeof(*srv), GFP_KERNEL);
> > > > > @@ -1812,6 +1814,7 @@ static int rtrs_rdma_connect(struct rdma_cm_id *cm_id,
> > > > > srv = get_or_create_srv(ctx, &msg->paths_uuid, msg->first_conn);
> > > > > if (IS_ERR(srv)) {
> > > > > err = PTR_ERR(srv);
> > > > > + pr_err("get_or_create_srv(), error %d\n", err);
> > > > > goto reject_w_err;
> > > > > }
> > > > > mutex_lock(&srv->paths_mutex);
> > > > > @@ -1850,11 +1853,13 @@ static int rtrs_rdma_connect(struct rdma_cm_id *cm_id,
> > > > > mutex_unlock(&srv->paths_mutex);
> > > > > put_srv(srv);
> > > > > err = PTR_ERR(sess);
> > > > > + pr_err("RTRS server session allocation failed: %d\n", err);
> > > > > goto reject_w_err;
> > > > > }
> > > > > }
> > > > > err = create_con(sess, cm_id, cid);
> > > > > if (err) {
> > > > > + rtrs_err((&sess->s), "create_con(), error %d\n", err);
> > > > > (void)rtrs_rdma_do_reject(cm_id, err);
> > > >
> > > > Unrelated to this change, but this (void) casting should be go.
> > >
> > > Hi Leon
> > >
> > > We wanted to explicitly signal that the code is ignoring the return
> > > value of the function. Is there a strong reason for the casting to be
> > > removed?
> >
> > "Don't write useless code and don't assume that the kernel developers
> > are first year college students" - is this strong enough reason for you?
>
> I am all for simple and minimum code; but this casting does have a
> decent reason.
>
> Anyway if the RDMA code style calls for this to be removed; will
> remove them in a separate patch and send out with the next batch of
> patches.
Yes, please, we prefer proper APIs that don't require any special
comments to use them.
Thanks
>
> >
> > Your (void) casting doesn't give anything extra, just churn and even
> > more suspicious review over such code.
> >
> > Thanks
next prev parent reply other threads:[~2021-05-10 13:22 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-03 11:47 [PATCH for-next 00/20] Misc update for rtrs Gioh Kim
2021-05-03 11:47 ` [PATCH for-next 01/20] RDMA/rtrs-srv: Kill reject_w_econnreset label Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 02/20] RDMA/rtrs-clt: Remove MAX_SESS_QUEUE_DEPTH from rtrs_send_sess_info Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 03/20] RDMA/rtrs-clt: No need to check queue_depth when receiving Gioh Kim
2021-05-09 11:24 ` Leon Romanovsky
2021-05-10 11:00 ` Haris Iqbal
2021-05-10 11:53 ` Leon Romanovsky
2021-05-10 12:06 ` Haris Iqbal
2021-05-10 12:17 ` Leon Romanovsky
2021-05-10 12:26 ` Haris Iqbal
2021-05-03 11:48 ` [PATCH for-next 04/20] RDMA/rtrs-srv: Add error messages for cases when failing RDMA connection Gioh Kim
2021-05-09 11:27 ` Leon Romanovsky
2021-05-10 10:55 ` Haris Iqbal
2021-05-10 12:03 ` Leon Romanovsky
2021-05-10 12:16 ` Haris Iqbal
2021-05-10 12:19 ` Leon Romanovsky [this message]
2021-05-03 11:48 ` [PATCH for-next 05/20] RDMA/rtrs-srv: Clean up the code in __rtrs_srv_change_state Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 06/20] RDMA/rtrs: Change MAX_SESS_QUEUE_DEPTH Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 07/20] RDMA/rtrs: Define MIN_CHUNK_SIZE Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 08/20] RDMA/rtrs: Use strscpy instead of strlcpy Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 09/20] RDMA/rtrs-clt: Kill rtrs_clt_{start,stop}_hb Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 10/20] RDMA/rtrs-clt: Kill rtrs_clt_disconnect_from_sysfs Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 11/20] RDMA/rtrs-srv: Kill __rtrs_srv_change_state Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 12/20] RDMA/rtrs-clt: Remove redundant 'break' Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 13/20] RDMA/rtrs-clt: Check state of the rtrs_clt_sess before reading its stats Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 14/20] RDMA/rtrs-srv: Replace atomic_t with percpu_ref for ids_inflight Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 15/20] RDMA/rtrs: Do not reset hb_missed_max after re-connection Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 16/20] RDMA/rtrs-srv: Duplicated session name is not allowed Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 17/20] RDMA/rtrs-srv: Fix memory leak of unfreed rtrs_srv_stats object Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 18/20] RDMA/rtrs-srv: Fix memory leak when having multiple sessions Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 19/20] RDMA/rtrs-clt: Check if the queue_depth has changed during a reconnection Gioh Kim
2021-05-03 11:48 ` [PATCH for-next 20/20] RDMA/rtrs-clt: Fix memory leak of not-freed sess->stats and stats->pcpu_stats 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=YJkk3lihskAtbBIv@unreal \
--to=leon@kernel.org \
--cc=bvanassche@acm.org \
--cc=dledford@redhat.com \
--cc=gi-oh.kim@ionos.com \
--cc=haris.iqbal@cloud.ionos.com \
--cc=haris.iqbal@ionos.com \
--cc=jgg@ziepe.ca \
--cc=jinpu.wang@ionos.com \
--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).