Skip to content

Conversation

sjanc
Copy link
Contributor

@sjanc sjanc commented Oct 7, 2025

This makes userchan transport behavior similar to other HCI transports (eg IPC). Improved logging gives clear overview of what RX events are discarded helping for configuration tuning.

struct net_buf *buf;

do {
buf = bt_buf_get_evt(data[1], discardable, discardable ? K_NO_WAIT : K_SECONDS(10));
Copy link
Member

Choose a reason for hiding this comment

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

10 seconds sounds like a long time. If the event is e.g. a command status/complete you'll trigger an assert in the host since that's how long it waits for HCI commands. I'd make this lower, perhaps just 1 second, and also make it configurable through Kconfig, i.e. a subordinate option depending on the userchan option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

note that this is in loop, so it behaves like K_FORVER anyway

but I can make it shorter (10 seconds was used simply because it is like that in IPC driver)

Copy link
Contributor

@Thalley Thalley left a comment

Choose a reason for hiding this comment

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

A few comments, but no blockers (but would like to get responses on the comments)

@sjanc sjanc force-pushed the user_channel_no_wait branch from 9966fa7 to 6ce7a92 Compare October 7, 2025 08:34
Those flexible arrays allow for easy access to event data.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
@sjanc sjanc force-pushed the user_channel_no_wait branch from 6ce7a92 to f0492fa Compare October 7, 2025 12:56
@zephyrbot zephyrbot added the area: Bluetooth Host Bluetooth Host (excluding BR/EDR) label Oct 7, 2025
@sjanc sjanc force-pushed the user_channel_no_wait branch from f0492fa to 94ef843 Compare October 7, 2025 13:50
uint8_t evt_type = evt_data[0];

switch (evt_type) {
switch (ev->evt) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Was ev chosen to avoid evt->evt? :)

@sjanc sjanc force-pushed the user_channel_no_wait branch from 94ef843 to 74f5d28 Compare October 7, 2025 15:53
Thalley
Thalley previously approved these changes Oct 7, 2025
This makes userchan transport behavior similar to other HCI
transports (eg IPC). Improved logging gives clear overview
of what RX events are discarded helping for configuration
tuning.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Copy link

sonarqubecloud bot commented Oct 7, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth HCI Bluetooth HCI Driver area: Bluetooth Host Bluetooth Host (excluding BR/EDR) area: Bluetooth
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants