fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/43117?usp=email )


Change subject: Transceiver52M: make TRXDv2 burst batching configurable
......................................................................

Transceiver52M: make TRXDv2 burst batching configurable

Add a "trxd-batch (disable|enable)" VTY command under the TRX node
(default: enable) to allow disabling per-frame BURST.ind batching
even when TRXDv2 is negotiated, e.g. to trade datagram count for
latency.

Change-Id: I2f58f87d85de5254bae6d7a606dffcd0ad4069d5
Related: OS#5283
---
M CommonLibs/config_defs.h
M CommonLibs/trx_vty.c
M Transceiver52M/Transceiver.cpp
3 files changed, 21 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/17/43117/1

diff --git a/CommonLibs/config_defs.h b/CommonLibs/config_defs.h
index 3b21fcb..5a83688 100644
--- a/CommonLibs/config_defs.h
+++ b/CommonLibs/config_defs.h
@@ -69,4 +69,5 @@
        } overrides;
        bool use_va;
        bool usrp1_singledb;
+       bool trxd_batch; /* Batch BURST.ind PDUs per TDMA frame when TRXDv2 is 
negotiated? */
 };
diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c
index 47ac90b..bd44cb8 100644
--- a/CommonLibs/trx_vty.c
+++ b/CommonLibs/trx_vty.c
@@ -645,6 +645,19 @@
        return CMD_SUCCESS;
 }

+DEFUN(cfg_trxd_batch, cfg_trxd_batch_cmd,
+       "trxd-batch (disable|enable)",
+       "BURST.ind PDU batching once TRXDv2 is negotiated (default=enable)\n"
+       "Send one BURST.ind datagram per burst\n"
+       "Batch all BURST.ind PDUs of a TDMA frame into one datagram\n")
+{
+       struct trx_ctx *trx = trx_from_vty(vty);
+
+       trx->cfg.trxd_batch = (strcmp(argv[0], "enable") == 0);
+
+       return CMD_SUCCESS;
+}
+
 DEFUN(cfg_chan_rx_path, cfg_chan_rx_path_cmd,
        "rx-path NAME",
        "Set the Rx Path\n"
@@ -742,6 +755,8 @@
                vty_out(vty, " viterbi-eq %s%s", trx->cfg.use_va ? "enable" : 
"disable", VTY_NEWLINE);
        if (trx->cfg.usrp1_singledb)
                vty_out(vty, " usrp1-singledb %s%s", trx->cfg.usrp1_singledb ? 
"enable" : "disable", VTY_NEWLINE);
+       if (!trx->cfg.trxd_batch)
+               vty_out(vty, " trxd-batch disable%s", VTY_NEWLINE);
        trx_rate_ctr_threshold_write_config(vty, " ");

        for (i = 0; i < trx->cfg.num_chans; i++) {
@@ -781,6 +796,7 @@
                trx->cfg.sched_rr ? "Enabled" : "Disabled", VTY_NEWLINE);
        vty_out(vty, " Stack size per Thread in BYTE (0 = OS default): %u%s", 
trx->cfg.stack_size, VTY_NEWLINE);
        vty_out(vty, " Single daughterboard (for USRP1): %s%s", 
trx->cfg.usrp1_singledb ? "Enabled" : "Disabled", VTY_NEWLINE);
+       vty_out(vty, " TRXDv2 BURST.ind batching: %s%s", trx->cfg.trxd_batch ? 
"Enabled" : "Disabled", VTY_NEWLINE);
        vty_out(vty, " Channels: %u%s", trx->cfg.num_chans, VTY_NEWLINE);
        for (i = 0; i < trx->cfg.num_chans; i++) {
                chan = &trx->cfg.chans[i];
@@ -854,6 +870,7 @@
        trx->cfg.filler = FILLER_ZERO;
        trx->cfg.rssi_offset = 0.0f;
        trx->cfg.dev_args = talloc_strdup(trx, "");
+       trx->cfg.trxd_batch = true;

        return trx;
 }
@@ -894,6 +911,7 @@
        install_element(TRX_NODE, &cfg_no_ctr_error_threshold_cmd);
        install_element(TRX_NODE, &cfg_stack_size_cmd);
        install_element(TRX_NODE, &cfg_usrp1_singledb_cmd);
+       install_element(TRX_NODE, &cfg_trxd_batch_cmd);

        install_element(TRX_NODE, &cfg_chan_cmd);
        install_element(TRX_NODE, &cfg_ul_fn_offset_cmd);
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 2753c47..3ad403d 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -1342,9 +1342,8 @@
   if (!(bi.flags & OSMO_TRXD_F_NOPE_IND) && log_check_level(DTRXDUL, 
LOGL_DEBUG))
     logRxBurst(chan, &bi);

-  /* TODO: make batching configurable via VTY, so it can be disabled even
-   * when TRXDv2 is negotiated (e.g. to trade datagram count for latency) */
-  if (mVersionTRXD[chan] < 2)
+  /* batching is a TRXDv2 feature, and can also be disabled via VTY */
+  if (mVersionTRXD[chan] < 2 || !cfg->trxd_batch)
     return sendBurstInd(chan, &bi);

   return queueBurstIndBatched(chan, &bi);

--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/43117?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I2f58f87d85de5254bae6d7a606dffcd0ad4069d5
Gerrit-Change-Number: 43117
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>

Reply via email to