From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C039E1DC1A2 for ; Wed, 30 Oct 2024 22:07:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730326060; cv=none; b=TYgvc4Vss0QUz4wrIt9wWAYBI7a9AReUfb5uWiUZxU4FfEjajCVY/szwOf42nAONc09gmEEIhhV1g93W9H1wBKJpZVAHyHH3UwwjHNXvmHU22BKepZl6BJRuqQETUe+XGLv0T+D94WPMD/PY9ZPzeOxuu5uUlUPutWQD2eHjbKs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730326060; c=relaxed/simple; bh=FGBXaMTs0zoZtuIJw76pQkmdmDElPzZuxay8K6IRs+M=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=iqRbLvLZzVteVHqIddt54FGSnTTIPHoGpgmzcnPUhVRz1FYZnUdLPGLHTfsUrumi7YpyhHtcZGROvGhjZ+uoiUlLE5YWpmG7tZL1rhFRRfnmLR1Ydaof7E8bUK1RG2h59mt2AtY8UkvVXXo7yxQis2S/z+g9NK8tV7+CbkZci3g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pymgKQqx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pymgKQqx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2195DC4CECE; Wed, 30 Oct 2024 22:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730326060; bh=FGBXaMTs0zoZtuIJw76pQkmdmDElPzZuxay8K6IRs+M=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=pymgKQqxDWszTJEoGeU8SOxQXzSUDVj057M2/sGjtLFYJttHMz/9aSEyG9uEWshEx BZOsy13EfwLb3MxEWqHyDkKiERyJ7dN/vrGPYzUfkAIISMXHt65w6YgmNg3PWBRi3M jo4aN5OxjQ9jf+Nqo3Dd6a3LL+gTrg4tYNFL/yNQjWtny7MhIoBc11YHSs4a8nXt0i Ya2zIbvL8QOMwLzkZrrxkXkBLOLjS/gs0Ps8vu7HAzSG5YOAMfF5E11fIMtqnQGoDq ugDndL4kZm7pvqCaoQAiBV9DY3wxrlMa/cHBqAqpxeNXoqMo5nlRXkwyB/BaYRXNlx gwGxXiMQUL2yA== Date: Wed, 30 Oct 2024 17:07:38 -0500 From: Bjorn Helgaas To: Logan Gunthorpe Cc: "Kasireddy, Vivek" , "dri-devel@lists.freedesktop.org" , "intel-xe@lists.freedesktop.org" , Bjorn Helgaas , "linux-pci@vger.kernel.org" Subject: Re: [PATCH v2 1/5] PCI/P2PDMA: Don't enforce ACS check for functions of same device Message-ID: <20241030220738.GA1221922@bhelgaas> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e146e2f-5d7c-4f28-b801-360795b4cae7@deltatee.com> On Wed, Oct 30, 2024 at 03:20:02PM -0600, Logan Gunthorpe wrote: > On 2024-10-30 12:46, Bjorn Helgaas wrote: > > On Fri, Oct 25, 2024 at 06:57:37AM +0000, Kasireddy, Vivek wrote: > > In the PCIe world, I don't think a TLP can "loop back" to another > > function on the same device. > > I'm not sure if the spec says anything that specifically denies this. I'm not a hardware guy and I don't know if there's a direct statement about it, but if a Downstream Port supports ACS, it must support ACS P2P Request Redirect (PCIe r6.0, sec 6.12.1.1), which specifically applies to peer-to-peer TLPs. If peer-to-peer TLPs appear on the link, the Downstream Port will see them and act on them, e.g., either route them upstream (if P2P Request Redirect is enabled) or back downstream. I don't think the VF could act on them directly via a loopback path because that would lead to duplicate writes and duplicate Completions for reads. > But it seems to me that it would be possible for a multifunction device > to handle a transfer to a neighbouring function internally and not > actually involve the PCIe fabric. This seems like something we'd want to > support if and when such a device were to be created. If peer-to-peer transactions are handled internally, an SR-IOV device other than an RCiEP is required to support ACS with P2P Egress Control (sec 7.7.11) and P2P Request Redirect (sec 7.7.11.2). Bjorn