This is an automated email from the ASF dual-hosted git repository.

rymek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 5a8d0e3a nimble/ll: Add option to prefill isoal mux
5a8d0e3a is described below

commit 5a8d0e3a7f0f9d6ca8cc2ac18613c231092e6e73
Author: Andrzej Kaczmarek <andrzej.kaczma...@codecoup.pl>
AuthorDate: Wed Aug 7 00:56:48 2024 +0200

    nimble/ll: Add option to prefill isoal mux
    
    This adds option to queue initial SDUs in mux until there are enough
    data to fill entire ISO event.
    
    This makes it easier to handle pre-transmissions since we don't care if
    host is aware that it should send more data for the 1st event to fill
    pre-transmission subevents - we will simply not "release" data from mux
    until there are enough SDUs to fill complete event (i.e. initial ISO
    events may contain only empty packets).
---
 nimble/controller/include/controller/ble_ll_isoal.h |  4 ++++
 nimble/controller/src/ble_ll_isoal.c                | 18 ++++++++++++++++++
 nimble/controller/syscfg.yml                        |  9 +++++++++
 3 files changed, 31 insertions(+)

diff --git a/nimble/controller/include/controller/ble_ll_isoal.h 
b/nimble/controller/include/controller/ble_ll_isoal.h
index 73ceaf76..4ad8d858 100644
--- a/nimble/controller/include/controller/ble_ll_isoal.h
+++ b/nimble/controller/include/controller/ble_ll_isoal.h
@@ -27,6 +27,10 @@ extern "C" {
 #if MYNEWT_VAL(BLE_LL_ISO)
 
 struct ble_ll_isoal_mux {
+#if MYNEWT_VAL(BLE_LL_ISOAL_MUX_PREFILL)
+    uint8_t active;
+#endif
+
     /* Max PDU length */
     uint8_t max_pdu;
     /* Number of expected SDUs per ISO interval */
diff --git a/nimble/controller/src/ble_ll_isoal.c 
b/nimble/controller/src/ble_ll_isoal.c
index 0ae6d6b7..bed974bb 100644
--- a/nimble/controller/src/ble_ll_isoal.c
+++ b/nimble/controller/src/ble_ll_isoal.c
@@ -119,13 +119,31 @@ ble_ll_isoal_mux_tx_pkt_in(struct ble_ll_isoal_mux *mux, 
struct os_mbuf *om,
     pkthdr = OS_MBUF_PKTHDR(om);
     STAILQ_INSERT_TAIL(&mux->sdu_q, pkthdr, omp_next);
     mux->sdu_q_len++;
+#if MYNEWT_VAL(BLE_LL_ISOAL_MUX_PREFILL)
+    if (mux->sdu_q_len == mux->sdu_per_event) {
+        mux->active = 1;
+    }
+#endif
     OS_EXIT_CRITICAL(sr);
 }
 
 int
 ble_ll_isoal_mux_event_start(struct ble_ll_isoal_mux *mux, uint32_t timestamp)
 {
+#if MYNEWT_VAL(BLE_LL_ISOAL_MUX_PREFILL)
+    /* If prefill is enabled, we always expect to have required number of SDUs
+     * in queue, otherwise we disable mux until enough SDUs are queued again.
+     */
+    mux->sdu_in_event = mux->sdu_per_event;
+    if (mux->sdu_in_event > mux->sdu_q_len) {
+        mux->active = 0;
+    }
+    if (!mux->active) {
+        mux->sdu_in_event = 0;
+    }
+#else
     mux->sdu_in_event = min(mux->sdu_q_len, mux->sdu_per_event);
+#endif
     mux->event_tx_timestamp = timestamp;
 
     return mux->sdu_in_event;
diff --git a/nimble/controller/syscfg.yml b/nimble/controller/syscfg.yml
index ce8fad1e..e77a1de4 100644
--- a/nimble/controller/syscfg.yml
+++ b/nimble/controller/syscfg.yml
@@ -516,6 +516,15 @@ syscfg.defs:
         value: 0
         experimental: 1
 
+    BLE_LL_ISOAL_MUX_PREFILL:
+        description: >
+            Waits until number of SDUs enqueued in mux is enough to fill 
complete
+            ISO event before providing data to ISO.
+            This is useful for pre-transmissions as it ensures that all 
subevents
+            in 1st ISO event are non-empty.
+        value: 0
+        experimental: 1
+
     BLE_LL_CHANNEL_SOUNDING:
         description: >
             Enable support for Channel Sounding feature.

Reply via email to