On 17-Sep-18 1:16 PM, Shahaf Shuler wrote:
Monday, September 17, 2018 1:07 PM, Burakov, Anatoly:
Subject: Re: [dpdk-dev] [PATCH 00/16] Support externally allocated memory
in DPDK

On 13-Sep-18 8:44 AM, Shahaf Shuler wrote:

[...]

The responsibility to ensure memory is accessible before using it is
on the shoulders of the user - there is no checking done with regards
to validity of the memory (nor could there be...).

That makes sense. However who should be in-charge of mapping this
memory for dma access?
The user or internally be the PMD when encounter the first packet or while
traversing the existing mempools?

Hi Shahaf,

There are two ways this can be solved. The first way is to perform VFIO
mapping automatically on adding/attaching memory. The second is to force
user to do it manually. For now, the latter is chosen because user knows best
if they intend to do DMA on that memory, but i'm open to suggestions.

I agree with that approach, and will add not only if the mempool is for dma or 
not but also which ports will use this mempool (this can effect on the mapping).

That is perhaps too hardware-specific - this should probably be handled inside the driver callbacks.

However I don't think this is generic enough to use only VFIO. As you said, 
there are some devices not using VFIO for mapping rather some proprietary 
driver utility.
IMO DPDK should introduce generic and device agnostic APIs to the user.

My suggestion is instead of doing vfio_dma_map that or vfio_dma_unmap that have 
a generic dma_map(uint8_t port, address, len). Each driver will register with 
its own mapping callback (can be vfio_dma_map).
It can be outside of this series, just wondering the people opinion on such 
approach.

I don't disagree. I don't like bus/net/etc drivers doing their own thing with regards to mapping, and i would by far prefer generic way to set up DMA maps, to which VFIO will be a subscriber.



There is an issue with some devices and buses (i.e. bus/fslmc) bypassing EAL
VFIO infrastructure and performing their own VFIO/DMA mapping magic, but
solving that problem is outside the scope of this patchset. Those
devices/buses should fix themselves :)

When not using VFIO, it's out of our hands anyway.

Why?
VFIO is not a must requirement for devices in DPDK.

When i say "out of our hands", what i mean to say is, currently as far as EAL API is concerned, there is no DMA mapping outside of VFIO.



--
Thanks,
Anatoly


--
Thanks,
Anatoly

Reply via email to