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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 F245CC7618B for ; Thu, 25 Jul 2019 11:50:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D5362229F9 for ; Thu, 25 Jul 2019 11:50:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727296AbfGYLul (ORCPT ); Thu, 25 Jul 2019 07:50:41 -0400 Received: from verein.lst.de ([213.95.11.211]:60849 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727116AbfGYLul (ORCPT ); Thu, 25 Jul 2019 07:50:41 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 3990468BFE; Thu, 25 Jul 2019 13:50:40 +0200 (CEST) Date: Thu, 25 Jul 2019 13:50:38 +0200 From: Christoph Hellwig To: Logan Gunthorpe Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, Bjorn Helgaas , Christian Koenig , Jason Gunthorpe , Sagi Grimberg , Keith Busch , Jens Axboe , Dan Williams , Eric Pilmore , Stephen Bates Subject: Re: [PATCH 14/14] PCI/P2PDMA: Introduce pci_p2pdma_[un]map_resource() Message-ID: <20190725115038.GC31065@lst.de> References: <20190722230859.5436-1-logang@deltatee.com> <20190722230859.5436-15-logang@deltatee.com> <20190724063235.GC1804@lst.de> <57e8fc1a-de70-fb65-5ef1-ffa2b95c73a6@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57e8fc1a-de70-fb65-5ef1-ffa2b95c73a6@deltatee.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Wed, Jul 24, 2019 at 10:06:22AM -0600, Logan Gunthorpe wrote: > Yes. This is the downside of dealing only with a phys_addr_t: we have to > look up against it. Unfortunately, I believe it's possible for different > BARs on a device to be in different windows, so something like this is > necessary unless we already know the BAR the phys_addr_t belongs to. It > might probably be sped up a bit by storing the offsets of each bar > instead of looping through all the bridge windows, but I don't think it > will get you *that* much. > > As this is an example with no users, the answer here will really depend > on what the use-case is doing. If they can lookup, ahead of time, the > mapping type and offset then they don't have to do this work on the hot > path and it means that pci_p2pdma_map_resource() is simply not a > suitable API. Ok. So lets just keep this out as an RFC and don't merge it until an actual concrete user shows up.