Fix bug where bluetooth-meshd stops sending
cover Fix bug where bluetooth-meshd stops sending
This patch fixes a bug where bluetooth-meshd may stop invoking the tx worker thread and hence stop broadcasting, accumulating all packets in its tx_pkts queue instead.
Updated: long line split in 2 lines
Jonas Maes (1):
Fix bug where bluetooth-meshd stops sending
mesh/mesh-io-generic.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)
Signature · 1 line
2.35.1
PATCH 1/1 Fix bug where bluetooth-meshd stops sending
When there is a backlog of mesh packets to be sent, the packet sender Fix bug where bluetooth-meshd stops sending
When there is a backlog of mesh packets to be sent, the packet sender incorrectly infers that the tx worker thread is already running and therefore needn't be invoked. As a result, the mesh daemon will sometimes stop broadcasting while there are still packets in the queue. It will not resume broadcasting.
This patch will invoke the tx worker thread correctly in that case.
The logic to send packets at least twice when the transmitter is idle was slightly modified accordingly, and should behave the same way as before.
UPDATE: long line split in 2 lines now
--- mesh/mesh-io-generic.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)
mesh/mesh-io-generic.c +8 -11
@@ -725,7 +725,6 @@ static bool send_tx(struct mesh_io *io, struct mesh_io_send_info *info, {struct mesh_io_private *pvt = io->pvt;struct tx_pkt *tx; -bool sending = false;if (!info || !data || !len || len >sizeof (tx->pkt))return false;
@@ -739,23 +738,21 @@ static bool send_tx(struct mesh_io *io, struct mesh_io_send_info *info,if (info->type ==MESH_IO_TIMING_TYPE_POLL_RSP )l_queue_push_head (pvt->tx_pkts, tx);else { -if (pvt->tx) - sending = true; -else - sending = !l_queue_isempty (pvt->tx_pkts); - -l_queue_push_tail (pvt->tx_pkts, tx); -/* * If transmitter is idle, send packets at least twice to * guard against in-line cancelation of HCI command chain. */ -if (info->type ==MESH_IO_TIMING_TYPE_GENERAL && !sending && - tx->info.u.gen.cnt ==1 ) +if (info->type ==MESH_IO_TIMING_TYPE_GENERAL && + !pvt->tx && +l_queue_isempty (pvt->tx_pkts) && + tx->info.u.gen.cnt ==1 ) tx->info.u.gen.cnt++; + +l_queue_push_tail (pvt->tx_pkts, tx); } -if (!sending) { +/* If not already sending, schedule the tx worker */ +if (!pvt->tx) {l_timeout_remove (pvt->tx_timeout); pvt->tx_timeout =NULL ;l_idle_oneshot (tx_worker, pvt,NULL );
Signature · 1 line
2.35.1
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=649335
---Test result---
Test Summary:
CheckPatch PASS 0.60 seconds GitLint PASS 0.36 seconds Prep - Setup ELL PASS 51.48 seconds Build - Prep PASS 0.59 seconds Build - Configure PASS 9.86 seconds Build - Make PASS 1784.55 seconds Make Check PASS 12.38 seconds Make Check w/Valgrind PASS 531.01 seconds Make Distcheck PASS 281.18 seconds Build w/ext ELL - Configure PASS 10.16 seconds Build w/ext ELL - Make PASS 1768.46 seconds Incremental Build with patchesPASS 0.00 seconds
---
Regards,
Linux Bluetooth
This patch was applied to bluetooth/bluez.git (master) by Brian Gix <[email protected]>:
Hello:
This patch was applied to bluetooth/bluez.git (master) by Brian Gix <[email protected]>:
Quoted 10 lines · On Fri, 10 Jun 2022 17:29:01 +0200 you wrote:
This patch fixes a bug where bluetooth-meshd may stop invoking the tx worker thread and hence stop broadcasting, accumulating all packets in its
tx_pktsqueue instead.Updated: long line split in 2 lines
Jonas Maes (1):
Fix bug where bluetooth-meshd stops sending[...]
Here is the summary with links:
- [BlueZ,1/1] Fix bug where bluetooth-meshd stops sending
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=71560e12863f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html