Skip to content

Commit

Permalink
Merge pull request #11067 from miri64/gnrc_netif/enh/msg-size-config
Browse files Browse the repository at this point in the history
gnrc_netif: expose message queue size configurable
  • Loading branch information
kaspar030 committed Feb 26, 2019
2 parents a1fcafa + 13030d5 commit 16e4722
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
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

0 comments on commit 16e4722

Please sign in to comment.