Received: by 10.223.185.116 with SMTP id b49csp8027775wrg; Thu, 1 Mar 2018 15:46:32 -0800 (PST) X-Google-Smtp-Source: AG47ELvPmPIni3Y2C7GDQShF8jG3FttVwrMIJghZCVMU4J1nX8YwERfgjRHmIqghn6fcmD3J9KKk X-Received: by 10.98.72.10 with SMTP id v10mr3675750pfa.148.1519947992467; Thu, 01 Mar 2018 15:46:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519947992; cv=none; d=google.com; s=arc-20160816; b=BGSZNa8Qs8krLrS71Jc/N01olpiRamioWgXtHILrbbrxRWr0I5aNxQwTKN/bQ9DUhd aNnoE5F7v4vonDGKE0Q/iHLOgHBhJ+kg/VjfVXN97kxQXb7DjgVatiogEoYusQTbpUpS 1tQ4llTm63+Fb2Miw8BKcOEmt3caHdCHV4u6Qv1osbAETd/U78EMr7cXsjurPx/Kvqjw 7TcE5fNPPl6YxKhmJ+SM/mlpYETeZGUGf5OG76YyeTOKLul9oc9g9XiVRojG0MtX8Ws0 UZvtwmKAeYcaaIpIeVca59AT9I65DPsR/iEJifm/d+xwjbEqRgKGvSSju8q60nQntZTt IITg== 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=Ehf/rLCG+Ty5g0KNSD+nAi95Fw3DiOmW5SX8p8cwXmY=; b=bsS6hIVd9kGDvKO/yLreSRybkMCcZNqwta9jdRPGXg65ib890q6VNI8uDlJ4MxSB/J LXscYSu/SpYR0GUF8DvXBWsJePB7yUBadmSFr8rMeKV7VkQ8OwKPMWkFmDi/j8uGb5Qm 5U3ST0F6zNXkLRfHcObed/p44jVCRXgSHhIRg2xrLpjf4HZPxcYj+lBvVhjv4cBxqpFv h22G2ih41oMAoAPmgs4W291El9t54kT871wKd5iMA6I2OZN5VqDm+a08Ezy3L4crflnI 1xaUp6zKHML1O8+jUgSx0dN/flFKhoHJlcAfepl+AdGUv+vqdGlju4083MkYV1HzsvUc BDbw== 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 z21si3846640pfa.33.2018.03.01.15.46.17; Thu, 01 Mar 2018 15:46:32 -0800 (PST) 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 S1163533AbeCAXpZ (ORCPT + 99 others); Thu, 1 Mar 2018 18:45:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:38258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163111AbeCAXpW (ORCPT ); Thu, 1 Mar 2018 18:45:22 -0500 Received: from localhost (unknown [69.71.4.158]) (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 BC5D92177C; Thu, 1 Mar 2018 23:45:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC5D92177C 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: Thu, 1 Mar 2018 17:45:19 -0600 From: Bjorn Helgaas To: Stephen Bates Cc: Logan Gunthorpe , "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 v2 01/10] PCI/P2PDMA: Support peer to peer memory Message-ID: <20180301234519.GC74737@bhelgaas-glaptop.roam.corp.google.com> References: <20180228234006.21093-1-logang@deltatee.com> <20180228234006.21093-2-logang@deltatee.com> <20180301173752.GE13722@bhelgaas-glaptop.roam.corp.google.com> <20180301230032.GA74737@bhelgaas-glaptop.roam.corp.google.com> <9B84B347-2CCF-4250-89ED-B29892E76597@raithlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9B84B347-2CCF-4250-89ED-B29892E76597@raithlin.com> 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 01, 2018 at 11:14:46PM +0000, Stephen Bates wrote: > > I'm pretty sure the spec disallows routing-to-self so doing a P2P > > transaction in that sense isn't going to work unless the device > > specifically supports it and intercepts the traffic before it gets to > > the port. > > This is correct. Unless the device intercepts the TLP before it hits > the root-port then this would be considered a "route to self" > violation and an error event would occur. The same holds for the > downstream port on a PCI switch (unless route-to-self violations are > disabled which violates the spec but which I have seen done in > certain applications). I agree that a function doing DMA to a sibling within the same multi-function device would probably not generate a TLP for it (I would be curious to read about this in the spec if you have a pointer). More fundamentally, is there some multi-function-specific restriction on peer-to-peer DMA? In conventional PCI, single-function devices on the same bus can DMA to each other. The transactions will appear on the bus, but the upstream bridge will ignore them because the address is inside the bridge's memory window. As far as I know, the same should happen on PCIe. I don't know what happens with functions of a multi-function device, either in conventional PCI or PCIe. I don't remember a restriction on whether they can DMA to each other, but maybe there is. Bjorn