Questions tagged [dma]

Direct memory access (DMA) is a feature of modern computers and microprocessors that allows certain hardware subsystems within the computer to access system memory for reading and/or writing independently of the central processing unit.

Direct memory access (DMA) is a feature of modern computers and microprocessors that allows certain hardware subsystems within the computer to access system memory for reading and/or writing independently of the central processing unit.

843 questions
12
votes
1 answer

difference between pci_alloc_consistent and dma_alloc_coherent

I am working on pcie based network driver. Different examples use one of pci_alloc_consistent or dma_alloc_coherent to get memory for transmission and reception descriptors. Which one is better if any and what is the difference between the two?
bdubey
  • 307
  • 4
  • 13
11
votes
2 answers

What happens after a packet is captured?

I've been reading about what happens after packets are captured by NICs, and the more I read, the more I'm confused. Firstly, I've read that traditionally, after a packet is captured by the NIC, it gets copied to a block of memory in the kernel…
Rayne
  • 14,247
  • 16
  • 42
  • 59
10
votes
2 answers

What is DMA mapping and DMA engine in context of linux kernel?

What is DMA mapping and DMA engine in context of linux kernel? When DMA mapping API and DMA engine API can be used in Linux Device Driver? Any real Linux Device Driver example as a reference would be great.
Jagdish
  • 1,848
  • 3
  • 22
  • 33
10
votes
1 answer

Large PCIe DMA Linux x86-64

I am working with a high speed serial card for high rate data transfers from an external source to a Linux box with a PCIe card. The PCIe card came with some 3rd party drivers that use dma_alloc_coherent to allocate the dma buffers to receive the…
LINEMAN78
  • 2,562
  • 16
  • 19
10
votes
3 answers

Memory alignment of arrays

I am having trouble aligning memory for DMA transfer on the Cell processor. I need the last 4 bits of an address to be 0. I have 4 arrays of unsigned int where each element must be aligned in memory so that its (hex) adress ends with a…
Felix Glas
  • 15,065
  • 7
  • 53
  • 82
10
votes
1 answer

mwait x86 instruction doesn't wait for DMA

I'm trying to use monitor/mwait instructions to monitor DMA writes from a device to a memory location. In a kernel module (char device) I have the following code (very similar to this piece of kernel code) that runs in a kernel thread: static int…
Igor R.
  • 14,716
  • 2
  • 49
  • 83
9
votes
7 answers

STM32: Implementing UART in DMA mode

I am trying to implement UART in DMA mode to transmit a simple string every time a push button is pressed. So I have used CubeMX to generate the code and I have configured UART2 TX DMA in normal (not circular) mode and also no FIFO and no…
Nixmd
  • 775
  • 5
  • 11
  • 20
8
votes
6 answers

How to use DMA or RDMA in java?

"DMA" here means: Direct memory access, and "RDMA" is: remote direct memory access. I used Java to created an application to transfer stock data, but I found the latency is bigger than I expected. I heard someone developed same type application used…
Freewind
  • 193,756
  • 157
  • 432
  • 708
8
votes
1 answer

How to allocate large contiguous, memory regions in Linux

Yes, I will ultimately be using this for DMA but lets leave coherency aside for the moment. I have 64 bit BAR registers, therefore, AFAIK, all of RAM (e.g. higher than 4G) is available for DMA. I am looking for about 64MB of contiguous RAM. Yes,…
tallen
  • 677
  • 6
  • 17
8
votes
1 answer

Linux kernel device driver to DMA into kernel space

LDD3 (p:453) demos dma_map_single using a buffer passed in as a parameter. bus_addr = dma_map_single(&dev->pci_dev->dev, buffer, count, dev->dma_dir); Q1: What/where does this buffer come from? kmalloc? Q2: Why does DMA-API-HOWTO.txt state I can…
Ian Vaughan
  • 20,211
  • 13
  • 59
  • 79
8
votes
1 answer

STM32 DMA transfer error

I use STM32F407VTG6 controller and try to receive data from SPI using DMA. Then I want to process data on DMA Complete Transfer Interrupt. But when Complete Transfer Interrupt is occurred I see that TEIF (transfer error interrupt flag) is set. After…
Goshik
  • 83
  • 1
  • 1
  • 5
8
votes
3 answers

How do I allocate a DMA buffer backed by 1GB HugePages in a linux kernel module?

I'm trying to allocate a DMA buffer for a HPC workload. It requires 64GB of buffer space. In between computation, some data is offloaded to a PCIe card. Rather than copy data into a bunch of dinky 4MB buffers given by pci_alloc_consistent, I would…
muusbolla
  • 637
  • 7
  • 20
8
votes
1 answer

Understanding Memory Mapped Files

I have started reading about memory mapped IO and I'm having some difficulties grasping the concepts This is what I have understood so far: Each process has a virtual address space. Memory mapped files are allocated a specific address…
Chander Shivdasani
  • 9,878
  • 20
  • 76
  • 107
8
votes
3 answers

How do I ensure buffer memory is aligned?

I am using a hardware interface to send data that requires me to set up a DMA buffer, which needs to be aligned on 64 bits boundaries. The DMA engine expects buffers to be aligned on at least 32 bits boundaries (4 bytes). For optimal performance the…
Krakkos
  • 1,439
  • 3
  • 19
  • 24
8
votes
2 answers

Linux driver DMA transfer to a PCIe card with PC as master

I am working on a DMA routine to transfer data from PC to a FPGA on a PCIe card. I read DMA-API.txt and LDD3 ch. 15 for details. However, I could not figure out how to do a DMA transfer from PC to a consistent block of iomem on the PCIe card. The…
kohpe
  • 315
  • 2
  • 4
  • 9
1
2
3
56 57