Skip to content
Permalink
Browse files

Bluetooth: controller: Implement low latency ULL processing

Implement a lower ISR latency ULL processing design. Instead
of looping use ISR/mayfly tail-chaining to process
successive ULL messages.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
  • Loading branch information...
cvinayak authored and nashif committed Feb 18, 2019
1 parent 34f6d08 commit 23269d989135593f6589ca1b387b67004a7f4662
Showing with 38 additions and 4 deletions.
  1. +9 −0 subsys/bluetooth/controller/Kconfig
  2. +29 −4 subsys/bluetooth/controller/ll_sw/ull.c
@@ -513,6 +513,15 @@ config BT_CTLR_LOW_LAT
Consequently, this reduces on-air radio utilization due to redundant
radio state switches.

config BT_CTLR_LOW_LAT_ULL
prompt "Low latency ULL"
bool
depends on BT_CTLR_LOW_LAT
default y
help
Low latency ULL implementation that uses tailchaining instead of while
loop to demux rx messages from LLL.

endif # BT_LL_SW_SPLIT

config BT_CTLR_RADIO_ENABLE_FAST
@@ -1275,7 +1275,9 @@ static inline void rx_demux_conn_tx_ack(u8_t ack_last, u16_t handle,
memq_link_t *link,
struct node_tx *node_tx)
{
#if !defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
do {
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */
/* Dequeue node */
lll_conn_ack_dequeue();

@@ -1308,18 +1310,27 @@ static inline void rx_demux_conn_tx_ack(u8_t ack_last, u16_t handle,
}

link = lll_conn_ack_by_last_peek(ack_last, &handle, &node_tx);

#if defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
if (!link)
#else /* CONFIG_BT_CTLR_LOW_LAT_ULL */
} while (link);
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */

/* trigger thread to call ll_rx_get() */
ll_rx_sched();
{
/* trigger thread to call ll_rx_get() */
ll_rx_sched();
}
}
#endif /* CONFIG_BT_CONN */

static void rx_demux(void *param)
{
memq_link_t *link;

#if !defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
do {
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */
struct node_rx_hdr *rx;

link = memq_peek(memq_ull_rx.head, memq_ull_rx.tail,
@@ -1341,14 +1352,20 @@ static void rx_demux(void *param)
rx_demux_conn_tx_ack(rx->ack_last, handle,
link_tx, node_tx);
} else
#endif
#endif /* CONFIG_BT_CONN */
{
nack = rx_demux_rx(link, rx);
}

#if defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
if (!nack) {
ull_rx_sched();
}
#else /* !CONFIG_BT_CTLR_LOW_LAT_ULL */
if (nack) {
break;
}
#endif /* !CONFIG_BT_CTLR_LOW_LAT_ULL */

#if defined(CONFIG_BT_CONN)
} else {
@@ -1360,10 +1377,18 @@ static void rx_demux(void *param)
if (link) {
rx_demux_conn_tx_ack(ack_last, handle,
link, node_tx);

#if defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
ull_rx_sched();
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */

}
#endif
#endif /* CONFIG_BT_CONN */
}

#if !defined(CONFIG_BT_CTLR_LOW_LAT_ULL)
} while (link);
#endif /* CONFIG_BT_CTLR_LOW_LAT_ULL */
}

/**

0 comments on commit 23269d9

Please sign in to comment.
You can’t perform that action at this time.