aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/osmo-bsc/handover_decision_2.c12
-rw-r--r--tests/handover/handover_test.c9
2 files changed, 16 insertions, 5 deletions
diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c
index 7df8bb1fb..4e54368ca 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -1362,6 +1362,12 @@ static void on_measurement_report(struct gsm_meas_rep *mr)
}
}
+static bool lchan_is_on_dynamic_ts(struct gsm_lchan *lchan)
+{
+ return lchan->ts->pchan_on_init == GSM_PCHAN_TCH_F_TCH_H_PDCH
+ || lchan->ts->pchan_on_init == GSM_PCHAN_TCH_F_PDCH;
+}
+
/* 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.
*/
@@ -1377,6 +1383,12 @@ static void pick_better_lchan_to_move(bool want_highest_db,
if (!want_highest_db && (*best_avg_db_p > other_avg_db))
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))
+ goto return_other;
+
/* keep the same candidate. */
return;
diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 6befc5a0a..804ff4b11 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -1679,16 +1679,15 @@ static char *test_case_30[] = {
"congestion-check",
"expect-chan", "0", "6",
"ack-chan",
- /* Not so good: rather than moving static TCH/F, we should favor freeing dyn TS, for more PDCH */
- "expect-ho", "0", "1",
+ "expect-ho", "0", "5",
"ho-complete",
- "expect-ts-use", "0", "0", "*", "-", "TCH/F", "TCH/F", "TCH/F", "TCH/F", "TCH/H-", "PDCH",
+ "expect-ts-use", "0", "0", "*", "TCH/F", "TCH/F", "TCH/F", "TCH/F", "PDCH", "TCH/H-", "PDCH",
"congestion-check",
"expect-chan", "0", "6",
"ack-chan",
- "expect-ho", "0", "2",
+ "expect-ho", "0", "4",
"ho-complete",
- "expect-ts-use", "0", "0", "*", "-", "-", "TCH/F", "TCH/F", "TCH/F", "TCH/HH", "PDCH",
+ "expect-ts-use", "0", "0", "*", "TCH/F", "TCH/F", "TCH/F", "PDCH", "PDCH", "TCH/HH", "PDCH",
"congestion-check",
"expect-no-chan",
NULL