title: PCIe - DMA: Consistent vs. Streaming Memory
body: <p>Currently I'm adding DMA to my PCIe driver for Linux. As I'm reading through the documentation it makes mention of consistent, or coherent, memory by using the API:</p>
  
  <pre><code>pci_set_consistent_dma_mask(...)
  </code></pre>
  
  <p>but never really talks about why to use it or what it does. It seems to mention to call the function for best practices and future proofing. The best I can gather is that consistent DMA memory does not have cache effects and the memory is written between device (FPGA) and CPU without any software/driver intervention once set up correctly (assuming I read correctly).
  So my questions are:</p>
  
  <ol>
  <li>Assuming a PCIe device does not require consistent memory then why would anyone use it, or in what cases is consistent memory used?</li>
  <li>If I use consistent memory then do I <strong>not</strong> need to implement an interrupt in the PCIe driver for DMA? If true, then how does the userpsace code and device know a transfer has occurred?</li>
  <li>If I transfer a lot of small packets, ~50 bytes, continuously and on occasion larger packets, ~6 kB, which DMA memory is better: consistent or streaming?</li>
  </ol>