diff options
author | pravin <pravin.manoharan@radisys.com> | 2016-09-30 10:29:00 +0530 |
---|---|---|
committer | pravin <pravin.manoharan@radisys.com> | 2016-09-30 10:29:00 +0530 |
commit | 07b05394bd281cb91aa4051ba9adc088309384d4 (patch) | |
tree | 046fe73fe3be678069e13ada2d38f297ffa57129 | |
parent | 92e8b8122fdb2f815a266961f9faab6d1f837d90 (diff) |
Fix: DL slot allocation based on direction configured
Currently number of TS for second DL TBF is less
compared to first DL TBF because PCU is considering the
combined capacity of DL and UL for TS allocation,
with this there is a difference in throughput between
the 2 DL TBFs. This patch enables the user to maximize
the number of DL TSs for the TBF based on the
direction configured through VTY with cfg_pcu_ts_alloc_maximise_cmd
Related: OS#1792
-rw-r--r-- | src/bts.h | 6 | ||||
-rw-r--r-- | src/gprs_rlcmac_ts_alloc.cpp | 10 | ||||
-rw-r--r-- | src/pcu_main.cpp | 2 | ||||
-rw-r--r-- | src/pcu_vty.c | 28 | ||||
-rw-r--r-- | tests/alloc/AllocTest.cpp | 14 | ||||
-rw-r--r-- | tests/alloc/AllocTest.ok | 2 |
6 files changed, 52 insertions, 10 deletions
@@ -44,6 +44,10 @@ extern "C" { #define LLC_CODEL_USE_DEFAULT (-1) #define MAX_GPRS_CS 9 +enum maximise_direction { + DL_ONLY, + NO_MAXIMISE +}; struct BTS; struct GprsMs; @@ -191,6 +195,8 @@ struct gprs_rlcmac_bts { /* 0 to support resegmentation in DL, 1 for no reseg */ uint8_t dl_arq_type; + enum maximise_direction maximise_dir; + uint32_t ms_idle_sec; uint8_t cs_adj_enabled; uint8_t cs_adj_upper_limit; diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..6d451ff 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -775,9 +775,13 @@ static int find_multi_slots(struct gprs_rlcmac_bts *bts, rx_window & tx_window, 'C'), capacity); #endif - - if (capacity <= max_capacity) - continue; + if (bts->maximise_dir == DL_ONLY) { + if (rx_window < max_dl_slots) + continue; + } else { + if (capacity <= max_capacity) + continue; + } max_capacity = capacity; max_ul_slots = tx_window; diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index 4a75c79..efefb24 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -217,6 +217,8 @@ int main(int argc, char *argv[]) */ bts->dl_arq_type = EGPRS_ARQ1; + bts->maximise_dir = NO_MAXIMISE; + msgb_set_talloc_ctx(tall_pcu_ctx); osmo_init_logging(&gprs_log_info); diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 535d512..8852935 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -497,6 +497,32 @@ DEFUN(cfg_pcu_dl_arq_type, return CMD_SUCCESS; } +#define MAXIMISE_STR "Maximise TS allocation based on configuration\n" + +DEFUN(cfg_pcu_ts_alloc_maximise_type, + cfg_pcu_ts_alloc_maximise_cmd, + "maximise-direction dl", + MAXIMISE_STR "Maximise DL capacity\n") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + bts->maximise_dir = DL_ONLY; + + return CMD_SUCCESS; +} + +DEFUN(cfg_pcu_no_maximise_direction, + cfg_pcu_no_maximise_direction_cmd, + "no maximise-direction", + NO_STR "Maximise direction configuration\n") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + bts->maximise_dir = NO_MAXIMISE; + + return CMD_SUCCESS; +} + DEFUN(cfg_pcu_window_size, cfg_pcu_window_size_cmd, "window-size <0-1024> [<0-256>]", @@ -972,6 +998,8 @@ int pcu_vty_init(const struct log_info *cat) install_element(PCU_NODE, &cfg_pcu_cs_lqual_ranges_cmd); install_element(PCU_NODE, &cfg_pcu_mcs_cmd); install_element(PCU_NODE, &cfg_pcu_dl_arq_cmd); + install_element(PCU_NODE, &cfg_pcu_ts_alloc_maximise_cmd); + install_element(PCU_NODE, &cfg_pcu_no_maximise_direction_cmd); install_element(PCU_NODE, &cfg_pcu_no_mcs_cmd); install_element(PCU_NODE, &cfg_pcu_mcs_max_cmd); install_element(PCU_NODE, &cfg_pcu_no_mcs_max_cmd); diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index f7794f7..0a97011 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -118,6 +118,7 @@ static void test_alloc_a(gprs_rlcmac_tbf_direction dir, bts = the_bts.bts_data(); bts->alloc_algorithm = alloc_algorithm_a; + bts->maximise_dir = NO_MAXIMISE; struct gprs_rlcmac_trx *trx = &bts->trx[0]; for (i = 0; i < 8; i += 1) @@ -196,6 +197,7 @@ static void test_alloc_b(int ms_class) bts = the_bts.bts_data(); bts->alloc_algorithm = alloc_algorithm_b; + bts->maximise_dir = NO_MAXIMISE; trx = &bts->trx[0]; trx->pdch[5].enable(); @@ -238,6 +240,7 @@ static void test_alloc_b(int ms_class) bts = the_bts.bts_data(); bts->alloc_algorithm = alloc_algorithm_b; + bts->maximise_dir = NO_MAXIMISE; trx = &bts->trx[0]; trx->pdch[5].enable(); @@ -285,6 +288,7 @@ static void test_alloc_b(int ms_class) bts = the_bts.bts_data(); bts->alloc_algorithm = alloc_algorithm_b; + bts->maximise_dir = NO_MAXIMISE; trx = &bts->trx[0]; trx->pdch[1].enable(); @@ -660,6 +664,7 @@ static void test_successive_allocation(algo_t algo, unsigned min_class, bts = the_bts.bts_data(); bts->alloc_algorithm = algo; + bts->maximise_dir = NO_MAXIMISE; trx = &bts->trx[0]; trx->pdch[3].enable(); @@ -698,6 +703,7 @@ static void test_many_connections(algo_t algo, unsigned expect_num, bts = the_bts.bts_data(); bts->alloc_algorithm = algo; + bts->maximise_dir = NO_MAXIMISE; trx = &bts->trx[0]; trx->pdch[3].enable(); @@ -806,6 +812,7 @@ static void test_2_consecutive_dl_tbfs() bts = the_bts.bts_data(); bts->alloc_algorithm = alloc_algorithm_b; + bts->maximise_dir = DL_ONLY; trx = &bts->trx[0]; trx->pdch[4].enable(); @@ -830,13 +837,8 @@ static void test_2_consecutive_dl_tbfs() if (dl_tbf2->pdch[i]) numTs2++; } - - /* - * TODO: currently 2nd DL TBF gets 3 TS - * This behaviour will be fixed in subsequent patch - */ printf("TBF2: numTs(%d)\n", numTs2); - OSMO_ASSERT(numTs2 == 3); + OSMO_ASSERT(numTs2 == 4); tbf_free(dl_tbf1); tbf_free(dl_tbf2); diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok index cbb65aa..9717411 100644 --- a/tests/alloc/AllocTest.ok +++ b/tests/alloc/AllocTest.ok @@ -10795,4 +10795,4 @@ Going to test assignment with many connections, algorithm dynamic Successfully allocated 160 TBFs Testing DL TS allocation for Multi UEs TBF1: numTs(4) -TBF2: numTs(3) +TBF2: numTs(4) |