net: Allow user to tweak 802.15.4 fibers stack sizes from Kconfig

User is able to tweak the stack sizes of 802.15.4 RX and TX fibers.
These fibers are responsible for receival and transmission of
6LoWPAN 802.15.4 network packets.

Change-Id: I28dea287c1d939333fef0c1ac4eb890295c7bd9e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2016-02-11 12:45:12 +02:00 committed by Gerrit Code Review
commit 4006f47627
2 changed files with 34 additions and 8 deletions

View file

@ -238,6 +238,29 @@ config NETWORKING_WITH_15_4
it into suitable chunks ready to be sent to the 802.15.4
hw driver
config 15_4_RX_STACK_SIZE
int "Stack size of 802.15.4 RX fiber"
depends on NETWORKING_WITH_15_4
default 1024
help
Set the 802.15.4 RX fiber stack size in bytes. The RX fiber
is waiting network packets from 802.15.4 device driver.
It will then run the packet through 6LoWPAN stack which
uncompresses and de-fragments the packet and passes those to
upper layers.
config 15_4_TX_STACK_SIZE
int "Stack size of 802.15.4 TX fiber"
depends on NETWORKING_WITH_15_4
default 4096
help
Set the 802.15.4 TX fiber stack size in bytes. The TX fiber
is waiting network packets from IP stack. It then feeds those
to 6LoWPAN stack which compresses and fragments packets before
passing the fragments to 802.15.4 device driver. Note that
this stack needs to be bigger that TX stack because stack is
used to store the fragmented 802.15.4 packets.
config 15_4_BEACON_SUPPORT
bool
prompt "Enable 802.15.4 beacon support"

View file

@ -43,14 +43,15 @@
* FIXME: stack size needs fine-tuning
*/
#define STACKSIZE_UNIT 1024
static char __noinit __stack rx_fiber_stack[STACKSIZE_UNIT * 1];
#if NET_802154_TX_STACK_SIZE
/* The 802.15.4 loopback test app (test_15_4) needs bigger stack. */
static char __noinit __stack tx_fiber_stack[NET_802154_TX_STACK_SIZE];
#else
static char __noinit __stack tx_fiber_stack[STACKSIZE_UNIT * 4];
#ifndef CONFIG_15_4_RX_STACK_SIZE
#define CONFIG_15_4_RX_STACK_SIZE (STACKSIZE_UNIT * 1)
#endif
#ifndef CONFIG_15_4_TX_STACK_SIZE
#define CONFIG_15_4_TX_STACK_SIZE (STACKSIZE_UNIT * 4)
#endif
static char __noinit __stack rx_fiber_stack[CONFIG_15_4_RX_STACK_SIZE];
static char __noinit __stack tx_fiber_stack[CONFIG_15_4_TX_STACK_SIZE];
/* Queue for incoming packets from hw driver */
static struct nano_fifo rx_queue;
@ -81,7 +82,8 @@ static int net_driver_15_4_send(struct net_buf *buf)
static void net_tx_15_4_fiber(void)
{
NET_DBG("Starting 15.4 TX fiber\n");
NET_DBG("Starting 15.4 TX fiber (stack %d bytes)\n",
sizeof(tx_fiber_stack));
while (1) {
struct net_buf *buf;
@ -116,7 +118,8 @@ static void net_rx_15_4_fiber(void)
int byte_count;
#endif
NET_DBG("Starting 15.4 RX fiber\n");
NET_DBG("Starting 15.4 RX fiber (stack %d bytes)\n",
sizeof(rx_fiber_stack));
while (1) {
/* Wait next packet from 15.4 stack */