wifi: use uint16_t to count MPDUs in A-MPDU

Since IEEE 802.11ax standard increased maximum Block Ack Bitmap length
to 256, and HeConfiguration::MpduBufferSize can be set to value 256,
numbers of MPDUs in block ack manager and rate control should be
stored in uint16_t.

Before this patch, when 256 MPDUs were received in one A-MPDU,
nSuccessfulMpdus counter overflowed and was accounted as 0.
This commit is contained in:
Alexander Krotov
2021-02-17 12:33:30 +03:00
parent c13d30f290
commit 28eb357992
7 changed files with 17 additions and 17 deletions

View File

@@ -456,8 +456,8 @@ BlockAckManager::NotifyGotBlockAck (const CtrlBAckResponseHeader *blockAck, Mac4
if (ExistsAgreementInState (recipient, tid, OriginatorBlockAckAgreement::ESTABLISHED))
{
bool foundFirstLost = false;
uint8_t nSuccessfulMpdus = 0;
uint8_t nFailedMpdus = 0;
uint16_t nSuccessfulMpdus = 0;
uint16_t nFailedMpdus = 0;
AgreementsI it = m_agreements.find (std::make_pair (recipient, tid));
PacketQueueI queueEnd = it->second.second.end ();

View File

@@ -282,10 +282,10 @@ IdealWifiManager::DoReportDataOk (WifiRemoteStation *st, double ackSnr, WifiMode
}
void
IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
IdealWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
{
NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataChannelWidth << +dataNss);
NS_LOG_FUNCTION (this << st << nSuccessfulMpdus << nFailedMpdus << rxSnr << dataSnr << dataChannelWidth << +dataNss);
IdealWifiRemoteStation *station = static_cast<IdealWifiRemoteStation*> (st);
if (dataSnr == 0)
{

View File

@@ -69,7 +69,7 @@ private:
double ctsSnr, WifiMode ctsMode, double rtsSnr);
void DoReportDataOk (WifiRemoteStation *station, double ackSnr, WifiMode ackMode,
double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss);
void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
void DoReportAmpduTxStatus (WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss);
void DoReportFinalRtsFailed (WifiRemoteStation *station);
void DoReportFinalDataFailed (WifiRemoteStation *station);

View File

@@ -632,10 +632,10 @@ MinstrelHtWifiManager::DoReportFinalDataFailed (WifiRemoteStation *st)
}
void
MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
{
NS_LOG_FUNCTION (this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataChannelWidth << +dataNss);
NS_LOG_FUNCTION (this << st << nSuccessfulMpdus << nFailedMpdus << rxSnr << dataSnr << dataChannelWidth << +dataNss);
MinstrelHtWifiRemoteStation *station = static_cast<MinstrelHtWifiRemoteStation*> (st);
CheckInit (station);
@@ -647,7 +647,7 @@ MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSu
NS_ASSERT_MSG (station->m_isHt, "A-MPDU Tx Status called but no HT or VHT supported.");
NS_LOG_DEBUG ("DoReportAmpduTxStatus. TxRate=" << station->m_txrate << " SuccMpdus=" <<
+nSuccessfulMpdus << " FailedMpdus=" << +nFailedMpdus);
nSuccessfulMpdus << " FailedMpdus=" << nFailedMpdus);
station->m_ampduPacketCount++;
station->m_ampduLen += nSuccessfulMpdus + nFailedMpdus;
@@ -793,9 +793,9 @@ MinstrelHtWifiManager::UpdateRetry (MinstrelHtWifiRemoteStation *station)
}
void
MinstrelHtWifiManager::UpdatePacketCounters (MinstrelHtWifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus)
MinstrelHtWifiManager::UpdatePacketCounters (MinstrelHtWifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus)
{
NS_LOG_FUNCTION (this << station << +nSuccessfulMpdus << +nFailedMpdus);
NS_LOG_FUNCTION (this << station << nSuccessfulMpdus << nFailedMpdus);
station->m_totalPacketsCount += nSuccessfulMpdus + nFailedMpdus;
if (station->m_isSampling)

View File

@@ -235,7 +235,7 @@ private:
void DoReportFinalDataFailed (WifiRemoteStation *station);
WifiTxVector DoGetDataTxVector (WifiRemoteStation *station);
WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station);
void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
void DoReportAmpduTxStatus (WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss);
bool DoNeedRetransmission (WifiRemoteStation *st, Ptr<const Packet> packet, bool normally);
@@ -313,7 +313,7 @@ private:
* \param nSuccessfulMpdus the number of successfully received MPDUs
* \param nFailedMpdus the number of failed MPDUs
*/
void UpdatePacketCounters (MinstrelHtWifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus);
void UpdatePacketCounters (MinstrelHtWifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus);
/**
* Getting the next sample from Sample Table.

View File

@@ -896,10 +896,10 @@ WifiRemoteStationManager::ReportRxOk (Mac48Address address, RxSignalInfo rxSigna
void
WifiRemoteStationManager::ReportAmpduTxStatus (Mac48Address address,
uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
double rxSnr, double dataSnr, WifiTxVector dataTxVector)
{
NS_LOG_FUNCTION (this << address << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr << dataTxVector);
NS_LOG_FUNCTION (this << address << SuccessfulMpdus << nFailedMpdus << rxSnr << dataSnr << dataTxVector);
NS_ASSERT (!address.IsGroup ());
for (uint8_t i = 0; i < nFailedMpdus; i++)
{
@@ -1578,7 +1578,7 @@ WifiRemoteStationManager::DoNeedFragmentation (WifiRemoteStation *station,
}
void
WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
WifiRemoteStationManager::DoReportAmpduTxStatus (WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
{
NS_LOG_DEBUG ("DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!");
}

View File

@@ -745,7 +745,7 @@ public:
* \param dataSnr data SNR reported by remote station
* \param dataTxVector the TXVECTOR of the MPDUs we sent
*/
void ReportAmpduTxStatus (Mac48Address address, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
void ReportAmpduTxStatus (Mac48Address address, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
double rxSnr, double dataSnr, WifiTxVector dataTxVector);
/**
@@ -1177,7 +1177,7 @@ private:
* \param dataChannelWidth the channel width (in MHz) of the A-MPDU we sent
* \param dataNss the number of spatial streams used to send the A-MPDU
*/
virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus,
virtual void DoReportAmpduTxStatus (WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus,
double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss);
/**