[message] document buffer size needs (#7998)

With changes in #7554 the `Metadata` stuct size in `Message` increased,
leading to unsufficient message buffer size when the maximum number
of children is configured, due to the variable size of `ChildMask`.

Furthermore, enabling CoAP Blockwise option also extends the message
buffer size requirements.

This commit documents those cases and makes it clearer
for users how to overcome the possible building issues.
This commit is contained in:
Eduardo Montoya
2022-08-08 11:06:59 -07:00
committed by GitHub
parent 0b41ae0a30
commit 5700f90590
3 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -951,7 +951,7 @@ private:
const HelpData &GetHelpData(void) const
{
static_assert(sizeof(HelpData) + kHelpDataAlignment <= kHeadBufferDataSize,
"Insufficient buffer size for CoAP processing!");
"Insufficient buffer size for CoAP processing! Increase OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE.");
return *static_cast<const HelpData *>(OT_ALIGN(GetFirstData(), kHelpDataAlignment));
}
+2 -1
View File
@@ -252,7 +252,8 @@ private:
} mBuffer;
};
static_assert(sizeof(Buffer) >= kBufferSize, "Buffer size if not valid");
static_assert(sizeof(Buffer) >= kBufferSize,
"Buffer size is not valid. Increase OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE.");
/**
* This class represents a message.
+3
View File
@@ -181,6 +181,9 @@
* to that on 32bit system. As a result, the first message always have some
* bytes left for small packets.
*
* Some configuration options can increase the buffer size requirments, including
* OPENTHREAD_CONFIG_MLE_MAX_CHILDREN and OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE.
*
*/
#ifndef OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE
#define OPENTHREAD_CONFIG_MESSAGE_BUFFER_SIZE (sizeof(void *) * 32)