From patchwork Tue Jul 21 11:40:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 6834911 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B150D9F380 for ; Tue, 21 Jul 2015 11:40:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D434020670 for ; Tue, 21 Jul 2015 11:40:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F2CFE205E9 for ; Tue, 21 Jul 2015 11:40:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752670AbbGULko (ORCPT ); Tue, 21 Jul 2015 07:40:44 -0400 Received: from [193.47.165.129] ([193.47.165.129]:46642 "EHLO mellanox.co.il" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752650AbbGULkn (ORCPT ); Tue, 21 Jul 2015 07:40:43 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from sagig@mellanox.com) with ESMTPS (AES256-SHA encrypted); 21 Jul 2015 14:40:16 +0300 Received: from r-vnc05.mtr.labs.mlnx (r-vnc05.mtr.labs.mlnx [10.208.0.115]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id t6LBeDqJ013561; Tue, 21 Jul 2015 14:40:13 +0300 Received: from r-vnc05.mtr.labs.mlnx (localhost [127.0.0.1]) by r-vnc05.mtr.labs.mlnx (8.14.4/8.14.4) with ESMTP id t6LBeDW5009706; Tue, 21 Jul 2015 14:40:13 +0300 Received: (from sagig@localhost) by r-vnc05.mtr.labs.mlnx (8.14.4/8.14.4/Submit) id t6LBeC9o009688; Tue, 21 Jul 2015 14:40:12 +0300 From: Sagi Grimberg To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe , Eli Cohen Subject: [PATCH] mlx5: Expose correct page_size_cap in device attributes Date: Tue, 21 Jul 2015 14:40:12 +0300 Message-Id: <1437478812-9650-1-git-send-email-sagig@mellanox.com> X-Mailer: git-send-email 1.8.4.3 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Should be all the page sizes that are supported by the device. Reported-by: Jason Gunthorpe Signed-off-by: Sagi Grimberg Reviewed-by: Jason Gunthorpe --- drivers/infiniband/hw/mlx5/main.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 725f857..a90ef7a 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -212,6 +212,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, int err = -ENOMEM; int max_rq_sg; int max_sq_sg; + u64 min_page_size = 1ull << MLX5_CAP_GEN(mdev, log_pg_sz); if (uhw->inlen || uhw->outlen) return -EINVAL; @@ -264,7 +265,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, props->hw_ver = mdev->pdev->revision; props->max_mr_size = ~0ull; - props->page_size_cap = 1ull << MLX5_CAP_GEN(mdev, log_pg_sz); + props->page_size_cap = ~(min_page_size - 1); props->max_qp = 1 << MLX5_CAP_GEN(mdev, log_max_qp); props->max_qp_wr = 1 << MLX5_CAP_GEN(mdev, log_max_qp_sz); max_rq_sg = MLX5_CAP_GEN(mdev, max_wqe_sz_rq) /