Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I am currently writing a PCI-express driver for a lab-PCIcard with a lots of memory on it. The driver should be used to access the memory and transport large ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    4

    Low speed for PCI express driver


    Hi,

    I am currently writing a PCI-express driver for a lab-PCIcard with a lots of memory on it. The driver should be used to access the memory and transport large amounts of data. My problem is that I cannot get good enough transfer speed on bus. I am using mmap in the driver and in my user application to map the PCI cards memory right up in userspace. Then I am using memcpy to read and write to the mmaped area. The transfer speed I get is 25Mb/s when writing from the PC to the PCIcard but only 2,5Mb/s when reading from the card to the PC. Why does it differ that much? Can any one give me some tips about how to increase the transfer speed? Can I do burst read/writes in any way? The PCI card do not have a DMA controler is it possible to use one from the motherboard if present?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,664
    I think that to use DMA transfers, the card has to support it. Is that megabytes or megabits per second? Data transfer speeds can be seriously affected by wait-states. How are you transferring data in your driver? Also, what are the specs for the board? Just because it is a PCI-express board doesn't mean that it can handle the full data speeds of the bus, and read speeds can significantly differ from write speeds.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Feb 2010
    Posts
    4
    The transfers speed should be in megabytes per second. The board is an FPGA lab board with an PCI express IP core which should support full PCI express speed. What do you mean with wait-state? The data is transferred directly up in userspace with a mmap implementation in the driver. The PCI bars are mapped with remap_pfn_range() in the mmap function in the driver. From the userspace application I then call mmap and read from and write to the pointer which mmap returns.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,664
    Memory I/O usually has some processor wait states, and depending upon the device, there may be more or less waits for reads vs. writes. In your case, the PCI-X interface probably introduces some, and if it is interrupt-driven then more stuff can be going on. You really need to understand fully exactly what is going on. This won't be a simple exercise, and I think that no one here can give you much more advice without actually having the hardware in-hand, along with possibly a digital oscilloscope to see what exactly is going on with the bus. At the very least, if I were helping you with this problem, I would have to spend some serious time with the board's technical documentation and diagnostic tools - assuming that this is commercial card and not a lab prototype sort of unit. If it is built in-house, then it's time to pull out the probes, oscilloscope, and whatever other tools you have to see what's what.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •