gnrc_tcp: requested changes

This commit is contained in:
Simon Brummer 2020-07-04 09:19:54 +02:00
parent aa1c2e9cba
commit 67b22d8783
5 changed files with 38 additions and 8 deletions

View File

@ -167,6 +167,24 @@ extern "C" {
#ifndef CONFIG_GNRC_TCP_PROBE_UPPER_BOUND
#define CONFIG_GNRC_TCP_PROBE_UPPER_BOUND (60U * US_PER_SEC)
#endif
/**
* @brief Message queue size for TCP API internal messaging
* @note The number of elements in a message queue must be a power of two.
* This value defines the exponent of 2^n.
*/
#ifndef CONFIG_GNRC_TCP_MSG_QUEUE_SIZE_EXP
#define CONFIG_GNRC_TCP_MSG_QUEUE_SIZE_EXP (2U)
#endif
/**
* @brief Message queue size for the TCP eventloop
* @note The number of elements in a message queue must be a power of two.
* This value defines the exponent of 2^n.
*/
#ifndef CONFIG_GNRC_TCP_EVENTLOOP_MSG_QUEUE_SIZE_EXP
#define CONFIG_GNRC_TCP_EVENTLOOP_MSG_QUEUE_SIZE_EXP (3U)
#endif
/** @} */
#ifdef __cplusplus

View File

@ -112,4 +112,18 @@ config GNRC_TCP_PROBE_UPPER_BOUND
int "Lower bound for the duration between probes in microseconds"
default 60000000
config GNRC_TCP_MSG_QUEUE_SIZE_SIZE_EXP
int "Message queue size for TCP API internal messaging (as exponent of 2^n)"
default 2
help
The number of elements in a message queue must be always a power of two.
This value defines the exponent of 2^n.
config GNRC_TCP_EVENTLOOP_MSG_QUEUE_SIZE_SIZE_EXP
int "Message queue size for the TCP eventloop (as exponent of 2^n)"
default 3
help
The number of elements in a message queue must be always a power of two.
This value defines the exponent of 2^n.
endif # KCONFIG_MODULE_GNRC_TCP

View File

@ -39,6 +39,8 @@
#define ENABLE_DEBUG (0)
#include "debug.h"
#define TCP_MSG_QUEUE_SIZE (1 << CONFIG_GNRC_TCP_MSG_QUEUE_SIZE_EXP)
/**
* @brief Allocate memory for GNRC TCP thread stack.
*/

View File

@ -34,6 +34,8 @@
#define ENABLE_DEBUG (0)
#include "debug.h"
#define TCP_EVENTLOOP_MSG_QUEUE_SIZE (1 << CONFIG_GNRC_TCP_EVENTLOOP_MSG_QUEUE_SIZE_EXP)
static msg_t _eventloop_msg_queue[TCP_EVENTLOOP_MSG_QUEUE_SIZE];
/**

View File

@ -39,11 +39,6 @@ extern "C" {
*/
#define PORT_UNSPEC (0)
/**
* @brief Message queue size for messaging between thread contexts
*/
#define TCP_MSG_QUEUE_SIZE (8U)
/**
* @brief TCB status flags
* @{
@ -57,9 +52,8 @@ extern "C" {
* @brief Defines for "eventloop" thread settings.
* @{
*/
#define TCP_EVENTLOOP_MSG_QUEUE_SIZE (8U)
#define TCP_EVENTLOOP_PRIO (THREAD_PRIORITY_MAIN - 2U)
#define TCP_EVENTLOOP_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
#define TCP_EVENTLOOP_PRIO (THREAD_PRIORITY_MAIN - 2U)
#define TCP_EVENTLOOP_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
/** @} */
/**