How to test PCIe bus speed and correctness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi, all:

I'm working on an embedded system using PCIe bus. Now my task is to
test the speed and correctness of the PCIe bus.

In order to do that:

1. find the corresponding resource I want to read and write ----
/sys/bus/pci/devices/XXXX:XX:XX.X/resource0
2. in my program, use function open() to open the resource
3.  remap it use mmap() like this:
long *where = (long*) mmap( NULL, getpagesize(), PROT_READ|PROT_WRITE,
MAP_SHARED, fd, 0)
4. then I can read and write through PCIe bus like this:
where[0]; //read
where[0] = 1; //write

Is this the correct and entire process to test it in Linux?

Besides, I also worry about the cache's effect. I will actually
read/write the register of PCIe switch through PCIe bus. Presumably,
they're actually IO from the perspective of Linux, and Linux should
not cache it. Is it correct?

Thanks a lot.

Best,
Hanks

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Networking]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

Add to Google Powered by Linux