From 3289af416225d5c2ab9b92cd05069038f07dddcc Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Thu, 22 Feb 2024 10:45:08 +0300 Subject: [PATCH] Driver: Shaper: Tweak limit processing --- src/driver/fortpkt.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/driver/fortpkt.c b/src/driver/fortpkt.c index f74e71a4..2514a7ae 100644 --- a/src/driver/fortpkt.c +++ b/src/driver/fortpkt.c @@ -583,12 +583,6 @@ inline static void fort_shaper_queue_advance_available( const LARGE_INTEGER last_tick = queue->last_tick; queue->last_tick = now; - if (fort_shaper_packet_list_is_empty(&queue->bandwidth_list) - && queue->available_bytes > FORT_QUEUE_INITIAL_TOKEN_COUNT) { - queue->available_bytes = FORT_QUEUE_INITIAL_TOKEN_COUNT; - return; - } - const UINT64 bps = queue->limit.bps; /* Advance the available bytes */ @@ -597,7 +591,7 @@ inline static void fort_shaper_queue_advance_available( queue->available_bytes += accumulated; - const UINT64 max_available = bps * 2; + const UINT64 max_available = bps; if (queue->available_bytes > max_available) { queue->available_bytes = max_available; } @@ -1081,8 +1075,8 @@ inline static NTSTATUS fort_shaper_packet_queue( } pkt->flow = flow; - pkt->latency_start = KeQueryPerformanceCounter(NULL); pkt->data_length = data_length; + pkt->latency_start = KeQueryPerformanceCounter(NULL); /* Add the Packet to Queue */ fort_shaper_packet_queue_add_packet(shaper, queue, pkt, queue_bit);