From e4e962c31530e055ca9e34a17337b76f67ef2e9e Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Mon, 13 Feb 2023 15:25:46 +0100 Subject: [PATCH] wifi: Always update queue priority when enqueuing an MPDU --- src/wifi/model/fcfs-wifi-queue-scheduler.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/wifi/model/fcfs-wifi-queue-scheduler.cc b/src/wifi/model/fcfs-wifi-queue-scheduler.cc index 825c5b3e9..ef255f430 100644 --- a/src/wifi/model/fcfs-wifi-queue-scheduler.cc +++ b/src/wifi/model/fcfs-wifi-queue-scheduler.cc @@ -132,15 +132,11 @@ FcfsWifiQueueScheduler::DoNotifyEnqueue(AcIndex ac, Ptr mpdu) const auto queueId = WifiMacQueueContainer::GetQueueId(mpdu); - if (GetWifiMacQueue(ac)->GetNPackets(queueId) > 1) - { - // Enqueue takes place at the tail, while the priority is determined by the - // head of the queue. Therefore, if the queue was not empty before inserting - // this MPDU, priority does not change - return; - } + // priority is determined by the head of the queue + auto item = GetWifiMacQueue(ac)->PeekByQueueId(queueId); + NS_ASSERT(item); - SetPriority(ac, queueId, {mpdu->GetTimestamp(), std::get(queueId)}); + SetPriority(ac, queueId, {item->GetTimestamp(), std::get(queueId)}); } void