Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: Host: Deprecate BT_BUF_ACL_RX_COUNT symbol #81747

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

theob-pro
Copy link
Contributor

@theob-pro theob-pro commented Nov 22, 2024

Because the number of ACL RX buffers must be at least the number of maximum connections plus one, increasing CONFIG_BT_MAX_CONN could inadvertently lead to a build failure if the number of ACL RX buffers is not also increased. This dependency may not be obvious to users.

To address this issue, this commit deprecates the CONFIG_BT_BUF_RX_COUNT Kconfig symbol and computes the value in buf.h using the new BT_BUF_RX_COUNT define.

Additionally, to allow users to increase the number of ACL RX buffers, this commit introduces the new CONFIG_BT_BUF_RX_COUNT_EXTRA Kconfig symbol. The value of this symbol will be added to the computed value of BT_BUF_RX_COUNT.

The configurations of tests and samples have been updated to reflect these changes.

@theob-pro theob-pro changed the title Bluetooth: Host: Deprecate BT_BUF_ACL_RX_COUNT symbol Bluetooth: Host: Deprecate BT_BUF_ACL_RX_COUNT symbol Nov 22, 2024
@theob-pro theob-pro added Enhancement Changes/Updates/Additions to existing features area: Bluetooth Release Notes To be mentioned in the release notes area: Bluetooth Host labels Nov 22, 2024
@theob-pro theob-pro marked this pull request as ready for review November 22, 2024 08:24
@zephyrbot zephyrbot added area: Bluetooth Mesh area: Bluetooth Qualification Bluetooth Qualification -related issues and pull requests area: Bluetooth Classic area: Bluetooth Controller area: Samples Samples area: Bluetooth HCI Bluetooth HCI Driver area: Bluetooth Controller labels Nov 22, 2024
subsys/bluetooth/common/Kconfig Outdated Show resolved Hide resolved
Comment on lines +88 to +89
By default, the number of incoming ACL data buffers is equal to
CONFIG_BT_MAX_CONN + 1.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this +1 because SMP needs an MTU of 69, and Controller sends two HCI ACL Data packets towards Host?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the explanation:

/* The host needs more ACL buffers than maximum ACL links. This is because of
* the way we re-assemble ACL packets into L2CAP PDUs.
*
* We keep around the first buffer (that comes from the driver) to do
* re-assembly into, and if all links are re-assembling, there will be no buffer
* available for the HCI driver to allocate from.
*
* Fixing it properly involves a re-design of the HCI driver interface.

Because the number of ACL RX buffers must be at least the number of
maximum connections plus one, increasing `CONFIG_BT_MAX_CONN` could
inadvertently lead to a build failure if the number of ACL RX buffers is
not also increased. This dependency may not be obvious to users.

To address this issue, this commit deprecates the
`CONFIG_BT_BUF_RX_COUNT` Kconfig symbol and computes the value in
`buf.h` using the new `BT_BUF_RX_COUNT` define. Note that the default
value and the minimum range value have been changed to 0 to "disable"
the option.

Additionally, to allow users to increase the number of ACL RX buffers,
this commit introduces the new `CONFIG_BT_BUF_RX_COUNT_EXTRA` Kconfig
symbol. The value of this symbol will be added to the computed value of
`BT_BUF_RX_COUNT`.

The configurations of tests and samples have been updated to reflect
these changes.

Signed-off-by: Théo Battrel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Classic area: Bluetooth Controller area: Bluetooth Controller area: Bluetooth HCI Bluetooth HCI Driver area: Bluetooth Host area: Bluetooth Mesh area: Bluetooth Qualification Bluetooth Qualification -related issues and pull requests area: Bluetooth area: Samples Samples Enhancement Changes/Updates/Additions to existing features Release Notes To be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants