From: Dave-RV on
I have inherited an NDIS 5.1 intermediate driver which runs correctly
under XP yet with Vista the processor occupancy shoots up as soon as
the user part of the application (a firewall) is started. The culprit
appears to be the time taken to call the Windows GetIfTable function.

To test my understanding of intermediate drivers I built and installed
the WDK Passthru Intermediate Miniport driver sample only to find that
this exhibits the same behavior. A test app shows that a single call
to GetIfTable takes around 3ms yet this increases to 210ms after
installing the driver (either my original or Passthru).

Under Vista each call to GetIfTable invokes MPQueryInformation 198
times per adapter - so as the driver is installed by five adapters
(two NICs and three WAN Miniports) - this results in 990 calls to
MPQueryInformation for each GetIfTable.

Any suggestions as to the cause of this problem are gratefully.

Many thanks

Dave
From: Thomas F. Divine on
Thanks for the heads-up. I certainly had not noticed this behavior (yet).
Your notes are very clear though.

1.) Does the behavior change if the table is not sorted?
2.) Is the behavior different if the new GetIfTable2 or GetIfTable2Ex are
used?

Just some rambling thoughts here...

Thomas F. Divine
http://www.pcausa.com


"Dave-RV" <global.tech.test1(a)googlemail.com> wrote in message
news:3d5fa67c-8b80-4d2e-9ea8-4a1e28d53c38(a)c34g2000yqn.googlegroups.com...
> I have inherited an NDIS 5.1 intermediate driver which runs correctly
> under XP yet with Vista the processor occupancy shoots up as soon as
> the user part of the application (a firewall) is started. The culprit
> appears to be the time taken to call the Windows GetIfTable function.
>
> To test my understanding of intermediate drivers I built and installed
> the WDK Passthru Intermediate Miniport driver sample only to find that
> this exhibits the same behavior. A test app shows that a single call
> to GetIfTable takes around 3ms yet this increases to 210ms after
> installing the driver (either my original or Passthru).
>
> Under Vista each call to GetIfTable invokes MPQueryInformation 198
> times per adapter - so as the driver is installed by five adapters
> (two NICs and three WAN Miniports) - this results in 990 calls to
> MPQueryInformation for each GetIfTable.
>
> Any suggestions as to the cause of this problem are gratefully.
>
> Many thanks
>
> Dave

From: Dave-RV on
Thanks for your thoughts.

I'd been calling GetIfTable without setting the Sorted flag - setting
this flag makes no difference, with the call still taking between 195
and 215 ms.
I also tested GetIfTable2 which is generally a few ms faster, but is
still over 190ms.

I also tried the sample IP redirector application from the PCAUSA
website (I wasn't sure the drivers installed for Vista would be NDIS
5.1 or 6), but this worked as expected with only a marginal timing
overhead.


Thanks for your assistance

Dave.



On 21 Jan, 14:59, "Thomas F. Divine" <tdivineATpcausaDOTcom> wrote:
> Thanks for the heads-up. I certainly had not noticed this behavior (yet).
> Your notes are very clear though.
>
> 1.) Does the behavior change if the table is not sorted?
> 2.) Is the behavior different if the new GetIfTable2 or GetIfTable2Ex are
> used?
>
> Just some rambling thoughts here...
>
> Thomas F. Divinehttp://www.pcausa.com
>
> "Dave-RV" <global.tech.te...(a)googlemail.com> wrote in message
>
> news:3d5fa67c-8b80-4d2e-9ea8-4a1e28d53c38(a)c34g2000yqn.googlegroups.com...
>
>
>
> > I have inherited an NDIS 5.1 intermediate driver which runs correctly
> > under XP yet with Vista the processor occupancy shoots up as soon as
> > the user part of the application (a firewall) is started. The culprit
> > appears to be the time taken to call the Windows GetIfTable function.
>
> > To test my understanding of intermediate drivers I built and installed
> > the WDK Passthru Intermediate Miniport driver sample only to find that
> > this exhibits the same behavior. A test app shows that a single call
> > to GetIfTable takes around 3ms yet this increases to 210ms after
> > installing the driver (either my original or Passthru).
>
> > Under Vista each call to GetIfTable invokes MPQueryInformation 198
> > times per adapter - so as the driver is installed by five adapters
> > (two NICs and three WAN Miniports) - this results in 990 calls to
> > MPQueryInformation for each GetIfTable.
>
> > Any suggestions as to the cause of this problem are gratefully.
>
> > Many thanks
>
> > Dave

From: Thomas F. Divine on
Dave,

If you are saying that the overhead was "OK" when IPRedir was installed,
then that is because IPRedir installs a NDIS 6 LWF on Windows Vista and
later. Not the NDIS 5 IM filter it uses on Windows XP

So, perhaps it is time to migrate to a NDIS 6 LWF...

Do you make this call frequently? If so, what volatile information do you
need? More importantly: Is there another way to get the info?

Good luck,

Thomas F. Divine
http://www.pcausa.com - http://www.rawether.net - http://www.ndis.com


