From 503ce004d79da53cd30cb569d7a0f764978e0747 Mon Sep 17 00:00:00 2001 From: Alexander Chemeris Date: Fri, 22 May 2020 21:26:32 +0300 Subject: stats: Add a BTS counter for paging rqsts responded elsewhere. If we have several BTS in a single LAC, only one of them will respond to the paging. Without this counter this situation will lead to "lost" paging requests, i.e. in disparity between attempted pagings and expired/responded/etc pagings. Now the sum of all paging response counters should actually match the attempted counter. Change-Id: I4b27a0559ef2762e62bc3ac30000f17b89b0ed48 --- include/osmocom/bsc/gsm_data.h | 2 ++ src/osmo-bsc/paging.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index a2e103d2e..38df1dce3 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1411,6 +1411,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_CHAN_ACT_TOTAL, @@ -1457,6 +1458,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_CHAN_ACT_TOTAL] = {"chan_act:total", "Total number of Channel Activations."}, diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index d32cded54..3da6ecce7 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -441,7 +441,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)) { + rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_PAGING_RESPONDED_ELSEWHERE]); + } } log_set_context(LOG_CTX_BSC_SUBSCR, NULL); } -- cgit v1.2.3 From 5ba2a9d069b58ddd6ebde087a0d28b8d2ff194a7 Mon Sep 17 00:00:00 2001 From: Alexander Chemeris Date: Fri, 22 May 2020 21:43:57 +0300 Subject: stats: Count paging requests flushed due to MSC Reset. Change-Id: Ie93fc54fecdfcf615483f7f41a36dbcea61a537b --- include/osmocom/bsc/gsm_data.h | 2 ++ src/osmo-bsc/paging.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 38df1dce3..214ad7fd2 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1414,6 +1414,7 @@ enum bts_counter_id { BTS_CTR_PAGING_RESPONDED_ELSEWHERE, BTS_CTR_PAGING_EXPIRED, BTS_CTR_PAGING_NO_ACTIVE_PAGING, + BTS_CTR_PAGING_MSC_FLUSH, BTS_CTR_CHAN_ACT_TOTAL, BTS_CTR_CHAN_ACT_NACK, BTS_CTR_RSL_UNKNOWN, @@ -1461,6 +1462,7 @@ static const struct rate_ctr_desc bts_ctr_description[] = { [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."}, [BTS_CTR_CHAN_ACT_TOTAL] = {"chan_act:total", "Total number of Channel Activations."}, [BTS_CTR_CHAN_ACT_NACK] = {"chan_act:nack", "Number of Channel Activations that the BTS NACKed"}, [BTS_CTR_RSL_UNKNOWN] = {"rsl:unknown", "Number of unknown/unsupported RSL messages received from BTS"}, diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index 3da6ecce7..92039f6e8 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -489,6 +489,7 @@ struct bsc_msc_data *paging_get_msc(struct gsm_bts *bts, struct bsc_subscr *bsub void paging_flush_bts(struct gsm_bts *bts, struct bsc_msc_data *msc) { struct gsm_paging_request *req, *req2; + int num_cancelled = 0; paging_init_if_needed(bts); @@ -498,7 +499,10 @@ void paging_flush_bts(struct gsm_bts *bts, struct bsc_msc_data *msc) /* now give up the data structure */ LOG_BTS(bts, DPAG, LOGL_DEBUG, "Stop paging %s (flush)\n", bsc_subscr_name(req->bsub)); paging_remove_request(&bts->paging, req); + num_cancelled++; } + + rate_ctr_add(&bts->bts_ctrs->ctr[BTS_CTR_PAGING_MSC_FLUSH], num_cancelled); } /*! Flush all paging requests issued by \a msc on any BTS in \a net */ -- cgit v1.2.3 From e27384b2cc59b5ccbd05a1f42c83d4d6e0b6ec74 Mon Sep 17 00:00:00 2001 From: Alexander Chemeris Date: Sat, 23 May 2020 00:54:15 +0300 Subject: paging: Remove obsolete comment. I beleive MSC split is finished a long time ago and everything is already re-wired for the A-interface. Change-Id: If2a0b15e360c44abc92fdeb9004be7ccc0537cdd --- src/osmo-bsc/paging.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c index 92039f6e8..d61d8dd72 100644 --- a/src/osmo-bsc/paging.c +++ b/src/osmo-bsc/paging.c @@ -58,12 +58,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... */ -- cgit v1.2.3 From 7af245de7f3364c818cdd18c506dafad3a11ab26 Mon Sep 17 00:00:00 2001 From: Alexander Chemeris Date: Sun, 24 May 2020 01:13:34 +0300 Subject: bsc_subscr_conn_fsm: Fix crash in gscon_forget_lchan() conn->fi might be NULL and thus can't be safely dereferenced. E.g. we're checking if it's NULL or not just a few lines above. so we should here as well. Here is a backtrace for the crash: (gdb) bt 0 0x000055b948002772 in gscon_forget_lchan (conn=0x55b949c6b870, lchan=lchan@entry=0x7f00ae9ade68) at bsc_subscr_conn_fsm.c:718 1 0x000055b948036c84 in lchan_fsm_wait_rf_release_ack_onenter (fi=, prev_state=) at lchan_fsm.c:1040 2 0x00007f00afc6a599 in state_chg (fi=fi@entry=0x55b949bcfe10, new_state=new_state@entry=8, keep_timer=keep_timer@entry=false, timeout_ms=2000, T=3111, file=, line=1344) at fsm.c:699 3 0x00007f00afc6aa5d in _osmo_fsm_inst_state_chg (fi=fi@entry=0x55b949bcfe10, new_state=new_state@entry=8, timeout_secs=, T=, file=, line=) at fsm.c:748 4 0x00007f00afc78e62 in _osmo_tdef_fsm_inst_state_chg (fi=fi@entry=0x55b949bcfe10, state=state@entry=8, timeouts_array=timeouts_array@entry=0x55b9482b56a0 , tdefs=, default_timeout=140730455622800, default_timeout@entry=5, file=file@entry=0x55b948079d39 "lchan_fsm.c", line=1344) at tdef.c:346 5 0x000055b9480341eb in lchan_fsm_timer_cb (fi=0x55b949bcfe10) at lchan_fsm.c:1344 6 0x00007f00afc6b84a in fsm_tmr_cb (data=0x55b949bcfe10) at fsm.c:325 7 0x00007f00afc65926 in osmo_timers_update () at timer.c:257 8 0x00007f00afc65cda in _osmo_select_main (polling=0) at select.c:260 9 0x00007f00afc66526 in osmo_select_main_ctx (polling=) at select.c:291 10 0x000055b947fdcadf in main (argc=, argv=) at osmo_bsc_main.c:953 (gdb) p conn->fi $1 = (struct osmo_fsm_inst *) 0x0 Change-Id: I2427266ef4660935cde899462fa6df8d785c420e --- src/osmo-bsc/bsc_subscr_conn_fsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 0b475ff92..3da9d6678 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -715,7 +715,7 @@ void gscon_forget_lchan(struct gsm_subscriber_connection *conn, struct gsm_lchan osmo_fsm_inst_name(conn->fi), detach_label); } - if (conn->fi->state != ST_CLEARING + if ((conn->fi && conn->fi->state != ST_CLEARING) && !conn->lchan && !conn->ho.new_lchan && !conn->assignment.new_lchan) -- cgit v1.2.3