Skip to content

Commit 1520516

Browse files
arkqpull[bot]
authored andcommitted
Default MRP_RETRY_INTERVAL_SENDER_BOOST to 0 ms (#27555)
1 parent d628baf commit 1520516

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

src/messaging/ReliableMessageMgr.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,7 @@ System::Clock::Timestamp ReliableMessageMgr::GetBackoff(System::Clock::Timestamp
261261
}
262262
#endif
263263

264-
#ifdef CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST
265264
mrpBackoffTime += CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST;
266-
#endif
267265

268266
return mrpBackoffTime;
269267
}

src/messaging/ReliableMessageProtocolConfig.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,10 @@ namespace chip {
162162
#ifndef CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST
163163
#if CHIP_ENABLE_OPENTHREAD && !CHIP_DEVICE_LAYER_TARGET_LINUX
164164
#define CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST (500_ms)
165+
#else
166+
#define CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST (0_ms)
165167
#endif
166-
#endif // CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST && !CHIP_DEVICE_LAYER_TARGET_LINUX
168+
#endif // CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST
167169

168170
/**
169171
* @brief

src/messaging/tests/TestAbortExchangesForFabric.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,10 @@ void CommonCheckAbortAllButOneExchange(nlTestSuite * inSuite, TestContext & ctx,
206206
// trigger a MRP failure due to timing out waiting for an ACK.
207207
//
208208
auto waitTimeout = System::Clock::Milliseconds32(1000);
209-
#ifdef CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST
210209
// Account for the retry delay booster, so that we do not timeout our IO processing before the
211210
// retransmission failure is triggered.
212211
waitTimeout += CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS * CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST;
213-
#endif
212+
214213
ctx.GetIOContext().DriveIOUntil(waitTimeout, [&]() { return false; });
215214
}
216215
else

src/messaging/tests/TestReliableMessageProtocol.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,13 @@ using TestContext = Test::LoopbackMessagingContext;
5858

5959
const char PAYLOAD[] = "Hello!";
6060

61-
#ifdef CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST
62-
// When the CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST is set, the stack
63-
// operates under the assumption of a high latency network (like Thread),
64-
// so it adds extra delays to avoid spurious retransmits.
61+
// The CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST can be set to non-zero value
62+
// to boost the retransmission timeout for a high latency network like Thread to
63+
// avoid spurious retransmits.
6564
//
6665
// This adds extra I/O time to account for this. See the documentation for
6766
// CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST for more details.
6867
constexpr auto retryBoosterTimeout = CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS * CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST;
69-
#else
70-
constexpr auto retryBoosterTimeout = System::Clock::Milliseconds32(0);
71-
#endif
7268

7369
class MockAppDelegate : public UnsolicitedMessageHandler, public ExchangeDelegate
7470
{

src/protocols/secure_channel/tests/TestPASESession.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ void SecurePairingHandshakeTestCommon(nlTestSuite * inSuite, void * inContext, S
279279

280280
while (delegate.mMessageDropped)
281281
{
282-
chip::test_utils::SleepMillis(100);
282+
// Wait some time so the dropped message will be retransmitted when we drain the IO.
283+
chip::test_utils::SleepMillis((100_ms + CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST).count());
283284
delegate.mMessageDropped = false;
284285
ReliableMessageMgr::Timeout(&ctx.GetSystemLayer(), ctx.GetExchangeManager().GetReliableMessageMgr());
285286
ctx.DrainAndServiceIO();

0 commit comments

Comments
 (0)