Skip to content

Commit 5dd9dfe

Browse files
committed
bluetooth: host: add kconfig for synchronous buffer count
- adding kconfig for HCI synchronous cmds, or events responsble to manage host-controller credits to avoid discard complete event due to unavailability of synchronous buffer. - Issue was present while working with usecases like Broadcast-BAP where more than 1 stream (SDU per BIS) sent to controller over HCI and controller sends NOCP events for both streams at the end of BIG sync anchor. The gap between two consecutive events in same BIG is within few usec range causes HCI driver to drop successive event while processing current and if not freed. Signed-off-by: Nirav Agrawal <nirav.agrawal@nxp.com>
1 parent 322da1d commit 5dd9dfe

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

subsys/bluetooth/common/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,19 @@ config BT_BUF_EVT_DISCARDABLE_COUNT
172172
it will not cause the allocation for other critical events to
173173
block and may even eliminate deadlocks in some cases.
174174

175+
config BT_BUF_EVT_SYNCHRONOUS_COUNT
176+
int "Number of synchronous HCI Event buffers"
177+
range 1 $(UINT8_MAX)
178+
# number of buffer require for bap-broadcast BIS counts
179+
default BT_BAP_BROADCAST_SRC_STREAM_COUNT if BT_BAP_BROADCAST_SOURCE
180+
default 1
181+
help
182+
Number of buffers in a separate pool for events which the HCI
183+
stack depedent to manage it's command buffer queue, host to
184+
controller buffer credits etc. The events command_complete,
185+
number of command processed(nocp) etc considered under this
186+
event pool and processed on priority.
187+
175188
config BT_BUF_CMD_TX_SIZE
176189
int "Maximum support HCI Command buffer length"
177190
default $(UINT8_MAX) if (BT_EXT_ADV || BT_CLASSIC || BT_ISO_CENTRAL || BT_CHANNEL_SOUNDING)

subsys/bluetooth/host/buf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static void iso_rx_freed_cb(void)
6464
* the HCI transport to fill buffers in parallel with `bt_recv`
6565
* consuming them.
6666
*/
67-
NET_BUF_POOL_FIXED_DEFINE(sync_evt_pool, 1, SYNC_EVT_SIZE, 0, NULL);
67+
NET_BUF_POOL_FIXED_DEFINE(sync_evt_pool, CONFIG_BT_BUF_EVT_SYNCHRONOUS_COUNT, SYNC_EVT_SIZE, 0, NULL);
6868

6969
NET_BUF_POOL_FIXED_DEFINE(discardable_pool, CONFIG_BT_BUF_EVT_DISCARDABLE_COUNT,
7070
BT_BUF_EVT_SIZE(CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE),

0 commit comments

Comments
 (0)