All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] l2cap-tester: ensure SO_SNDBUF is large enough for the writes
@ 2025-03-18 22:22 Pauli Virtanen
  2025-03-18 23:32 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Pauli Virtanen @ 2025-03-18 22:22 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

Since btdev runs from same thread and won't flush, SO_SNDBUF needs to
hold all data we are going to write.  Fix spurious test failure
in "L2CAP LE Client - Write 32k Success".
---
 tools/l2cap-tester.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c
index e56773d13..3b3ffb6a7 100644
--- a/tools/l2cap-tester.c
+++ b/tools/l2cap-tester.c
@@ -1451,8 +1451,9 @@ static void l2cap_write_data(struct test_data *data, GIOChannel *io,
 	const struct l2cap_data *l2data = data->test_data;
 	struct bthost *bthost;
 	ssize_t ret;
-	int sk;
+	int sk, size;
 	unsigned int count;
+	socklen_t len = sizeof(size);
 
 	sk = g_io_channel_unix_get_fd(io);
 
@@ -1464,6 +1465,15 @@ static void l2cap_write_data(struct test_data *data, GIOChannel *io,
 
 	l2cap_tx_timestamping(data, io);
 
+	/* Socket buffer needs to hold what we send, btdev doesn't flush now */
+	ret = getsockopt(sk, SOL_SOCKET, SO_SNDBUF, &size, &len);
+	if (!ret) {
+		size += l2data->data_len * (l2data->repeat_send + 1);
+		ret = setsockopt(sk, SOL_SOCKET, SO_SNDBUF, &size, len);
+	}
+	if (ret)
+		tester_warn("Failed to set SO_SNDBUF = %d", size);
+
 	for (count = 0; count < l2data->repeat_send + 1; ++count) {
 		ret = l2cap_send(sk, l2data->write_data, l2data->data_len,
 							data->l2o.omtu);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [BlueZ] l2cap-tester: ensure SO_SNDBUF is large enough for the writes
  2025-03-18 22:22 [PATCH BlueZ] l2cap-tester: ensure SO_SNDBUF is large enough for the writes Pauli Virtanen
@ 2025-03-18 23:32 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2025-03-18 23:32 UTC (permalink / raw)
  To: linux-bluetooth, pav

[-- Attachment #1: Type: text/plain, Size: 1260 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=945352

---Test result---

Test Summary:
CheckPatch                    PENDING   0.20 seconds
GitLint                       PENDING   0.20 seconds
BuildEll                      PASS      20.38 seconds
BluezMake                     PASS      1472.88 seconds
MakeCheck                     PASS      13.26 seconds
MakeDistcheck                 PASS      158.31 seconds
CheckValgrind                 PASS      213.97 seconds
CheckSmatch                   PASS      283.23 seconds
bluezmakeextell               PASS      98.45 seconds
IncrementalBuild              PENDING   0.24 seconds
ScanBuild                     PASS      865.27 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-03-18 23:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-18 22:22 [PATCH BlueZ] l2cap-tester: ensure SO_SNDBUF is large enough for the writes Pauli Virtanen
2025-03-18 23:32 ` [BlueZ] " bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.