[dpdk-dev] [PATCH v4 3/6] bus: introduce device level DMA memory mapping

Shahaf Shuler shahafs at mellanox.com
Wed Mar 13 12:12:42 CET 2019



> -----Original Message-----
> From: Thomas Monjalon <thomas at monjalon.net>
> Sent: Wednesday, March 13, 2019 11:56 AM
> To: Shahaf Shuler <shahafs at mellanox.com>; anatoly.burakov at intel.com
> Cc: dev at dpdk.org; Yongseok Koh <yskoh at mellanox.com>;
> ferruh.yigit at intel.com; nhorman at tuxdriver.com; gaetan.rivet at 6wind.com
> Subject: Re: [dpdk-dev] [PATCH v4 3/6] bus: introduce device level DMA
> memory mapping
> 
> 10/03/2019 09:28, Shahaf Shuler:
> > For PCI bus devices, the pci driver can expose its own map and unmap
> > functions to be used for the mapping. In case the driver doesn't
> > provide any, the memory will be mapped, if possible, to IOMMU through
> VFIO APIs.
> >
> > Application usage with those APIs is quite simple:
> > * allocate memory
> > * call rte_extmem_register on the memory chunk.
> > * take a device, and query its rte_device.
> > * call the device specific mapping function for this device.
> 
> Should we make it documented somewhere?

The full flow to work w/ external memory is documented at doc/guides/prog_guide/env_abstraction_layer.rst , Subchapter "Support for Externally Allocated Memory.
The last commit in series update the right API to use. 
> 
> > +/**
> > + * Device level DMA map function.
> > + * After a successful call, the memory segment will be mapped to the
> > + * given device.
> > + *
> > + * @note: Memory must be registered in advance using rte_extmem_*
> APIs.
> 
> Could we make more explicit that this function is part of the "external
> memory API"?

How do you suggest? 
This function belongs to rte_dev therefore the rte_dev prefix. better rte_dev_extmem_dma_map ?

> 
> 

[1]
https://patches.dpdk.org/patch/51018/


More information about the dev mailing list