From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 240DAA0A0E; Mon, 10 May 2021 14:03:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0816440140; Mon, 10 May 2021 14:03:05 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 3EC574003E for ; Mon, 10 May 2021 14:03:04 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id A4068FE3; Mon, 10 May 2021 08:03:02 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 10 May 2021 08:03:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= 82HpHNu/8I1rGMZAA3tQaws/gwVSmG3v0CfLIw9hPiQ=; b=lTLDMN+2C2bf51CS 1AmKzXidtZkRWhmXfPTBlY4IWqTiR86w+x1RgvNg7QrbYshZcDN4+3qyinS90fWo fs8E+h/3/HrpnDxO19N4bR3QHX/iVcFdVHqvFLrU91SZqFApXKIIEB0Ig2S7fId/ 8h4VkiKOdZtK1QWMCWFWnDqiFa+ZVp122v/TDc/quagnifwBvlwFcFAbIl66hxKE 6fXwfpv2fOxeLDMEY+54QaRmi0DnGuQTs3gJqWM8cRh0RHbtpgz//RPeTidm1cWV aQ2til2jX7NqJvquzFugEsu5xf/CApqPFCnmBeZFLH8+8e0G351IFHBuuZxCSUWl wfQuAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=82HpHNu/8I1rGMZAA3tQaws/gwVSmG3v0CfLIw9hP iQ=; b=sVqBETQcOveCpMU+/cCjeNAjeinyzxhrx6NveSOsjtJpfX7F8X7KUnB+W bASeehqDfKdunlisCSktDexA8MF+J9q/PqeRPHalGBSd0yh3TKsEqdZblcHlvwZy MAfR1bAfSHv2LFvtcnYckCoGmRgfxDQBEsQlR46fF9WS7s19ho5RKix07nEjAbJ6 TIM0QQXHL7yorW3v0uK2szADBx7nzFmr+IEySAA2YkesToQa0ln0b/mvHm9Z8AEq /+aM6g+4QKcFdRrjI3lXEZ9A3Gvcic2n6z0A6QVPwvbXNEYll+amsQY+TdHC3lxu wHH2iBV9YCaB0Z3Yyg7bn8Ch7g9lg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdegkedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 10 May 2021 08:03:00 -0400 (EDT) From: Thomas Monjalon To: Bruce Richardson , "Burakov, Anatoly" Cc: dev@dpdk.org, Harry van Haaren , david.marchand@redhat.com, jerinj@marvell.com Date: Mon, 10 May 2021 14:02:57 +0200 Message-ID: <1683456.p9nEelPzVB@thomas> In-Reply-To: References: <20210506150908.797110-1-bruce.richardson@intel.com> <2168873.xxFOWYceCV@thomas> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] raw/ioat: fix bus requiring virtual addressing when no devs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 10/05/2021 13:20, Bruce Richardson: > On Mon, May 10, 2021 at 12:18:50PM +0200, Thomas Monjalon wrote: > > 06/05/2021 17:34, Bruce Richardson: > > > On Thu, May 06, 2021 at 04:27:03PM +0100, Burakov, Anatoly wrote: > > > > On 06-May-21 4:09 PM, Bruce Richardson wrote: > > > > > If after a bus scan, there are no devices using a particular bus, then > > > > > that bus should not be taken into account when deciding whether DPDK > > > > > should be run in VA or PA addressing mode. This becomes an issue when > > > > > the DSA bus driver code is used on a system without an IOMMU. The PCI > > > > > bus correctly reports that it only works in PA mode, while the DSA bus - > > > > > also correctly - reports that it works only in VA mode. The difference > > > > > is that there will be no devices found in a scan for the DSA bus, since > > > > > the kernel driver can only present those to userspace in the presence of > > > > > an IOMMU. > > > > > > > > > > While we could change DSA instance to always report that it does not > > > > > care about the addressing mode, this would imply that it could be used > > > > > with DPDK in PA mode which is not the case. Therefore, this patch > > > > > changes the driver to report DC (don't care) in the case where no > > > > > devices are present, and VA otherwise. > > > > > > > > > > NOTE: this addressing mode use of VA-only applies only in the case of > > > > > using DSA through the idxd kernel driver. The use of DSA though vfio-pci > > > > > is unaffected and works as with other PCI devices. > > > > > > > > > > Fixes: b7aaf417f936 ("raw/ioat: add bus driver for device scanning automatically") > > > > > > > > > > Reported-by: Harry van Haaren > > > > > Signed-off-by: Bruce Richardson > > > > > --- > > > > > > > > This would be a good opportunity to start a discussion on a "proper" fix for > > > > this, because while this hack is acceptable being so close to release, IMO > > > > we need a more general solution. Maybe a bus API reporting number of scanned > > > > devices would be nice to have, as EAL will then be able to ignore the > > > > opinion of those buses who don't have any devices. > > > > > > > > The "number of devices" is a bit of a fluid concept, as number of scanned > > > > devices may not be the same as number of *probed* devices, and there's also > > > > hotplug. However, i think that we can ignore all that, because we care about > > > > initialization only - any other issues can be addressed by forcing > > > > --iova-mode by the user, as we cannot really do anything about hotplug or > > > > devices that fail to probe. > > > > > > > > Thoughts? > > > > > > > Perhaps rather than just "number of devices" we should have buses report > > > whether they are relevant or not. For example, there are a number of > > > SoC-specific bus drivers in DPDK, which are presumably only relevant on > > > particular SoCs. Similarly here for the DSA bus, the presence of the > > > devices is a useful proxy for relevance - especially since it doesn't > > > support hotplug - but if we had a way to report relevance/non-relevance DSA > > > could just report itself as not-relevant in case where there is no IOMMU > > > enabled on the system, or when the "idxd" kernel driver is not present, for > > > example, and then have EAL skip even asking about PA/VA support > > > > I think what you are describing is the same as reporting "don't care". > > Why do you consider it as a hack? > > > It's not the same as don't-care, because the bus just won't work with > iova-as-pa, it must have iova-as-va. Therefore to respond as anything other > than VA here would be incorrect. > > The issue is that if one bus must have PA and another must have VA, then > obviously both cannot be in use at the same time, and we have no way of > sanely resolving that conflict, or specifying which to ignore. The reason > this patch is a hack, is that this dsa bus driver is taking it on itself to > basic say "ignore me" (by returning DC rather than VA), when no devices are > found. > > Maybe it's the case that busses are supposed to behave that way, but it's > not clear from the doxygen comments. I would have thought that we should > have a way for a bus to signal back to EAL that the whole bus is not > relevant, and then can be skipped for querying PA/VA and for probe etc. We can have more functions to better describe the real status, but would it make any difference compared as the self "don't care" meaning "ignore me at init stage"? I think it could make a difference only for detecting issues on hotplug, but it would not solve hotplug conflict :/