[dpdk-dev] [EXT] Re: [PATCH] bus/pci: fix IOVA as VA mode selection

Burakov, Anatoly anatoly.burakov at intel.com
Tue Jul 9 13:40:19 CEST 2019


On 09-Jul-19 12:13 PM, Jerin Jacob Kollanukkaran wrote:
>> -----Original Message-----
>> From: Burakov, Anatoly <anatoly.burakov at intel.com>
>> Sent: Tuesday, July 9, 2019 3:15 PM
>> To: Jerin Jacob Kollanukkaran <jerinj at marvell.com>; David Marchand
>> <david.marchand at redhat.com>
>> Cc: dev <dev at dpdk.org>; Thomas Monjalon <thomas at monjalon.net>; Ben
>> Walker <benjamin.walker at intel.com>
>> Subject: Re: [EXT] Re: [dpdk-dev] [PATCH] bus/pci: fix IOVA as VA mode
>> selection
>>
>> On 08-Jul-19 8:13 PM, Jerin Jacob Kollanukkaran wrote:
>>> See below,
>>>
>>> Please send the email as text to avoid formatting issue.(No HTML)
>>>
>>> From: David Marchand <david.marchand at redhat.com>
>>> Sent: Tuesday, July 9, 2019 12:09 AM
>>> To: Jerin Jacob Kollanukkaran <jerinj at marvell.com>
>>> Cc: dev <dev at dpdk.org>; Thomas Monjalon <thomas at monjalon.net>;
>> Ben
>>> Walker <benjamin.walker at intel.com>; Burakov, Anatoly
>>> <anatoly.burakov at intel.com>
>>> Subject: [EXT] Re: [dpdk-dev] [PATCH] bus/pci: fix IOVA as VA mode
>>> selection
>>>
>>> ________________________________________
>>>
>>> On Mon, Jul 8, 2019 at 4:25 PM <mailto:jerinj at marvell.com> wrote:
>>> From: Jerin Jacob <mailto:jerinj at marvell.com>
>>>
>>> Existing logic fails to select IOVA mode as VA if driver request to
>>> enable IOVA as VA.
>>>
>>> IOVA as VA has more strict requirement than other modes, so enabling
>>> positive logic for IOVA as VA selection.
>>>
>>> This patch also updates the default IOVA mode as PA for PCI devices as
>>> it has to deal with DMA engines unlike the virtual devices that may
>>> need only IOVA as DC.
>>>
>>> We have three cases:
>>> - driver/hw supports IOVA as PA only
>>>
>>> [Jerin] It is not driver cap, it is more of system cap(IOMMU vs non
>>> IOMMU). We are already addressing that case
>>
>> I don't get how this works. How does "system capability" affect what the
>> device itself supports? Are we to assume that *all* hardware support IOVA
>> as VA by default? "System capability" is more of a bus issue than an individual
>> device issue, is it not?
> 
> What I meant is, supporting VA vs PA is function of IOMMU(not the device attribute).
> Ie. Device makes the  bus master request, if IOMMU available and enabled in the SYSTEM ,
> It goes over IOMMU  and translate the IOVA to physical address.
> 
> Another way to put is, Is there any _PCIe_ device which need/requires
> RTE_PCI_DRV_NEED_IOVA_AS_PA in rte_pci_driver.drv_flags
> 
> 

Previously, as far as i can tell, the flag was used to indicate support 
for IOVA as VA mode, not *requirement* for IOVA as VA mode. For example, 
there are multiple patches [1][2][3][4] (i'm sure i can find more!) that 
added IOVA as VA support to various drivers, and they all were worded it 
in this exact way - "support for IOVA as VA mode", not "require IOVA as 
VA mode". As far as i can tell, none of these drivers *require* IOVA as 
VA mode - they merely use this flag to indicate support for it.

Specifically, from my perspective, the "support for IOVA as VA mode" has 
in practice always indicated support for VFIO (or similar drivers) as 
far as the PCI bus is concerned. As in, the device *could* use IOVA as 
VA mode, but since it may be bound to igb_uio (which doesn't support 
IOVA as VA), the IOVA as VA mode may not be supported for a particular 
device. So, a particular device *cannot support* IOVA as VA if it's 
bound to igb_uio or uio_pci_generic (or VFIO in noiommu mode). This is 
not *just* a capability thing, but also kernel driver issue.

Now suddenly it turns out that someone somewhere "knew" that "IOVA as 
VA" flag in PCI drivers is supposed to indicate *requirement* and not 
support, and it appears that this knowledge was not communicated nor 
documented anywhere, and is now treated as common knowledge.

[1] http://patchwork.dpdk.org/patch/53206/
[2] http://patchwork.dpdk.org/patch/50274/
[3] http://patchwork.dpdk.org/patch/50991/
[4] http://patchwork.dpdk.org/patch/46134/

-- 
Thanks,
Anatoly


More information about the dev mailing list