* [PATCH BlueZ 0/1] Fix bug where bluetooth-meshd stops sending
@ 2022-06-10 15:29 Jonas Maes
2022-06-10 15:29 ` [PATCH BlueZ 1/1] " Jonas Maes
2022-06-21 20:20 ` [PATCH BlueZ 0/1] " patchwork-bot+bluetooth
0 siblings, 2 replies; 5+ messages in thread
From: Jonas Maes @ 2022-06-10 15:29 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Jonas Maes
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(-)
--
2.35.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH BlueZ 1/1] Fix bug where bluetooth-meshd stops sending
2022-06-10 15:29 [PATCH BlueZ 0/1] Fix bug where bluetooth-meshd stops sending Jonas Maes
@ 2022-06-10 15:29 ` Jonas Maes
2022-06-10 17:03 ` bluez.test.bot
2022-06-21 20:20 ` [PATCH BlueZ 0/1] " patchwork-bot+bluetooth
1 sibling, 1 reply; 5+ messages in thread
From: Jonas Maes @ 2022-06-10 15:29 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Jonas Maes
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(-)
diff --git a/mesh/mesh-io-generic.c b/mesh/mesh-io-generic.c
index 50a2a6a86..2d7ef261e 100644
--- a/mesh/mesh-io-generic.c
+++ b/mesh/mesh-io-generic.c
@@ -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);
--
2.35.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH BlueZ 0/1] Fix bug where bluetooth-meshd stops sending
2022-06-10 15:29 [PATCH BlueZ 0/1] Fix bug where bluetooth-meshd stops sending Jonas Maes
2022-06-10 15:29 ` [PATCH BlueZ 1/1] " Jonas Maes
@ 2022-06-21 20:20 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2022-06-21 20:20 UTC (permalink / raw)
To: Jonas Maes; +Cc: linux-bluetooth
Hello:
This patch was applied to bluetooth/bluez.git (master)
by Brian Gix <brian.gix@intel.com>:
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_pkts queue 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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH BlueZ 1/1] Fix bug where bluetooth-meshd stops sending
@ 2022-06-09 9:08 Jonas Maes
2022-06-09 11:02 ` bluez.test.bot
0 siblings, 1 reply; 5+ messages in thread
From: Jonas Maes @ 2022-06-09 9:08 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Jonas Maes
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.
---
mesh/mesh-io-generic.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/mesh/mesh-io-generic.c b/mesh/mesh-io-generic.c
index 50a2a6a86..eed77a7a8 100644
--- a/mesh/mesh-io-generic.c
+++ b/mesh/mesh-io-generic.c
@@ -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,20 @@ 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 &&
+ 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);
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: Fix bug where bluetooth-meshd stops sending
2022-06-09 9:08 [PATCH BlueZ 1/1] " Jonas Maes
@ 2022-06-09 11:02 ` bluez.test.bot
0 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2022-06-09 11:02 UTC (permalink / raw)
To: linux-bluetooth, jonas
[-- Attachment #1: Type: text/plain, Size: 1918 bytes --]
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=648769
---Test result---
Test Summary:
CheckPatch FAIL 1.04 seconds
GitLint PASS 0.74 seconds
Prep - Setup ELL PASS 52.08 seconds
Build - Prep PASS 0.72 seconds
Build - Configure PASS 10.12 seconds
Build - Make PASS 1878.37 seconds
Make Check PASS 12.93 seconds
Make Check w/Valgrind PASS 530.30 seconds
Make Distcheck PASS 280.29 seconds
Build w/ext ELL - Configure PASS 10.22 seconds
Build w/ext ELL - Make PASS 1835.88 seconds
Incremental Build with patchesPASS 0.00 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script with rule in .checkpatch.conf
Output:
[BlueZ,1/1] Fix bug where bluetooth-meshd stops sending
WARNING:LONG_LINE: line length of 88 exceeds 80 columns
#111: FILE: mesh/mesh-io-generic.c:746:
+ l_queue_isempty(pvt->tx_pkts) &&
/github/workspace/src/12875093.patch total: 0 errors, 1 warnings, 36 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/12875093.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-06-21 20:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-10 15:29 [PATCH BlueZ 0/1] Fix bug where bluetooth-meshd stops sending Jonas Maes
2022-06-10 15:29 ` [PATCH BlueZ 1/1] " Jonas Maes
2022-06-10 17:03 ` bluez.test.bot
2022-06-21 20:20 ` [PATCH BlueZ 0/1] " patchwork-bot+bluetooth
-- strict thread matches above, loose matches on Subject: below --
2022-06-09 9:08 [PATCH BlueZ 1/1] " Jonas Maes
2022-06-09 11:02 ` bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).