Received: by 2002:ab2:7041:0:b0:1f4:bcc8:f211 with SMTP id x1csp23972lql; Fri, 12 Apr 2024 02:22:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUpNSSiDBrp2S7SZjE7WmpQ4A5oXIff7S4xmXybmOAxf3B64HI/c05lE0rCp6+VtX0LjCs72gNaXRpqnJdZQ9PHrBL2lIqNnr4z9FUufw== X-Google-Smtp-Source: AGHT+IF+EERvxvBtxOlhj7XtQ5VxKOi8fZ1D/NcH5Z3j3sbANgSWXpf108WNylGIfqS/XsDIJtu/ X-Received: by 2002:a05:6214:21eb:b0:69b:58f8:c332 with SMTP id p11-20020a05621421eb00b0069b58f8c332mr1290722qvj.19.1712913755061; Fri, 12 Apr 2024 02:22:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712913755; cv=pass; d=google.com; s=arc-20160816; b=uMIy97GZpQq3ayo7YrC8OhYoWtxEhXm54O7azfrufMG9BWA9STifNAUivKdlX/Rr1C 3pSSPEplkxBzZXaNwDQdBSQMvAYVlkm7zrmetbuV2TZ9MsMCiPMv2avWiU2D4U8Q5B0U 7rRr9RYqHUplm4l48UvdheeCuKWM3/wxIAHaZfIE6G2vqSWosr20E1jc+UBOHl8RDOpa U7kwFjFwoN7m8Vi9mSrr71vEp41R0E8my1B3iYGCyipYopn+AtXBqKryFURJKade+bN5 OLxP1owMK85ez7VzSOS7MyeQudWH9ZCCJpZgExYL8XzOLunhCJ03Nx0oy2cO54yaxlO7 x9CQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=60JM/yvdbizYtuOjBV3bIBwrte+F9+TU/y5v6ida2YM=; fh=KWvyQxL3Ff+3WPSMjlYu+P4255AmcMULAsFol6M1vNI=; b=kaDfpOcpl+Cp+Dp9YOZMwy20OufDfUI8+9jOfVL4Im7oF5TdfKTkl/4NNGUUTJicXF JjYepW9x60mIZ3Jx5gpUMQyytAzWDj5O/AZcv7mk+G4NPqngUbI7qu8MxQhijeAsOLhC EQEAMObi+hOCXi8eh8Ma8stoWTCk4eH8AueibUPZM7QbmHeXeepIbNgh+sCYr2fihU6o BM+dm2mu9rzlDGfwblRvdWxf4oqgRfAxlN9nH2qPsJs0CE6EsXsBJ55cQVlcq0d/rSrL P5ZRxvLgUwicNAnp6qJhKSGVyhi/wOHgTEfMAbN62SZvj33JPCvpzOyAjRzUgk7NDPZv SK7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=hisilicon.com dmarc=pass fromdomain=hisilicon.com); spf=pass (google.com: domain of linux-kernel+bounces-142391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jn8-20020ad45de8000000b0068f2cd94c5esi3525685qvb.346.2024.04.12.02.22.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 02:22:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-142391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=hisilicon.com dmarc=pass fromdomain=hisilicon.com); spf=pass (google.com: domain of linux-kernel+bounces-142391-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-142391-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=hisilicon.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C1B161C211D0 for ; Fri, 12 Apr 2024 09:22:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FD8C50A72; Fri, 12 Apr 2024 09:20:55 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE305524DC; Fri, 12 Apr 2024 09:20:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712913653; cv=none; b=qStQFTc8g6xPpPOGh6Sk7Drl1Cq7SdCUMgbF8KYyTo8MGjzibvPqqtK7uEmDOG3ZbJ/9J3ElfoSh4nCoW3N5HRnGjZBYU3OJECRaTLpoGg3FrHslvdBHLwnftbsR8e5UBmz0vQjkWBo9UAJEL2fkJ0QVaQLk+yXogd/UVY9vtQY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712913653; c=relaxed/simple; bh=KAFrw43VY7dIaUOjOnZcEaIumeJ5kKw92qD/q3wDPYA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TrJDoDm3IXY8QqnPzRFPqTQmg63m+J44bbG4oPbFhI7L0w4eesZaw+2SbTOlu0ORntvdMPHxCKE5CQU5Oi6xqHB+QMhCTvZE24LHYqH+jydCjItdoguS0GqYbddrwc/n5iSJJa76H7Lp59xZPNkiAN+TPwCMC3nM2+YICSHh2FQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com; spf=pass smtp.mailfrom=hisilicon.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hisilicon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hisilicon.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4VG9vm1BlZz2NW6t; Fri, 12 Apr 2024 17:17:56 +0800 (CST) Received: from kwepemi500006.china.huawei.com (unknown [7.221.188.68]) by mail.maildlp.com (Postfix) with ESMTPS id 913981A016C; Fri, 12 Apr 2024 17:20:49 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemi500006.china.huawei.com (7.221.188.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 12 Apr 2024 17:20:49 +0800 From: Junxian Huang To: , CC: , , , Subject: [PATCH for-next 07/10] RDMA/hns: Fix GMV table pagesize Date: Fri, 12 Apr 2024 17:16:13 +0800 Message-ID: <20240412091616.370789-8-huangjunxian6@hisilicon.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240412091616.370789-1-huangjunxian6@hisilicon.com> References: <20240412091616.370789-1-huangjunxian6@hisilicon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500006.china.huawei.com (7.221.188.68) From: Chengchang Tang GMV's BA table only supports 4K pages. Currently, PAGESIZE is used to calculate gmv_bt_num, which will cause an abnormal number of gmv_bt_num in a 64K OS. Fixes: d6d91e46210f ("RDMA/hns: Add support for configuring GMV table") Signed-off-by: Chengchang Tang Signed-off-by: Junxian Huang --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 2a97a81ae19f..89d0f5b8be75 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -2101,7 +2101,7 @@ static void apply_func_caps(struct hns_roce_dev *hr_dev) caps->gmv_bt_num * (HNS_HW_PAGE_SIZE / caps->gmv_entry_sz)); - caps->gmv_entry_num = caps->gmv_bt_num * (PAGE_SIZE / + caps->gmv_entry_num = caps->gmv_bt_num * (HNS_HW_PAGE_SIZE / caps->gmv_entry_sz); } else { u32 func_num = max_t(u32, 1, hr_dev->func_num); -- 2.30.0