MSI and MSI-X support in NIDS60

Discussion in 'Windows Vista Drivers' started by Aniketa K S, Apr 27, 2007.

  1. Aniketa K S

    Aniketa K S Guest

    Hi folks,

    I have a couple of questions related to MSI/MSI-X:

    How can I differentiate between MSI and MSI-X resources in
    MiniportFilterResourceRequirements()? Lets consider a case where NIC
    supports both MSI and MSI-X. Also let us say NIC supports only one
    vector in both MSI and MSI-X. Now I want to support only MSI or MSI-X
    in my Miniport Driver. How do I know which one to filter out in the
    resource list?

    Miniport Driver has to register message interrupt disable/enable
    routines with the NDIS in the call to NdisMRegisterInterruptEx(). But
    in order to achieve MSI/MSI-X vector enable/disable, one need to read/
    write from NIC config space using NdisMGet/SetBusData() APIs. The
    catch here is DDK says NDIS calls message interrupt enable/disable
    routines from DIRQL. But the NdisMGet/SetBusData routines should be
    called at DISPATCH_LEVEL. What am I missing here? Are there any NDIS
    supported APIs to enable/disable individual MSI/MSI-X vectors?

    Also It looks like Windows categorizes the interrupts as either line
    based or message based. But not between MSI and MSI-X inside message
    based (from NIC Miniport Driver perspective). Why is that?

    Aniketa K S, Apr 27, 2007
    1. Advertisements

  2. Aniketa K S

    Pavel A. Guest

    You have an opportunity to read the PCI registers, and set up your
    device behavior in MiniportInitialize - this is long before your
    miniport enable/disable interrupt routines will be called.
    Information about your MSI is also contained in the INF.

    Pavel A., Apr 27, 2007
    1. Advertisements

  3. Aniketa, If you are still following this thread, please post a response and
    I will try to answer your questions the best I can.

    Alireza Dabagh [MS], May 5, 2007
  4. Aniketa K S

    Aniketa K S Guest

    Thanks ali, I am still waiting for answers. In fact I was thinking of
    posting it again. Please let me know what you think.

    Thanks again,
    Aniketa K S, May 8, 2007
  5. Hope this is not too late!

    If you support both and message base interrupts are available, you will get
    MSI-X. system has no reason to give you MSI resources if your hardware
    supports MSI-X. If we can not give you MSI-X resources, we will drop to
    line-based interrupts.

    First of all in NDIS 6.1 (shipping with Windows Server 2008) we have
    dedicated routine to mask/unmask an MSI-X table entry so you don't have to
    write to PCI config space yourself.
    Second, the documentation for NdisGet/SetBusData is wrong. these routines
    can be called at any IRQL. We are fixing the documents. My apologies.

    Your observation is correct. The reason is that OS does not give you MSI
    resources if your hardware can do MSI-X.
    i.e. we don't have a case in which we can give you MSI resources and not
    MSI-X resources. so the fallback from not being able to get MSI-X resources
    is dropping to line-based. of course if your device can only do MSI (and not
    MSI-X), then we try MSI and then fallback to line-based.

    Hope this helps.

    Alireza Dabagh [MS], Jun 11, 2007
  6. Aniketa K S

    Aniketa K S Guest

    Thanks a lot Ali, this really helped.

    Aniketa K S, Jun 21, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.