From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADD0FC47094 for ; Thu, 10 Jun 2021 11:47:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9594B613F5 for ; Thu, 10 Jun 2021 11:47:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230285AbhFJLtY (ORCPT ); Thu, 10 Jun 2021 07:49:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:55560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230033AbhFJLtY (ORCPT ); Thu, 10 Jun 2021 07:49:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A3FA960FD8; Thu, 10 Jun 2021 11:47:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623325648; bh=7YxuqwYsONDTA+qgI2aFEeQMgplxmNsE4J8CozrGE5w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bXWdtSZhHuDdBalkXqg2WYUd0yWxMJnELLfm5pmvHZOffo/tp4kOMnv9BSUv2VmhF HsEbQbVuGwgzHMdnLos/WSC78ggYBLosLxMr5J66AOhnHp3GBVxHEhgrxdclVeZQK+ kkQILXWlJVu+0bTzgP2O83QLyNEWAIJQ/mJI6gbCXaexTaWULOZ0Od4b8nKYA/uLws dd4Ps38Hb+c0Q6sOFYSMe+x8p7D+mwPujoIolNJ3ZkI/Zw5DY82rOxwPPKHsIV/F88 4qY4h0kmube/KlaZOEBXO1F8CNy6Y204EIMJtuCheeIQMevAcdAEuBumitna7SP9Ci 238FnzpJngSiQ== Date: Thu, 10 Jun 2021 14:47:24 +0300 From: Leon Romanovsky To: Jinpu Wang Cc: RDMA mailing list , Bart Van Assche , Doug Ledford , Jason Gunthorpe , Haris Iqbal , Md Haris Iqbal , Jack Wang , Gioh Kim Subject: Re: [PATCH for-next 3/4] RDMA/rtrs: RDMA_RXE requires more number of WR Message-ID: References: <20210608103039.39080-1-jinpu.wang@ionos.com> <20210608103039.39080-4-jinpu.wang@ionos.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Thu, Jun 10, 2021 at 01:01:07PM +0200, Jinpu Wang wrote: > On Thu, Jun 10, 2021 at 9:23 AM Leon Romanovsky wrote: > > > > On Tue, Jun 08, 2021 at 12:30:38PM +0200, Jack Wang wrote: > > > From: Md Haris Iqbal > > > > > > 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 > > > Signed-off-by: Jack Wang > > > Signed-off-by: Gioh Kim > > > --- > > > 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 > > >