Change in osmo-bsc[master]: hodec 2: prefer moving TCH/H from half-used dyn TS

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/.

neels gerrit-no-reply at lists.osmocom.org
Wed Nov 18 14:17:01 UTC 2020


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/21236 )


Change subject: hodec 2: prefer moving TCH/H from half-used dyn TS
......................................................................

hodec 2: prefer moving TCH/H from half-used dyn TS

Change-Id: I427dc9faa3790c24119127ae227d8cc802dd50e6
---
M src/osmo-bsc/handover_decision_2.c
M tests/handover/handover_test.c
2 files changed, 23 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/36/21236/1

diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c
index 4e54368..9fab1fc 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -1368,6 +1368,17 @@
 		|| lchan->ts->pchan_on_init == GSM_PCHAN_TCH_F_PDCH;
 }
 
+static unsigned int ts_usage_count(struct gsm_bts_trx_ts *ts)
+{
+	struct gsm_lchan *lchan;
+	unsigned int count = 0;
+	ts_for_each_lchan(lchan, ts) {
+		if (lchan_state_is(lchan, LCHAN_ST_ESTABLISHED))
+			count++;
+	}
+	return count;
+}
+
 /* Given two candidates, pick the one that should rather be moved during handover.
  * Return the better candidate in out-parameters best_cand and best_avg_db.
  */
@@ -1384,10 +1395,17 @@
 		goto return_other;
 
 	/* The two lchans have identical ratings, prefer picking a dynamic timeslot: free PDCH and allow more timeslot
-	 * type flexibility for further congestion resolution. If both are dynamic, it does not matter which one is
-	 * picked. */
-	if (lchan_is_on_dynamic_ts(other_cand->lchan))
+	 * type flexibility for further congestion resolution. */
+	if (lchan_is_on_dynamic_ts(other_cand->lchan)) {
+		/* If both are dynamic, prefer one that completely (or to a higher degree) frees its timeslot. */
+		if (lchan_is_on_dynamic_ts((*best_cand_p)->lchan)
+		    && ts_usage_count((*best_cand_p)->lchan->ts) < ts_usage_count(other_cand->lchan->ts))
+			return;
+		/* If both equally satisfy these preferences, it does not matter which one is picked.
+		 * Give slight preference to moving later dyn TS, so that a free dyn TS may group with following static
+		 * PDCH, though this depends on how the user configured the TS -- not harmful to do so anyway. */
 		goto return_other;
+	}
 
 	/* keep the same candidate. */
 	return;
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 62c01f0..28d87db 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -1765,10 +1765,9 @@
 	"congestion-check",
 	"expect-chan", "0", "1",
 	"ack-chan",
-	/* Not so good: should move the half-used TCH/H instead of "halving" another dyn TS */
-	"expect-ho", "0", "4",
+	"expect-ho", "0", "3",
 	"ho-complete",
-	"expect-ts-use", "0", "0",  "*", "TCH/F", "TCH/HH", "TCH/H-", "TCH/H-", "PDCH", "-", "-",
+	"expect-ts-use", "0", "0",  "*", "TCH/F", "TCH/HH", "PDCH", "TCH/HH", "PDCH", "-", "-",
 	NULL
 };
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21236
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I427dc9faa3790c24119127ae227d8cc802dd50e6
Gerrit-Change-Number: 21236
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201118/13c74768/attachment.htm>


More information about the gerrit-log mailing list