pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-bsc/+/27935 )
Change subject: paging: Estimate available_slots based on BTS config when no CCCH Load Ind
received
......................................................................
paging: Estimate available_slots based on BTS config when no CCCH Load Ind received
Related: OS#5537
Change-Id: I2df68e10eb549d62765ad3b25429f7fe2d5bb0b9
---
M include/osmocom/bsc/paging.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/paging.c
3 files changed, 22 insertions(+), 11 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
diff --git a/include/osmocom/bsc/paging.h b/include/osmocom/bsc/paging.h
index 593529d..2102e04 100644
--- a/include/osmocom/bsc/paging.h
+++ b/include/osmocom/bsc/paging.h
@@ -128,5 +128,7 @@
void paging_flush_bts(struct gsm_bts *bts, struct bsc_msc_data *msc);
void paging_flush_network(struct gsm_network *net, struct bsc_msc_data *msc);
+uint16_t paging_estimate_available_slots(struct gsm_bts *bts, unsigned int time_span_s);
+
int bsc_paging_start(struct bsc_paging_params *params);
#endif
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 627af11..bacfa64 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -2341,8 +2341,7 @@
case RSL_IE_PAGING_LOAD:
sd.pg_buf_space = rslh->data[1] << 8 | rslh->data[2];
if (is_ipaccess_bts(sign_link->trx->bts) && sd.pg_buf_space ==
UINT16_MAX) {
- /* paging load below configured threshold, use 50 as default */
- sd.pg_buf_space = 50;
+ sd.pg_buf_space = paging_estimate_available_slots(sd.bts,
sd.bts->ccch_load_ind_period);
}
paging_update_buffer_space(sign_link->trx->bts, sd.pg_buf_space);
osmo_signal_dispatch(SS_CCCH, S_CCCH_PAGING_LOAD, &sd);
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index c0649da..5be7d81 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -119,11 +119,10 @@
static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_bts);
static void paging_give_credit(void *data)
{
- struct gsm_bts_paging_state *paging_bts = data;
-
- LOG_BTS(paging_bts->bts, DPAG, LOGL_NOTICE, "No PCH LOAD IND, adding 20
slots)\n");
- paging_bts->available_slots = 20;
- paging_handle_pending_requests(paging_bts);
+ struct gsm_bts_paging_state *paging_bts_st = data;
+ struct gsm_bts *bts = paging_bts_st->bts;
+ paging_bts_st->available_slots = paging_estimate_available_slots(bts,
bts->ccch_load_ind_period * 2);
+ paging_handle_pending_requests(paging_bts_st);
}
/*! count the number of free channels for given RSL channel type required
@@ -187,6 +186,7 @@
{
struct gsm_paging_request *request, *initial_request;
unsigned int num_paged = 0;
+ struct gsm_bts *bts = paging_bts->bts;
/*
* Determine if the pending_requests list is empty and
@@ -198,7 +198,7 @@
}
/* Skip paging if the bts is down. */
- if (!paging_bts->bts->oml_link)
+ if (!bts->oml_link)
goto sched_next_iter;
/* do while loop: Try send at most first MAX_PAGE_REQ_PER_ITER paging
@@ -217,7 +217,7 @@
* to zero and we do not get any messages.
*/
if (paging_bts->available_slots == 0) {
- osmo_timer_schedule(&paging_bts->credit_timer, 5, 0);
+ osmo_timer_schedule(&paging_bts->credit_timer, bts->ccch_load_ind_period *
2, 0);
return;
}
@@ -259,8 +259,7 @@
{
bts->paging.bts = bts;
bts->paging.free_chans_need = -1;
- /* Large number, until we get a proper message */
- bts->paging.available_slots = 20;
+ bts->paging.available_slots = paging_estimate_available_slots(bts,
bts->ccch_load_ind_period * 2);
INIT_LLIST_HEAD(&bts->paging.pending_requests);
osmo_timer_setup(&bts->paging.work_timer, paging_worker, &bts->paging);
osmo_timer_setup(&bts->paging.credit_timer, paging_give_credit,
&bts->paging);
@@ -547,3 +546,14 @@
llist_for_each_entry(bts, &net->bts_list, list)
paging_flush_bts(bts, msc);
}
+
+/*! Estimate available_slots credit over a time period, used when below CCCH Load
Indication Threshold */
+uint16_t paging_estimate_available_slots(struct gsm_bts *bts, unsigned int time_span_s)
+{
+ /* TODO: use gsm48_number_of_paging_subchannels() instead? */
+ unsigned int n_pag_blocks = gsm0502_get_n_pag_blocks(&bts->si_common.chan_desc);
+ uint16_t available_slots = n_pag_blocks * time_span_s * 1000000 /
GSM51_MFRAME_DURATION_us;
+ LOG_BTS(bts, DPAG, LOGL_DEBUG, "Estimated %u paging available_slots over %u
seconds\n",
+ available_slots, time_span_s);
+ return available_slots;
+}
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc/+/27935
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2df68e10eb549d62765ad3b25429f7fe2d5bb0b9
Gerrit-Change-Number: 27935
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: merged