I found that the MMIO read / write latency was unreasonably long. Hope someone can give me some advice.
In kernel space, I wrote a simple program to read a 4-byte value in the BAR0 address of a PCIe device. The device is a PCIe Intel 10G NIC and is connected to the PCIe x16 bus on my Xeon E5 server. I use rdtsc to measure the time between the start of reading MMIO and the end, the code snippet looks like this:
vaddr = ioremap_nocache(0xf8000000, 128);
I expect that the elapsed time between (end, init) will be less than 1us, after all, the data passing through the PCIe data channel should be only a few nanoseconds. However, my test results are shown in a 5.5use lease to read an MMIO PCIe device. I wonder if this is reasonable. I change my code to a remote memory barrier (rmb), but still get a delay of 5 s.
This document refers to PCIe delay measurement. Usually it is less than 1us. www.cl.cam.ac.uk/~awm22/.../miller2009motivating.pdf Do I need to make any special configuration, such as a kernel or device, in order to get a lower latency of access to MMIO? or does anyone have experience doing this before?
linux linux-device-driver pci-e pci-bus
William Tu
source share