You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "Johan Hedberg (JIRA)" <ji...@apache.org> on 2017/02/14 23:27:41 UTC

[jira] [Commented] (MYNEWT-287) Host Flow Control

    [ https://issues.apache.org/jira/browse/MYNEWT-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15866915#comment-15866915 ] 

Johan Hedberg commented on MYNEWT-287:
--------------------------------------

Sorry to ruin the party, but turns out we do need host flow control after all, at least for something like UART. The problem is that when we stop the RX interrupt we also prevent HCI events such as Number of Completed Packets from getting through. Not processing these events may cause the host to run out of TX buffers (since the host is waiting to send its current queued TX buffers to the controller). If the thread that's waiting to get a TX buffer is the RX thread (e.g. it wants to respond to an ATT request) then we have the recipe for a deadlock: the RX thread is blocked, new RX packets get queued up but never processed, and once out of them the UART RX interrupt is disabled, thus preventing the Number of Completed Packets event from ever coming through and unlocking the RX thread.

So there really needs to be a way of saying "stop ACL data, but let HCI events through", and the RX interrupt (being a global lock) will not work for that.

Currently we don't see this issue with anything else than UART where you have a single pipe that interleaves ACL data and HCI events, however I suppose that's already sufficient to keep this feature implementation task as quite high priority.

> Host Flow Control
> -----------------
>
>                 Key: MYNEWT-287
>                 URL: https://issues.apache.org/jira/browse/MYNEWT-287
>             Project: Mynewt
>          Issue Type: New Feature
>          Components: Nimble
>         Environment: Using nimble from an external host stack
>            Reporter: Johan Hedberg
>            Assignee: Christopher Collins
>             Fix For: v1_1_beta1
>
>
> If the Nimble controller part is connected to an external host stack the host may need to control the flow of ACL packets from the controller to the host. This is particularly important for resource-constrained hosts that have a limited amount of RX ACL data buffers.
> The Bluetooth core specification provides a standard feature to accomplish this called Host Flow Control. (Vol 2, Part E, Section 4.2). To implement this the controller needs to support the "Set Controller To Host Flow Control", "Host Buffer Size" and "Host Number Of Completed Packets" HCI commands.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)