Are NDIS and TCP/IP creating interrupts

Hi,

I’m writing an NDIS miniport driver for windows server 2003 SNP.
I have changed my network card not to use interrupts at all (it is using polling for both send and receive).
When running stress, I some times see the system with almost no interrupts at all, but sometimes there are ~10,000 interrupts every second.

I have a printing every time that I receive an interrupt in my driver, and this interrupts don’t seem to come from to my card. On the hand there is a 100% correlation between my test and the interrupt storm.

I want to know if this is an expected behavior. What I mean is this, Do NDIS or TCP create the interrupts by themselves (for example using a hardware timer) or is it some bug in my Card/driver?

Is there a way to know which device is creating the interrupts?

Thanks
Tzachi

xxxxx@mellanox.co.il wrote:

I’m writing an NDIS miniport driver for windows server 2003 SNP.
I have changed my network card not to use interrupts at all (it is using polling for both send and receive).
When running stress, I some times see the system with almost no interrupts at all, but sometimes there are ~10,000 interrupts every second.

I have a printing every time that I receive an interrupt in my driver, and this interrupts don’t seem to come from to my card. On the hand there is a 100% correlation between my test and the interrupt storm.

I want to know if this is an expected behavior. What I mean is this, Do NDIS or TCP create the interrupts by themselves (for example using a hardware timer) or is it some bug in my Card/driver?

Is there a way to know which device is creating the interrupts?

On a PCI bus, virtually every interrupt is shared between several
devices. You might be sharing your interrupt with the disk controller,
for example. There’s nothing surprising about this. You just have to
be able to tell quickly whether it came from your board, and return
FALSE if it didn’t.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks for your answer Tim, but my problem is different.

I do share the interrupt with a “standard Pci to Pci Bridge” but my card doesn’t get any interrupts.
Still, someone is generating many interrupts when the test is running, and I’m trying to understand who that is.

----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Thursday, November 08, 2007 3:16 PM
Subject: RE:[ntdev] Are NDIS and TCP/IP creating interrupts

> Thanks for your answer Tim, but my problem is different.
>
> I do share the interrupt with a “standard Pci to Pci Bridge” but my card
> doesn’t get any interrupts.
> Still, someone is generating many interrupts when the test is running, and
> I’m trying to understand who that is.
>

I’m not completely sure I understand your situation. Is your ISR called or
not? If it’s called at all, then it’s not your board.

Have a nice day
GV


Gianluca Varenni, Windows DDK MVP

CACE Technologies
http://www.cacetech.com

>
> —
> 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

>I’m not completely sure I understand your situation. Is your ISR called or

not? If it’s called at all, then it’s not your board.

I’ll try to explain my self better.
Before I run the test there are about 350 interrupts/second.

I run the test (a normal winsock test) and my ISR is being called about 40 times/sec. At that time the total number of interrupts goes to 10,000.

I’m trying to understand who is creating those interrupts. Is it NDIS? Is this my board after all?

By the way this doesn’t always happen, sometimes the test runs and there are no additional interrupts.

Thanks
Tzachi

----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Thursday, November 08, 2007 3:54 PM
Subject: RE:[ntdev] Are NDIS and TCP/IP creating interrupts

>I’m not completely sure I understand your situation. Is your ISR called or
>not? If it’s called at all, then it’s not your board.

I’ll try to explain my self better.
Before I run the test there are about 350 interrupts/second.

I run the test (a normal winsock test) and my ISR is being called about 40
times/sec. At that time the total number of interrupts goes to 10,000.

I’m trying to understand who is creating those interrupts. Is it NDIS? Is
this my board after all?

–GV–
If your ISR gets called 40 times/s and the total amount of interrupts is
10,000, then it’s almost impossible that your board is generating such
interrupts. Interrupt lines are hardwired. NDIS cannot generate hardware
interrupts, the only thing it might generate is software interrupts in the
form of DPCs. How are you measuring these interrupts? perfmon?

Have a nice day
GV


Gianluca Varenni, Windows DDK MVP

CACE Technologies
http://www.cacetech.com

By the way this doesn’t always happen, sometimes the test runs and there are
no additional interrupts.

Thanks
Tzachi


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

Odds are high that your board is triggering those interrupts. The only way
to know for sure involves using an interposer card that splits out the INTA#
signal from your device to either to a logic analyzer, or perhaps just and
LED.

If you’re talking about a PCIe device, you’ll definitely need a logic
analyzer to know for sure.

  • Jake Oshins

wrote in message news:xxxxx@ntdev…
>I’m not completely sure I understand your situation. Is your ISR called or
>not? If it’s called at all, then it’s not your board.

I’ll try to explain my self better.
Before I run the test there are about 350 interrupts/second.

I run the test (a normal winsock test) and my ISR is being called about 40
times/sec. At that time the total number of interrupts goes to 10,000.

I’m trying to understand who is creating those interrupts. Is it NDIS? Is
this my board after all?

By the way this doesn’t always happen, sometimes the test runs and there are
no additional interrupts.

Thanks
Tzachi

> How are you measuring these interrupts? perfmon?

