-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Bluetooth: Mesh: Introduce separate workq for ADV EXT #78914
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
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 |
|---|---|---|
|
|
@@ -103,6 +103,64 @@ menuconfig BT_MESH_ADV_EXT | |
|
|
||
| if BT_MESH_ADV_EXT | ||
|
|
||
| choice BT_MESH_WORKQ_CONTEXT | ||
alxelax marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| prompt "Advertising thread selection" | ||
| default BT_MESH_WORKQ_MESH | ||
| help | ||
| Defines a context for mesh messages transmission. | ||
|
|
||
| config BT_MESH_WORKQ_MESH | ||
| bool "Mesh-specific workqueue" | ||
| help | ||
| When this option is selected, the mesh sends messages from the | ||
| mesh-specific workqueue. This will ensure that messages are always sent. | ||
| The application needs to ensure the mesh-specific workqueue size is large | ||
| enough. Refer to BT_MESH_ADV_STACK_SIZE for the recommended minimum. | ||
|
|
||
| config BT_MESH_WORKQ_SYS | ||
| bool "System workqueue" | ||
| help | ||
| When this option is selected, the mesh sends messages from | ||
| the system work queue. The application needs to ensure the system | ||
| workqueue stack size (SYSTEM_WORKQUEUE_STACK_SIZE) is large enough, | ||
| refer to BT_MESH_ADV_STACK_SIZE for the recommended minimum. | ||
|
|
||
| When this option is enabled and the mesh tries to send a message, | ||
| and the host ran out the HCI command buffers controlled by | ||
| CONFIG_BT_BUF_CMD_TX_COUNT, the host returns -ENOBUFS immediately | ||
| and the mesh drops the message transmission. To mitigate this | ||
| issue, make sure to have sufficient number of HCI command buffers. | ||
| When this option is enabled, the latency of sending mesh messages | ||
| will be affected by other users on the system work queue, resulting in | ||
| reduced reliability for sending mesh messages. | ||
|
|
||
| endchoice | ||
|
|
||
| if BT_MESH_WORKQ_MESH | ||
|
|
||
| config BT_MESH_ADV_STACK_SIZE | ||
|
||
| int "Mesh extended advertiser thread stack size" | ||
| default 1536 if BT_MESH_PROXY | ||
| default 1024 if BT_HOST_CRYPTO | ||
| default 776 if BT_MESH_PRIV_BEACONS | ||
| default 768 | ||
| help | ||
| Size of bt mesh adv thread stack. | ||
|
|
||
| NOTE: This is an advanced setting and should not be changed unless | ||
| absolutely necessary | ||
|
|
||
| config BT_MESH_ADV_PRIO | ||
| int "Mesh advertiser thread priority" | ||
| default 7 | ||
| help | ||
| Priority of bt mesh adv thread. | ||
|
|
||
| NOTE: This is an advanced setting and should not be changed unless | ||
| absolutely necessary | ||
|
|
||
| endif # BT_MESH_WORKQ_MESH | ||
|
|
||
| config BT_MESH_RELAY_ADV_SETS | ||
| int "Maximum of simultaneous relay message support" | ||
| default 0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -258,3 +258,8 @@ int bt_mesh_adv_gatt_start(const struct bt_le_adv_param *param, int32_t duration | |
| adv_timeout = duration; | ||
| return bt_le_adv_start(param, ad, ad_len, sd, sd_len); | ||
| } | ||
|
|
||
| int bt_mesh_wq_submit(struct k_work *work) | ||
| { | ||
| return k_work_submit(work); | ||
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| CONFIG_BT_MESH_WORKQ_SYS=y |

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.
This seems to imply that this is targeting Zephyr 4.0, however there's no milestone set for this PR and there's also no bug report that this is referencing. You'll need to address both of those if you want this for Zephyr 4.0.
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.
This partially fixes #77241 but I guess we can't use "Partially fixes #...." so probably a new issue should be created. By partially I mean we leave option with sysworkq and that may still not work in certain conditions. Also, ideally, this shouldn't be fixed by a new thread, but currently there is no alternative. So actual fix should included some sort of asynchronous API.