Skip to contentSkip to conversation

Understanding behavior of memcpy_count and bytes_transferred in dmaengine

DISCUSSION Garg, Shivank 1 participant 1 message Jun 6, 2024 dmaengine

lore
Share & tools
lore
#0 lore raw

Hi Community,

I want to understand how/when memcpy_count and bytes_transferred are increased.

/sys/devices/pci0000:00/0000:00:07.1/0000:03:00.2/dma/dma0chan0$ ls bytes_transferred device in_use memcpy_count power subsystem uevent

I did some experiments with a test kernel driver (doing simple memcpy from 1 NUMA node to another) and dmatest kernel module.

In my testing, both bytes_transferred or memcpy_count remain zero in all testing. However, I observed in_use is changes to 1 when the channel is requested.

Inside the dmaengine: count += per_cpu_ptr(chan->local, i)->memcpy_count;

I checked these variable to understand if my kernel driver is actually copying any data using DMA but it left me more confused. Can you please help in understanding its behavior?

Thanks,
Shivank