[riot-notifications] [RIOT-OS/RIOT] pkg/nimble/netif: use global MSYS memory pool (#15648)

Hauke Petersen notifications at github.com
Mon Apr 12 14:41:48 CEST 2021

@haukepetersen commented on this pull request.

> -            struct os_mbuf *sdu_rx = os_mbuf_get_pkthdr(&_mbuf_pool, 0);
-            /* we should never run out of buffer space... */
-            assert(sdu_rx != NULL);
+            struct os_mbuf *sdu_rx = os_msys_get_pkthdr(
+                                            MYNEWT_VAL_BLE_L2CAP_COC_MPS, 0);
+            /* in the rare case that we run out of buffers, we close the new
+             * connection right away */
+            if (sdu_rx == NULL) {
+                ble_gap_terminate(handle, BLE_ERR_REM_USER_CONN_TERM);
+                break;
+            }

because before we used buffer space that was solely allocated and sized for this specific purpose while now we use shared buffers that could potentially be exhausted by other modules

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210412/fa9aa671/attachment.htm>

More information about the notifications mailing list