none
Choosing between MSI and MSI-x RRS feed

  • Question

  • Hi,

    I have an NDIS driver managing a NIC. The HW supports both MSI and MSI-X.

    How do the OS choose whether to use MSI or MSI-X with a given NIC? Will it automatically use the maximal supported capability (i.e. MSI-X) or this needs to be somehow explicitly configured?

    Thanks

    Tuesday, March 24, 2015 11:03 AM

Answers

  • Assuming the hardware and the motherboard support MSI-X properly - and the driver is written properly - then NDIS will use MSI-X

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Tuesday, March 24, 2015 7:26 PM
    Moderator

All replies

  • Assuming the hardware and the motherboard support MSI-X properly - and the driver is written properly - then NDIS will use MSI-X

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Tuesday, March 24, 2015 7:26 PM
    Moderator
  • And if I want to support both MSI and MSI-X internally by the driver? I.e., the device can be installed on various platforms, either supporting MSI-X or not. Is there a way to know whether NDIS chose MSI or MSI-X?
    • Edited by -IgorC- Wednesday, March 25, 2015 9:02 AM
    Wednesday, March 25, 2015 8:45 AM
  • MSI and MSI-X have separate capability blocks (5h and 11h), and the enable bit will be set in only one of them.

    -- pa

    Wednesday, March 25, 2015 12:11 PM
  • MSI and MSI-X have separate capability blocks (5h and 11h), and the enable bit will be set in only one of them.

    -- pa

    Can you elaborate a bit? What's the API to access these capability blocks?
    Wednesday, March 25, 2015 12:19 PM
  • Only a bit :)No special API, just the normal way to access the config space... Or, the device itself can sense this and inform the driver.

    Regards,

    - pa

    Yes, I've been reading this. Mostly understandable, I just have 2 items not so clear to me:

    - Is it ok to use NDIS API to query bus data (NdisMGetBusData)?

    - The capabilities structures aren't exposed in the OS headers and are only documented online, e.g. MSI-X capability . So I should internally define the relevant type and cast the received data to it? A bit weird mode.

    Wednesday, March 25, 2015 1:28 PM
  • Yes, use NdisMGetBusData to read the capabilities from the PCI config space

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Wednesday, March 25, 2015 8:07 PM
    Moderator
  • Thanks everyone.

    One more question - is it possible to force the opposite, i.e. tell the OS to use MSI even if MSI-X is available? E.g., switching the MSI-X capability bit to off and MSI capability bit to on by utilizing NdisMSetBusData.

    Wednesday, March 25, 2015 9:58 PM
  • If you want this to test the driver in MSI mode - can your firmware folks just hide the MSI-X capability? At Intel, they can make up anything ;)

    -- pa

    But the capabilities are reported from PCI config space to the OS during device enumeration, isn't it so? That's before firmware kicks in :)
    Wednesday, March 25, 2015 11:29 PM
  • ?? The configuration space is created by the firmware on power-up... usually. Ask your h/w folks...

    -- pa


    Whatever piece of SW that can run during power up must be in device ROM, i.e. embedded in production - and that's exactly what we're trying to avoid by trying to enable the configuration by SW without altering the HW.
    Saturday, March 28, 2015 2:19 PM