* [PATCH] Bluetooth: L2CAP: Don't lower the MPS of a credit based channel
@ 2026-11-27 12:13 Simon Mikuda
2026-11-27 14:01 ` bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Simon Mikuda @ 2026-11-27 12:13 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Simon Mikuda, Marcel Holtmann, Luiz Augusto von Dentz
When the first K-frame of a segmented SDU is shorter than the MPS,
l2cap_ecred_data_rcv() lowers chan->mps to its size, to hand out
credits for smaller K-frames. The lowered MPS is then also the limit
for the K-frames that follow, so a peer that sends a short first
K-frame and a longer second one, both within the MPS we announced,
gets its channel disconnected:
> LE-ACL: Handle 2048 flags 0x01 dlen 2
Channel: 64 len 241 sdu 672 [PSM 128 mode Enhanced Credit (0x81)]
> LE-ACL: Handle 2048 flags 0x01 dlen 4
Channel: 64 len 243 sdu 433 [PSM 128 mode Enhanced Credit (0x81)]
< LE-ACL: Handle 2048 flags 0x00 dlen 12
LE L2CAP: Disconnection Request (0x06) ident 2 len 4
Bluetooth: Too big LE L2CAP MPS: len 243 > 241
PTS does this in L2CAP/COS/ECFC/BV-02-C and BV-03-C. The lowered MPS
would also go out in a reconfiguration request, which may not lower
the MPS of more than one channel.
A peer that does not use the whole MPS runs out of credits sooner, and
the receive path already hands out new credits when they run out. So
keep the MPS we announced.
Fixes: a5c3021bb62b ("Bluetooth: L2CAP: Detect if remote is not able to use the whole MPS")
Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
---
net/bluetooth/l2cap_core.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index da947b65d26a..289e6b95cbac 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -7269,16 +7269,6 @@ static int l2cap_ecred_data_rcv(struct l2cap_chan *chan, struct sk_buff *skb)
chan->sdu_len = sdu_len;
chan->sdu_last_frag = skb;
- /* Detect if remote is not able to use the selected MPS */
- if (skb->len + L2CAP_SDULEN_SIZE < chan->mps) {
- u16 mps_len = skb->len + L2CAP_SDULEN_SIZE;
-
- /* Adjust the number of credits */
- BT_DBG("chan->mps %u -> %u", chan->mps, mps_len);
- chan->mps = mps_len;
- l2cap_chan_le_send_credits(chan);
- }
-
return 0;
}
base-commit: 77bc0f253ff9fe1656f6e0fe9e9f5d3da91faf60
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-27 14:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 12:13 [PATCH] Bluetooth: L2CAP: Don't lower the MPS of a credit based channel Simon Mikuda
2026-11-27 14:01 ` 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