Skip to content

Commit

Permalink
Bluetooth: controller: split: Reduce event done queue size
Browse files Browse the repository at this point in the history
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 11, 2019
1 parent e8b776a commit f6799ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions subsys/bluetooth/controller/ll_sw/lll.h
Expand Up @@ -11,6 +11,7 @@
#define TICKER_USER_ID_THREAD MAYFLY_CALL_ID_PROGRAM #define TICKER_USER_ID_THREAD MAYFLY_CALL_ID_PROGRAM


#define EVENT_PIPELINE_MAX 5 #define EVENT_PIPELINE_MAX 5
#define EVENT_DONE_MAX 3


#define HDR_ULL(p) ((void *)((u8_t *)(p) + sizeof(struct evt_hdr))) #define HDR_ULL(p) ((void *)((u8_t *)(p) + sizeof(struct evt_hdr)))
#define HDR_ULL2LLL(p) ((struct lll_hdr *)((u8_t *)(p) + \ #define HDR_ULL2LLL(p) ((struct lll_hdr *)((u8_t *)(p) + \
Expand Down
11 changes: 5 additions & 6 deletions subsys/bluetooth/controller/ll_sw/ull.c
Expand Up @@ -128,18 +128,17 @@ static MFIFO_DEFINE(prep, sizeof(struct lll_event), EVENT_PIPELINE_MAX);
* Queue of pointers to struct node_rx_event_done. * Queue of pointers to struct node_rx_event_done.
* The actual backing behind these pointers is mem_done * The actual backing behind these pointers is mem_done
*/ */
static MFIFO_DEFINE(done, sizeof(struct node_rx_event_done *), static MFIFO_DEFINE(done, sizeof(struct node_rx_event_done *), EVENT_DONE_MAX);
EVENT_PIPELINE_MAX);


/* Backing storage for elements in mfifo_done */ /* Backing storage for elements in mfifo_done */
static struct { static struct {
void *free; 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; } mem_done;


static struct { static struct {
void *free; 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; } mem_link_done;


#define PDU_RX_CNT (CONFIG_BT_CTLR_RX_BUFFERS + 3) #define PDU_RX_CNT (CONFIG_BT_CTLR_RX_BUFFERS + 3)
Expand Down Expand Up @@ -1125,10 +1124,10 @@ static inline int init_reset(void)


/* Initialize done pool. */ /* Initialize done pool. */
mem_init(mem_done.pool, sizeof(struct node_rx_event_done), 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. */ /* 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); &mem_link_done.free);


/* Allocate done buffers */ /* Allocate done buffers */
Expand Down

0 comments on commit f6799ff

Please sign in to comment.