All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jinpu Wang <jinpu.wang@cloud.ionos.com>
Cc: linux-rdma@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Danil Kipnis <danil.kipnis@cloud.ionos.com>
Subject: Re: [PATCH 1/2] RDMA/rtrs: Use new shared CQ mechanism
Date: Mon, 22 Feb 2021 15:16:56 +0200	[thread overview]
Message-ID: <YDOuyLMjl6jYMDEA@unreal> (raw)
In-Reply-To: <CAMGffEk7Qn9W+tjvb4S-aHs7N0DtkwNRR76X3Lf6zjfRujTP5g@mail.gmail.com>

On Mon, Feb 22, 2021 at 11:31:55AM +0100, Jinpu Wang wrote:
> On Sun, Feb 21, 2021 at 7:23 AM Leon Romanovsky <leon@kernel.org> wrote:
> >
> > On Fri, Feb 19, 2021 at 12:50:18PM +0100, Jack Wang wrote:
> > > Has the driver use shared CQs providing ~10%-20% improvement during
> > > test.
> > > Instead of opening a CQ for each QP per connection, a CQ for each QP
> > > will be provided by the RDMA core driver that will be shared between
> > > the QPs on that core reducing interrupt overhead.
> > >
> > > Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
> > > ---
> > >  drivers/infiniband/ulp/rtrs/rtrs-clt.c | 10 +++++-----
> > >  drivers/infiniband/ulp/rtrs/rtrs-pri.h |  1 +
> > >  drivers/infiniband/ulp/rtrs/rtrs-srv.c | 10 +++++-----
> > >  drivers/infiniband/ulp/rtrs/rtrs.c     | 11 +++++++----
> > >  4 files changed, 18 insertions(+), 14 deletions(-)

<...>

> > >       err = create_qp(con, sess->dev->ib_pd, max_send_wr, max_recv_wr,
> > >                       max_send_sge);
> > >       if (err) {
> > > -             ib_free_cq(con->cq);
> > > +             ib_cq_pool_put(con->cq, con->cq_size);
> > >               con->cq = NULL;
> > > +             con->cq_size = 0;
> >
> > It is better do not clear fields that not used, it hides bugs.
> > Other than that.
> I feel rewinding on the error path by resetting the cq_size is the
> right thing to do.

It is the right thing to do if down the road you have an access to
cq_size with if (..) check. Other than that, it is not right thing to
do.

Thanks

  reply	other threads:[~2021-02-22 13:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19 11:50 [PATCH 1/2] RDMA/rtrs: Use new shared CQ mechanism Jack Wang
2021-02-19 11:50 ` [PATCH 2/2] RDMA/rtrs-clt: Use rdma_event_msg in log Jack Wang
2021-02-21  6:24   ` Leon Romanovsky
2021-02-22 10:32     ` Jinpu Wang
2021-02-21  6:23 ` [PATCH 1/2] RDMA/rtrs: Use new shared CQ mechanism Leon Romanovsky
2021-02-22 10:31   ` Jinpu Wang
2021-02-22 13:16     ` Leon Romanovsky [this message]
2021-02-22 14:13       ` Jinpu Wang

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=YDOuyLMjl6jYMDEA@unreal \
    --to=leon@kernel.org \
    --cc=bvanassche@acm.org \
    --cc=danil.kipnis@cloud.ionos.com \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=jinpu.wang@cloud.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.