Bluetooth: Introduce separate pool for discardable events

Introduce a separate buffer pool for events which the HCI driver
considers discardable. Examples of such events could be e.g.
Advertising Reports. The benefit of having such a pool means that the
if there is a heavy inflow of such events it will not cause the
allocation for other critical events to block and may even eliminate
deadlocks in some cases.

Also update all mesh samples not to specify explicit RX buffer counts
anymore. Instead, create appropriate defaults in Kconfig so that we
only need to override this in the app for cases like the bbc:microbit
with limited memory.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2019-06-28 12:09:36 +03:00 committed by Johan Hedberg
commit 0d9dab300e
29 changed files with 57 additions and 31 deletions

View file

@ -26,6 +26,7 @@ config BT_HCI_CMD_COUNT
config BT_RX_BUF_COUNT
int "Number of HCI RX buffers"
default 3 if BT_RECV_IS_RX_THREAD
default 20 if (BT_MESH && !BT_DISCARDABLE_BUF_COUNT)
default 10
range 2 255
help
@ -47,6 +48,20 @@ config BT_RX_BUF_LEN
an L2CAP MTU of 65 bytes. On top of this there's the L2CAP header
(4 bytes) and the ACL header (also 4 bytes) which yields 73 bytes.
config BT_DISCARDABLE_BUF_COUNT
int "Number of discardable event buffers"
range 1 255
default 20 if BT_MESH
default 3
depends on BT_H4 || BT_CTLR
help
Number of buffers in a separate buffer pool for events which
the HCI driver considers discardable. Examples of such events
could be e.g. Advertising Reports. The benefit of having such
a pool means that the if there is a heavy inflow of such events
it will not cause the allocation for other critical events to
block and may even eliminate deadlocks in some cases.
config BT_HCI_TX_STACK_SIZE
# NOTE: This value is derived from other symbols and should not be
# user-configurable. Do not give it a prompt.