Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnrc_netif: expose message queue size configurable #11067

Merged
merged 1 commit into from Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions sys/include/net/gnrc/netif/conf.h
Expand Up @@ -46,6 +46,17 @@ extern "C" {
#define GNRC_NETIF_PRIO (THREAD_PRIORITY_MAIN - 5)
#endif

/**
* @brief Message queue size for network interface threads
*
* @attention This has influence on the used stack memory of the thread, so
* the thread's stack size might need to be adapted if this is
* changed.
*/
#ifndef GNRC_NETIF_MSG_QUEUE_SIZE
#define GNRC_NETIF_MSG_QUEUE_SIZE (8U)
#endif

/**
* @brief Number of multicast addresses needed for @ref net_gnrc_rpl "RPL".
*
Expand Down
6 changes: 2 additions & 4 deletions sys/net/gnrc/netif/gnrc_netif.c
Expand Up @@ -38,8 +38,6 @@
#define ENABLE_DEBUG (0)
#include "debug.h"

#define _NETIF_NETAPI_MSG_QUEUE_SIZE (8)

static gnrc_netif_t _netifs[GNRC_NETIF_NUMOF];

static void _update_l2addr_from_dev(gnrc_netif_t *netif);
Expand Down Expand Up @@ -1170,15 +1168,15 @@ static void *_gnrc_netif_thread(void *args)
netdev_t *dev;
int res;
msg_t reply = { .type = GNRC_NETAPI_MSG_TYPE_ACK };
msg_t msg, msg_queue[_NETIF_NETAPI_MSG_QUEUE_SIZE];
msg_t msg, msg_queue[GNRC_NETIF_MSG_QUEUE_SIZE];

DEBUG("gnrc_netif: starting thread %i\n", sched_active_pid);
netif = args;
gnrc_netif_acquire(netif);
dev = netif->dev;
netif->pid = sched_active_pid;
/* setup the link-layer's message queue */
msg_init_queue(msg_queue, _NETIF_NETAPI_MSG_QUEUE_SIZE);
msg_init_queue(msg_queue, GNRC_NETIF_MSG_QUEUE_SIZE);
/* register the event callback with the device driver */
dev->event_callback = _event_cb;
dev->context = netif;
Expand Down