2022-10-17 14:57:09

by Christian Eggers

[permalink] [raw]
Subject: Support for Data Length Extension (DLE)?

When monitoring a Bluetooth connection between two Linux systems
(kernel 5.14 / 5.15 + bluez-5.65), I noticed the following:

> HCI Event: LE Meta Event (0x3e) plen 12 #21108 [hci0] 1650.255887
LE Read Remote Used Features (0x04)
Status: Success (0x00)
Handle: 25 Address: 00:1A:7D:F0:21:40 (OUI 00-1A-7D)
Features: 0xbd 0x5f 0x66 0x00 0x00 0x00 0x00 0x00
...
LE Data Packet Length Extension
...

> ACL Data RX: Handle 25 flags 0x02 dlen 18 #21109 [hci0] 1650.300224
LE L2CAP: LE Connection Request (0x14) ident 1 len 10
PSM: 128 (0x0080)
Source CID: 64
MTU: 672
MPS: 23
Credits: 30
< ACL Data TX: Handle 25 flags 0x00 dlen 18 #21110 [hci0] 1650.300431
LE L2CAP: LE Connection Response (0x15) ident 1 len 10
Destination CID: 64
MTU: 672
MPS: 23
Credits: 30
Result: Connection successful (0x0000)
...
> HCI Event: LE Meta Event (0x3e) plen 11 #21113 [hci0] 1650.345822
LE Data Length Change (0x07)
Handle: 25 Address: 00:1A:7D:F0:21:40 (OUI 00-1A-7D)
Max TX octets: 251
Max TX time: 2120
Max RX octets: 251
Max RX time: 2120

I can't find that HCI_EV_LE_DATA_LEN_CHANGE is implemented anywhere in the kernel nor in bluez userspace.
So why do I get this event? Is it generated by controller firmware itself?

I think that both adapters support DLE. Is there there already support for using it with Linux?

regards
Christian




2022-10-17 20:16:02

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Support for Data Length Extension (DLE)?

Hi Christian,

On Mon, Oct 17, 2022 at 7:57 AM Christian Eggers <[email protected]> wrote:
>
> When monitoring a Bluetooth connection between two Linux systems
> (kernel 5.14 / 5.15 + bluez-5.65), I noticed the following:
>
> > HCI Event: LE Meta Event (0x3e) plen 12 #21108 [hci0] 1650.255887
> LE Read Remote Used Features (0x04)
> Status: Success (0x00)
> Handle: 25 Address: 00:1A:7D:F0:21:40 (OUI 00-1A-7D)
> Features: 0xbd 0x5f 0x66 0x00 0x00 0x00 0x00 0x00
> ...
> LE Data Packet Length Extension
> ...
>
> > ACL Data RX: Handle 25 flags 0x02 dlen 18 #21109 [hci0] 1650.300224
> LE L2CAP: LE Connection Request (0x14) ident 1 len 10
> PSM: 128 (0x0080)
> Source CID: 64
> MTU: 672
> MPS: 23
> Credits: 30
> < ACL Data TX: Handle 25 flags 0x00 dlen 18 #21110 [hci0] 1650.300431
> LE L2CAP: LE Connection Response (0x15) ident 1 len 10
> Destination CID: 64
> MTU: 672
> MPS: 23
> Credits: 30
> Result: Connection successful (0x0000)
> ...
> > HCI Event: LE Meta Event (0x3e) plen 11 #21113 [hci0] 1650.345822
> LE Data Length Change (0x07)
> Handle: 25 Address: 00:1A:7D:F0:21:40 (OUI 00-1A-7D)
> Max TX octets: 251
> Max TX time: 2120
> Max RX octets: 251
> Max RX time: 2120
>
> I can't find that HCI_EV_LE_DATA_LEN_CHANGE is implemented anywhere in the kernel nor in bluez userspace.
> So why do I get this event? Is it generated by controller firmware itself?

We do programm the it earlier though with HCI_OP_LE_WRITE_DEF_DATA_LEN:

https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/tree/net/bluetooth/hci_sync.c#n4362

> I think that both adapters support DLE. Is there there already support for using it with Linux?

I guess it would probably make sense to handle
HCI_EV_LE_DATA_LEN_CHANGE, that said it seems to come after the L2CAP
Connection Request in case you are suggesting to align the MTU with
Max TX/RX length.

> regards
> Christian
>
>
>


--
Luiz Augusto von Dentz