Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > bizarre performance issue when TSO is enabled

Reply
Thread Tools Display Modes

bizarre performance issue when TSO is enabled

 
 
capricornian@gmail.com
Guest
Posts: n/a

 
      07-21-2006
I am writing a de-serialized NDIS driver for a network card, which
supports TSO. My driver works smoothy when TSO is disabled. On windows
2003 enterprise server, netperf can achieve 900+ Mbps. But when TSO is
enabled, the speed drops to 100+ Mbps !

The following is the key functions of the driver.

MiniportHandleInterrupt()
{
NdisAcquireSpinLock(lock);

/* scan the rx ring for pkts */

NdisReleaseSpinLock(lock);
NdisMIndicateReceivePacket();
NdisAcquireSpinLock(lock);

CheckTxCompletion(); -> check tx ring for tx completion and call
NdisMSendComplete
if (txQueue not empty){
send pkts in the txQueue
}
NdisReleaseSpinLock(lock);
}

MiniportMultipleSend()
{
NdisAcquireSpinLock(lock);

queue the pkts into txQueue

CheckTxCompletion(); ****

if (txQueue not empty){
send pkts in the txQueue
}

NdisReleaseSpinLock(lock);
}

If I remove CheckTxCompletion() from MiniportMultipleSend, netperf
thruput comes back to 900+ when tso is enabled. I don't understand why.

What's more strange is that the driver (with the fix mentioned above)
works equally fine in windows 2000 advance server w/ SP4 when tso is
disabled. But when tso is enabled, the thruput drops to 2 Mbps! The cpu
is completely idle during the test.

Has anybody encountered the same issue before? Also, is there any rule
when NdisMSendComplete should be called? Thanks

 
Reply With Quote
 
 
 
 
Pavel A.
Guest
Posts: n/a

 
      07-22-2006
It seems like you call CheckTxCompletion with
a spinlock held.
If this function calls NdisSendComplete, you call NDIS with
a spinlock held - which can result in a variety of
nasty things, from performance hit to a deadlock.

Regards,
--PA


"" wrote:
> I am writing a de-serialized NDIS driver for a network card, which
> supports TSO. My driver works smoothy when TSO is disabled. On windows
> 2003 enterprise server, netperf can achieve 900+ Mbps. But when TSO is
> enabled, the speed drops to 100+ Mbps !
>
> The following is the key functions of the driver.
>
> MiniportHandleInterrupt()
> {
> NdisAcquireSpinLock(lock);
>
> /* scan the rx ring for pkts */
>
> NdisReleaseSpinLock(lock);
> NdisMIndicateReceivePacket();
> NdisAcquireSpinLock(lock);
>
> CheckTxCompletion(); -> check tx ring for tx completion and call
> NdisMSendComplete
> if (txQueue not empty){
> send pkts in the txQueue
> }
> NdisReleaseSpinLock(lock);
> }
>
> MiniportMultipleSend()
> {
> NdisAcquireSpinLock(lock);
>
> queue the pkts into txQueue
>
> CheckTxCompletion(); ****
>
> if (txQueue not empty){
> send pkts in the txQueue
> }
>
> NdisReleaseSpinLock(lock);
> }
>
> If I remove CheckTxCompletion() from MiniportMultipleSend, netperf
> thruput comes back to 900+ when tso is enabled. I don't understand why.
>
> What's more strange is that the driver (with the fix mentioned above)
> works equally fine in windows 2000 advance server w/ SP4 when tso is
> disabled. But when tso is enabled, the thruput drops to 2 Mbps! The cpu
> is completely idle during the test.
>
> Has anybody encountered the same issue before? Also, is there any rule
> when NdisMSendComplete should be called? Thanks
>
>

 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow Performance when working Online with Offline files enabled gburnett Windows Vista Networking 3 04-20-2009 08:49 PM
Bizarre performance issue justrick Windows Vista Performance 1 02-11-2009 10:44 AM
Bizarre DirectX Performance with Windows Vista invader@nospamforme.com Windows Vista Performance 2 11-28-2007 04:01 PM
Bizarre DirectX Performance with Windows Vista invader@nospamforme.com Windows Vista General Discussion 4 11-28-2007 04:01 PM
performance issue Erik Visser Windows Vista General Discussion 1 06-15-2006 08:23 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59