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=-20.4 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,USER_AGENT_GIT autolearn=unavailable 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 90350C11F67 for ; Tue, 6 Jul 2021 11:54:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 89AE06115B for ; Tue, 6 Jul 2021 11:54:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241028AbhGFL4X (ORCPT ); Tue, 6 Jul 2021 07:56:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:42502 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234569AbhGFLdf (ORCPT ); Tue, 6 Jul 2021 07:33:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7C56761E03; Tue, 6 Jul 2021 11:22:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625570578; bh=x1TvY+knuN5gDF07XZ/Q+PwYNswhi2uTCeBf1ReKKX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LReabAhsSlJ4x4jPEYk07oKGwDdjRT7S7Z8B2U2GABOv2CDdcLPdD9XMU4QApo335 hX+r9FaohKdqQ9u/ZiR2bBYZ5ET+G3GmlXVoz0K3UCRK14XuTV6ArZKn38rYk97l0w ZFqv46Yru3OY2PPe4y9WYh7bM8ed21EOJHX10qJ5oqEjycEIPejd3rXGsCl6kqnpT9 bloJxoykDwIrtoxTIQjSmhSfHkXBNPB9rtXuAnUPo7FDyuIIEc2gBNovr7jtzu19vS 7YJ44kQoDgTu97eAxb469FcgYmUJJ0hy73ZAMf9WjSjx/gHggvjSNpF+lU9PjJ733d hn5rpSz380ZFA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Gioh Kim , Gioh Kim , Jack Wang , kernel test robot , Jason Gunthorpe , Sasha Levin , linux-rdma@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 042/137] RDMA/rtrs: Change MAX_SESS_QUEUE_DEPTH Date: Tue, 6 Jul 2021 07:20:28 -0400 Message-Id: <20210706112203.2062605-42-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210706112203.2062605-1-sashal@kernel.org> References: <20210706112203.2062605-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gioh Kim [ Upstream commit 3a98ea7041b7d18ac356da64823c2ba2f8391b3e ] Max IB immediate data size is 2^28 (MAX_IMM_PAYL_BITS) and the minimum chunk size is 4096 (2^12). Therefore the maximum sess_queue_depth is 65536 (2^16). Link: https://lore.kernel.org/r/20210528113018.52290-6-jinpu.wang@ionos.com Signed-off-by: Gioh Kim Signed-off-by: Jack Wang Reported-by: kernel test robot Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/ulp/rtrs/rtrs-pri.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/ulp/rtrs/rtrs-pri.h b/drivers/infiniband/ulp/rtrs/rtrs-pri.h index 8caad0a2322b..51c60f542876 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-pri.h +++ b/drivers/infiniband/ulp/rtrs/rtrs-pri.h @@ -47,12 +47,15 @@ enum { MAX_PATHS_NUM = 128, /* - * With the size of struct rtrs_permit allocated on the client, 4K - * is the maximum number of rtrs_permits we can allocate. This number is - * also used on the client to allocate the IU for the user connection - * to receive the RDMA addresses from the server. + * Max IB immediate data size is 2^28 (MAX_IMM_PAYL_BITS) + * and the minimum chunk size is 4096 (2^12). + * So the maximum sess_queue_depth is 65536 (2^16) in theory. + * But mempool_create, create_qp and ib_post_send fail with + * "cannot allocate memory" error if sess_queue_depth is too big. + * Therefore the pratical max value of sess_queue_depth is + * somewhere between 1 and 65536 and it depends on the system. */ - MAX_SESS_QUEUE_DEPTH = 4096, + MAX_SESS_QUEUE_DEPTH = 65536, RTRS_HB_INTERVAL_MS = 5000, RTRS_HB_MISSED_MAX = 5, -- 2.30.2