Question regarding PCIe-DMA

Comments and questions related to the "Down to the TLP" pages

Question regarding PCIe-DMA

Postby vsagar »

In the tutorial "Down to the TLP: How PCI express devices talk (Part I)" and under the heading "Bus Mastering (DMA)", it is mentioned that "The second thing is that the driver software needs to inform the peripheral about the relevant buffer’s physical address, most probably by writing to a BAR-mapped register." What is writing BAR registers to do with DMA operation. As far as I know, BAR registers are the windows through which the system/processor is able to do read/writes to the memory that is exposed/available in the PCIe device. Where as for DMA, we have to enabling bus mastering capability in the PCIe command register, inform the device, the bus address from where it has to do read/write DMA. Please correct me if I'm wrong.
vsagar
 
Posts: 1
Joined:

Re: Question regarding PCIe-DMA

Postby support »

Hi,

You're of course right. The thing is: How do you inform the device about the addresses of the DMA buffers? The answer is that the device exposes registers. How does the host know the registers' addresses, then? Well, they are mapped on a BAR space.

Registers is in fact the most common use of the BAR space. Some devices (in particular display adapters) also use them to map memory, but this is the less common use.

Regards,
Eli
support
 
Posts: 802
Joined:


Return to General PCIe

cron