[data-poll-manager] remove code handling NO_BUFS error (#3918)

This commit remove the logic in `DataPollManager` related to handling
the `NO_BUFS` error case when sending a data poll. This logic is no
longer needed since the data poll tx logic is now handled by `Mac`
layer directly and there is no need to allocate/use a `Message` instance
for data poll (which could lead to `NO_BUFs` error situation).
This commit is contained in:
Abtin Keshavarzian
2019-06-18 11:48:44 -07:00
committed by Jonathan Hui
parent 936d4efe93
commit 67f159c5e3
2 changed files with 8 additions and 31 deletions
+2 -23
View File
@@ -56,7 +56,6 @@ DataPollManager::DataPollManager(Instance &aInstance)
, mEnabled(false)
, mAttachMode(false)
, mRetxMode(false)
, mNoBufferRetxMode(false)
, mPollTimeoutCounter(0)
, mPollTxFailureCounter(0)
, mRemainingFastPolls(0)
@@ -82,7 +81,6 @@ void DataPollManager::StopPolling(void)
mTimer.Stop();
mAttachMode = false;
mRetxMode = false;
mNoBufferRetxMode = false;
mPollTimeoutCounter = 0;
mPollTxFailureCounter = 0;
mRemainingFastPolls = 0;
@@ -111,17 +109,7 @@ exit:
{
case OT_ERROR_NONE:
otLogDebgMac("Sending data poll");
if (mNoBufferRetxMode == true)
{
mNoBufferRetxMode = false;
ScheduleNextPoll(kRecalculatePollPeriod);
}
else
{
ScheduleNextPoll(kUsePreviousPollPeriod);
}
ScheduleNextPoll(kUsePreviousPollPeriod);
break;
case OT_ERROR_INVALID_STATE:
@@ -134,9 +122,8 @@ exit:
ScheduleNextPoll(kUsePreviousPollPeriod);
break;
case OT_ERROR_NO_BUFS:
default:
mNoBufferRetxMode = true;
otLogWarnMac("Unexpected error %s requesting data poll", otThreadErrorToString(error));
ScheduleNextPoll(kRecalculatePollPeriod);
break;
}
@@ -440,14 +427,6 @@ uint32_t DataPollManager::CalculatePollPeriod(void) const
}
}
if (mNoBufferRetxMode == true)
{
if ((period == 0) || (period > kNoBufferRetxPollPeriod))
{
period = kNoBufferRetxPollPeriod;
}
}
if (mRemainingFastPolls != 0)
{
if ((period == 0) || (period > kFastPollPeriod))
+6 -8
View File
@@ -219,13 +219,12 @@ public:
private:
enum // Poll period under different conditions (in milliseconds).
{
kAttachDataPollPeriod = OPENTHREAD_CONFIG_ATTACH_DATA_POLL_PERIOD, ///< Poll period during attach.
kRetxPollPeriod = OPENTHREAD_CONFIG_RETX_POLL_PERIOD, ///< Poll retx period due to tx failure.
kNoBufferRetxPollPeriod = 200, ///< Poll retx due to no buffer space.
kFastPollPeriod = 188, ///< Period used for fast polls.
kMinPollPeriod = OPENTHREAD_CONFIG_MINIMUM_POLL_PERIOD, ///< Minimum allowed poll period.
kMaxExternalPeriod = ((1 << 26) - 1), ///< Maximum allowed user-specified period.
///< i.e. (0x3FFFFF)ms, about 18.64 hours.
kAttachDataPollPeriod = OPENTHREAD_CONFIG_ATTACH_DATA_POLL_PERIOD, ///< Poll period during attach.
kRetxPollPeriod = OPENTHREAD_CONFIG_RETX_POLL_PERIOD, ///< Poll retx period due to tx failure.
kFastPollPeriod = 188, ///< Period used for fast polls.
kMinPollPeriod = OPENTHREAD_CONFIG_MINIMUM_POLL_PERIOD, ///< Minimum allowed poll period.
kMaxExternalPeriod = ((1 << 26) - 1), ///< Maximum allowed user-specified period.
///< i.e. (0x3FFFFF)ms, about 18.64 hours.
};
enum
@@ -256,7 +255,6 @@ private:
bool mEnabled : 1; //< Indicates whether data polling is enabled/started.
bool mAttachMode : 1; //< Indicates whether in attach mode (to use attach poll period).
bool mRetxMode : 1; //< Indicates whether last poll tx failed at mac/radio layer (poll retx mode).
bool mNoBufferRetxMode : 1; //< Indicates whether last poll tx failed due to insufficient buffer.
uint8_t mPollTimeoutCounter : 4; //< Poll timeouts counter (0 to `kQuickPollsAfterTimout`).
uint8_t mPollTxFailureCounter : 4; //< Poll tx failure counter (0 to `kMaxPollRetxAttempts`).
uint8_t mRemainingFastPolls : 4; //< Number of remaining fast polls when in transient fast polling mode.