aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-05-25 00:02:56 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2020-06-10 14:21:11 +0200
commiteec776e9ca6aff527108fff01deca1535c34b364 (patch)
tree45ecf97cf74fc016ecc256306d903e14310e2f34 /include
parent112609f918e96103b2598c4307fffc400d50c555 (diff)
refactor bsc_find_msc()'s round-robin
Prepare for MSC pooling by NRI. Before introducing actual NRI decoding and MSC matching, fix the bsc_find_msc() implementation. (Indicate the places relevant for NRI by "TODO" comments). bsc_find_msc() puts an MSC to the end of the internal list of MSCs when it was used. This has problems: - Modifying the list affects VTY output, e.g. 'show running-config' and 'show mscs' change their order in which MSCs are shown, depending on how often a round-robin selection has taken place. - Emergency calls and normal calls potentially pick quite different sets of eligible MSCs. When the round-robin choices between these sets affect each other, the choice is not balanced. For example, if only the first MSC is allow_emerg == true, every emergency call would reset the round-robin state to the first MSC in the list, also for normal calls. If there are regular emergency calls, normal calls will then tend to load more onto the first few MSCs after those picked for emergency calls. Fix: Never affect the ordering of MSCs in the internal list of MSCs. Instead, keep a "next_nr" MSC index and determine the next round-robin target like that. Keep a separate "next_emerg_nr" MSC index so that emergency call round-robin does no longer cause normal round-robin to skip MSCs. Further problems in current bsc_find_msc(): - The "blind:" label should also do round-robin. - The "paging:" part should not attempt to use disconnected MSCs. - Both should also heed NRI matches (when they are added). Fix: instead of code dup, determine Paging Response matching with an earlier Paging Request right at the start. If that yields no usable MSC, continue into the normal NRI and round-robin selection. The loop in this patch is inspired by the upcoming implementation of MSC pooling by NRI, as indicated by the two TODO comments. The point is that, in the presence of an NRI from a TMSI identity, we always need to iterate all of the MSCs to find possible NRI matches. The two round-robin sets (Emergency and non-Emergency) are determined in the same loop iteration for cases that have no or match no NRI, or where a matching MSC is currently disconnected. Change-Id: Idf71f07ba5a17d5b870dc1a5a2875b6fedb61291
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/bsc/gsm_data.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 1e7e88fe5..52ff5e4ea 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1651,6 +1651,10 @@ struct gsm_network {
/* msc configuration */
struct llist_head mscs;
+ uint8_t mscs_round_robin_next_nr;
+ /* Emergency calls potentially select a different set of MSCs, so to not mess up the normal round-robin
+ * behavior, emergency calls need a separate round-robin counter. */
+ uint8_t mscs_round_robin_next_emerg_nr;
/* rf ctl related bits */
int mid_call_timeout;