Commit 2fb635a8 authored by Jukka Rissanen's avatar Jukka Rissanen
Browse files

net: Wakeup TX fiber when packet needs to be sent



This is not mandatory but makes sure that TX fiber is wakeup
as soon as possible to send the actual IP packet.

Change-Id: I48fb8a5e428f67e249ba0ea2c0f14b0d512f148b
Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
parent e2692eba
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ int net_context_tcp_send(struct net_buf *buf);
static char __noinit __stack rx_fiber_stack[CONFIG_IP_RX_STACK_SIZE];
static char __noinit __stack tx_fiber_stack[CONFIG_IP_TX_STACK_SIZE];
static char __noinit __stack timer_fiber_stack[CONFIG_IP_TIMER_STACK_SIZE];
static nano_thread_id_t timer_fiber_id;
static nano_thread_id_t timer_fiber_id, tx_fiber_id;

static struct net_dev {
	/* Queue for incoming packets from driver */
@@ -123,6 +123,9 @@ int net_send(struct net_buf *buf)

	nano_fifo_put(&netdev.tx_queue, buf);

	/* Tell the IP stack it can proceed with the packet */
	fiber_wakeup(tx_fiber_id);

	return 0;
}

@@ -883,8 +886,9 @@ static void init_tx_queue(void)
{
	nano_fifo_init(&netdev.tx_queue);

	fiber_start(tx_fiber_stack, sizeof(tx_fiber_stack),
		    (nano_fiber_entry_t)net_tx_fiber, 0, 0, 7, 0);
	tx_fiber_id = fiber_start(tx_fiber_stack, sizeof(tx_fiber_stack),
				  (nano_fiber_entry_t)net_tx_fiber,
				  0, 0, 7, 0);
}

static void init_timer_fiber(void)