Windows: Line-Based vs. Message Signaled-Based Interrupts. MSI tool.

Discussion in 'Operating Systems' started by mbk1969, May 7, 2013.

  1. X7007

    X7007 Ancient Guru

    Messages:
    1,582
    Likes Received:
    29
    GPU:
    Sapphire 6900XT
    Anyone knows if it's possible to increase the LIMIT of the device ? I'm not sure why it's 8 or 1 when you can change it to max 16 for PCI 2.2 which I think most devices are



    [​IMG]


    This lines are what scaring me because it can cause the device to fail

    In Windows 8, the operating system does not support resource requests for more than 2048 interrupt messages per device function. In Windows 7 and Windows Vista, the operating system does not support resource requests for more than 910 interrupt messages per device function. If the device driver exceeds this limit, the device might fail to start. To enable a driver to operate in a computer that contains many logical processors, the driver should avoid requesting more than one interrupt per processor.

    During system rebalancing of interrupt resources, the PnP manager might ask a driver to select a preferred set of alternate interrupt resources from a resource requirements list. However, the PnP manager cannot always assign to a driver the resources that the driver prefers. The driver must therefore tolerate, without failures, the assignment of any set of alternate interrupt resources from the resource requirements list. For example, the device might be assigned a smaller number of message interrupts than the driver requested. In the worst case, the driver must be prepared to operate the device with just one line-based interrupt.


    https://docs.microsoft.com/en-us/wi...g-message-signaled-interrupts-in-the-registry
    https://docs.microsoft.com/en-us/wi...l/introduction-to-message-signaled-interrupts
     
  2. mbk1969

    mbk1969 Ancient Guru

    Messages:
    10,788
    Likes Received:
    8,026
    GPU:
    GF RTX 2070 Super
    PCI 2.2 is old PCI bus (and PCI 3.0 as well ). It is not PCI Express bus.
    https://en.wikipedia.org/wiki/Conventional_PCI
    [​IMG]
     
    Last edited: Aug 27, 2018
  3. X7007

    X7007 Ancient Guru

    Messages:
    1,582
    Likes Received:
    29
    GPU:
    Sapphire 6900XT
    So can we change the limits or it's the driver defaults ?
     
  4. mbk1969

    mbk1969 Ancient Guru

    Messages:
    10,788
    Likes Received:
    8,026
    GPU:
    GF RTX 2070 Super
    If you have not meddled with limit settings then it is driver defaults. Only developers of device and its drivers know the meaning of that limit setting. You can toy with it but write down (or take a screenshot) beforehand.

    PS I understand only one direction of tweaking the limit setting - to set it "1" in attempt to troubleshoot faulty device (to overwrite the defaults). But if you think that device will work faster or something if you increase that limit setting, I strictly doubt that.

    PPS
    1) The value utility shows is read from registry. I.e. this is configuration value for drivers. Drivers can request this limit setting to OS but, as you quoted MS docs, there is no guarantee OS will give it.
    2) Btw, the feel of this limit setting is not "give me specified MSIs", but literally "limit the MSIs assigned to device (drivers)".
     
    Last edited: Aug 27, 2018

  5. X7007

    X7007 Ancient Guru

    Messages:
    1,582
    Likes Received:
    29
    GPU:
    Sapphire 6900XT
    https://en.wikipedia.org/wiki/Message_Signaled_Interrupts
    But they are saying that

    as an example, PCI Express does not have separate interrupt pins at all; instead, it uses special in-band messages to allow pin assertion or deassertion to be emulated. Some non-PCI architectures also use MSI; as another example, HP GSC devices do not have interrupt pins and can generate interrupts only by writing directly to the processor's interrupt register in memory space.[citation needed] The HyperTransport protocol also supports MSI.[4]

    While more complex to implement in a device, message signaled interrupts have some significant advantages over pin-based out-of-band interrupt signaling. On the mechanical side, fewer pins makes for a simpler, cheaper, and more reliable connector. While this is no advantage to the standard PCI connector, PCI Express takes advantage of these savings.

    MSI[edit]
    MSI (first defined in PCI 2.2) permits a device to allocate 1, 2, 4, 8, 16 or 32 interrupts. The device is programmed with an address to write to (generally a control register in an interrupt controller), and a 16-bit data word to identify it. The interrupt number is added to the data word to identify the interrupt.[1] Some platforms such as Windows do not use all 32 interrupts but only use up to 16 interrupts.[6]


    Did you see this ? you answered this one

    https://forums.guru3d.com/threads/w...-based-interrupts.378044/page-26#post-5447998
     
    Last edited: Aug 27, 2018
  6. X7007

    X7007 Ancient Guru

    Messages:
    1,582
    Likes Received:
    29
    GPU:
    Sapphire 6900XT
    Ok I have some update, very important one.

    We have 3 ways PCIE works

    You can see my PCIE Sound card works as maximum PCIE speed and not legacy , even when it says it's IRQ 32 and MSI not enabled on the windows registry or MSI Utility

    Some devices are

    PCIE Express Endpoint
    Legacy PCI Express Endpoint which what Nvidia uses. I also found the reason, read below.
    Even after changing using the MSI utility it still stay Legacy PCI Express Endpoint

    And they connected to PCIE Port which called

    Root Port of PCI Express Root Complex




    https://nvidia.custhelp.com/app/answers/detail/a_id/4135/~/vmware-vdga-/-gpu-passthrough-requires-that-msi-is-disabled-on-vms


    [​IMG]
     
    Last edited: Aug 27, 2018
  7. mbk1969

    mbk1969 Ancient Guru

    Messages:
    10,788
    Likes Received:
    8,026
    GPU:
    GF RTX 2070 Super
    It is not clear to me what are you asking.

    PCI Express always works in MSI mode - that`s the HW and FW level. But PCI Express drivers can emulate legacy (LineBased) mode - that`s OS kernel level. If device (drivers) works in legacy mode then all interactions with drivers goes like in legacy mode - ISR (routine) of device drivers is called and this routine should read info about interrupt (and in case of IRQ sharing all drivers of all devices which share IRQ should estimate whether interrupt arrived from their own device). If device (drivers) works in MSI mode then info about arrived interrupt is already passed to ISR (routine) and this routine skips the info retrieving step. And also there is not IRQ sharing in MSI mode. That`s the idea for the difference in legacy and MSI modes in OS kernel.

    When device (drivers) works in MSI mode developers can utilize MSI capability - multiple messages - as they want. They can use multiple messages to notify about different device events - like errors, warnings, acknowledges. Or they can use multiple messages to notify about the all device events just to improve response time or scalability (on multi CPU/core platforms).
     
    Last edited: Aug 27, 2018
  8. X7007

    X7007 Ancient Guru

    Messages:
    1,582
    Likes Received:
    29
    GPU:
    Sapphire 6900XT
    Ok that's understood , but what Hwinfo shows us then ? only the port or the real hardware support ? can you check urs ?
     
  9. mbk1969

    mbk1969 Ancient Guru

    Messages:
    10,788
    Likes Received:
    8,026
    GPU:
    GF RTX 2070 Super
    According to this article
    http://www.embeddedintel.com/technology_applications.php?article=444
    some devices are still legacy PCI ones just connected to newer PCI Express bus.

    PS I have checked my work rig (a notebook on Intel chipset) and there are no such "PCI Eexpress to PCI/PCI-X bridge" ports.
    I can assume that it is better to have all devices as pure "Device/Port Type: PCI Express Endpoint" because any bridging adds complexity and performance penalties.
     
    Last edited: Aug 27, 2018
  10. X7007

    X7007 Ancient Guru

    Messages:
    1,582
    Likes Received:
    29
    GPU:
    Sapphire 6900XT
    So what does it matter if it still using Legacy after I changed it on the MSI Utility or Enabled MSI support ? if it still shows in HWINFO legacy , but windows uses Minus IRQ (-45) for example.

    Depends, for sound card there won't be big issue, only for Network cards and Storage.

    This thread also some details that we've been through./
    https://www.reddit.com/r/Amd/comments/654wfd/has_there_still_been_no_more_complete_test_on_how/
     

  11. mbk1969

    mbk1969 Ancient Guru

    Messages:
    10,788
    Likes Received:
    8,026
    GPU:
    GF RTX 2070 Super
    I don`t get where you see "legacy" in HWInfo screenshot.

    PS When device is in MSI mode you see in System Resources group (in HWInfo):
    Interrupt Line: N/A

    When in legacy mode:
    Interrupt Line: IRQ23
     
  12. X7007

    X7007 Ancient Guru

    Messages:
    1,582
    Likes Received:
    29
    GPU:
    Sapphire 6900XT
    Yes you are correct I missed this one. What I was talking about is
    Device/Port Type: Root Port of PCI Express Root Complex
    About the Legacy this is where I see it

    [​IMG]

    Another interesting thing I've found


    MSI Style Interrupt Handling Similar to PCI-X
    Interrupt handling is accomplished in-band using the MSI protocol. PCI Express devices use a memory write packet to transmit an interrupt vector to the host bridge device (root complex), which in turn interrupts the CPU. PCI Express devices are
    required to implement the MSI capability register block, but also support legacy interrupt handling in-band by encoding interrupt signal transitions (for INTA#, INTB#, INTC# and INTD#) using Message transactions. Only endpoint devices that must
    support legacy functions and PCI Express-to-PCI bridges are allowed to support legacy interrupt generation.

    Some more information : https://forums.guru3d.com/threads/x58-legacy-pci-express-endpoint.408078/

    The PDF I took information from https://www.mindshare.com/files/resources/MindShare_Intro_to_PCIe.pdf

    Also there is this : https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/content/wdm/ne-wdm-_irq_device_policy

    Windows uses 05 key for me which is not the great. I don't really need it to use BOTH CPUS and all cores for SATA . it will cause latency issues when it goes from one CPU to 2nd CPU.

    You can change it to use specific CORES which can cause huge decrease on latency . for me specific is important because I don't want some drivers to use the 2x 8 cores because they have huge latency different compare to the first CPU.

    I search in google more and I've found Intel RST drivers 15.9 Resolved issues

    Resolved Issues In 15.9.0.1011 Beta Release
    1804926545
    OS freezes in IOmeter with MSI-X MessageNumberLimit = 1
    windows.10_rs1.x64

    I don't understand if they change it to =1 or it was 1 and that was the fix to change it .

    Another bug they fixed with version 16.0
    S3/S4 tests with remapped PCIe when MSI-X MessageNumberLimit is set to 1

    Now what I was saying about the limit is that Intel RST Drivers gives LIMIT of 80 ! compare to the Microsoft Standard AHCI Controller
    I did not change anything here , all is default. I just installed the intel RST Software drivers.
    This is on my laptop computer 970m Asus G751JT

    What I don't understand why on my Desktop AMD there are still -X numbers but MSI is not enabled.. should I enable them ?

    [​IMG]
    [​IMG]
     
    Last edited: Aug 28, 2018
  13. mbk1969

    mbk1969 Ancient Guru

    Messages:
    10,788
    Likes Received:
    8,026
    GPU:
    GF RTX 2070 Super
    I found the answer here
    https://www.mindshare.com/files/resources/MindShare_Intro_to_PCIe.pdf


    You can use MS own Interrupt-Affinity Policy Tool for this
    http://download.microsoft.com/downl...ef1dae939e/interrupt_affinity_policy_tool.msi

    Only their developers can answer.

    That simply means that devices have no MSI related registry keys/values but work in MSI mode despite that. You can leave such devices unchecked. Unless you want to disable MSI mode. In such case you should check device, press "Apply", uncheck device and press "Apply" again.
     
    Last edited: Aug 28, 2018
  14. X7007

    X7007 Ancient Guru

    Messages:
    1,582
    Likes Received:
    29
    GPU:
    Sapphire 6900XT
    Ok , we have good information that was not here before.

    I also find out something that everyone fail to do . on my laptop the default nvidia drivers add MSI enabled but also Limit 1 . if you don't add the Limit to 1 then I think this will cause stability issues

    Some details about MSI-MSI-X for Network adapters

    Message-Signaled Interrupts (MSI/MSI-X)

    Network adapters that support MSI/MSI-X can target their interrupts to specific processors. If the adapters also support RSS, then a processor can be dedicated to servicing interrupts and DPCs for a given TCP connection. This preserves the cache locality of TCP structures and greatly improves performance.
     
    Last edited: Aug 29, 2018
  15. mbk1969

    mbk1969 Ancient Guru

    Messages:
    10,788
    Likes Received:
    8,026
    GPU:
    GF RTX 2070 Super
    That is only relevant for servers. Also this RSS + MSI combo violates OSI model, increases complexity, involves many more components from different companies (OS kernel).
     
    Last edited: Aug 29, 2018

  16. mbk1969

    mbk1969 Ancient Guru

    Messages:
    10,788
    Likes Received:
    8,026
    GPU:
    GF RTX 2070 Super
    On my desktop rig NVIDIA drivers have never added neither "MSI enabled" nor "Limit 1". I switch videocard to MSI after each driver installation, and I do not set the limit. There are no stability issues.

    When device utilizes multiple MSI messages we can see it in Device Manager as multiple entries (in IRQ subtree) of that device with multiple IRQs. I have never seen devices apart from network cards and RAID/SATA controllers which do that.
     
    toyo likes this.
  17. X7007

    X7007 Ancient Guru

    Messages:
    1,582
    Likes Received:
    29
    GPU:
    Sapphire 6900XT
    I am using a Server grade network adapter , SolarFlare SFN6122F +SFP I am using it to connect my computer using 10Gb SFP cable ( Fiber Optic ) . SolarFlare has their own drivers to manage RSS to yes , it works better on many areas instead of using the Microsoft one. you had option to change it before, but now it's only the SolarFlare. For example this is big deal because if I try to install old drivers that support both the windows will crash with BSOD with NDIS.sys driver. the only way to use the newest and better is to use the newest drivers . and it has those many features . as for windows 10 I don't see it has many devices IRQ anymore like you said, it was on the first windows 10 like version 1507 or something but it was changed with the windows and drivers.. so it's different now. things change.
     
  18. ralphedison

    ralphedison New Member

    Messages:
    6
    Likes Received:
    0
    GPU:
    NVIDIA GTX 970
    Hi guys, from what I read here a few pages back, is it right to assume that using the Intel inf chipset driver like "Intel (R) 6 Series/C200 Series Chipset Family 6 Port SATA AHCI Controller - 1C02" running the storahci.sys stock driver worse than the "Standard SATA AHCI Controller" or is it just the same?
     
  19. Agent-A01

    Agent-A01 Ancient Guru

    Messages:
    11,404
    Likes Received:
    921
    GPU:
    ASUS 3080 Strix H20
    Standard SATA AHCI will use storahci driver.

    So yes, it's the same
     
    ralphedison likes this.
  20. mbk1969

    mbk1969 Ancient Guru

    Messages:
    10,788
    Likes Received:
    8,026
    GPU:
    GF RTX 2070 Super
    ralphedison likes this.

Share This Page