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: ISO: Fragmented data test #81871

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Thalley
Copy link
Collaborator

@Thalley Thalley commented Nov 25, 2024

Adds a test of sending SDUs larger than the controller buffers

@Thalley Thalley changed the title Iso fragment test Bluetooth: ISO: Fragmented data test Nov 25, 2024
Comment on lines 100 to 101
} else {
TEST_FAIL("Failed to receive");
Copy link
Contributor

Choose a reason for hiding this comment

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

This new validation may need this fix: 736bf5b

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed it for now :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Please put it back, it will be a good coverage when #80788 is merged.

@Thalley Thalley force-pushed the iso_fragment_test branch 2 times, most recently from 9ca2d5e to 3352d4b Compare November 25, 2024 16:20
@cvinayak
Copy link
Contributor

d_00: @00:00:00.112946  [00:00:00.112,945] <err> bt_ctlr_ull_iso: Tx Buffer Overflow
d_00: @00:00:00.112946  ASSERTION FAIL [0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/controller/ll_sw/ull_iso.c:1824
d_00: @00:00:00.112946  @ WEST_TOPDIR/zephyr/subsys/bluetooth/controller/ll_sw/ull_iso.c:1824
d_00: @00:00:00.112946  [00:00:00.112,945] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
d_00: @00:00:00.112946  [00:00:00.112,945] <err> os: Current thread: 0x81e1800 (unknown)
d_00: @00:00:00.112946  [00:00:00.112,945] <err> os: Halting system

This is due to the below FIXME:

#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) * \
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 */
#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 */

Since the SDUs are now allocated by the application
and the host does not care about the SDU sizes, the check
is useless.

Signed-off-by: Emil Gydesen <[email protected]>
Modify the test to use the controller buffer size as the maximum
SDU size, so per default we can send up to the maximum size
the controller supports. This ensures that the tests will
never do fragmentation over HCI.

This also adds verification of the received data on the
ISO sync receiver.

Signed-off-by: Emil Gydesen <[email protected]>
Add a test for broadcast ISO that uses fragmentation.
The host will attempt to send SDUs 3 times the HCI ISO
data buffer size, so that it will be fragmented into a
BT_ISO_START, BT_ISO_CONT and a BT_ISO_END HCI ISO data
packet.

Signed-off-by: Emil Gydesen <[email protected]>
Enable support for building and running the BIS ISO host test
on the nRF5340bsim board.

The purpose of this is to test the ISO fragmentation on both the
nRF52bsim and nRF5340bsim, as they use different drivers.

Signed-off-by: Emil Gydesen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants