Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp751610imm; Fri, 31 Aug 2018 12:13:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbQue05KT9M3FnjHH1guYKviJD69H9Tk+p1RK8I+HFST0HxS3nsKiNB9mboVpjM6FDkjwHe X-Received: by 2002:a63:f206:: with SMTP id v6-v6mr15953043pgh.319.1535742835720; Fri, 31 Aug 2018 12:13:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535742835; cv=none; d=google.com; s=arc-20160816; b=mekK/khoN15osI7WnYyRGKOos47mk8S22DusKzwJG8cYZgTPYE9V93rOVFMIclrzyK RACouvSh9qTWJbftzyCW+uRMJa7wdgiCMnWIET4+7SMZj4ul70ir0ZQCDpcMvRvi38lw /Z38vjk0aF1WpABz36Ml96Y1cal7oMtHjrid3MgiVEe8kq0cpzYE07XkxdgjWeob8vR9 zHoQlq04HRctpVWwd/HC8oIs0CrmwBJiFyOchGY7E/ldYTZYhY7C7L2BdlSanTA2ujK4 5rONH0wgiY5k3EjH+HxxOCTqqu4w+zq4fR0S4I6smRdLq8vDSzkUAI/01Frr+rgVSQNN TP4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:arc-authentication-results; bh=fAByr+T5jzJFBRlLX5C9z4hDUnmxdpBc4yL9grVP/4g=; b=ubeUxzO88Srv9vUX0DCGAcOak+fnu2pHmvCb5321ZU+R1xsdpTKOpfrgcxJOcwTXaq mrik6oJd2gYVrD58w0xO5ThDs8b0cRWbuBRRtpQFkK0T2RCgjtGbfdmQa/k4fmVE5KCT 2n9dWZCrEjU+mfGJmoGL7rdhJGxT52Wz3Nr7Ag2PHrYzIRPH5+By/KpQ7A7NEj+CBqVS B148oLljfFbvU69yLNJGlehul1Egm/lcDl3cmGYJYM5uAx7qdTM4fwqjQTHjNw8MoTMg +yXkZPBMHWoPQ+dtqasLC6/Fqjb+4p+2zuLh844jExI2ah6+BJrcR9xinQQKjOmUhpa7 N3Xg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1-v6si9782522plv.26.2018.08.31.12.13.40; Fri, 31 Aug 2018 12:13:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727477AbeHaXVF (ORCPT + 99 others); Fri, 31 Aug 2018 19:21:05 -0400 Received: from ale.deltatee.com ([207.54.116.67]:48140 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727201AbeHaXVF (ORCPT ); Fri, 31 Aug 2018 19:21:05 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1fvopp-0006bO-E0; Fri, 31 Aug 2018 13:11:58 -0600 To: =?UTF-8?Q?Christian_K=c3=b6nig?= , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-nvdimm@lists.01.org, linux-block@vger.kernel.org Cc: Stephen Bates , Christoph Hellwig , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Dan Williams , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt , Alex Williamson , Jonathan Corbet References: <20180830185352.3369-1-logang@deltatee.com> <20180830185352.3369-7-logang@deltatee.com> <98bff500-4e4c-3a34-6762-16ef4b076d90@amd.com> <6820d451-9591-1979-00bf-60c65fc4f136@deltatee.com> <30411655-9b90-749e-857f-318dac7cccbf@amd.com> From: Logan Gunthorpe Message-ID: <9452ee6c-e989-d178-cd51-f29782ad9b31@deltatee.com> Date: Fri, 31 Aug 2018 13:11:48 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <30411655-9b90-749e-857f-318dac7cccbf@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: corbet@lwn.net, alex.williamson@redhat.com, benh@kernel.crashing.org, jglisse@redhat.com, dan.j.williams@intel.com, maxg@mellanox.com, jgg@mellanox.com, bhelgaas@google.com, sagi@grimberg.me, keith.busch@intel.com, hch@lst.de, sbates@raithlin.com, linux-block@vger.kernel.org, linux-nvdimm@lists.01.org, linux-rdma@vger.kernel.org, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, christian.koenig@amd.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.1 Subject: Re: [PATCH v5 06/13] PCI/P2PDMA: Add P2P DMA driver writer's documentation X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 31/08/18 11:38 AM, Christian König wrote: > If you can separate out adding the detection I can take a look adding > this with my DMA-buf P2P efforts. Oh, maybe my previous email wasn't clear, but I'd say that detection is already separate from ZONE_DEVICE. Nothing really needs to be changed. I just think you'll probably want to write you're own function similar to pci_p2pdma_distance that perhaps just takes two pci_devs instead of the list of clients as is needed by nvme-of-like users. To enable a whitelist we just have to handle the case where upstream_bridge_distance() returns -1 and check if the devices are in the same root complex with supported root ports before deciding the transaction is not supported. Logan