MSI-X

Peter

For MSI-X … because this is the only way you’ll be able to distinguish between the different interrupts. The Message ID parameter, in this case, isn’t used (it’ll always be zero, because each interrupt has a separate Interrupt Resource.

I am not sure above is correct (provided that I understood it correctly).

I do have 32 MSI-X (And do WdfInterruptCreate() for each). I assign same EvtInterruptIsr/Dpc to each WDFINTERRUPT.
Then in that single ISR, I handle each MSI-X based on the MsgID.

I think for each WDFINTERRUPT, windows just assigns the MSgId sequentially.
Also I noticed below.

  • Mydevice has 32 functional MSI-X that I can interpret. But for some/whatever reason FW has coded 35 for below
    NTSTATUS status = MsixInterface->GetTableSize(MsixInterface->Context, &TableSize);
    -When I dump like below, for Msgids[32,34], the MessageNumber printed is actually zero.
for (UINT8 MsgId = 0; MsgId < TableSize; MsgId++)
       {
           status = MsixInterface->GetTableEntry(MsixInterface->Context, MsgId, &MessageNumber, &Masked);

By default, the interrupt table is configured so that the first entry has message ID zero, the second entry has message ID one, and so on. If the number of table entries exceeds the number of messages, each additional table entry is assigned message ID zero.

Thanks

(moved your post to NTDEV, instead of in A&A…)

I am not sure above is correct (provided that I understood it correctly).

Thanks for noticing and commenting.

That is possible. I don’t have an MSI-X device in front of me at the moment.

Let me go back and check my MSI-X driver and verify…

Peter

Then in that single ISR, I handle each MSI-X based on the MsgID.

Looking back at the code, YES… you are correct. THANK you.

I’m going to edit my previous post in that thread.

I appreciate the correction. This stuff is SUCH a mess, it’ll be nice to have a correct/clear set of guidelines for people to refer to.

Thanks again,

Peter