[riot-notifications] [RIOT-OS/RIOT] pkg/nimble/netif: fix and optimize NimBLE buffer sizes (#16503)

Hauke Petersen notifications at github.com
Thu May 27 12:48:52 CEST 2021


### Contribution description
The current buffer size configuration for `nimble_netif` is broken: if the L2CAP COC MPS size (`MYNEWT_VAL_BLE_L2CAP_COC_MPS`) is set to a value larger than the maximum link layer packet size (`MYNEWT_VAL_BLE_LL_MAX_PKT_SIZE`), it triggers faulty behavior where the link layer will simply cut off bytes at the end of the payload, leading to the receiving node being stuck waiting for those missing bytes.

Currently, nodes will run out of nimble buffers and get stuck when receiving IP packets larger than 251 bytes...

This PR cleans up and optimizes the NimBLE buffer sizes for the use with `nimble_netif`: 
- the faulty behavior as described above is fixed by setting `COC_MPS` equal to `LL_MAX_PKT_SIZE`
- the `MSYS_1_BLOCK_SIZE` is adapted, so that a full COC payload of 251 bytes fits into a single block

To verify the used parameters, I also set the buffer sizes for the `tests/nimble_l2cap` test application to the same values.

### Testing procedure
- run `gnrc_networking`, everything should work as expected.
- run `tests/nimble_l2cap` with two nodes, flooding and inctest should work as expected.

### Issues/PRs references
none
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/16503

-- Commit Summary --

  * pkg/nimble/netif: fix buffer sizes
  * tests/nimble_l2cap: adapt buffer sizes

-- File Changes --

    M pkg/nimble/Makefile.include (18)
    M tests/nimble_l2cap_server/nimble.inc.mk (6)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/16503.patch
https://github.com/RIOT-OS/RIOT/pull/16503.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16503
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210527/94063fd4/attachment.htm>


More information about the notifications mailing list