DMA Transfers to PCIe Bar Memory
Dmitry Kozlyuk
dmitry.kozliuk at gmail.com
Thu Nov 7 10:42:25 CET 2024
2024-11-07 09:16 (UTC+0000), Wieckowski, Jacob:
> Hi Dimitry,
>
> thank you for the quick response.
>
> Ok, DMA in the classic sense is not possible.
>
> However, if you carry out a write transfer into the BAR memory from DPDK, then, as I understand it, this access should be divided into several small postage-compliant TLP packets with a maximum payload size as specified in config space.
>
> Can block transfers in sizes of 512 bytes be carried out with the rte memcpy? The DPDK API states that the AVX-512 memcpy parameter must be enabled for x86 platforms.
>
> Do other special precautions have to be taken in the DPDK environment to setup this kind of transfer?
Could you please start with the problem you're solving?
DPDK uses DMA internally (mainly) to transfer packet data from/to HW.
It puts physical address of the buffer, etc. to NIC queue descriptor,
writes to a doorbell register, then the NIC DMA-writes/reads the buffer;
PCI transfer sizes are probably selected by HW.
All of this is within PMD (userspace drivers), no API is exposed.
rte_memcpy() is intended for copy from RAM to RAM.
You can Cc: Morten Brørup <mb at smartsharesystems.com> probably,
but I doubt that rte_memcpy() is specialized for DMA in any way.
The buffer may be filled with rte_mempcy() by application,
but this is done before handling the buffer to PMD, and thus before DMA.
Are you looking for functionality of "dmadev" library?
https://doc.dpdk.org/guides/prog_guide/dmadev.html
More information about the users
mailing list