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=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=no 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 82E25C4363A for ; Mon, 26 Oct 2020 13:22:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DF2F207DE for ; Mon, 26 Oct 2020 13:22:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603718569; bh=WN48BsDW4YWDZH9vRbJ0KsZM81iUpHmuKeC2degqmfI=; h=From:To:Cc:Subject:Date:List-ID:From; b=pPsnPF06U5FQTjsjloYPUVplxYSep+GVKi78Wqv4P9jsoNShyZIRn7r4Wn8q5s59n E/vaSEXC4T6tjtbnRnYAXt2qqW87UtYutD7BBXS4turn87aBCd9OPEUC/l5tVDH0y5 IcYYBklRiGqhkRxQOD9NHQ/UDlRDyoRP2Vcx8WJU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1779961AbgJZNWq (ORCPT ); Mon, 26 Oct 2020 09:22:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:54404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1776648AbgJZNTn (ORCPT ); Mon, 26 Oct 2020 09:19:43 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F09B722263; Mon, 26 Oct 2020 13:19:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603718382; bh=WN48BsDW4YWDZH9vRbJ0KsZM81iUpHmuKeC2degqmfI=; h=From:To:Cc:Subject:Date:From; b=RAL8/S1dVoRwxVEhEzNJDtjG8WqUV9vQwS6fwfRMgCDitEeM9fuXQQ60MI6BwY1iE imEcO9farQ2c/z6mKAaxVn9p7vjw0pQs7QyHnj0l/p6gFtggF4DyaDZZnXQyjUtMxa cxbO7JTFG7svAy05IYo7+4llSbrp4wtkAT66gK28= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , Artemy Kovalyov , linux-rdma@vger.kernel.org, Saeed Mahameed Subject: [PATCH rdma-next 0/7] Use only a umem and HW page_shift to calculate MR sizes Date: Mon, 26 Oct 2020 15:19:29 +0200 Message-Id: <20201026131936.1335664-1-leon@kernel.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Leon Romanovsky >From Jason: The MR code computes and passes around a tuple of (npages, page_shift, ncont, order) to represent the size of the MR in various terms. This is quite confusing about what term refers to what, and overlaps with data already stored and computed inside the umem. Rework all of this to be more umem centric and use these identities instead: npages == ib_umem_num_pages(mr->umem) page_shift == mr->page_shift ncont == ib_umem_num_dma_blocks(mr->umem, 1 << mr->page_shift) order == order_base_2(ncont) By storing the page_shift inside the mlx5_ib_mr it becomes nearly self describing. Thanks Jason Gunthorpe (7): RDMA/mlx5: Remove mlx5_ib_mr->order RDMA/mlx5: Fix corruption of reg_pages in mlx5_ib_rereg_user_mr() RDMA/mlx5: Remove mlx5_ib_mr->npages RDMA/mlx5: Move mlx5_ib_cont_pages() to the creation of the mlx5_ib_mr RDMA/mlx5: Remove order from mlx5_ib_cont_pages() RDMA/mlx5: Remove ncont from mlx5_ib_cont_pages() RDMA/mlx5: Remove npages from mlx5_ib_cont_pages() drivers/infiniband/hw/mlx5/cq.c | 39 ++++--- drivers/infiniband/hw/mlx5/devx.c | 20 ++-- drivers/infiniband/hw/mlx5/mem.c | 30 ++--- drivers/infiniband/hw/mlx5/mlx5_ib.h | 6 +- drivers/infiniband/hw/mlx5/mr.c | 168 ++++++++++++--------------- drivers/infiniband/hw/mlx5/qp.c | 39 +++---- drivers/infiniband/hw/mlx5/srq.c | 8 +- 7 files changed, 134 insertions(+), 176 deletions(-) -- 2.26.2