Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp306003iog; Wed, 29 Jun 2022 00:00:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tsLLLWMP5vginV7M2wTlUv9r78kQjDxSv3yME6hjTvggi+DXKpTQVsTLDKcvsrcUzRmV+W X-Received: by 2002:a05:6402:4242:b0:437:7771:982c with SMTP id g2-20020a056402424200b004377771982cmr2355788edb.146.1656486051298; Wed, 29 Jun 2022 00:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656486051; cv=none; d=google.com; s=arc-20160816; b=dbiLGGktk4vIVBAlWd82w3RUC4BoJEJXHU9GK8asxZjBRw06gCD9ggRL0JAEznCWZM dx/zePu/gdCwDbZO5v4Jb427QceNAPpUCH9k+1g4WdLX9ElfOugU+/QGyKd3PTN+wroG VugkmYpiNzCKRKUpkWOd03uxn2drWfPNaOm1+YoDrkzP03vupanxsfaxqWmwRQYisu+l 7oyDHH8ve5KwvASVaBunY2Z70Wc8YOd7fKH/ezAYuUpU+9DJMbVs96erN8C+32c07XqV vbDfBeh+h6KgC+KY9j78S1XapCa2KryVdxTlFQ1wpWl3bZR40kjMC7NkWtRlXhQmSG8f sDXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ABoTTpU3JTWfBWE3xlxTeugKJPEA+6jj3ElYfHE7mXc=; b=e4szc4wY+bNkg6us8FG8NSkDPnIRLm0gmmWimbfUmukMNGbqEbLFrAbAIPyxhV+0i2 4G+mOExh1mjvxXXxhLGt6pzpaLAxCh+/8p7e/HaRZb5GjumncAuUkfvNvyRtsjpLkuW/ YkKVuF56SDvhAs9E7kEN+L5Nche87jJNlQF9H2K5YXzYR4myjpKR+1Xzgq69pXmjZv6a BiJNaMNREdaAa9l83luVm5axPtcoNo95z56TFAYXFQRlpa1ia5VyhxSLlbVnLkJ+f6Jr zfKQkq0D3UFMm8dZJnSuA1abjWux/QDiAAiT5nqNzWLjktzRGhj90M/1WPtvk53nvjqI lCNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg6-20020a170907970600b00726294f089fsi1303582ejc.229.2022.06.29.00.00.24; Wed, 29 Jun 2022 00:00:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231264AbiF2Gmm (ORCPT + 99 others); Wed, 29 Jun 2022 02:42:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232300AbiF2Gmj (ORCPT ); Wed, 29 Jun 2022 02:42:39 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEF062AC78; Tue, 28 Jun 2022 23:42:38 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 2864567373; Wed, 29 Jun 2022 08:42:36 +0200 (CEST) Date: Wed, 29 Jun 2022 08:42:35 +0200 From: Christoph Hellwig To: Logan Gunthorpe Cc: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Stephen Bates , Christoph Hellwig , Dan Williams , Jason Gunthorpe , Christian =?iso-8859-1?Q?K=F6nig?= , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Minturn Dave B , Jason Ekstrand , Dave Hansen , Xiong Jianxin , Bjorn Helgaas , Ira Weiny , Robin Murphy , Martin Oliveira , Chaitanya Kulkarni , Ralph Campbell , Jason Gunthorpe , Max Gurtovoy Subject: Re: [PATCH v7 11/21] RDMA/core: introduce ib_dma_pci_p2p_dma_supported() Message-ID: <20220629064235.GK17234@lst.de> References: <20220615161233.17527-1-logang@deltatee.com> <20220615161233.17527-12-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220615161233.17527-12-logang@deltatee.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 15, 2022 at 10:12:23AM -0600, Logan Gunthorpe wrote: > Introduce the helper function ib_dma_pci_p2p_dma_supported() to check > if a given ib_device can be used in P2PDMA transfers. This ensures > the ib_device is not using virt_dma and also that the underlying > dma_device supports P2PDMA. > > Use the new helper in nvme-rdma to replace the existing check for > ib_uses_virt_dma(). Adding the dma_pci_p2pdma_supported() check allows > switching away from pci_p2pdma_[un]map_sg(). > > Signed-off-by: Logan Gunthorpe > Reviewed-by: Jason Gunthorpe > Reviewed-by: Max Gurtovoy Looks good: Reviewed-by: Christoph Hellwig