From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id E5154A0548;
	Mon, 10 May 2021 12:18:54 +0200 (CEST)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 6963F40140;
	Mon, 10 May 2021 12:18:54 +0200 (CEST)
Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com
 [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id C6FD94003E
 for <dev@dpdk.org>; Mon, 10 May 2021 12:18:52 +0200 (CEST)
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43])
 by mailout.nyi.internal (Postfix) with ESMTP id 70B4F5C0178;
 Mon, 10 May 2021 06:18:52 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute3.internal (MEProxy); Mon, 10 May 2021 06:18:52 -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=
 KSJFb+QGoLWJLrobqMpD+dmD3eBN04TVC407NHdBRik=; b=f/O3CqAj0ToKn3P9
 ad0Nhy/i+2htwFTi+BS+6ackWzxfuLB5g3fiOFg3UE4za3Y/Yf3tWythw++NE+jr
 rQ8gR740SNcssKzK7hjBq1yoYaa0GtkVCp/UlEqmJshex6Igg9UUT2156eWqIXLe
 8r66mLkh9q0NY+Co5K1g063diXTTX0FEymZmrfdDbsrMiL9WdxzQnf3Ad4LRIM68
 JB/Y+6lCpWMmLxzSlXKqfLkoAml5PMqoRx7BJ428s/Cekzaqo/7t6p/6lCWkABXN
 FCNLFf0ludb4/cVwakM+coRzAngLr56xSD3cpXpOEGgquV4GtrYsEmb8hP4RV47Y
 bE0FSg==
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=KSJFb+QGoLWJLrobqMpD+dmD3eBN04TVC407NHdBR
 ik=; b=f+MW36XNRIh40W7BUEWB0Frr8q488J8x96X0fJOxMV9Fdpe+T4Tculqkc
 ept+vq3zA4OwhntK541tTmkHXvx6O3QkUbMvspFBpS3ouBcYgdFLNMHU5ksvtRQz
 2gRmi+m8i2gAD+FZ8SJEYszzoWzm7V+MLCZb/33WTh18Vpu9spjFTt7wfV1XdO/v
 Vj6biHxTwgMijR8xD9rvRmGTY0ikpX7F+et8H08lAPewGl+y2NkL+Y0Uzz5nb3+S
 PBMDfWv5u19TMM7rW6NKehlG/AbYy1WQp4GIqa+r9M7OrM37K/XTm8CM494WBvTt
 Z5ExMNF6Lom95Ih+DeB9sQwnYYaxw==
X-ME-Sender: <xms:iwiZYMeCeeQj39lu6dUmBx0OP5eLnPlCUQGWsQqv_qwfHlcWWnwBHA>
 <xme:iwiZYOOUpdylg0q0h0ex3oO_18p_0t2qRNFW5RWxdhny0O3rtErbp9T0GvyqcAllm
 3Ge1wYMoTeWCNFWpA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdegkedgvdejucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg
 ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu
 ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf
 hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl
 ohhnrdhnvght
X-ME-Proxy: <xmx:iwiZYNiu6MiXKPWnoQH4jmm8a_tEww0M0BhfPJHjCy0jZezBE9Qpqg>
 <xmx:iwiZYB_uK1x0yCrniZ_2JMdPU4cK1fT66HZpJhfWjMB3fCZ0U3pwbQ>
 <xmx:iwiZYIsBfFk2YtIU8xqUh-Sbu_evvtdspagY8bIXouads5C0Lm7RYA>
 <xmx:jAiZYB6V09gytRalQUOMbjIqiE2k6oIizQp897160donlse9tf0HUw>
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 06:18:51 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>,
 Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, Harry van Haaren <harry.van.haaren@intel.com>,
 david.marchand@redhat.com
Date: Mon, 10 May 2021 12:18:50 +0200
Message-ID: <2168873.xxFOWYceCV@thomas>
In-Reply-To: <YJQMfTcvK8pyrRkh@bricha3-MOBL.ger.corp.intel.com>
References: <20210506150908.797110-1-bruce.richardson@intel.com>
 <18d300a4-f8f2-06b9-894e-91cd899bf933@intel.com>
 <YJQMfTcvK8pyrRkh@bricha3-MOBL.ger.corp.intel.com>
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

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 <harry.van.haaren@intel.com>
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > > ---
> > 
> > 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?