I found my MMIO read/write latency is unreasonably high. I hope someone could give me some suggestions.
In the Linux kernel space, I wrote a simple program to read a 4 byte value in a PCIe device's BAR0 address. The device is a PCIe Intel 10G NIC and plugged-in at the PCIe x16 bus on my Xeon E5 server. I use rdtsc to measure the time between the beginning of the MMIO read and the end, a code snippet looks like this:
Code: Select all
vaddr = ioremap_nocache(0xf8000000, 128); // addr is the BAR0 of the device
rdtscl(init);
ret = readl(vaddr);
rmb();
rdtscl(end);
Code: Select all
rdtscl(init);
end = readl(vaddr);
rdtscl(end);
http://www.cl.cam.ac.uk/~awm22/.../mill ... ating.pdf
Do I need to do any special configuration such as kernel or device to get lower MMIO access latency? or Does anyone has experiences doing this before?
Thanks!
William