Not Getting Enough MSIx vectors

Hi Guys,
I have written a KMDF driver which needs at least three MSIx vectors and can handle up to Max of 32 MSIx vectors. If the driver gets anything less than three vectors, it cannot operate and returns error from “PrepareHardware” Callback. I have tested the driver under QEMU and it works great.

I tried the driver with actual hardware (FPGA) on another machine and for some reason the “PrepareHardware” always gets called with 1 interrupt resource and with only one MSIx message.
I looked at the registry to make sure that the INF file add registry directive is actually creating the MSIx registry entries. I could see that the registry entries are created under

 Computer\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\PCI\VEN_XXXX&DEV_XXXX&SUBSYS_XXXXXXXX&REV_00\4&36daf17&0&0010\Device Parameters\Interrupt 
  Management\MessageSignaledInterruptProperties

and the entries created are

    MessageNumberLimit                REG_DWORD      0x20 (32)
    MSISupported                      REG_DWORD      0x01

The machine that I am testing the driver on is a intel XEON based machine with Windows 10 Enterprise (640-bit).

Any pointers to debug this problem further are highly appreciated.

Thanks
AJ.

Assuming all else correct, you get one of below in windows

  1. All requested MSI-X vectors (should be power of 2)
  2. 1 MSI-x
  3. 1 Line interrupt

Driver is supposed to work with any of above given config.

Try #vectors 4 to see if it helps.

Check the Full set of Capability structures, also.

Also, I like to check the requested resources by DbgPrint’ing the resource list(s) at the pre Prepare Hardware callbacks (like Query Resource RequirementsQuery Resource Requirements.

Maybe one of those will help you understand what’s going on.

Be certain you’re requesting MSI-X resources, and not MSI resources. You should be able to get 32 MSI-X resources, but you’re very unlikely to get 32 MSI resources.

Peter

I figured it out. The device was not requesting the correct resources. The PCIe configuration was not setup properly.

There you go. Examining the capabilities will show that.

Another mystery solved.

Thanks for getting back to us to let us know.

Thanks for the help @“Peter_Viscarola_(OSR)” and everyone else , I have been a long long time poster on this list, though disappeared for a few years in between, and I always believed the community created by OSR is nothing short of a blessing for all the windows kernel developers. Its amazing what you guys have done and achieved.
-Aj