public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jinpu Wang <jinpu.wang@ionos.com>
Cc: RDMA mailing list <linux-rdma@vger.kernel.org>,
	Bart Van Assche <bvanassche@acm.org>,
	Doug Ledford <dledford@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Haris Iqbal <haris.iqbal@ionos.com>,
	Md Haris Iqbal <haris.iqbal@cloud.ionos.com>,
	Jack Wang <jinpu.wang@cloud.ionos.com>,
	Gioh Kim <gi-oh.kim@ionos.com>
Subject: Re: [PATCH for-next 3/4] RDMA/rtrs: RDMA_RXE requires more number of WR
Date: Thu, 10 Jun 2021 14:47:24 +0300	[thread overview]
Message-ID: <YMH7zI0VZ4u1EfoJ@unreal> (raw)
In-Reply-To: <CAMGffE=dUEnVrtYLy2xVYdm0Jb=JEnfBYvUB1ZZavx5a1BpnDA@mail.gmail.com>

On Thu, Jun 10, 2021 at 01:01:07PM +0200, Jinpu Wang wrote:
> On Thu, Jun 10, 2021 at 9:23 AM Leon Romanovsky <leon@kernel.org> wrote:
> >
> > On Tue, Jun 08, 2021 at 12:30:38PM +0200, Jack Wang wrote:
> > > From: Md Haris Iqbal <haris.iqbal@cloud.ionos.com>
> > >
> > > When using rdma_rxe, post_one_recv() returns
> > > NOMEM error due to the full recv queue.
> > > This patch increase the number of WR for receive queue
> > > to support all devices.
> >
> > Why don't you query IB device to get max_qp_wr and set accordingly?
> >
> > Thanks
> Hi Leon,
> 
> We don't want to set the max_qp_wr, it will consume lots of memory.
> this patch is only for service connection
> used control messages.

OK, so why don't you set min(your_define, max_qp_wr)?

Thanks

> 
> For IO connection, we do query and max_qp_wr of the device, but still
> we need to set the minimum to
> reduce the memory consumption.
> 
> Thanks! Regards
> >
> > >
> > > Signed-off-by: Md Haris Iqbal <haris.iqbal@cloud.ionos.com>
> > > Signed-off-by: Jack Wang <jinpu.wang@cloud.ionos.com>
> > > Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com>
> > > ---
> > >  drivers/infiniband/ulp/rtrs/rtrs-clt.c | 7 ++++---
> > >  drivers/infiniband/ulp/rtrs/rtrs-srv.c | 2 +-
> > >  2 files changed, 5 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> > > index cd53edddfe1f..acf0fde410c3 100644
> > > --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> > > +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> > > @@ -1579,10 +1579,11 @@ static int create_con_cq_qp(struct rtrs_clt_con *con)
> > >       lockdep_assert_held(&con->con_mutex);
> > >       if (con->c.cid == 0) {
> > >               /*
> > > -              * One completion for each receive and two for each send
> > > -              * (send request + registration)
> > > +              * Two (request + registration) completion for send
> > > +              * Two for recv if always_invalidate is set on server
> > > +              * or one for recv.
> > >                * + 2 for drain and heartbeat
> > > -              * in case qp gets into error state
> > > +              * in case qp gets into error state.
> > >                */
> > >               max_send_wr = SERVICE_CON_QUEUE_DEPTH * 2 + 2;
> > >               max_recv_wr = SERVICE_CON_QUEUE_DEPTH * 2 + 2;
> > > diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> > > index 04ec3080e9b5..bb73f7762a87 100644
> > > --- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> > > +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> > > @@ -1656,7 +1656,7 @@ static int create_con(struct rtrs_srv_sess *sess,
> > >                * + 2 for drain and heartbeat
> > >                */
> > >               max_send_wr = SERVICE_CON_QUEUE_DEPTH * 2 + 2;
> > > -             max_recv_wr = SERVICE_CON_QUEUE_DEPTH + 2;
> > > +             max_recv_wr = SERVICE_CON_QUEUE_DEPTH * 2 + 2;
> > >               cq_size = max_send_wr + max_recv_wr;
> > >       } else {
> > >               /*
> > > --
> > > 2.25.1
> > >

  reply	other threads:[~2021-06-10 11:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08 10:30 [PATCH for-next 0/4] misc update for RTRS Jack Wang
2021-06-08 10:30 ` [PATCH for-next 1/4] RDMA/rtrs-srv: Set minimal max_send_wr and max_recv_wr Jack Wang
2021-06-08 10:30 ` [PATCH for-next 2/4] RDMA/rtrs-clt: Use minimal max_send_sge when create qp Jack Wang
2021-06-08 10:30 ` [PATCH for-next 3/4] RDMA/rtrs: RDMA_RXE requires more number of WR Jack Wang
2021-06-10  7:23   ` Leon Romanovsky
2021-06-10 11:01     ` Jinpu Wang
2021-06-10 11:47       ` Leon Romanovsky [this message]
2021-06-10 12:00         ` Jinpu Wang
2021-06-08 10:30 ` [PATCH for-next 4/4] RDMA/rtrs: Rename some variables to avoid confusion Jack 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=YMH7zI0VZ4u1EfoJ@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@cloud.ionos.com \
    --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