summaryrefslogtreecommitdiff
path: root/docs/develop
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2021-07-21 17:47:13 +1000
committerDamien George <damien@micropython.org>2021-07-23 21:58:10 +1000
commit341158c251c032fe1116395d60ea69c6dc406898 (patch)
tree2f9066e86153b9d4a3c8c0806e017ca4460b17ad /docs/develop
parentedfb5d56c8392b1c0933abf49e757b90f2c07859 (diff)
extmod/nimble: Add "memory stalling" mechanism for l2cap_send.
When l2cap_send detects that the sys mempool is running low (used to store the outgoing HCI payloads), it will report stalled back to the application, and then only unstall once these HCI payloads have been sent. This prevents a situation where a remote receiver with very large MTU can cause NimBLE to queue up more than MYNEWT_VAL_MSYS_1_BLOCK_COUNT (i.e. 12) payloads, causing further attempts to send to fail with ENOMEM (even though the channel is not stalled and we have room in the channel mbufs). The regular credit/stall flow control is not effective here because the receiver's MTU is large enough that it will not activate (i.e. there are lots of credits available). Thresholds of 1/2 (stall) and 1/4 (unstall) chosen to allow headroom for other payloads (e.g. notifications) and that when a regular stall occurs it might keep sending (and creating more payloads) in the background.
Diffstat (limited to 'docs/develop')
0 files changed, 0 insertions, 0 deletions