Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp708265pxv; Thu, 15 Jul 2021 14:04:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylh4vLbdCWqnZ3uzbfphsFAIVY4MTc0gytaP8Ex+67nkpmjTLJAjMUidWoK73zlbUdt7kq X-Received: by 2002:aa7:c04e:: with SMTP id k14mr9565361edo.157.1626383072227; Thu, 15 Jul 2021 14:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383072; cv=none; d=google.com; s=arc-20160816; b=T1ghHrKXx/wvl4owIwpMrZS0SGu2+zjpwkxQgJZt1zFpXQB0qVp/VGAlcEuh2L2Vzj lcp60pDzFgJ/mT95U4olTBImCAsimfeVXesfbh+4zQv3mvuLGSwCabPlLBls7gE0pg6a vpONjKoiQcs036lfLegIJaqExNwu1lzebKles2yf0zfqGGKVXZOXJoTBnyTvavseb9eO ccuawU61sD1VVFh5zrZo+eDRJOTUXsMUx2roL2wc9u9vQAP2SaqFNF027YOkBBCyMo6J 2fwmtwRUiEhao1MymyHxsL73BD0tsBra3B6Sa9pOtugbsiMZ0Y+aSZhrCo7Dtwozf+fx 8CNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=59lm57HGkcnZ2Q2KB3LAtNZ7EDEvpUb8z4OiHTLBe44=; b=fn93pt20ksWk7RxqSBaRvVgDTOwMBgk5uw7Sbh8WHri836EHOeJ8zKEHNS6TBLpYF7 l1xFH6fjd2KnDYA7v5/gPOxwfYTMFopdgm4r0O4CvGoNfO30SYlilvxlOhWT0CzJnjsP FAH6pWK4BJ5ubC+KK2nVyaaaTThTdJxDrMHopEoDjxvt0jDQueFm0RNP5VMt7yC/AnaG Q8tE7hexqVvtqxBSmylnjJ2l8QyRwj4iAlJugy1WxVrwDi/h25Cx5PkNYUz2zl49bJSI eHcnGWW7SJ1Xsd7hh4tdrLuvvbp75ReZ9voVL1etROY9euJi/83RBrhJceap2Ft4Y3zM Macg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pq9Qxfuq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz13si4556289ejc.690.2021.07.15.14.04.08; Thu, 15 Jul 2021 14:04:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pq9Qxfuq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244686AbhGOTPC (ORCPT + 99 others); Thu, 15 Jul 2021 15:15:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:33970 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242180AbhGOS6e (ORCPT ); Thu, 15 Jul 2021 14:58:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7BBC5613CA; Thu, 15 Jul 2021 18:55:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375334; bh=x1TvY+knuN5gDF07XZ/Q+PwYNswhi2uTCeBf1ReKKX8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pq9Qxfuqyuv/wgwGxlyVBlmci/4vaw3rkwQ+QP7lchfkAvcUtra7MXkJY/cdLJmkP JRB1Be8eQeblci+IXeB4cOV4vQq6gyOiaunCeGgF4NZraV/CF0pTCsCvQ674T7UASD e+OxFjUPjY3IdmbW+DofX2d5WoZmfihS5Uph3s/g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Gioh Kim , Jack Wang , kernel test robot , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.12 042/242] RDMA/rtrs: Change MAX_SESS_QUEUE_DEPTH Date: Thu, 15 Jul 2021 20:36:44 +0200 Message-Id: <20210715182559.463660059@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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