From dc69da17ad802d7f4533955f09fe6e7c14caab5e Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 13 Nov 2020 02:14:37 +0100 Subject: hodec 2: favor moving dyn TS When a used timeslot gets moved to another timeslot for load balancing, prefer moving a dynamic timeslot, as illustrated by handover_test.c test 30. Rationale: freeing up a dynamic timeslot is better for PDCH availability, as well as for flexibility in timeslots. Test 30 shows that when freeing a static TCH/F even though a dynamic one with identical ratings is in use, later handovers to a TCH/H may become impossible, because no more dynamic timeslots are available to switch to TCH/H. A freed dynamic timeslot allows congestion resolution to continue and reduce more TCH/F to TCH/H. The scope of this preference is per-TRX, where the RXLEV ratings used for picking a target lchan are the same by definition. In other words, this never overrules picking another lchan that has better RXLEV. Among lchans on dynamic timeslots that could be moved, this code favors moving later lchans; mainly because it makes for a simpler condition in the code. Change-Id: Ic221b8d2687cdec0bf94410c84a4da43853f0900 --- src/osmo-bsc/handover_decision_2.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/osmo-bsc') 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; -- cgit v1.2.3