-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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: Controller: Fix ISO Tx PDU buffer counts for fragmentation #82026
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,19 +4,31 @@ | |
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#if defined(CONFIG_BT_CTLR_ADV_ISO) || defined(CONFIG_BT_CTLR_CONN_ISO) | ||
/* Calculate ISO PDU buffers required considering SDU fragmentation */ | ||
/* FIXME: Calculation considering both Connected and Broadcast ISO PDU | ||
* fragmentation. | ||
*/ | ||
#if defined(CONFIG_BT_CTLR_CONN_ISO) | ||
#define BT_CTLR_ISO_TX_BUFFERS (((CONFIG_BT_CTLR_CONN_ISO_SDU_LEN_MAX + \ | ||
CONFIG_BT_CTLR_CONN_ISO_PDU_LEN_MAX - 1U) / \ | ||
CONFIG_BT_CTLR_CONN_ISO_PDU_LEN_MAX) * \ | ||
#if defined(CONFIG_BT_CTLR_ADV_ISO) || defined(CONFIG_BT_CTLR_CONN_ISO) | ||
#define BT_CTLR_ISO_SDU_LEN_MAX ((CONFIG_BT_CTLR_ISO_TX_BUFFER_SIZE * \ | ||
CONFIG_BT_CTLR_ISO_TX_BUFFERS) - \ | ||
BT_HCI_ISO_SDU_HDR_SIZE) | ||
#if defined(CONFIG_BT_CTLR_ADV_ISO) && defined(CONFIG_BT_CTLR_CONN_ISO) | ||
#define BT_CTLR_ISO_TX_BUFFERS (DIV_ROUND_UP(BT_CTLR_ISO_SDU_LEN_MAX, \ | ||
MIN((CONFIG_BT_CTLR_ISO_TX_BUFFER_SIZE - \ | ||
BT_HCI_ISO_SDU_TS_HDR_SIZE), \ | ||
MIN(CONFIG_BT_CTLR_ADV_ISO_PDU_LEN_MAX, \ | ||
CONFIG_BT_CTLR_CONN_ISO_PDU_LEN_MAX))) * \ | ||
CONFIG_BT_CTLR_ISO_TX_BUFFERS) | ||
#elif defined(CONFIG_BT_CTLR_ADV_ISO) | ||
#define BT_CTLR_ISO_TX_BUFFERS (DIV_ROUND_UP(BT_CTLR_ISO_SDU_LEN_MAX, \ | ||
MIN((CONFIG_BT_CTLR_ISO_TX_BUFFER_SIZE - \ | ||
BT_HCI_ISO_SDU_TS_HDR_SIZE), \ | ||
CONFIG_BT_CTLR_ADV_ISO_PDU_LEN_MAX)) * \ | ||
CONFIG_BT_CTLR_ISO_TX_BUFFERS) | ||
#else /* CONFIG_BT_CTLR_CONN_ISO */ | ||
#define BT_CTLR_ISO_TX_BUFFERS (DIV_ROUND_UP(BT_CTLR_ISO_SDU_LEN_MAX, \ | ||
MIN((CONFIG_BT_CTLR_ISO_TX_BUFFER_SIZE - \ | ||
BT_HCI_ISO_SDU_TS_HDR_SIZE), \ | ||
CONFIG_BT_CTLR_CONN_ISO_PDU_LEN_MAX)) * \ | ||
CONFIG_BT_CTLR_ISO_TX_BUFFERS) | ||
#else /* !CONFIG_BT_CTLR_CONN_ISO */ | ||
#define BT_CTLR_ISO_TX_BUFFERS CONFIG_BT_CTLR_ISO_TX_BUFFERS | ||
#endif /* !CONFIG_BT_CTLR_CONN_ISO */ | ||
#endif /* CONFIG_BT_CTLR_CONN_ISO */ | ||
Check notice on line 31 in subsys/bluetooth/controller/ll_sw/ull_iso_internal.h GitHub Actions / Run compliance checks on patch series (PR)You may want to run clang-format on this change
|
||
Comment on lines
+8
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's gotta be better way than this :D I don't have one on hand right now, but still... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree. And this is not feasible either, the RAM usage is too high (see CI failures) and need to limit the calculated tx buffer counts. |
||
#else /* !CONFIG_BT_CTLR_ADV_ISO && !CONFIG_BT_CTLR_CONN_ISO */ | ||
#define BT_CTLR_ISO_TX_BUFFERS 0 | ||
#endif /* !CONFIG_BT_CTLR_ADV_ISO && !CONFIG_BT_CTLR_CONN_ISO */ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to go through the deprecation process for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ISO is experimental upstream. And not sure if any downstream implementation use this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we would
select EXPERIMENTAL
for all experiment controller Kconfigs as well then