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 <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2019-08-09 02:44:56 +02:00 committed by Carles Cufí
commit f6799ff57e
2 changed files with 6 additions and 6 deletions

View file

@ -11,6 +11,7 @@
#define TICKER_USER_ID_THREAD MAYFLY_CALL_ID_PROGRAM
#define EVENT_PIPELINE_MAX 5
#define EVENT_DONE_MAX 3
#define HDR_ULL(p) ((void *)((u8_t *)(p) + sizeof(struct evt_hdr)))
#define HDR_ULL2LLL(p) ((struct lll_hdr *)((u8_t *)(p) + \

View file

@ -128,18 +128,17 @@ static MFIFO_DEFINE(prep, sizeof(struct lll_event), EVENT_PIPELINE_MAX);
* Queue of pointers to struct node_rx_event_done.
* The actual backing behind these pointers is mem_done
*/
static MFIFO_DEFINE(done, sizeof(struct node_rx_event_done *),
EVENT_PIPELINE_MAX);
static MFIFO_DEFINE(done, sizeof(struct node_rx_event_done *), EVENT_DONE_MAX);
/* Backing storage for elements in mfifo_done */
static struct {
void *free;
u8_t pool[sizeof(struct node_rx_event_done) * EVENT_PIPELINE_MAX];
u8_t pool[sizeof(struct node_rx_event_done) * EVENT_DONE_MAX];
} mem_done;
static struct {
void *free;
u8_t pool[sizeof(memq_link_t) * EVENT_PIPELINE_MAX];
u8_t pool[sizeof(memq_link_t) * EVENT_DONE_MAX];
} mem_link_done;
#define PDU_RX_CNT (CONFIG_BT_CTLR_RX_BUFFERS + 3)
@ -1125,10 +1124,10 @@ static inline int init_reset(void)
/* Initialize done pool. */
mem_init(mem_done.pool, sizeof(struct node_rx_event_done),
EVENT_PIPELINE_MAX, &mem_done.free);
EVENT_DONE_MAX, &mem_done.free);
/* Initialize done link pool. */
mem_init(mem_link_done.pool, sizeof(memq_link_t), EVENT_PIPELINE_MAX,
mem_init(mem_link_done.pool, sizeof(memq_link_t), EVENT_DONE_MAX,
&mem_link_done.free);
/* Allocate done buffers */