Hi
I am looking for guidance about how to set following kernel config options.
CONFIG_BT_L2CAP_RX_MTU, CONFIG_BT_L2CAP_TX_MTU.
In build/zephyr/.config, both of these are set to 65 bytes.
From the function l2cap_chan_rx_init(), I understand that the receive mps size of the channel is capped to minimum of rx.mtu or L2CAP_MAX_LE_MPS.
L2CAP_MAX_LE_MPS is defined as equal to CONFIG_BT_L2CAP_RX_MTU.
But for the transmit direction, in function le_conn_req(), the tx.mps is directly set to the value as received from the peer linux (i.e. 230).
For tx.mps, why the code does not pick the minimum of CONFIG_BT_L2CAP_TX_MTU and mps value (as received from linux)?
I am running 6loble between zephyr and linux and facing issues while transferring bigger sized pkts across connection.
The default sized ping is successful, but specifying a size such as 1000 bytes shows up SDU length errors at linux (which I suspect are due to corruptions).
I checked that linux sends its mps value as 230 bytes. The zephyr code sets up chan->tx.mps as 230 bytes.
In this situation for 1000 bytes packets, zephyr sends l2cap packets of more than 65 bytes. SDUs seemingly get corrupt as seen as linux end.
Then I tried forcefully setting value of tx.mps to L2CAP_MAX_LE_MPS at zephyr. I overwrite mps value (230) received from linux.
And now ping of bigger packets started working well with no SDU errors seen.
I want to understand, whether zephyr l2cap stack should use mps value as-is as received from linux for segmenting l2cap frames.
Or do we need some modification in zephyr code to cap value of mps?
Regards
Vakul