Storport : Enabling MSI

Enabling of MSI in storport.

We would like to enable MSI for one of our devices

In that process, we did the following things

  1. Made the necessary changes under the Registry settings

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\VEN_11F8&DEV_8032&SUBSYS_00000000&REV_08\4&2afbb6c9&0&0008\Device Parameters\Interrupt Management\MessageSignaledInterruptProperties]
“MSISupported”=dword:00000001
“MessageNumberLimit”=dword:00000001

  1. In the HWFindAdapter routine we initialize the PORT_CONFIGURATION_INFORMATION with MSI specific member variables

/* Enable MSI */
config_info->InterruptSynchronizationMode = InterruptSynchronizeAll;
config_info->HwMSInterruptRoutine = XXX_XXX_XXX_isr;

  1. In the HwInitialize, we make the storport call “StorportGetMSIInfo” to know whether MSI is supported or not.

In this step we always get “STOR_STATUS_INVALID_DEVICE_REQUEST” from “StorportGetMSIInfo”.
we are making the storportGetMSIInfo call as follows:

" StorPortGetMSIInfo((void *)ptr->access_context, 0, &InterruptInfo); "

(void *)ptr->access_context ==> Device Extension
0 ==> value zero (‘0’)
InterruptInfo ==> MESSAGE_INTERRUPT_INFORMATION

we would like to know what is the condition that storport uses to determine that MSI is supported by the device.

Visakan K

At the risk of asking the obvious here: your hardware device supports MSI
interrupts and is plugged into a pci bus that supports MSI interrupts on a
platform that supports MSI interrupts?

Mark Roddy

On Fri, Apr 9, 2010 at 2:36 PM, wrote:

> Enabling of MSI in storport.
> ==============================
>
> We would like to enable MSI for one of our devices
>
> In that process, we did the following things
>
> 1. Made the necessary changes under the Registry settings
>
> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\VEN_11F8&DEV_8032&SUBSYS_00000000&REV_08\4&2afbb6c9&0&0008\Device
> Parameters\Interrupt Management\MessageSignaledInterruptProperties]
> “MSISupported”=dword:00000001
> “MessageNumberLimit”=dword:00000001
>
> 2. In the HWFindAdapter routine we initialize the
> PORT_CONFIGURATION_INFORMATION with MSI specific member variables
>
> /* Enable MSI */
> config_info->InterruptSynchronizationMode = InterruptSynchronizeAll;
> config_info->HwMSInterruptRoutine = XXX_XXX_XXX_isr;
>
>
> 3. In the HwInitialize, we make the storport call “StorportGetMSIInfo” to
> know whether MSI is supported or not.
>
> In this step we always get “STOR_STATUS_INVALID_DEVICE_REQUEST” from
> “StorportGetMSIInfo”.
> we are making the storportGetMSIInfo call as follows:
>
> " StorPortGetMSIInfo((void *)ptr->access_context, 0,
> &InterruptInfo); "
>
> (void *)ptr->access_context ==> Device Extension
> 0 ==> value zero (‘0’)
> InterruptInfo ==>
> MESSAGE_INTERRUPT_INFORMATION
>
>
> we would like to know what is the condition that storport uses to determine
> that MSI is supported by the device.
>
>
> Visakan K
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Did you manually added these entries in registry? If so, thats *not* the
right way! You have to specify MSI support, no of messages in your
miniport’s inf under *DDInstall.HW Section* (
http://msdn.microsoft.com/en-us/library/ff544246.aspx). And its worth
verifying the inf once with chkinf!

I assume here you are using Windows Server 2008 (/Vista) and above.

Regards,
Gokul T V

On Sat, Apr 10, 2010 at 12:06 AM, wrote:

> Enabling of MSI in storport.
> ==============================
>
> We would like to enable MSI for one of our devices
>
> In that process, we did the following things
>
> 1. Made the necessary changes under the Registry settings
>
> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\VEN_11F8&DEV_8032&SUBSYS_00000000&REV_08\4&2afbb6c9&0&0008\Device
> Parameters\Interrupt Management\MessageSignaledInterruptProperties]
> “MSISupported”=dword:00000001
> “MessageNumberLimit”=dword:00000001
>
> 2. In the HWFindAdapter routine we initialize the
> PORT_CONFIGURATION_INFORMATION with MSI specific member variables
>
> /* Enable MSI */
> config_info->InterruptSynchronizationMode = InterruptSynchronizeAll;
> config_info->HwMSInterruptRoutine = XXX_XXX_XXX_isr;
>
>
> 3. In the HwInitialize, we make the storport call “StorportGetMSIInfo” to
> know whether MSI is supported or not.
>
> In this step we always get “STOR_STATUS_INVALID_DEVICE_REQUEST” from
> “StorportGetMSIInfo”.
> we are making the storportGetMSIInfo call as follows:
>
> " StorPortGetMSIInfo((void *)ptr->access_context, 0,
> &InterruptInfo); "
>
> (void *)ptr->access_context ==> Device Extension
> 0 ==> value zero (‘0’)
> InterruptInfo ==>
> MESSAGE_INTERRUPT_INFORMATION
>
>
> we would like to know what is the condition that storport uses to determine
> that MSI is supported by the device.
>
>
> Visakan K
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

You may want to verify the MSI resource is granted by the system, which means :

  1. MSI vectors are allocated in PCI memory space that is related to a BAR memory specified by your hardware.
  2. Each vector, the address is valid (nonzero) and data is also programmed, the mask bit is cleared.
    If all the above are in place, StorPortGetMSIInfo will return your the meaningful infomation.

>>Did you manually added these entries in registry? If so, thats *not* the

>right way! You have to specify MSI support, no of messages in your
>miniport’s inf under *DDInstall.HW Sectio

Yes. I did manually edit the registry values. I will try using the INF files.

>1.MSI vectors are allocated in PCI memory space that is related to a BAR memory
>specified by your hardware.
>2. Each vector, the address is valid (nonzero) and data is also programmed, the
>mask bit is cleared.

I will check with the PCI memory space.

Visakan K

Thanks all. I got it working.

I didnt use INF file for the registry changes, manual changes did the job. (but i need the INF in the final version). Windows (storport) automatically picks MSI-X option when the device supports MSI and MSI-X.