# Reducing ISR DPC Processing Times for Network Adapters



## HappyAlive

Cool. Keep up the great work.


----------



## EniGma1987

Can you still maintain good throughput with these settings? the caches look good enough for gigabit still but the RSS queues has me a little worried.


----------



## Timecard

What about the RSS queues has you worried?


----------



## EniGma1987

You are limiting yourself to 2 processor cores for network traffic. Under heavy load this could bog down those cores more by not allowing the load to be spread out to more cores. Im sure this is a fine setup for all basic traffic, but it will probably limit the total number of packets per second your PC can process.
Since you only have a quad core CPU, and since you are limiting yourself to not allow network traffic to process on the first core, the max processors you can use is still only 3. However, that would still be a 50% increase over 2 cores for network packet processing.


----------



## Timecard

Driver only lets me set two


----------



## Timecard

You guys are right, NDIS latency tends to be overall lower with 2 RSS queues vs 4. With 4 you'd likely get better throughput but if we're talking about video games then volume isn't usually as important. It's really easy to toggle with powershell for example.


----------



## Timecard

This was the best I could get during some simulated load which matches load during gameplay of Half-Life 1 mod, it uses mostly UDP at roughly 100 packets per second and payload sizes around 130-160bytes on average.


----------



## kromtomas

did you changed something? can you do a list what you alle did to archive this?


----------



## kromtomas

i could replicate it, but there are two ndis.sys in the textfile. Which is the right one?


----------



## Timecard

kromtomas said:


> i could replicate it, but there are two ndis.sys in the textfile. Which is the right one?


The top ndis.sys was referenced in my screenshot (dpc related) the bottom one in the xperf report is for interrupt service request latency which is probably always near 99%.

Based on your dpc latency you have a RealTek network adapter?


----------



## BroadPwns

Out of curiosity, apart from the benchmark - did you notice any real world change?


----------



## Timecard

I mentioned it a bit in the original post, online gaming experience felt more responsive (kb input and mouse) during online gameplay, again we're talking microseconds not milliseconds but any reduction in wait times should have positive influence in the overall processing pipeline.


----------



## kromtomas

so i discovered something,
the first ndis.sys thing is the "sending data"
the second one is the "receiving data"

EDIT: nope, i was wrong


----------



## n1kobg

hint: You can also specify to use only core 2 and 3 or only core 2 if u use 1 queue.


----------



## Marctraider

EniGma1987 said:


> You are limiting yourself to 2 processor cores for network traffic. Under heavy load this could bog down those cores more by not allowing the load to be spread out to more cores. Im sure this is a fine setup for all basic traffic, but it will probably limit the total number of packets per second your PC can process.
> Since you only have a quad core CPU, and since you are limiting yourself to not allow network traffic to process on the first core, the max processors you can use is still only 3. However, that would still be a 50% increase over 2 cores for network packet processing.


This is only under the assumption that you will load up with some major bandwidth load. On average usage with just two RSS cores it could actually be a sweetspot. I've also noticed that at least offloading network to any core but Core 0 has beneficial effects, but going higher than 1 or two queues already increases complexity/jitter again.


----------



## OCmember

Sorry for the thread resurrect but what are the instructions for xperf to monitor the packets?


----------



## Timecard

You'd need to install Windows Performance Toolkit in Windows Assessment and Deployment Kit then you can use this script, just needs a little modification for directories/paths.








GamingPCSetup/xperfdpcisr.ps1 at master · djdallmann/GamingPCSetup


A research and evidence based approach to optimizing your gaming PC, configuration and setup. Recommendations found in this guide are based on curated reputable technical references, and personal r...




github.com





Make sure to download the right version for your OS








Download and install the Windows ADK


Instructions on how to download and install the Windows ADK



docs.microsoft.com


----------



## OCmember

Where is the Reg key for MessageNumberLimit? I think it can be adjusted via MSI utility but I'm wondering where the reg location is.

Thanks


----------



## Timecard

1. Device Manager > Network Adapters > Right click your network adapter and go to properties > Details > Device Instance Path (Copy this)
2. Open regedit and go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\
3. From there follow it to your Device Instance Path after this path ^ e.g. PCI\VEN_8086&DEV_15B8&SUBSYS_15B81849&REV_00\3&11583659&0&FE
4. Then go to your devices configuration > Device Parameters\Interrupt Management\MessageSignaledInterruptProperties
5. Edit/Add MessageNumberLimit (DWORD32)


----------



## OCmember

Timecard said:


> 1. Device Manager > Network Adapters > Right click your network adapter and go to properties > Details > Device Instance Path (Copy this)
> 2. Open regedit and go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI\
> 3. From there follow it to your Device Instance Path after this path ^ e.g. PCI\VEN_8086&DEV_15B8&SUBSYS_15B81849&REV_00\3&11583659&0&FE
> 4. Then go to your devices configuration > Device Parameters\Interrupt Management\MessageSignaledInterruptProperties
> 5. Edit/Add MessageNumberLimit (DWORD32)


Thanks, man! I use to have notes on things like this but I don't know what happened..

I installed the Windows Assessment and Deployment kit but I don't know the first thing about how to use it to analyze my rigs ndis.sys latency. I'm a total newb with it. I'd like to analyze the packets and make adjustments to the ndis settings to reduce the IRS DPC processing time. How do I do use that app to do so?

Thanks for your time.


----------



## Asutz

using 2 rss queues and set buffer size to 768 but still have latency problems.thinking about getting a seperate card.does that help?

Highest DPC routine execution time (µs): 86,410
Driver with highest DPC routine execution time: ndis.sys


----------



## OCmember

Asutz said:


> using 2 rss queues and set buffer size to 768 but still have latency problems.thinking about getting a seperate card.does that help?
> 
> Highest DPC routine execution time (µs): 86,410
> Driver with highest DPC routine execution time: ndis.sys


What NIC are you using? According to others Realtek has higher dpc latency


----------



## EniGma1987

Asutz said:


> Driver with highest DPC routine execution time: ndis.sys


You sure that is something NIC related and not Nvidia related? Kinda lookks like one of Nvidia's things since they usually start with n


----------



## OCmember

EniGma1987 said:


> You sure that is something NIC related and not Nvidia related? Kinda lookks like one of Nvidia's things since they usually start with n


Network Driver Interface..


----------



## OCmember

@Timecard I think I got the hang of how to use it.


----------



## Timecard

EniGma1987 said:


> You sure that is something NIC related and not Nvidia related?











NDIS Network Interface Architecture - Windows drivers


NDIS Network Interface Architecture



docs.microsoft.com


----------



## Asutz

Onboard Intel(R) I211 Gigabit Network Connection.


----------



## Timecard

Asutz said:


> Onboard Intel(R) I211 Gigabit Network Connection.


I can probably help you isolate cause, pm me.


----------



## OCmember

Timecard said:


> I can probably help you isolate cause, pm me.


I'm also using the same NIC and I'm not getting consistent results across different games e.g. UT4, CS:GO, Rising Storm: Vietnam. Could that likely be due to different game engines, different maps (some maps run better than others), amount of packets? One thing I've noticed is the first game after a setting change is the .ndis.sys results is good then the next few games I get readings of, 0 usecs AND <= 1 usecs, "packet count", or 59%

Another thing I notice is when I drop the MSI limit from 3 to 2, the amount of IRQ amount also drops from 6 to 2


----------

