Skip to content

Commit f6799ff

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: controller: split: Reduce event done queue size
Reduce the maximum number of pending event done elements by decoupling it from the maximum pipeline elements. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent e8b776a commit f6799ff

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

subsys/bluetooth/controller/ll_sw/lll.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define TICKER_USER_ID_THREAD MAYFLY_CALL_ID_PROGRAM
1212

1313
#define EVENT_PIPELINE_MAX 5
14+
#define EVENT_DONE_MAX 3
1415

1516
#define HDR_ULL(p) ((void *)((u8_t *)(p) + sizeof(struct evt_hdr)))
1617
#define HDR_ULL2LLL(p) ((struct lll_hdr *)((u8_t *)(p) + \

subsys/bluetooth/controller/ll_sw/ull.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,17 @@ static MFIFO_DEFINE(prep, sizeof(struct lll_event), EVENT_PIPELINE_MAX);
128128
* Queue of pointers to struct node_rx_event_done.
129129
* The actual backing behind these pointers is mem_done
130130
*/
131-
static MFIFO_DEFINE(done, sizeof(struct node_rx_event_done *),
132-
EVENT_PIPELINE_MAX);
131+
static MFIFO_DEFINE(done, sizeof(struct node_rx_event_done *), EVENT_DONE_MAX);
133132

134133
/* Backing storage for elements in mfifo_done */
135134
static struct {
136135
void *free;
137-
u8_t pool[sizeof(struct node_rx_event_done) * EVENT_PIPELINE_MAX];
136+
u8_t pool[sizeof(struct node_rx_event_done) * EVENT_DONE_MAX];
138137
} mem_done;
139138

140139
static struct {
141140
void *free;
142-
u8_t pool[sizeof(memq_link_t) * EVENT_PIPELINE_MAX];
141+
u8_t pool[sizeof(memq_link_t) * EVENT_DONE_MAX];
143142
} mem_link_done;
144143

145144
#define PDU_RX_CNT (CONFIG_BT_CTLR_RX_BUFFERS + 3)
@@ -1125,10 +1124,10 @@ static inline int init_reset(void)
11251124

11261125
/* Initialize done pool. */
11271126
mem_init(mem_done.pool, sizeof(struct node_rx_event_done),
1128-
EVENT_PIPELINE_MAX, &mem_done.free);
1127+
EVENT_DONE_MAX, &mem_done.free);
11291128

11301129
/* Initialize done link pool. */
1131-
mem_init(mem_link_done.pool, sizeof(memq_link_t), EVENT_PIPELINE_MAX,
1130+
mem_init(mem_link_done.pool, sizeof(memq_link_t), EVENT_DONE_MAX,
11321131
&mem_link_done.free);
11331132

11341133
/* Allocate done buffers */

0 commit comments

Comments
 (0)