Skip to content

Conversation

@jori-nordic
Copy link
Contributor

Trigger the TX processor on connection teardown.

When a disconnection happens before the controller has acknowledged some
ACL fragments the host has sent, we run `process_unack_tx()` to free
those unacknowledged buffers and their associated TX contexts.

The problem is that the TX processor still holds a reference to the conn
object. That reference is not released until the TX processor is
triggered again and figures out that the connection is invalid.

Fixes #76951

@zephyrbot zephyrbot added area: Bluetooth area: Bluetooth Host Bluetooth Host (excluding BR/EDR) platform: nRF BSIM Nordic Semiconductors, nRF BabbleSim labels Aug 14, 2024
@aescolar aescolar assigned jhedberg and unassigned aescolar Aug 14, 2024
fabiobaltieri
fabiobaltieri previously approved these changes Aug 14, 2024
Copy link
Member

@fabiobaltieri fabiobaltieri left a comment

Choose a reason for hiding this comment

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

Thanks!

@jhedberg
Copy link
Member

@jori-nordic does this need backporting to 3.7.1?

@fabiobaltieri
Copy link
Member

@jori-nordic does this need backporting to 3.7.1?

The regression was introduced during the 3.7 stabilization I'd say it does.

@fabiobaltieri fabiobaltieri added the backport v3.7-branch Request backport to the v3.7-branch label Aug 14, 2024
jhedberg
jhedberg previously approved these changes Aug 14, 2024
Thalley
Thalley previously approved these changes Aug 14, 2024
@jori-nordic jori-nordic added this to the v3.7.1 milestone Aug 14, 2024
@fabiobaltieri
Copy link
Member

@jori-nordic this needs a rebase now

fabiobaltieri
fabiobaltieri previously approved these changes Aug 16, 2024
@jhedberg
Copy link
Member

What's the babblesim CI test failure?

/__w/zephyr/zephyr/tests/bsim/sh_common.source: line 16: /__w/zephyr/zephyr/tests/bsim/bluetooth/host/misc/acl_tx_frag/compile.sh: No such file or directory

@jori-nordic
Copy link
Contributor Author

alwa changed the hierarchy of compile.sh. I'll move it in 2sec.

Verifies that we don't leak connection references when the peer goes out
of range whilst we are fragmenting and sending data to the controller.

Signed-off-by: Jonathan Rico <[email protected]>
Trigger the TX processor on connection teardown.

When a disconnection happens before the controller has acknowledged some
ACL fragments the host has sent, we run `process_unack_tx()` to free
those unacknowledged buffers and their associated TX contexts.

The problem is that the TX processor still holds a reference to the conn
object. That reference is not released until the TX processor is
triggered again and figures out that the connection is invalid.

Signed-off-by: Jonathan Rico <[email protected]>
@fabiobaltieri fabiobaltieri merged commit 80a92f5 into zephyrproject-rtos:main Aug 16, 2024
Execute "${test_exe}" -v=${verbosity_level} -s=${simulation_id} -d=0 -rs=420 -testid=dut \
-argstest log_level 3
Execute "${test_exe}" -v=${verbosity_level} -s=${simulation_id} -d=1 -rs=69 -testid=peer \
-argstest log_level 3 >/dev/null
Copy link
Member

Choose a reason for hiding this comment

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

>/dev/null

was this left due to an oversight? (note you should be able to set the verbosity to 0 and get nothing but warnings out of a device)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oversight at first, but then realized logs from the other device are not useful. So I left it there.
I'll use the -v switch next time, sorry.

Copy link
Member

Choose a reason for hiding this comment

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

nothing to be sorry about

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth backport v3.7-branch Request backport to the v3.7-branch platform: nRF BSIM Nordic Semiconductors, nRF BabbleSim

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bluetooth unbalanced connection references on unexpected disconnect

6 participants