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: Application-managed L2CAP credits #57485

Closed
alwa-nordic opened this issue May 2, 2023 · 1 comment · Fixed by #58155
Closed

Bluetooth: Host: Application-managed L2CAP credits #57485

alwa-nordic opened this issue May 2, 2023 · 1 comment · Fixed by #58155
Assignees
Labels
area: Bluetooth Host area: Bluetooth priority: medium Medium impact/importance bug Regression Something, which was working, does not anymore
Milestone

Comments

@alwa-nordic
Copy link
Collaborator

alwa-nordic commented May 2, 2023

Android ASHA requires an initial credit count of 8. It is not possible to satisfy this requirement in Zephyr after the change in the L2CAP credit fix. This requirement is vital for interoperability with current software1.

Footnotes

  1. The Android implementation does actually not enforce 8 initial credits, but uses the actual received initial credits in a calculation. This calculation does not deal well with just 1 initial credit.

@alwa-nordic alwa-nordic added priority: medium Medium impact/importance bug area: Bluetooth Regression Something, which was working, does not anymore area: Bluetooth Host labels May 2, 2023
@alwa-nordic alwa-nordic added this to the v3.5.0 milestone May 2, 2023
@alwa-nordic alwa-nordic self-assigned this May 2, 2023
@alwa-nordic
Copy link
Collaborator Author

alwa-nordic commented May 2, 2023

To fix this regression, we need to make init_credits significant again. However, init_credits in its current form is an awkward interface because it specifies credits for L2CAP PDUs, but the application provides buffers for SDUs.

The Host could interpret the init_credits field as the number of SDU buffers the application has to give out and manage credits accordingly. Host would keep track of the number of available buffers and give out a credit when a buffer becomes available. This definition of init_credits would be natural for any application that does not have any guarantees from the remote.

But sometimes, the application layer has more information than the Host, and wishes to use credits a specialized fashion. So this is an opportunity define an alternative simplified API for L2CAP that presents the application directly with L2CAP PDUs and allows the application to control the credits explicitly. In the case of ASHA, the specification guarantees that no L2CAP segmentation will occur, so this is perfect. This simplified API would allow applications that have this kind of guarantee to omit compiling in code for L2CAP fragmentation. This API would also benefit applications wish to optimize throughput by making use of some known guarantees or at the cost of reliability.

alwa-nordic added a commit to alwa-nordic/zephyr that referenced this issue May 22, 2023
This is an alternative API for the L2CAP receive functionality. It
allows an application the receive L2CAP segments directly and manage
credits explictly. The API is guarded by an experimental kconfig option.

Fixes: zephyrproject-rtos#57485

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
alwa-nordic added a commit to alwa-nordic/zephyr that referenced this issue May 23, 2023
This is an alternative API for the L2CAP receive functionality. It
allows an application the receive L2CAP segments directly and manage
credits explictly. The API is guarded by an experimental kconfig option.

Fixes: zephyrproject-rtos#57485

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
alwa-nordic added a commit to alwa-nordic/zephyr that referenced this issue May 23, 2023
This is an alternative API for the L2CAP receive functionality. It
allows an application the receive L2CAP segments directly and manage
credits explictly. The API is guarded by an experimental kconfig option.

Fixes: zephyrproject-rtos#57485

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
alwa-nordic added a commit to alwa-nordic/zephyr that referenced this issue May 23, 2023
This is an alternative API for the L2CAP receive functionality. It
allows an application the receive L2CAP segments directly and manage
credits explictly. The API is guarded by an experimental kconfig option.

Fixes: zephyrproject-rtos#57485

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
alwa-nordic added a commit to alwa-nordic/zephyr that referenced this issue May 23, 2023
This is an alternative API for the L2CAP receive functionality. It
allows an application the receive L2CAP segments directly and manage
credits explictly. The API is guarded by an experimental kconfig option.

Fixes: zephyrproject-rtos#57485

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
alwa-nordic added a commit to alwa-nordic/zephyr that referenced this issue May 23, 2023
This is an alternative API for the L2CAP receive functionality. It
allows an application the receive L2CAP segments directly and manage
credits explictly. The API is guarded by an experimental kconfig option.

Fixes: zephyrproject-rtos#57485

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
@alwa-nordic alwa-nordic modified the milestones: v3.5.0, v3.4.0 May 23, 2023
alwa-nordic added a commit to alwa-nordic/zephyr that referenced this issue May 24, 2023
This is an alternative API for the L2CAP receive functionality. It
allows an application the receive L2CAP segments directly and manage
credits explictly. The API is guarded by an experimental kconfig option.

Fixes: zephyrproject-rtos#57485

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
alwa-nordic added a commit to alwa-nordic/zephyr that referenced this issue May 24, 2023
This is an alternative API for the L2CAP receive functionality. It
allows an application the receive L2CAP segments directly and manage
credits explictly. The API is guarded by an experimental kconfig option.

Fixes: zephyrproject-rtos#57485

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
alwa-nordic added a commit to alwa-nordic/zephyr that referenced this issue May 24, 2023
This is an alternative API for the L2CAP receive functionality. It
allows an application the receive L2CAP segments directly and manage
credits explictly. The API is guarded by an experimental kconfig option.

Fixes: zephyrproject-rtos#57485

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
nashif pushed a commit that referenced this issue May 24, 2023
This is an alternative API for the L2CAP receive functionality. It
allows an application the receive L2CAP segments directly and manage
credits explictly. The API is guarded by an experimental kconfig option.

Fixes: #57485

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
coreboot-org-bot pushed a commit to coreboot/zephyr-cros that referenced this issue May 26, 2023
This is an alternative API for the L2CAP receive functionality. It
allows an application the receive L2CAP segments directly and manage
credits explictly. The API is guarded by an experimental kconfig option.

(cherry picked from commit 92fcd9e)

Original-Fixes: zephyrproject-rtos/zephyr#57485
Original-Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
GitOrigin-RevId: 92fcd9e
Change-Id: I25cb29c539c194a638aadb31a6abcd5015b0a723
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/4566174
Commit-Queue: Keith Short <keithshort@chromium.org>
Tested-by: CopyBot Service Account <copybot.service@gmail.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Tested-by: Keith Short <keithshort@chromium.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Host area: Bluetooth priority: medium Medium impact/importance bug Regression Something, which was working, does not anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant