Home › Forums › Discussions › General › OID_GEN_TRANSMIT_QUEUE_LENGTH
- This topic has 5 replies, 3 voices, and was last updated 3 years, 9 months ago by mikebromwich.
-
AuthorPosts
-
February 4, 2021 at 10:40 am #11471
Hi
I’m evaluating the driver for use in a network gateway – and successfully passing traffic in excess of 1Gbit/s. However, if I generate traffic too quickly – then the kernel memory usage grows quickly and then runs-out – causing a fatal error.
I would like to control the rate at which data is sent according to the throughput available, so I am querying OID_GEN_TRANSMIT_QUEUE_LENGTH using NdisrdRequest. This always succeeds (returns true) but always returns zero as the queue length. Is this expected? Or is there another way to monitor the transmit queue within the driver/card?
Thanks
February 4, 2021 at 12:01 pm #11474Hi,
Well, OID_GEN_TRANSMIT_QUEUE_LENGTH is an optional, so you are not guaranteed to receive anything useful.
I had not tried to overflow the network card, but I think you could limit your packet sending rate according the card transmit speed. Anyway, faulting the system at high rates looks confusing, I would rather expect card to drop packets if the rate exceeds its capabilities.
Regards,
VadimFebruary 4, 2021 at 12:08 pm #11475Thanks for your reply Vadim.
The issue is that the Pool Nonpaged Bytes reduces as traffic increases – and when it reaches zero, the program fails.
If I stop sending, then the Pool Nonpaged Bytes slowly reduces to normal levels as the packets I have sent to the driver are sent to the network.
I was wondering whether there was any way to read the length of this queue, in a similar way as GetAdapterPacketQueueSize for reading the queue for packets queued in the other direction.
Generally, the driver is working very well – great work.
Mike
February 6, 2021 at 5:08 am #11476I think you could try to monitor non paged pool usage via ZwQuerySystemInformation with SystemPerformanceInformation class. Although SYSTEM_PERFORMANCE_INFORMATION is not officially documented but I don’t think that in Windows 10 it is very different (if different at all) from the one below (I think this definition is from times of NT 4.0/2000/XP):
typedef struct _SYSTEM_PERFORMANCE_INFORMATION { LARGE_INTEGER IdleProcessTime; LARGE_INTEGER IoReadTransferCount; LARGE_INTEGER IoWriteTransferCount; LARGE_INTEGER IoOtherTransferCount; ULONG IoReadOperationCount; ULONG IoWriteOperationCount; ULONG IoOtherOperationCount; ULONG AvailablePages; ULONG CommittedPages; ULONG CommitLimit; ULONG PeakCommitment; ULONG PageFaultCount; ULONG CopyOnWriteCount; ULONG TransitionCount; ULONG CacheTransitionCount; ULONG DemandZeroCount; ULONG PageReadCount; ULONG PageReadIoCount; ULONG CacheReadCount; ULONG CacheIoCount; ULONG DirtyPagesWriteCount; ULONG DirtyWriteIoCount; ULONG MappedPagesWriteCount; ULONG MappedWriteIoCount; ULONG PagedPoolPages; ULONG NonPagedPoolPages; ULONG PagedPoolAllocs; ULONG PagedPoolFrees; ULONG NonPagedPoolAllocs; ULONG NonPagedPoolFrees; ULONG FreeSystemPtes; ULONG ResidentSystemCodePage; ULONG TotalSystemDriverPages; ULONG TotalSystemCodePages; ULONG NonPagedPoolLookasideHits; ULONG PagedPoolLookasideHits; ULONG Spare3Count; ULONG ResidentSystemCachePage; ULONG ResidentPagedPoolPage; ULONG ResidentSystemDriverPage; ULONG CcFastReadNoWait; ULONG CcFastReadWait; ULONG CcFastReadResourceMiss; ULONG CcFastReadNotPossible; ULONG CcFastMdlReadNoWait; ULONG CcFastMdlReadWait; ULONG CcFastMdlReadResourceMiss; ULONG CcFastMdlReadNotPossible; ULONG CcMapDataNoWait; ULONG CcMapDataWait; ULONG CcMapDataNoWaitMiss; ULONG CcMapDataWaitMiss; ULONG CcPinMappedDataCount; ULONG CcPinReadNoWait; ULONG CcPinReadWait; ULONG CcPinReadNoWaitMiss; ULONG CcPinReadWaitMiss; ULONG CcCopyReadNoWait; ULONG CcCopyReadWait; ULONG CcCopyReadNoWaitMiss; ULONG CcCopyReadWaitMiss; ULONG CcMdlReadNoWait; ULONG CcMdlReadWait; ULONG CcMdlReadNoWaitMiss; ULONG CcMdlReadWaitMiss; ULONG CcReadAheadIos; ULONG CcLazyWriteIos; ULONG CcLazyWritePages; ULONG CcDataFlushes; ULONG CcDataPages; ULONG ContextSwitches; ULONG FirstLevelTbFills; ULONG SecondLevelTbFills; ULONG SystemCalls; } SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION;
February 6, 2021 at 5:15 am #11477Here you can find SYSTEM_PERFORMANCE_INFORMATION for Windows 8 and later.
February 8, 2021 at 2:43 am #11478Thanks you for the advice – I’ll have a look into ZwQuerySystemInformation.
In the mean time, I have taken your advice and queried the speed of the interface (using OID_GEN_LINK_STATE Oid) – and created a rate limiter. This has solved the problem and allowed me to progress.
Thanks,
-
AuthorPosts
- You must be logged in to reply to this topic.