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 221CFA0524; Thu, 6 May 2021 17:27:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0457410EE; Thu, 6 May 2021 17:27:11 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id C5E58410DB for ; Thu, 6 May 2021 17:27:09 +0200 (CEST) IronPort-SDR: dCAk+OrlGACj1vKzEH3rkW7VV5QdCav+zn5ZsU9ej0DajwtFMFeskcCoRpJloAuY0CIWNRH0au V1E/s+r2Lb9g== X-IronPort-AV: E=McAfee;i="6200,9189,9976"; a="185961785" X-IronPort-AV: E=Sophos;i="5.82,277,1613462400"; d="scan'208";a="185961785" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2021 08:27:08 -0700 IronPort-SDR: /VskUoQBuYYXoAUVKguUzkm2/R9rfmEVUri5AscWh72LeNxVV5QN75J9CWwQhxnbaxndxxT6Xp 7sb810rgwcAQ== X-IronPort-AV: E=Sophos;i="5.82,277,1613462400"; d="scan'208";a="434407161" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.229.99]) ([10.213.229.99]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2021 08:27:06 -0700 To: Bruce Richardson , dev@dpdk.org Cc: Harry van Haaren References: <20210506150908.797110-1-bruce.richardson@intel.com> From: "Burakov, Anatoly" Message-ID: <18d300a4-f8f2-06b9-894e-91cd899bf933@intel.com> Date: Thu, 6 May 2021 16:27:03 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210506150908.797110-1-bruce.richardson@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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" 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? -- Thanks, Anatoly