I have tried two ways to measure: 1) perfmon, 2) kernrate. Both show the same number of interrupts.

Thanks
Tzachi

If your interrupt routine is being called, you need to check if your board
is generating an interrupt. Now, if it is not your board and you return
TRUE from the interrupt routine you would generate an interrupt storm which
could explain your problem. Of course if it is your board, then your
hardware is probably the problem.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

wrote in message news:xxxxx@ntdev…
>I’m not completely sure I understand your situation. Is your ISR called or
>not? If it’s called at all, then it’s not your board.

I’ll try to explain my self better.
Before I run the test there are about 350 interrupts/second.

I run the test (a normal winsock test) and my ISR is being called about 40
times/sec. At that time the total number of interrupts goes to 10,000.

I’m trying to understand who is creating those interrupts. Is it NDIS? Is
this my board after all?

By the way this doesn’t always happen, sometimes the test runs and there are
no additional interrupts.

Thanks
Tzachi

But this would trigger the ISR of his driver, right? From his description of
the problem, his ISR is called at a much lower rate.

GV

----- Original Message -----
From: “Jake Oshins”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Thursday, November 08, 2007 4:08 PM
Subject: Re:[ntdev] Are NDIS and TCP/IP creating interrupts

> Odds are high that your board is triggering those interrupts. The only
> way to know for sure involves using an interposer card that splits out the
> INTA# signal from your device to either to a logic analyzer, or perhaps
> just and LED.
>
> If you’re talking about a PCIe device, you’ll definitely need a logic
> analyzer to know for sure.
>
> - Jake Oshins
>
>
>
> wrote in message news:xxxxx@ntdev…
>>I’m not completely sure I understand your situation. Is your ISR called or
>>not? If it’s called at all, then it’s not your board.
>
> I’ll try to explain my self better.
> Before I run the test there are about 350 interrupts/second.
>
> I run the test (a normal winsock test) and my ISR is being called about 40
> times/sec. At that time the total number of interrupts goes to 10,000.
>
> I’m trying to understand who is creating those interrupts. Is it NDIS? Is
> this my board after all?
>
> By the way this doesn’t always happen, sometimes the test runs and there
> are no additional interrupts.
>
> Thanks
> Tzachi
>
>
>
> —
> 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

If his device were asserting an interrupt, and he was not handling and clearing that interrupt, wouldn’t the system lock up?

----- Original Message -----
From:
To: “Windows System Software Devs Interest List”
Sent: Thursday, November 08, 2007 5:24 PM
Subject: RE:[ntdev] Are NDIS and TCP/IP creating interrupts

> If his device were asserting an interrupt, and he was not handling and
> clearing that interrupt, wouldn’t the system lock up?
>

You would have an interrupt storm. On a UP machine, this means a machine
lock up (it’s more of a live lock). On an SMP machine I don’t know exactly
what happens. It all depends on what the other processor does (can it serve
other interrupts). I’d really like to study more about these things :slight_smile:

Ciao
GV

> —
> 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

Does your hardware/driver support TOE offload?

Does this happen with SP1?

How about when you disable IOAT (on SP2) through
registry settings, or using netsh?

I’m suspecting the TCP/IP’s stack registered NetDMA
handler, handling receive data mem->mem copies
(assuming all is good with your miniport, and no
shared device interrupt issues).

Cheers

— xxxxx@mellanox.co.il wrote:

Hi,

I’m writing an NDIS miniport driver for windows
server 2003 SNP.
I have changed my network card not to use interrupts
at all (it is using polling for both send and
receive).
When running stress, I some times see the system
with almost no interrupts at all, but sometimes
there are ~10,000 interrupts every second.

I have a printing every time that I receive an
interrupt in my driver, and this interrupts don’t
seem to come from to my card. On the hand there is a
100% correlation between my test and the interrupt
storm.

I want to know if this is an expected behavior. What
I mean is this, Do NDIS or TCP create the interrupts
by themselves (for example using a hardware timer)
or is it some bug in my Card/driver?

Is there a way to know which device is creating the
interrupts?

Thanks
Tzachi


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


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

> Does your hardware/driver support TOE offload?
It supports RSS but not full TOE.

Does this happen with SP1?
Since my driver is an NDIS 5.2 I can not try this on SP1 driver. I will try this on a SP1 with SNP though.

How about when you disable IOAT (on SP2) through
registry settings, or using netsh?

I’m suspecting the TCP/IP’s stack registered NetDMA
handler, handling receive data mem->mem copies
(assuming all is good with your miniport, and no
shared device interrupt issues).

The machine is an AMD computer so I believe that NetDMA doesn’t work there at all.

> I want to know if this is an expected behavior. What I mean is this, Do

NDIS or TCP create the interrupts by themselves (for example using a
hardware timer) or is it some bug in my Card/driver?

You might use ISR/DPC tracing to see who is processing these interrupts. See
http://msdn2.microsoft.com/en-us/library/ms797921.aspx for details on how to
use this facility. My fuzzy memory also was the version of tracerpt that
came in W2K3 would not analyze this trace data, but the version that came
with XP would.

Jan