From 45fdc44d683365b806b90e694cb7b960dc967b31 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Thu, 5 Sep 2019 15:12:20 +0200 Subject: [PATCH] tbf_dl: make preemptive retransmission optional Since [1], OsmoPCU already starts to retransmit downlink blocks before the MS has had a chance to receive them and/or send the related acknowledgement in uplink. Make this optional with the new VTY option "no dl-tbf-preemptive-retransmission". [1] e25b5b91f60f20f61096bc6199a05b58ee6c6328 ("tbf: Only create dummy frames if necessary") Related: OS#2408 Change-Id: Id08aed513d4033aa0d4324c6ce07cbb2852f2f92 --- doc/manuals/vty/osmo-pcu_vty_reference.xml | 11 ++++++++ src/bts.cpp | 1 + src/bts.h | 1 + src/pcu_vty.c | 30 ++++++++++++++++++++++ src/tbf_dl.cpp | 2 +- 5 files changed, 44 insertions(+), 1 deletion(-) diff --git a/doc/manuals/vty/osmo-pcu_vty_reference.xml b/doc/manuals/vty/osmo-pcu_vty_reference.xml index cc8fffae..ea2d674a 100644 --- a/doc/manuals/vty/osmo-pcu_vty_reference.xml +++ b/doc/manuals/vty/osmo-pcu_vty_reference.xml @@ -1807,6 +1807,17 @@ + + + + + + + + + + + diff --git a/src/bts.cpp b/src/bts.cpp index 26dd4015..60f74dd6 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -216,6 +216,7 @@ BTS::BTS() { memset(&m_bts, 0, sizeof(m_bts)); m_bts.bts = this; + m_bts.dl_tbf_preemptive_retransmission = true; /* initialize back pointers */ for (size_t trx_no = 0; trx_no < ARRAY_SIZE(m_bts.trx); ++trx_no) { diff --git a/src/bts.h b/src/bts.h index 767605cd..45d52a97 100644 --- a/src/bts.h +++ b/src/bts.h @@ -135,6 +135,7 @@ struct gprs_rlcmac_bts { uint8_t alpha, gamma; uint8_t egprs_enabled; uint32_t dl_tbf_idle_msec; /* hold time for idle DL TBFs */ + bool dl_tbf_preemptive_retransmission; uint8_t si13[GSM_MACBLOCK_LEN]; bool si13_is_set; /* 0 to support resegmentation in DL, 1 for no reseg */ diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 1e4f50c2..a566e735 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -254,6 +254,8 @@ static int config_write_pcu(struct vty *vty) if (bts->dl_tbf_idle_msec) vty_out(vty, " dl-tbf-idle-time %d%s", bts->dl_tbf_idle_msec, VTY_NEWLINE); + if (!bts->dl_tbf_preemptive_retransmission) + vty_out(vty, " no dl-tbf-preemptive-retransmission%s", VTY_NEWLINE); if (strcmp(bts->pcu_sock_path, PCU_SOCK_DEFAULT)) vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); @@ -870,6 +872,32 @@ DEFUN(cfg_pcu_no_dl_tbf_idle_time, return CMD_SUCCESS; } +#define RETRANSMISSION_STR "retransmit blocks even before the MS had a chance to receive them (better throughput," \ + " less readable traces)" +DEFUN(cfg_pcu_dl_tbf_preemptive_retransmission, + cfg_pcu_dl_tbf_preemptive_retransmission_cmd, + "dl-tbf-preemptive-retransmission", + RETRANSMISSION_STR " (enabled by default)") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + bts->dl_tbf_preemptive_retransmission = true; + + return CMD_SUCCESS; +} + +DEFUN(cfg_pcu_no_dl_tbf_preemptive_retransmission, + cfg_pcu_no_dl_tbf_preemptive_retransmission_cmd, + "no dl-tbf-preemptive-retransmission", + NO_STR RETRANSMISSION_STR) +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + bts->dl_tbf_preemptive_retransmission = false; + + return CMD_SUCCESS; +} + #define MS_IDLE_TIME_STR "keep an idle MS object alive for the time given\n" DEFUN(cfg_pcu_ms_idle_time, cfg_pcu_ms_idle_time_cmd, @@ -1215,6 +1243,8 @@ int pcu_vty_init(void) install_element(PCU_NODE, &cfg_pcu_gamma_cmd); install_element(PCU_NODE, &cfg_pcu_dl_tbf_idle_time_cmd); install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_idle_time_cmd); + install_element(PCU_NODE, &cfg_pcu_dl_tbf_preemptive_retransmission_cmd); + install_element(PCU_NODE, &cfg_pcu_no_dl_tbf_preemptive_retransmission_cmd); install_element(PCU_NODE, &cfg_pcu_ms_idle_time_cmd); install_element(PCU_NODE, &cfg_pcu_no_ms_idle_time_cmd); install_element(PCU_NODE, &cfg_pcu_gsmtap_categ_cmd); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index d5e4a455..510a65c5 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -431,7 +431,7 @@ int gprs_rlcmac_dl_tbf::take_next_bsn(uint32_t fn, m_window.v_s(), mcs_name(new_cs)); bsn = create_new_bsn(fn, new_cs); - } else if (!m_window.window_empty()) { + } else if (bts->bts_data()->dl_tbf_preemptive_retransmission && !m_window.window_empty()) { LOGPTBFDL(this, LOGL_DEBUG, "Restarting at BSN %d, because all blocks have been transmitted (FLOW).\n", m_window.v_a());