Received: by 10.213.65.68 with SMTP id h4csp732727imn; Fri, 23 Mar 2018 14:51:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELvoy2rmKTBrzcXQqK+8C8YJLRjVSCDDW5xh1krA5r2zaO1iuJqFJm3SrmTwdUZcdN54WDy/ X-Received: by 10.99.121.73 with SMTP id u70mr22614259pgc.232.1521841916855; Fri, 23 Mar 2018 14:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521841916; cv=none; d=google.com; s=arc-20160816; b=ulM9yei7UkqHznzE05tuwNA50uxBQ3bqLoDzN+8aY7NgnDbGSFg7BPtCirv9mJN1Ff kwP9o6+/Fp3I2r0RNRgzlQZWUEMaMGmrQI4MUv/2+OSQMB9EFLE/4vWYM4Id8zvUBbKu sHw8TZn1pFEVNYV0+/eFXbENtRGOjj3NHvHNHJyNpfwn2iAwsSh6634DS6jrhT6Nd6Y0 aIt+yFRssFXCBado5IcjGQb9ZcSJMB9ZjeXv/x70mw2b6zBVyl7I1p4mVuD/SgcpSrNr lMHlr96KJnrtiqylkNAiycJ1LBSVa/GxJlph1UjdKprJ5GFx94GlIDAPW8x2z6OPtTHW SODg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:arc-authentication-results; bh=MZxFTH/fDWTbwYAt0BfWf5MGv56AXsxvW1EnZMhYdZo=; b=kH18+qlcoCEJp6tFGxex3Disg+f6uy5yYCzDhV9yRYA8CquxBz7yQ4kBSyvP7/urJb qz6UllK7/+hUD+lN4fUnw6tRojFceRxh17LjJJYPL15eCsIL6SFVCJh47mBiJRH2LEyu 3jqxVpak23RgjV2DTqaZAEafiyJN05kTGVzaofkyhH8Nqa+HG8fKwnHsS0hkbA4r7mKB QbUecLtP3/N8ggHQu+cRJnMPC80lOcO6ouN+eZiaIBbM8EHMqCSjmNkJVe1VJvILnTzl rvKSJIXmYgt4rm+frSg5tttCNNdC37gFJqn+pfQ7oBc8+KnjyURP/TAN919a6gsszn3l UgDg== 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 134si6655358pgd.709.2018.03.23.14.51.41; Fri, 23 Mar 2018 14:51:56 -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 S1752097AbeCWVuv (ORCPT + 99 others); Fri, 23 Mar 2018 17:50:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:57486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751847AbeCWVut (ORCPT ); Fri, 23 Mar 2018 17:50:49 -0400 Received: from localhost (unknown [150.199.191.185]) (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 4F0D721770; Fri, 23 Mar 2018 21:50:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F0D721770 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Date: Fri, 23 Mar 2018 16:50:46 -0500 From: Bjorn Helgaas To: Stephen Bates Cc: Logan Gunthorpe , Sinan Kaya , "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" , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Dan Williams , =?iso-8859-1?B?Suly9G1l?= Glisse , Benjamin Herrenschmidt , Alex Williamson Subject: Re: [PATCH v3 01/11] PCI/P2PDMA: Support peer-to-peer memory Message-ID: <20180323215046.GC210003@bhelgaas-glaptop.roam.corp.google.com> References: <3e738f95-d73c-4182-2fa1-8664aafb1ab7@deltatee.com> <703aa92c-0c1c-4852-5887-6f6e6ccde0fb@codeaurora.org> <3ea80992-a0fc-08f2-d93d-ae0ec4e3f4ce@codeaurora.org> <4eb6850c-df1b-fd44-3ee0-d43a50270b53@deltatee.com> <757fca36-dee4-e070-669e-f2788bd78e41@codeaurora.org> <4f761f55-4e9a-dccb-d12f-c59d2cd689db@deltatee.com> <20180313230850.GA45763@bhelgaas-glaptop.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 22, 2018 at 10:57:32PM +0000, Stephen Bates wrote: > > I've seen the response that peers directly below a Root Port could not > > DMA to each other through the Root Port because of the "route to self" > > issue, and I'm not disputing that. > > Bjorn > > You asked me for a reference to RTS in the PCIe specification. As > luck would have it I ended up in an Irish bar with Peter Onufryk > this week at OCP Summit. We discussed the topic. It is not > explicitly referred to as "Route to Self" and it's certainly not > explicit (or obvious) but r6.2.8.1 of the PCIe 4.0 specification > discusses error conditions for virtual PCI bridges. One of these > conditions (given in the very first bullet in that section) applies > to a request that is destined for the same port it came in on. When > this occurs the request must be terminated as a UR. Thanks for that reference! I suspect figure 10-3 in sec 10.1.1 might also be relevant, although it's buried in the ATS section. It shows internal routing between functions of a multifunction device. That suggests that the functions should be able to DMA to each other without those transactions ever appearing on the link. Popping way up the stack, my original point was that I'm trying to remove restrictions on what devices can participate in peer-to-peer DMA. I think it's fairly clear that in conventional PCI, any devices in the same PCI hierarchy, i.e., below the same host-to-PCI bridge, should be able to DMA to each other. The routing behavior of PCIe is supposed to be compatible with conventional PCI, and I would argue that this effectively requires multi-function PCIe devices to have the internal routing required to avoid the route-to-self issue. Bjorn