Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH v1] profile: Set L2CAP IMTU for external profile listeners
@ 2026-05-22  5:40 Wei Deng
  2026-05-22  8:37 ` [v1] " bluez.test.bot
  2026-06-02  3:17 ` [PATCH v2] " Wei Deng
  0 siblings, 2 replies; 10+ messages in thread
From: Wei Deng @ 2026-05-22  5:40 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: luiz.von.dentz, cheng.jiang, jinwang.li, shuai.zhang, wei.deng

bt_io_listen() in ext_start_servers() creates the L2CAP listening
socket for external profiles without an explicit IMTU, causing the
socket to default to the L2CAP minimum of 672 bytes. This is advertised
to the peer in L2CAP_CONFIGURATION_RSP and limits PDU size, degrading
Rx throughput.

The obexd client side (obexd/client/bluetooth.c) already sets IMTU to
BT_RX_MTU (32767) when connecting. Mirror that on the server side by
setting BT_IO_OPT_IMTU to 32767 in ext_start_servers().

Signed-off-by: Wei Deng <wei.deng@oss.qualcomm.com>
---
 src/profile.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/profile.c b/src/profile.c
index dfc5f7161..297959f3c 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -55,6 +55,8 @@
 #define MAS_DEFAULT_CHANNEL	16
 #define MNS_DEFAULT_CHANNEL	17
 
+#define BT_RX_MTU		32767
+
 #define BTD_PROFILE_PSM_AUTO	-1
 #define BTD_PROFILE_CHAN_AUTO	-1
 
@@ -1411,6 +1413,7 @@ static uint32_t ext_start_servers(struct ext_profile *ext,
 					BT_IO_OPT_MODE, ext->mode,
 					BT_IO_OPT_PSM, psm,
 					BT_IO_OPT_SEC_LEVEL, ext->sec_level,
+					BT_IO_OPT_IMTU, BT_RX_MTU,
 					BT_IO_OPT_INVALID);
 		if (err != NULL) {
 			error("L2CAP server failed for %s: %s",
-- 
2.34.1


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

end of thread, other threads:[~2026-06-04 18:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22  5:40 [PATCH v1] profile: Set L2CAP IMTU for external profile listeners Wei Deng
2026-05-22  8:37 ` [v1] " bluez.test.bot
2026-06-02  3:17 ` [PATCH v2] " Wei Deng
2026-06-02  7:08   ` [v2] " bluez.test.bot
2026-06-02 14:21   ` [PATCH v2] " Luiz Augusto von Dentz
2026-06-02 14:42     ` Luiz Augusto von Dentz
2026-06-03 13:31       ` Wei Deng
2026-06-04  9:30   ` [PATCH v3] profile: Set L2CAP IMTU for OBEX " Wei Deng
2026-06-04 12:09     ` [v3] " bluez.test.bot
2026-06-04 18:10     ` [PATCH v3] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox