Commit fed05a7e authored by Dimitris Lampridis's avatar Dimitris Lampridis Committed by Dimitris Lampridis

sw: Fix loopback NET_TX bug

Fix bug where an event passed to another CPU with NET_TX capability would be mis-routed.
parent e3f785e2
...@@ -34,6 +34,11 @@ static void wrtd_local_output(struct wrtd_event *ev, unsigned ch); ...@@ -34,6 +34,11 @@ static void wrtd_local_output(struct wrtd_event *ev, unsigned ch);
static int wrtd_user_init(void); static int wrtd_user_init(void);
static void wrtd_io(void); static void wrtd_io(void);
/* Forward function declarations. */
#if WRTD_NET_TX > 0
static int wrtd_send_network(struct wrtd_event *ev);
#endif
static struct wrtd_rule rules[NBR_RULES]; static struct wrtd_rule rules[NBR_RULES];
static struct wrtd_alarm alarms[NBR_ALARMS]; static struct wrtd_alarm alarms[NBR_ALARMS];
...@@ -167,7 +172,12 @@ static void wrtd_recv_loopback(void) ...@@ -167,7 +172,12 @@ static void wrtd_recv_loopback(void)
e = &q->buf[q->read_idx]; e = &q->buf[q->read_idx];
wrtd_local_output((struct wrtd_event *)&e->ev, e->ch); #if WRTD_NET_TX > 0
if (e->ch == WRTD_DEST_CH_NET)
wrtd_send_network((struct wrtd_event *)&e->ev);
else
#endif // WRTD_NET_TX
wrtd_local_output((struct wrtd_event *)&e->ev, e->ch);
q->read_idx = (q->read_idx + 1) & (LOOPBACK_QUEUE_SIZE - 1); q->read_idx = (q->read_idx + 1) & (LOOPBACK_QUEUE_SIZE - 1);
smem_atomic_add(&q->count, -1); smem_atomic_add(&q->count, -1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment