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

Francisco notifications at github.com
Mon Apr 12 13:36:30 CEST 2021

@fjmolinas commented on this pull request.

> In my initial implementation of nimble_netif I decided for using a local memory pool for buffering IP packets when transferring them from GNRC pktbuf to NimBLEs own (mbuf) memory pool. Now after more understanding and a lot of more experience using NimBLE, I come to the conclusion that it is far sufficient to use NimBLE global memory pool for this step as well.|

Can you explain why initially you though buffering was needed? Otherwise looks good.

> -            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;
+            }

Why did this change from "we should never run out of buffer space..." to "in the rare case that we run out of buffers", just future proofing?

> @@ -442,16 +429,22 @@ static int _on_gap_master_evt(struct ble_gap_event *event, void *arg)
                 _notify(handle, NIMBLE_NETIF_ABORT_MASTER, addr);
                 return 0;


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/02b907dc/attachment.htm>

More information about the notifications mailing list