-
Notifications
You must be signed in to change notification settings - Fork 8k
bluetooth: hci: userchan: Improve RX allocation handling #97091
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
base: main
Are you sure you want to change the base?
Conversation
drivers/bluetooth/hci/userchan.c
Outdated
struct net_buf *buf; | ||
|
||
do { | ||
buf = bt_buf_get_evt(data[1], discardable, discardable ? K_NO_WAIT : K_SECONDS(10)); |
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.
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.
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.
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)
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.
A few comments, but no blockers (but would like to get responses on the comments)
9966fa7
to
6ce7a92
Compare
Those flexible arrays allow for easy access to event data. Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
6ce7a92
to
f0492fa
Compare
f0492fa
to
94ef843
Compare
drivers/bluetooth/hci/userchan.c
Outdated
uint8_t evt_type = evt_data[0]; | ||
|
||
switch (evt_type) { | ||
switch (ev->evt) { |
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.
Was ev
chosen to avoid evt->evt
? :)
94ef843
to
74f5d28
Compare
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>
74f5d28
to
4e2b5ee
Compare
|
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.