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
8
votes
2 answers

Linux device driver to allow an FPGA to DMA directly to CPU RAM

I'm writing a linux device driver to allow an FPGA (currently connected to the PC via PCI express) to DMA data directly into CPU RAM. This needs to happen without any interaction and user space needs to have access to the data. Some details: -…
jedrumh
  • 81
  • 1
  • 3
7
votes
0 answers

The dmaengine in Linux - how to check the number of actually transferred bytes in a single SG transfer?

The dmaengine in Linux significantly simplifies writing of drivers for devices using DMA, especially if they support and use scatter-gather (SG) transfers. However, there is a problem in case if the length of such transfer is not known a priori.…
wzab
  • 788
  • 7
  • 24
7
votes
1 answer

DMA memcpy operation in Linux

I want to dma using dma_async_memcpy_buf_to_buf function which is in dmaengine.c file (linux/drivers/dma). For this, I add a function in dmatest.c file (linux/drivers/dma) as following: void foo () { int index = 0; dma_cookie_t cookie; …
Mustafat
  • 69
  • 1
  • 1
  • 4
7
votes
3 answers

Where to start learning about linux DMA / device drivers / memory allocation

I'm porting / debugging a device driver (that is used by another kernel module) and facing a dead end because dma_sync_single_for_device() fails with an kernel oops. I have no clue what that function is supposed to do and googling does not really…
Kimvais
  • 38,306
  • 16
  • 108
  • 142
7
votes
1 answer

Is a buffer within kmalloc also a DMA safe buffer?

I'm in the middle of writing a framebuffer driver for an SPI connected LCD. I use kmalloc to allocate the buffer, which is quite large - 150KB. Given the way kmalloc is allocating the buffer, ksize reports that way more memory is being used - 256KB…
carveone
  • 889
  • 9
  • 16
7
votes
3 answers

asynchronous memcpy in linux?

Is there any asynchronous memcpy function in linux? I want it to work with DMA and notify me when it gets completed.
SunnyShah
  • 28,934
  • 30
  • 90
  • 137
7
votes
3 answers

From the kernel to the user space (DMA)

Lately, I have been reading a lot of websites,and books about 10gb/s NICs, their DMA and the way data are handled by the linux kernel (10/100 mb/s NICs) and a few questions came to my mind. What would be the easiest way to send a 10GB/s flow of…
AdventN
  • 355
  • 1
  • 3
  • 9
6
votes
1 answer

Streaming DMA in PCIE linux kernel driver

I'm working on FPGA driver for Linux kernel. Code seems to work fine on x86, but on x86_64 I've got some problems. I implemented streaming DMA. So it goes like get_user_pages(...); for (...) { sg_set_page(); } pci_map_sg(); But pci_map_sg…
soh
  • 85
  • 1
  • 6
6
votes
2 answers

What is the difference between DMA-Engine and DMA-Controller?

As mentioned above, what is the difference between a dma engine and a dma-controller (on focus on linux)? When does the linux dma engine come into place? Is this a special device or always part of all periphery devices, which support dma? When…
john s.
  • 476
  • 9
  • 21
6
votes
1 answer

how to programmatically get physical memory address range in linux

I am trying to get the physical address range of all the available ram in the system inside a linux kernel module. I saw cat /proc/iomem and saw that the physical memory is itself not contiguous. I understand that for 32bit systems compatibility…
hiteshradia
  • 357
  • 2
  • 9
6
votes
1 answer

How does MSI interrupt work in linux driver?

Currently working on a PCI device driver. And the device is programmed like this: When a DMA transmission is done, the device send a MSI interrupt to PC with MSI data "001" binary. Now I'm writing a driver for this pci device, and for the MSI…
Cong Li
  • 369
  • 2
  • 5
  • 13
6
votes
2 answers

Are there any DMA Linux kernel driver example with PCIe for FPGA?

I would like to write a driver in kernel space that: Communicate a FPGA connected by PCIe in a embedded system( with powerPC). It uses DMA to transfer information from the FPGA to RAM. User programs have to access to this information. I need some…
manolo tunez
  • 131
  • 1
  • 2
  • 9
6
votes
1 answer

DMA PCIe read transfer from PC to FPGA

I'm trying to get DMA transfer working between an FPGA and an x86_64 Linux machine. On the PC side I'm doing this initialization: //driver probe ... pci_set_master(dev); //set endpoint as master result = pci_set_dma_mask(dev, 0xffffffffffffffff);…
Cpu86
  • 123
  • 1
  • 8
6
votes
1 answer

Optimize socket data transfer over loopback wrt NUMA

I was looking over the Linux loopback and IP network data handling, and it seems that there is no code to cover the case where 2 CPUs on different sockets are passing data via the loopback. I think it should be possible to detect this condition and…
jxh
  • 69,070
  • 8
  • 110
  • 193
6
votes
2 answers

Using DMA Memory Transfer in User-Space

Is there a linux DMA mem-to-mem copy mechanism available to userspace? I have a linux application that routinely (50-100 times a second) has to memcpy several megs (10+) of data around. Often it's not an issue, but we've begun to see evidence that…
Yeraze
  • 3,269
  • 4
  • 28
  • 42
1 2
3
56 57