[PATCH] osmo-pcu[master]: Fix slot allocation based on direction configured

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

arvind.sirsikar gerrit-no-reply at lists.osmocom.org
Mon Sep 19 06:43:56 UTC 2016


Hello Neels Hofmeyr, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/819

to look at the new patch set (#4).

Fix 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 during TS allocation. With this issue
there was no fairness in throughput between the 2 DL TBFs
This patch enables the user to maximize the number of TS
allocation for the DL or UL TBF based on the direction
configured through VTY with cfg_pcu_ts_alloc_maximise_cmd

Related: OS#1792

Change-Id: I4b4a99194ccae68bb3417bce538d16e944d5ec71
---
M src/bts.h
M src/gprs_rlcmac_ts_alloc.cpp
M src/pcu_main.cpp
M src/pcu_vty.c
M tests/alloc/AllocTest.cpp
M tests/alloc/AllocTest.ok
6 files changed, 62 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/19/819/4

diff --git a/src/bts.h b/src/bts.h
index ba6fc4d..d7a59ce 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -44,6 +44,11 @@
 #define LLC_CODEL_USE_DEFAULT (-1)
 #define MAX_GPRS_CS 9
 
+enum maximise_direction {
+	DL_ONLY,
+	UL_ONLY,
+	NO_MAXIMISE
+};
 
 struct BTS;
 struct GprsMs;
@@ -191,6 +196,8 @@
 	/* 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..8ccc270 100644
--- a/src/gprs_rlcmac_ts_alloc.cpp
+++ b/src/gprs_rlcmac_ts_alloc.cpp
@@ -775,9 +775,20 @@
 					rx_window & tx_window, 'C'),
 			capacity);
 #endif
-
-		if (capacity <= max_capacity)
-			continue;
+		switch (bts->maximise_dir) {
+		case UL_ONLY:
+			if (tx_window < max_ul_slots)
+				continue;
+		break;
+		case DL_ONLY:
+			if (rx_window < max_dl_slots)
+				continue;
+		break;
+		default:
+			if (capacity <= max_capacity)
+				continue;
+		break;
+		}
 
 		max_capacity = capacity;
 		max_ul_slots = tx_window;
diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp
index afdfdc7..c476726 100644
--- a/src/pcu_main.cpp
+++ b/src/pcu_main.cpp
@@ -217,6 +217,8 @@
 	 */
 	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..18cea07 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -497,6 +497,35 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_pcu_ts_alloc_maximise_type,
+      cfg_pcu_ts_alloc_maximise_cmd,
+      "maximise-direction (dl|ul)",
+      "number of TS allocation based on direction configured\n"
+      "maximise DL capacity\n"
+      "maximise UL capacity")
+{
+	struct gprs_rlcmac_bts *bts = bts_main_data();
+
+	if (!strcmp(argv[0], "dl"))
+		bts->maximise_dir = DL_ONLY;
+	else if (!strcmp(argv[0], "ul"))
+		bts->maximise_dir = UL_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 +1001,7 @@
 	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_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 @@
 
 	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 @@
 
 		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 @@
 
 		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 @@
 
 		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 @@
 
 	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 @@
 
 	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 @@
 
 	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 @@
 		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 @@
   Successfully allocated 160 TBFs
 Testing DL TS allocation for Multi UEs
 TBF1: numTs(4)
-TBF2: numTs(3)
+TBF2: numTs(4)

-- 
To view, visit https://gerrit.osmocom.org/819
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4b4a99194ccae68bb3417bce538d16e944d5ec71
Gerrit-PatchSet: 4
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: arvind.sirsikar <arvind.sirsikar at radisys.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: arvind.sirsikar <arvind.sirsikar at radisys.com>



More information about the gerrit-log mailing list