* [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
* RE: [v1] profile: Set L2CAP IMTU for external profile listeners
2026-05-22 5:40 [PATCH v1] profile: Set L2CAP IMTU for external profile listeners Wei Deng
@ 2026-05-22 8:37 ` bluez.test.bot
2026-06-02 3:17 ` [PATCH v2] " Wei Deng
1 sibling, 0 replies; 10+ messages in thread
From: bluez.test.bot @ 2026-05-22 8:37 UTC (permalink / raw)
To: linux-bluetooth, wei.deng
[-- Attachment #1: Type: text/plain, Size: 825 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=1099144
---Test result---
Test Summary:
CheckPatch PASS 0.39 seconds
GitLint PASS 0.28 seconds
BuildEll PASS 15.97 seconds
BluezMake PASS 489.53 seconds
CheckSmatch PASS 252.95 seconds
bluezmakeextell PASS 129.96 seconds
IncrementalBuild PASS 493.87 seconds
ScanBuild PASS 719.71 seconds
https://github.com/bluez/bluez/pull/2144
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v2] profile: Set L2CAP IMTU for external profile listeners
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 ` Wei Deng
2026-06-02 7:08 ` [v2] " bluez.test.bot
` (2 more replies)
1 sibling, 3 replies; 10+ messages in thread
From: Wei Deng @ 2026-06-02 3:17 UTC (permalink / raw)
To: linux-bluetooth
bt_io_listen() in ext_start_servers() creates the L2CAP listening
socket for external profiles without an explicit IMTU. This causes
the socket to use the L2CAP minimum of 672 bytes, which is advertised
to the peer in L2CAP_CONFIGURATION_RSP.
As a result, when acting as a server (receiver), the peer limits its
outgoing PDU size to our advertised 672 bytes. This leads to small
OBEX body chunks (~669 bytes) and severely degraded Rx throughput,
while Tx throughput is unaffected since the peer's IMTU is not
constrained by our setting.
The obexd client side (obexd/client/bluetooth.c) already sets IMTU to
BT_RX_MTU (32767) for outgoing connections. Mirror that on the server
side by setting BT_IO_OPT_IMTU to BT_RX_MTU in ext_start_servers(),
so incoming connections advertise the same maximum receive capability.
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
* RE: [v2] profile: Set L2CAP IMTU for external profile listeners
2026-06-02 3:17 ` [PATCH v2] " Wei Deng
@ 2026-06-02 7:08 ` bluez.test.bot
2026-06-02 14:21 ` [PATCH v2] " Luiz Augusto von Dentz
2026-06-04 9:30 ` [PATCH v3] profile: Set L2CAP IMTU for OBEX " Wei Deng
2 siblings, 0 replies; 10+ messages in thread
From: bluez.test.bot @ 2026-06-02 7:08 UTC (permalink / raw)
To: linux-bluetooth, wei.deng
[-- Attachment #1: Type: text/plain, Size: 826 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=1104327
---Test result---
Test Summary:
CheckPatch PASS 0.42 seconds
GitLint PASS 1.32 seconds
BuildEll PASS 20.60 seconds
BluezMake PASS 666.26 seconds
CheckSmatch PASS 365.80 seconds
bluezmakeextell PASS 187.14 seconds
IncrementalBuild PASS 659.47 seconds
ScanBuild PASS 1050.72 seconds
https://github.com/bluez/bluez/pull/2164
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] profile: Set L2CAP IMTU for external profile listeners
2026-06-02 3:17 ` [PATCH v2] " Wei Deng
2026-06-02 7:08 ` [v2] " bluez.test.bot
@ 2026-06-02 14:21 ` Luiz Augusto von Dentz
2026-06-02 14:42 ` Luiz Augusto von Dentz
2026-06-04 9:30 ` [PATCH v3] profile: Set L2CAP IMTU for OBEX " Wei Deng
2 siblings, 1 reply; 10+ messages in thread
From: Luiz Augusto von Dentz @ 2026-06-02 14:21 UTC (permalink / raw)
To: Wei Deng; +Cc: linux-bluetooth
Hi,
On Mon, Jun 1, 2026 at 11:18 PM Wei Deng <wei.deng@oss.qualcomm.com> wrote:
>
> bt_io_listen() in ext_start_servers() creates the L2CAP listening
> socket for external profiles without an explicit IMTU. This causes
> the socket to use the L2CAP minimum of 672 bytes, which is advertised
> to the peer in L2CAP_CONFIGURATION_RSP.
>
> As a result, when acting as a server (receiver), the peer limits its
> outgoing PDU size to our advertised 672 bytes. This leads to small
> OBEX body chunks (~669 bytes) and severely degraded Rx throughput,
> while Tx throughput is unaffected since the peer's IMTU is not
> constrained by our setting.
>
> The obexd client side (obexd/client/bluetooth.c) already sets IMTU to
> BT_RX_MTU (32767) for outgoing connections. Mirror that on the server
> side by setting BT_IO_OPT_IMTU to BT_RX_MTU in ext_start_servers(),
> so incoming connections advertise the same maximum receive capability.
>
> 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,
This is doing it for all service registered via ProfileManager which
is not going to fly, instead we probably need to add a MTU option so
the profile entity can pass it instead of getting the default.
> BT_IO_OPT_INVALID);
> if (err != NULL) {
> error("L2CAP server failed for %s: %s",
> --
> 2.34.1
>
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] profile: Set L2CAP IMTU for external profile listeners
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
0 siblings, 1 reply; 10+ messages in thread
From: Luiz Augusto von Dentz @ 2026-06-02 14:42 UTC (permalink / raw)
To: Wei Deng; +Cc: linux-bluetooth
Hi,
On Tue, Jun 2, 2026 at 10:21 AM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> Hi,
>
> On Mon, Jun 1, 2026 at 11:18 PM Wei Deng <wei.deng@oss.qualcomm.com> wrote:
> >
> > bt_io_listen() in ext_start_servers() creates the L2CAP listening
> > socket for external profiles without an explicit IMTU. This causes
> > the socket to use the L2CAP minimum of 672 bytes, which is advertised
> > to the peer in L2CAP_CONFIGURATION_RSP.
> >
> > As a result, when acting as a server (receiver), the peer limits its
> > outgoing PDU size to our advertised 672 bytes. This leads to small
> > OBEX body chunks (~669 bytes) and severely degraded Rx throughput,
> > while Tx throughput is unaffected since the peer's IMTU is not
> > constrained by our setting.
> >
> > The obexd client side (obexd/client/bluetooth.c) already sets IMTU to
> > BT_RX_MTU (32767) for outgoing connections. Mirror that on the server
> > side by setting BT_IO_OPT_IMTU to BT_RX_MTU in ext_start_servers(),
> > so incoming connections advertise the same maximum receive capability.
> >
> > 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,
>
> This is doing it for all service registered via ProfileManager which
> is not going to fly, instead we probably need to add a MTU option so
> the profile entity can pass it instead of getting the default.
Actually there are no options, it's built from `default_setting`,
which doesn't set any MTU for some reason. For the OBEX profiles it
probably makes sense to add an MTU field so it gets properly set.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v2] profile: Set L2CAP IMTU for external profile listeners
2026-06-02 14:42 ` Luiz Augusto von Dentz
@ 2026-06-03 13:31 ` Wei Deng
0 siblings, 0 replies; 10+ messages in thread
From: Wei Deng @ 2026-06-03 13:31 UTC (permalink / raw)
To: Luiz Augusto von Dentz
Cc: linux-bluetooth, luiz.von.dentz, cheng.jiang, jinwang.li,
shuai.zhang
Hi Luiz,
On Tue, Jun 2, 2026 at 10:42 AM Luiz Augusto von Dentz <luiz.dentz@gmail.com> wrote:
>
> Actually there are no options, it's built from `default_setting`,
> which doesn't set any MTU for some reason. For the OBEX profiles it
> probably makes sense to add an MTU field so it gets properly set.
Thanks for the clarification. Agreed -- I'll add an imtu field to
default_settings and populate it only for the OBEX profiles (OPP, FTP,
PSE, MAS, MNS), then have ext_start_servers() apply it via bt_io_set()
only when the field is set, so non-OBEX listeners keep their current
behavior.
I'll send V3 with that approach shortly.
--
Best Regards,
Wei Deng
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v3] profile: Set L2CAP IMTU for OBEX profile listeners
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-04 9:30 ` Wei Deng
2026-06-04 12:09 ` [v3] " bluez.test.bot
2026-06-04 18:10 ` [PATCH v3] " patchwork-bot+bluetooth
2 siblings, 2 replies; 10+ messages in thread
From: Wei Deng @ 2026-06-04 9:30 UTC (permalink / raw)
To: linux-bluetooth; +Cc: luiz.von.dentz, cheng.jiang, jinwang.li, shuai.zhang
The default_settings entries for OBEX profiles (OPP, FTP, PBAP, MAS,
MNS) have no imtu field, so ext_start_servers() creates the L2CAP
listening socket without an explicit IMTU. This causes the socket to
advertise the L2CAP minimum of 672 bytes in L2CAP_CONFIGURATION_RSP,
limiting the peer's outgoing PDU size and degrading Rx throughput.
Add an imtu field to default_settings and set it to 32767 for all
OBEX profiles that use L2CAP. Copy the value in ext_set_defaults()
and apply it to the listening socket via bt_io_set() after
bt_io_listen() succeeds.
Signed-off-by: Wei Deng <wei.deng@oss.qualcomm.com>
---
src/profile.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/src/profile.c b/src/profile.c
index dfc5f7161..65df0f7a0 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
@@ -678,6 +680,7 @@ struct ext_profile {
uint16_t version;
uint16_t features;
+ uint16_t imtu;
GSList *records;
GSList *servers;
@@ -1423,6 +1426,9 @@ static uint32_t ext_start_servers(struct ext_profile *ext,
if (psm == 0)
bt_io_get(io, NULL, BT_IO_OPT_PSM, &psm,
BT_IO_OPT_INVALID);
+ if (ext->imtu)
+ bt_io_set(io, NULL, BT_IO_OPT_IMTU, ext->imtu,
+ BT_IO_OPT_INVALID);
l2cap->io = io;
l2cap->proto = BTPROTO_L2CAP;
l2cap->psm = psm;
@@ -2075,6 +2081,7 @@ static struct default_settings {
struct ext_io *rfcomm);
uint16_t version;
uint16_t features;
+ uint16_t imtu;
} defaults[] = {
{
.uuid = SPP_UUID,
@@ -2142,6 +2149,7 @@ static struct default_settings {
.authorize = false,
.get_record = get_opp_record,
.version = 0x0102,
+ .imtu = BT_RX_MTU,
}, {
.uuid = OBEX_FTP_UUID,
.name = "File Transfer",
@@ -2151,6 +2159,7 @@ static struct default_settings {
.authorize = true,
.get_record = get_ftp_record,
.version = 0x0103,
+ .imtu = BT_RX_MTU,
}, {
.uuid = OBEX_SYNC_UUID,
.name = "Synchronization",
@@ -2167,6 +2176,7 @@ static struct default_settings {
.authorize = true,
.get_record = get_pse_record,
.version = 0x0101,
+ .imtu = BT_RX_MTU,
}, {
.uuid = OBEX_PCE_UUID,
.name = "Phone Book Access Client",
@@ -2182,7 +2192,8 @@ static struct default_settings {
.mode = BT_IO_MODE_ERTM,
.authorize = true,
.get_record = get_mas_record,
- .version = 0x0100
+ .version = 0x0100,
+ .imtu = BT_RX_MTU,
}, {
.uuid = OBEX_MNS_UUID,
.name = "Message Notification",
@@ -2191,7 +2202,8 @@ static struct default_settings {
.mode = BT_IO_MODE_ERTM,
.authorize = true,
.get_record = get_mns_record,
- .version = 0x0104
+ .version = 0x0104,
+ .imtu = BT_RX_MTU,
},
};
@@ -2249,6 +2261,9 @@ static void ext_set_defaults(struct ext_profile *ext)
if (settings->features)
ext->features = settings->features;
+ if (settings->imtu)
+ ext->imtu = settings->imtu;
+
if (settings->name)
ext->name = g_strdup(settings->name);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* RE: [v3] profile: Set L2CAP IMTU for OBEX profile listeners
2026-06-04 9:30 ` [PATCH v3] profile: Set L2CAP IMTU for OBEX " Wei Deng
@ 2026-06-04 12:09 ` bluez.test.bot
2026-06-04 18:10 ` [PATCH v3] " patchwork-bot+bluetooth
1 sibling, 0 replies; 10+ messages in thread
From: bluez.test.bot @ 2026-06-04 12:09 UTC (permalink / raw)
To: linux-bluetooth, wei.deng
[-- Attachment #1: Type: text/plain, Size: 825 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=1105837
---Test result---
Test Summary:
CheckPatch PASS 0.36 seconds
GitLint PASS 0.23 seconds
BuildEll PASS 17.80 seconds
BluezMake PASS 634.83 seconds
CheckSmatch PASS 311.82 seconds
bluezmakeextell PASS 166.60 seconds
IncrementalBuild PASS 599.14 seconds
ScanBuild PASS 913.59 seconds
https://github.com/bluez/bluez/pull/2176
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3] profile: Set L2CAP IMTU for OBEX profile listeners
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 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 10+ messages in thread
From: patchwork-bot+bluetooth @ 2026-06-04 18:10 UTC (permalink / raw)
To: Wei Deng
Cc: linux-bluetooth, luiz.von.dentz, cheng.jiang, jinwang.li,
shuai.zhang
Hello:
This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Thu, 4 Jun 2026 15:00:24 +0530 you wrote:
> The default_settings entries for OBEX profiles (OPP, FTP, PBAP, MAS,
> MNS) have no imtu field, so ext_start_servers() creates the L2CAP
> listening socket without an explicit IMTU. This causes the socket to
> advertise the L2CAP minimum of 672 bytes in L2CAP_CONFIGURATION_RSP,
> limiting the peer's outgoing PDU size and degrading Rx throughput.
>
> Add an imtu field to default_settings and set it to 32767 for all
> OBEX profiles that use L2CAP. Copy the value in ext_set_defaults()
> and apply it to the listening socket via bt_io_set() after
> bt_io_listen() succeeds.
>
> [...]
Here is the summary with links:
- [v3] profile: Set L2CAP IMTU for OBEX profile listeners
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=646014a6a246
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] 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