From: ManiS on
I have a hardware that exhibits only MSI-X (4 vectors) and no INTX support,
and am developing a Win Server 2008 x64 driver for it.
I tried using this IoConnectInterruptEx with MessageBased option with fields
filled in:
struct {
PDEVICE_OBJECT PhysicalDeviceObject; == PDO of my device
union {
PVOID *Generic; == ptr to my IntMessageTable
PIO_INTERRUPT_MESSAGE_INFO *InterruptMessageTable;
PKINTERRUPT *InterruptObject;
} ConnectionContext;
PKMESSAGE_SERVICE_ROUTINE MessageServiceRoutine; = my int handler code
PVOID ServiceContext; == my FDO
PKSPIN_LOCK SpinLock; = NULL
KIRQL SynchronizeIrql; == PassiveLevel
BOOLEAN FloatingSave; = 0
PKSERVICE_ROUTINE FallBackServiceRoutine; = NULL
} MessageBased;

This does work in most cases and I do get my MSI-X interrupts allocated and
driver loads.
But in cases when I introduce other hardware in the server that also use
MSI-X, my driver fails to load with code 10 (IoCOnnectInterruptEx fails with
error code 0xc000 00bb - STATUS_NOT_SUPPORTED).
After some more hours of debugging, I decided to put in a dummy function
pointer for the FALLBACKSERVICEROUTINE pointer in the MessageBased Structure
- And that helped! Now my driver loads always without any issues and it only
gets MSI-X vectors.

This seems strange that I have to give a line based interrupt handling
function pointer when I know my hardware only supports MSI-x and I am also
asking only for MSI-X.

Anybody has seen this?

Thanks
Mani
From: Maxim S. Shatskih on
> This seems strange that I have to give a line based interrupt handling
> function pointer when I know my hardware only supports MSI-x and I am also
> asking only for MSI-X.

I think that Windows cannot guarantee to grant all MSI requests, so sometimes the hardware will be switched to the usual line-based interrupt mode.

--
Maxim S. Shatskih
Windows DDK MVP
maxim(a)storagecraft.com
http://www.storagecraft.com

From: Pavel A. on
This is well known, see here for example:
http://blogs.msdn.com/b/doronh/archive/2010/05/06/arbitration-and-translation-part-3.aspx

<quote> If there are enough free IDT entries .... then the first claim gets
satisfied. If not, it goes for the single message claim. If that can't be
satisfied, it will back off to the line-based interrupt, which is usually
shared with something else and will almost certainly succeed. </quote>

So if this device really has no INTX support, blame the hardware designer.

-- pa


"ManiS" <ManiS(a)discussions.microsoft.com> wrote in message
news:5C288904-4662-4378-94C3-4214893DCA38(a)microsoft.com...
> I have a hardware that exhibits only MSI-X (4 vectors) and no INTX
> support,
> and am developing a Win Server 2008 x64 driver for it.
> I tried using this IoConnectInterruptEx with MessageBased option with
> fields
> filled in:
> struct {
> PDEVICE_OBJECT PhysicalDeviceObject; == PDO of my device
> union {
> PVOID *Generic; == ptr to my IntMessageTable
> PIO_INTERRUPT_MESSAGE_INFO *InterruptMessageTable;
> PKINTERRUPT *InterruptObject;
> } ConnectionContext;
> PKMESSAGE_SERVICE_ROUTINE MessageServiceRoutine; = my int handler
> code
> PVOID ServiceContext; == my FDO
> PKSPIN_LOCK SpinLock; = NULL
> KIRQL SynchronizeIrql; == PassiveLevel
> BOOLEAN FloatingSave; = 0
> PKSERVICE_ROUTINE FallBackServiceRoutine; = NULL
> } MessageBased;
>
> This does work in most cases and I do get my MSI-X interrupts allocated
> and
> driver loads.
> But in cases when I introduce other hardware in the server that also use
> MSI-X, my driver fails to load with code 10 (IoCOnnectInterruptEx fails
> with
> error code 0xc000 00bb - STATUS_NOT_SUPPORTED).
> After some more hours of debugging, I decided to put in a dummy function
> pointer for the FALLBACKSERVICEROUTINE pointer in the MessageBased
> Structure
> - And that helped! Now my driver loads always without any issues and it
> only
> gets MSI-X vectors.
>
> This seems strange that I have to give a line based interrupt handling
> function pointer when I know my hardware only supports MSI-x and I am also
> asking only for MSI-X.
>
> Anybody has seen this?
>
> Thanks
> Mani