Skip to content
Permalink
Browse files

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>
  • Loading branch information...
cvinayak authored and carlescufi committed Aug 9, 2019
1 parent e8b776a commit f6799ff57eca2f59fad13d2164d37f420f2511a9
Showing with 6 additions and 6 deletions.
  1. +1 −0 subsys/bluetooth/controller/ll_sw/lll.h
  2. +5 −6 subsys/bluetooth/controller/ll_sw/ull.c
@@ -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) + \
@@ -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 */

0 comments on commit f6799ff

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