Bluetooth: Controller: Maximize BIG event length and preempt PTO & CTRL

Maximize BIG event length to extend upto ISO interval, and
allow PTO and Control subevents to be pre-emptible.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2023-01-31 12:30:49 +05:30 committed by Carles Cufí
parent 87138e7ee3
commit 0f2980db15
2 changed files with 49 additions and 16 deletions

View File

@ -386,6 +386,18 @@ config BT_CTLR_ADV_RESERVE_MAX
corresponding to the Advertising Data present at the time of the
start/enable of Advertising is used.
config BT_CTLR_ADV_ISO_RESERVE_MAX
bool "Use maximum Broadcast ISO event time reservation"
depends on BT_CTLR_ADV_ISO
default y
help
Use maximum Broadcast ISO event time reservation. If disabled, then
time reservation does not include the pre-transmissions of the last
BIS and any Control subevents. This will allow extended or periodic
advertising events to preempt the BIG events but allow higher radio
utilizations by allowing larger BIG events when not overlapping with
extended or periodic advertising.
config BT_CTLR_ADV_AUX_SYNC_OFFSET
int "Pre-defined offset between AUX_ADV_IND and AUX_SYNC_IND"
depends on BT_CTLR_ADV_PERIODIC

View File

@ -282,27 +282,41 @@ uint8_t ll_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
event_spacing = latency_packing + ctrl_spacing +
EVENT_OVERHEAD_START_US + EVENT_OVERHEAD_END_US;
/* Calculate overheads due to extended advertising. */
aux = HDR_LLL2ULL(adv->lll.aux);
ticks_slot_aux = aux->ull.ticks_slot;
if (IS_ENABLED(CONFIG_BT_CTLR_LOW_LAT)) {
ticks_slot_overhead = MAX(aux->ull.ticks_active_to_start,
aux->ull.ticks_prepare_to_start);
/* Check if aux context allocated before we are creating ISO */
if (adv->lll.aux) {
aux = HDR_LLL2ULL(adv->lll.aux);
} else {
ticks_slot_overhead = 0U;
aux = NULL;
}
/* Calculate overheads due to extended advertising. */
if (aux && aux->is_started) {
ticks_slot_aux = aux->ull.ticks_slot;
if (IS_ENABLED(CONFIG_BT_CTLR_LOW_LAT)) {
ticks_slot_overhead = MAX(aux->ull.ticks_active_to_start,
aux->ull.ticks_prepare_to_start);
} else {
ticks_slot_overhead = 0U;
}
ticks_slot_aux += ticks_slot_overhead;
} else {
ticks_slot_aux = 0U;
}
ticks_slot_aux += ticks_slot_overhead;
/* Calculate overheads due to periodic advertising. */
sync = HDR_LLL2ULL(lll_adv_sync);
ticks_slot_sync = sync->ull.ticks_slot;
if (IS_ENABLED(CONFIG_BT_CTLR_LOW_LAT)) {
ticks_slot_overhead = MAX(sync->ull.ticks_active_to_start,
sync->ull.ticks_prepare_to_start);
if (sync->is_started) {
ticks_slot_sync = sync->ull.ticks_slot;
if (IS_ENABLED(CONFIG_BT_CTLR_LOW_LAT)) {
ticks_slot_overhead = MAX(sync->ull.ticks_active_to_start,
sync->ull.ticks_prepare_to_start);
} else {
ticks_slot_overhead = 0U;
}
ticks_slot_sync += ticks_slot_overhead;
} else {
ticks_slot_overhead = 0U;
ticks_slot_sync = 0U;
}
ticks_slot_sync += ticks_slot_overhead;
/* Calculate total overheads due to extended and periodic advertising */
if (CONFIG_BT_CTLR_ADV_AUX_SYNC_OFFSET > 0U) {
@ -1008,8 +1022,15 @@ static uint32_t adv_iso_start(struct ll_adv_iso_set *adv_iso,
EVENT_MSS_US;
ctrl_spacing = PDU_BIS_US(sizeof(struct pdu_big_ctrl), lll_iso->enc,
lll_iso->phy, lll_iso->phy_flags);
slot_us = (pdu_spacing * lll_iso->nse * lll_iso->num_bis) +
ctrl_spacing;
if (IS_ENABLED(CONFIG_BT_CTLR_ADV_ISO_RESERVE_MAX)) {
slot_us = (pdu_spacing * lll_iso->nse * lll_iso->num_bis) +
ctrl_spacing;
} else {
slot_us = pdu_spacing * ((lll_iso->nse * lll_iso->num_bis) -
lll_iso->ptc);
}
slot_us += EVENT_OVERHEAD_START_US + EVENT_OVERHEAD_END_US;
adv_iso->ull.ticks_active_to_start = 0U;