"Dave-RV" <global.tech.test1(a)googlemail.com> wrote in message
news:7f624147-9450-45fc-8e0b-e8384568b935(a)r5g2000yqb.googlegroups.com...
> Thanks for your thoughts.
>
> I'd been calling GetIfTable without setting the Sorted flag - setting
> this flag makes no difference, with the call still taking between 195
> and 215 ms.
> I also tested GetIfTable2 which is generally a few ms faster, but is
> still over 190ms.
>
> I also tried the sample IP redirector application from the PCAUSA
> website (I wasn't sure the drivers installed for Vista would be NDIS
> 5.1 or 6), but this worked as expected with only a marginal timing
> overhead.
>
>
> Thanks for your assistance
>
> Dave.
>
>
>
> On 21 Jan, 14:59, "Thomas F. Divine" <tdivineATpcausaDOTcom> wrote:
>> Thanks for the heads-up. I certainly had not noticed this behavior (yet).
>> Your notes are very clear though.
>>
>> 1.) Does the behavior change if the table is not sorted?
>> 2.) Is the behavior different if the new GetIfTable2 or GetIfTable2Ex are
>> used?
>>
>> Just some rambling thoughts here...
>>
>> Thomas F. Divinehttp://www.pcausa.com
>>
>> "Dave-RV" <global.tech.te...(a)googlemail.com> wrote in message
>>
>> news:3d5fa67c-8b80-4d2e-9ea8-4a1e28d53c38(a)c34g2000yqn.googlegroups.com...
>>
>>
>>
>> > I have inherited an NDIS 5.1 intermediate driver which runs correctly
>> > under XP yet with Vista the processor occupancy shoots up as soon as
>> > the user part of the application (a firewall) is started. The culprit
>> > appears to be the time taken to call the Windows GetIfTable function.
>>
>> > To test my understanding of intermediate drivers I built and installed
>> > the WDK Passthru Intermediate Miniport driver sample only to find that
>> > this exhibits the same behavior. A test app shows that a single call
>> > to GetIfTable takes around 3ms yet this increases to 210ms after
>> > installing the driver (either my original or Passthru).
>>
>> > Under Vista each call to GetIfTable invokes MPQueryInformation 198
>> > times per adapter - so as the driver is installed by five adapters
>> > (two NICs and three WAN Miniports) - this results in 990 calls to
>> > MPQueryInformation for each GetIfTable.
>>
>> > Any suggestions as to the cause of this problem are gratefully.
>>
>> > Many thanks
>>
>> > Dave
>
From: Dave-RV on
Yes, my test app showed the IPRedir overhead to negligible ( 1 – 2ms
as I recall) so I had assumed this was NDIS 6.

I know you’re right in that NDIS 6 LWF is the way to go, but as our
customer base is substantially XP based and my time is limited I am
tempted to think about this as an update for the next revision.

The code currently calls GetIfTable only for relatively static
information (index, mtu, speed) and the number of calls can be
optimized considerably by sharing the results of a single call between
all adapters, so I think this is where my solution lies.


Thanks for your assistance.


Dave


On 21 Jan, 17:19, "Thomas F. Divine" <tdivineATpcausaDOTcom> wrote:
> Dave,
>
> If you are saying that the overhead was "OK" when IPRedir was installed,
> then that is because IPRedir installs a NDIS 6 LWF on Windows Vista and
> later. Not the NDIS 5 IM filter it uses on Windows XP
>
> So, perhaps it is time to migrate to a NDIS 6 LWF...
>
> Do you make this call frequently? If so, what volatile information do you
> need? More importantly: Is there another way to get the info?
>
> Good luck,
>
> Thomas F. Divinehttp://www.pcausa.com-http://www.rawether.net-http://www.ndis.com
>
> "Dave-RV" <global.tech.te...(a)googlemail.com> wrote in message
>
> news:7f624147-9450-45fc-8e0b-e8384568b935(a)r5g2000yqb.googlegroups.com...
>
>
>
> > Thanks for your thoughts.
>
> > I'd been calling GetIfTable without setting the Sorted flag - setting
> > this flag makes no difference, with the call still taking between 195
> > and 215 ms.
> > I also tested GetIfTable2 which is generally a few ms faster, but is
> > still over 190ms.
>
> > I also tried the sample IP redirector application from the PCAUSA
> > website (I wasn't sure the drivers installed for Vista would be NDIS
> > 5.1 or 6), but this worked as expected with only a marginal timing
> > overhead.
>
> > Thanks for your assistance
>
> > Dave.
>
> > On 21 Jan, 14:59, "Thomas F. Divine" <tdivineATpcausaDOTcom> wrote:
> >> Thanks for the heads-up. I certainly had not noticed this behavior (yet).
> >> Your notes are very clear though.
>
> >> 1.) Does the behavior change if the table is not sorted?
> >> 2.) Is the behavior different if the new GetIfTable2 or GetIfTable2Ex are
> >> used?
>
> >> Just some rambling thoughts here...
>
> >> Thomas F. Divinehttp://www.pcausa.com
>
> >> "Dave-RV" <global.tech.te...(a)googlemail.com> wrote in message
>
> >>news:3d5fa67c-8b80-4d2e-9ea8-4a1e28d53c38(a)c34g2000yqn.googlegroups.com....
>
> >> > I have inherited an NDIS 5.1 intermediate driver which runs correctly
> >> > under XP yet with Vista the processor occupancy shoots up as soon as
> >> > the user part of the application (a firewall) is started. The culprit
> >> > appears to be the time taken to call the Windows GetIfTable function..
>
> >> > To test my understanding of intermediate drivers I built and installed
> >> > the WDK Passthru Intermediate Miniport driver sample only to find that
> >> > this exhibits the same behavior. A test app shows that a single call
> >> > to GetIfTable takes around 3ms yet this increases to 210ms after
> >> > installing the driver (either my original or Passthru).
>
> >> > Under Vista each call to GetIfTable invokes MPQueryInformation 198
> >> > times per adapter - so as the driver is installed by five adapters
> >> > (two NICs and three WAN Miniports) - this results in 990 calls to
> >> > MPQueryInformation for each GetIfTable.
>
> >> > Any suggestions as to the cause of this problem are gratefully.
>
> >> > Many thanks
>
> >> > Dave