PCIe DMA method chose

Comments and questions to the author of the "Down to the TLP" posts (Eli Billauer)

PCIe DMA method chose

Postby Guest » Tue Jul 26, 2016 1:56 pm

Hello eli,

First of all, thanks for this very informative forum and your patience on answering questions.
My question is about how to chose the method to do PCIe DMA between RP and EP.

I recently aware that the linux offers a solution called "linux dma engine API". Which in my understanding, it means: the Host PC sends dma(rd/wr) requests to device, and those dma descriptors are also defined in host PC.
And there is another method: the device(EP) sends dma(rd/wr) requests to host PC(RP), and those descriptors are defined in the device.

So if we want to do dma between a fpga card and a PC with linux installed, which method is better? (considering the transmission speed and difficulty of development)


Thanks for advance ;)
Guest
 

Re: PCIe DMA method chose

Postby support » Tue Jul 26, 2016 7:18 pm

Hello,

A DMA engine, in general, is a piece of hardware which initiates data copies from one region to another without the direct intervention of the processor. Whether these data copies turn into efficient PCIe transactions if the relevant bus addresses are mapped to the PCIe bus, is hardware dependent.

This way or another, I don't know about a single x86-based processor that has a DMA engine, and for sure, they're not common. The reason is simple: There has been no motivation to support such a feature, since all consumer peripherals take care of their bus transactions by themselves.

So as far as I know, the only way to do DMA on a PC, is to have the endpoint initiate it.

I might be wrong on this. If someone finds an x86 processor which is DMA capable, please add a post below. Not to mention if this engine creates efficient PCIe traffic (i.e. not a packet for each 4 or 8 bytes).

Regards,
Eli
support
 
Posts: 482
Joined: Tue Apr 24, 2012 3:46 pm

Re: PCIe DMA method chose

Postby Guest » Mon Aug 08, 2016 1:51 pm

Hello again eli,

Thx for your answer.
I agree with you that the general thoughts about PCIe DMA, that the DMA should be initiated by the device not the host PC.

It's an API tutorial I found which makes me confused.
https://www.kernel.org/doc/Documentatio ... client.txt

It talks about how to use linux API to do DMA engine.
I'm not sure if I understand it correctly, but I think it tells us how to initiate DMA requests from host PC.

Regards,
colis
Guest
 

Re: PCIe DMA method chose

Postby support » Mon Aug 08, 2016 3:39 pm

Hello,

The question is not whether DMA engines exist or whether Linux support them. The answer to both questions is yes.

But can you do it on a PC? That is, on a x86-based platform? I didn't find any note on that in the kernel doc page you pointed at. As I said before, I don't know about any x86-based processor which has that capability, let alone one that would work efficiently with PCIe. If you (or someone else) finds one, please post below.

Regards,
Eli
support
 
Posts: 482
Joined: Tue Apr 24, 2012 3:46 pm


Return to General PCIe

cron