wifi: MAC queues handle MPDU aliases

This commit is contained in:
Stefano Avallone
2022-09-14 14:06:12 +02:00
committed by Stefano Avallone
parent 1f203aab9e
commit 470a6d5bae
2 changed files with 6 additions and 5 deletions

View File

@@ -42,6 +42,7 @@ WifiMacQueueContainer::insert(const_iterator pos, Ptr<WifiMpdu> item)
NS_ABORT_MSG_UNLESS(pos == m_queues[queueId].cend() || GetQueueId(pos->mpdu) == queueId,
"pos iterator does not point to the correct container queue");
NS_ABORT_MSG_IF(!item->IsOriginal(), "Only the original copy of an MPDU can be inserted");
auto [it, ret] = m_nBytesPerQueue.insert({queueId, 0});
it->second += item->GetSize();

View File

@@ -248,7 +248,7 @@ WifiMacQueue::DequeueIfQueued(const std::list<Ptr<const WifiMpdu>>& mpdus)
{
auto it = GetIt(mpdu);
NS_ASSERT(it->ac == m_ac);
NS_ASSERT(it->mpdu == mpdu);
NS_ASSERT(it->mpdu == mpdu->GetOriginal());
iterators.emplace_back(it);
}
}
@@ -374,7 +374,7 @@ WifiMacQueue::Remove(Ptr<const WifiMpdu> mpdu)
NS_ASSERT(mpdu && mpdu->IsQueued());
auto it = GetIt(mpdu);
NS_ASSERT(it->ac == m_ac);
NS_ASSERT(it->mpdu == mpdu);
NS_ASSERT(it->mpdu == mpdu->GetOriginal());
return DoRemove(it);
}
@@ -386,7 +386,7 @@ WifiMacQueue::Replace(Ptr<const WifiMpdu> currentItem, Ptr<WifiMpdu> newItem)
NS_ASSERT(currentItem->IsQueued());
auto currentIt = GetIt(currentItem);
NS_ASSERT(currentIt->ac == m_ac);
NS_ASSERT(currentIt->mpdu == currentItem);
NS_ASSERT(currentIt->mpdu == currentItem->GetOriginal());
NS_ASSERT(!newItem->IsQueued());
Time expiryTime = currentIt->expiryTime;
@@ -425,12 +425,12 @@ WifiMacQueue::DoEnqueue(ConstIterator pos, Ptr<WifiMpdu> item)
}
auto queueId = WifiMacQueueContainer::GetQueueId(item);
if (pos != GetContainer().GetQueue(queueId).cend() && pos->mpdu == mpdu)
if (pos != GetContainer().GetQueue(queueId).cend() && mpdu && pos->mpdu == mpdu->GetOriginal())
{
// the element pointed to by pos must be dropped; update insert position
pos = std::next(pos);
}
if (mpdu != nullptr)
if (mpdu)
{
DoRemove(GetIt(mpdu));
}