none
MSI Interrupt latency - RRS feed

  • Question

  • Hi,

    It seems to me that the MSI interrupt has huge latency. It is so large that I think it is something else that is not right.

    Here is the logic and program flow:

    1. DeviceIOControl Event: DMA Transaction Routine() in the PCIe Kernel driver. The event is sent from GUI application.

        1.1 setup DMA descriptors and control registers. (read/write a small buffer to PCIe FPGA and back to PC memory.

        1.2 command to start DMA operation of the device (GO).

        1.3 in a few loops to check the status of the control registers and memory.

        1.4 Data and Completion Register are immediately updated

             (from PC source -> PC destination memory) at the very first loop.

        1.5 Repeat a few print out loops.

        1.6  Counter of interrupts received is not updated. (in other words, ISR or IsrDPC routine has not been called yet.

    2. In the ISR routine calls WdfInterruptQueueDpcForIsr(Interrupt);

    3. In the DPcForISr routine increases counter of interrupts received.

    WdfSpinLockAcquire(fdoData->SendLock);
    fdoData->ulInterruptCnt++;
    WdfSpinLockRelease(fdoData->SendLock);

    4. ulInterruptCnt is not updated in the step 1.3 above.

    5. Because the step 1.3 has debug print (serial at 115200), I suspect that the latency is huge or something else is wrong.

    Is this normal behave of the MSI interrupts?

    Thanks,

    Tiger

    1. I setup DMA descriptor and control registers to start a DMA data transfer between PCIe (FPGA) and PC (Windows 7) in a DeviceIOControl event in the PCIe Kernel driver.

    2.

    Friday, May 22, 2015 2:41 PM

Answers

  • I've seen good performance with MSI.  Now, you are queuing a DPC for each interrupt, your interrupt count could easily be done in the ISR, since there is an overhead for running the DPC.  For most high performance devices I've worked with you initiate the next operation in the ISR, then only queue the DPC complete the original request.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Friday, May 22, 2015 2:51 PM

All replies

  • I've seen good performance with MSI.  Now, you are queuing a DPC for each interrupt, your interrupt count could easily be done in the ISR, since there is an overhead for running the DPC.  For most high performance devices I've worked with you initiate the next operation in the ISR, then only queue the DPC complete the original request.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Friday, May 22, 2015 2:51 PM
  • Yes, I measured. ISR routine has almost no latency. The latency is from DPC queuing and spinlock (may be).

    Friday, May 22, 2015 3:37 PM