aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill Zakharenko <earwin@gmail.com>2020-06-06 02:22:54 +0300
committerKirill Zakharenko <earwin@gmail.com>2020-06-06 02:22:54 +0300
commitcc871b5d2fe8357b2309787d2566fd129de9b090 (patch)
tree930ef9729b141f61810f2bc530b3abd6c616a3df
parentd3cb71b5510476f6f8aed1b3e9e5585dac317b5e (diff)
parentf7e70b5228affca2dfa2ce1fac57195acd06d0b9 (diff)
Merge fairwaves/stats-work into master
-rw-r--r--include/osmocom/bsc/gsm_data.h2
-rw-r--r--src/osmo-bsc/chan_alloc.c7
-rw-r--r--src/osmo-bsc/gsm_data.c4
-rw-r--r--src/osmo-bsc/paging.c10
-rw-r--r--src/osmo-bsc/timeslot_fsm.c23
5 files changed, 31 insertions, 15 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 1e7e88fe5..d2f6c0972 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1397,6 +1397,7 @@ enum bts_counter_id {
BTS_CTR_PAGING_ATTEMPTED,
BTS_CTR_PAGING_ALREADY,
BTS_CTR_PAGING_RESPONDED,
+ BTS_CTR_PAGING_RESPONDED_ELSEWHERE,
BTS_CTR_PAGING_EXPIRED,
BTS_CTR_PAGING_NO_ACTIVE_PAGING,
BTS_CTR_PAGING_MSC_FLUSH,
@@ -1444,6 +1445,7 @@ static const struct rate_ctr_desc bts_ctr_description[] = {
[BTS_CTR_PAGING_ATTEMPTED] = {"paging:attempted", "Paging attempts for a subscriber."},
[BTS_CTR_PAGING_ALREADY] = {"paging:already", "Paging attempts ignored as subscriber was already being paged."},
[BTS_CTR_PAGING_RESPONDED] = {"paging:responded", "Paging attempts with successful paging response."},
+ [BTS_CTR_PAGING_RESPONDED_ELSEWHERE] = {"paging:responded_elsewhere", "Paging attempts with paging response received on another BTS with the same LAC."},
[BTS_CTR_PAGING_EXPIRED] = {"paging:expired", "Paging Request expired because of timeout T3113."},
[BTS_CTR_PAGING_NO_ACTIVE_PAGING] = {"paging:no_active_paging", "Paging response without an active paging request (arrived after paging expiration?)."},
[BTS_CTR_PAGING_MSC_FLUSH] = {"paging:msc_flush", "Paging flushed due to MSC Reset BSSMAP message."},
diff --git a/src/osmo-bsc/chan_alloc.c b/src/osmo-bsc/chan_alloc.c
index f23a982a1..226984d56 100644
--- a/src/osmo-bsc/chan_alloc.c
+++ b/src/osmo-bsc/chan_alloc.c
@@ -45,7 +45,7 @@ void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts)
llist_for_each_entry(trx, &bts->trx_list, list) {
int i;
- /* skip administratively deactivated tranxsceivers */
+ /* skip administratively deactivated transceivers */
if (!trx_is_usable(trx))
continue;
@@ -58,6 +58,11 @@ void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts)
if (!nm_is_running(&ts->mo.nm_state))
continue;
+ /* skip timeslots which are not yet initialized or which
+ * have been de-initialized due to RSL link going down */
+ if (ts->fi->state == TS_ST_NOT_INITIALIZED)
+ continue;
+
/* Dynamic timeslots have to be counted separately
* when not in TCH/F or TCH/H mode because they don't
* have an lchan's allocated to them. At the same time,
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 46e26acff..0df45bf5c 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -1373,6 +1373,10 @@ bool ts_is_tch(struct gsm_bts_trx_ts *ts)
bool trx_is_usable(const struct gsm_bts_trx *trx)
{
+ /* not usable when RSL link is down */
+ if (trx->rsl_link == NULL)
+ return false;
+
/* FIXME: How does this behave for BS-11 ? */
if (is_ipaccess_bts(trx->bts)) {
if (!nm_is_running(&trx->mo.nm_state) ||
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index 7b89dad9b..22e572a6b 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -59,12 +59,6 @@ void *tall_paging_ctx = NULL;
#define PAGING_TIMER 0, 500000
/*
- * TODO MSCSPLIT: the paging in libbsc is closely tied to MSC land in that the
- * MSC realm callback functions used to be invoked from the BSC/BTS level. So
- * this entire file needs to be rewired for use with an A interface.
- */
-
-/*
* Kill one paging request update the internal list...
*/
static void paging_remove_request(struct gsm_bts_paging_state *paging_bts,
@@ -441,7 +435,9 @@ void paging_request_stop(struct llist_head *bts_list,
/* Sort of an optimization. */
if (bts == _bts)
continue;
- _paging_request_stop(bts, bsub, NULL, NULL);
+ if (_paging_request_stop(bts, bsub, NULL, NULL) == 0) {
+ rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_PAGING_RESPONDED_ELSEWHERE]);
+ }
}
log_set_context(LOG_CTX_BSC_SUBSCR, NULL);
}
diff --git a/src/osmo-bsc/timeslot_fsm.c b/src/osmo-bsc/timeslot_fsm.c
index 4816dafb5..541cfd97e 100644
--- a/src/osmo-bsc/timeslot_fsm.c
+++ b/src/osmo-bsc/timeslot_fsm.c
@@ -750,14 +750,25 @@ static int ts_fsm_timer_cb(struct osmo_fsm_inst *fi)
}
}
+static void _count_borken_on_teardown(struct osmo_fsm_inst *fi)
+{
+ struct gsm_bts_trx_ts *ts = ts_fi_ts(fi);
+ if (ts->fi->state == TS_ST_BORKEN) {
+ rate_ctr_inc(&ts->trx->bts->bts_ctrs->ctr[BTS_CTR_TS_BORKEN_EV_TEARDOWN]);
+ osmo_stat_item_dec(ts->trx->bts->bts_statg->items[BTS_STAT_TS_BORKEN], 1);
+ }
+}
+
static void ts_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct gsm_bts_trx_ts *ts = ts_fi_ts(fi);
switch (event) {
case TS_EV_OML_DOWN:
ts->is_oml_ready = false;
- if (fi->state != TS_ST_NOT_INITIALIZED)
+ if (fi->state != TS_ST_NOT_INITIALIZED) {
+ _count_borken_on_teardown(fi);
osmo_fsm_inst_state_chg(fi, TS_ST_NOT_INITIALIZED, 0, 0);
+ }
OSMO_ASSERT(fi->state == TS_ST_NOT_INITIALIZED);
ts_terminate_lchan_fsms(ts);
ts->pchan_is = ts->pchan_on_init = GSM_PCHAN_NONE;
@@ -766,8 +777,10 @@ static void ts_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data
case TS_EV_RSL_DOWN:
ts->is_rsl_ready = false;
- if (fi->state != TS_ST_NOT_INITIALIZED)
+ if (fi->state != TS_ST_NOT_INITIALIZED) {
+ _count_borken_on_teardown(fi);
osmo_fsm_inst_state_chg(fi, TS_ST_NOT_INITIALIZED, 0, 0);
+ }
OSMO_ASSERT(fi->state == TS_ST_NOT_INITIALIZED);
ts->pchan_is = GSM_PCHAN_NONE;
ts_lchans_dispatch(ts, -1, LCHAN_EV_TS_ERROR);
@@ -780,11 +793,7 @@ static void ts_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data
static void ts_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)
{
- struct gsm_bts_trx_ts *ts = ts_fi_ts(fi);
- if (ts->fi->state == TS_ST_BORKEN) {
- rate_ctr_inc(&ts->trx->bts->bts_ctrs->ctr[BTS_CTR_TS_BORKEN_EV_TEARDOWN]);
- osmo_stat_item_dec(ts->trx->bts->bts_statg->items[BTS_STAT_TS_BORKEN], 1);
- }
+ _count_borken_on_teardown(fi);
}
#define S(x) (1 << (x))