pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27944 )
Change subject: paging: Decouple retransmit period from regular worker interval
......................................................................
paging: Decouple retransmit period from regular worker interval
Before this patch, on each BTS a 500ms timer was used to schedule some
work, sending up to 20 paging requests verytime.
This means, however, for an initial paging request it may take up to
500ms delay to be scheduled to the BTS, which is huge.
While we still want to maintain this 500ms interval for retransmits, it
doesn't make sense to wait that much for other cases. It's far better
sending less requests (10 instead of 20) every half time (250ms instead
of 500ms), since it will spread the load and paging more over time,
allowing for other work to be done in the middle.
Change-Id: I7a1297452cc4734b6ee8c38fb94cf32f38d57c3d
---
M include/osmocom/bsc/paging.h
M src/osmo-bsc/paging.c
2 files changed, 33 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/44/27944/1
diff --git a/include/osmocom/bsc/paging.h b/include/osmocom/bsc/paging.h
index 2102e04..d9fd501 100644
--- a/include/osmocom/bsc/paging.h
+++ b/include/osmocom/bsc/paging.h
@@ -82,6 +82,8 @@
/* How often did we ask the BTS to page? */
int attempts;
+ /* Timestamp of last time the subscriber was paged */
+ struct timespec last_attempt_ts;
/* MSC that has issued this paging */
struct bsc_msc_data *msc;
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index 8ce3508..c957f9f 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -59,7 +59,19 @@
void *tall_paging_ctx = NULL;
/* How many paging requests to Tx on RSL at max before going back to main loop */
-#define MAX_PAGE_REQ_PER_ITER 20
+#define MAX_PAGE_REQ_PER_ITER 10
+
+/* How often to attempt sending new paging requests (initial, not retrans): 250ms */
+static const struct timespec initial_period = {
+ .tv_sec = 0,
+ .tv_nsec = 250 * 1000 * 100,
+};
+
+/* Minimum period between retransmits of paging req to a subscriber: 500ms */
+static const struct timespec retrans_period = {
+ .tv_sec = 0,
+ .tv_nsec = 500 * 1000 * 100,
+};
/*
* Kill one paging request update the internal list...
@@ -184,6 +196,7 @@
struct gsm_paging_request *request, *initial_request;
unsigned int num_paged = 0;
struct gsm_bts *bts = paging_bts->bts;
+ struct timespec now, retrans_ts;
/*
* Determine if the pending_requests list is empty and
@@ -198,6 +211,8 @@
if (!bts->c0->rsl_link_primary)
goto sched_next_iter;
+ osmo_clock_gettime(CLOCK_MONOTONIC, &now);
+
/* do while loop: Try send at most first MAX_PAGE_REQ_PER_ITER paging
* requests (or before if there are no more available slots). Since
* transmitted requests are re-appended at the end of the list, we check
@@ -222,9 +237,23 @@
goto sched_next_iter;
}
+ /* If we reach around back of the queue (retransmitions), check
+ * if time to retransmit has elapsed. Otherwise, wait until its
+ * time to retransmit. */
+ if (request->attempts > 0) {
+ timespecadd(&request->last_attempt_ts, &retrans_period, &retrans_ts);
+ if (timespeccmp(&now, &retrans_ts, <)) {
+ struct timespec tdiff;
+ timespecsub(&retrans_ts, &now, &tdiff);
+ osmo_timer_schedule(&paging_bts->work_timer, tdiff.tv_sec, tdiff.tv_nsec / 1000);
+ return;
+ }
+ }
+
/* handle the paging request now */
page_ms(request);
paging_bts->available_slots--;
+ request->last_attempt_ts = now;
request->attempts++;
num_paged++;
@@ -236,7 +265,7 @@
/* Once done iterating, prepare next scheduling: */
sched_next_iter:
- osmo_timer_schedule(&paging_bts->work_timer, 0, 500000);
+ osmo_timer_schedule(&paging_bts->work_timer, initial_period.tv_sec, initial_period.tv_nsec / 1000);
}
static void paging_worker(void *data)
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27944
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7a1297452cc4734b6ee8c38fb94cf32f38d57c3d
Gerrit-Change-Number: 27944
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27921 )
Change subject: Always use reported features if available
......................................................................
Always use reported features if available
Instead of sometimes checking against hardcoded BTS model features, and
sometimes against features reported at runtime (which only some BTS
models do):
* copy the hardcoded BTS model features to BTS features initially
* do all checks against BTS features
Related: SYS#5922, OS#5538
Change-Id: Idf2d933aa8b03b1f708e56a08707fe6c620a97aa
---
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_trx_vty.c
M src/osmo-bsc/system_information.c
3 files changed, 12 insertions(+), 6 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index 774384f..54d9cdd 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -615,6 +615,13 @@
int gsm_set_bts_model(struct gsm_bts *bts, struct gsm_bts_model *model)
{
bts->model = model;
+
+ /* Copy hardcoded feature list from BTS model. For some BTS we support
+ * reporting features at runtime (as of writing nanobts, OsmoBTS),
+ * which will then replace this list. */
+ if (model)
+ memcpy(bts->_features_data, bts->model->_features_data, sizeof(bts->_features_data));
+
return 0;
}
@@ -683,11 +690,11 @@
int bts_gprs_mode_is_compat(struct gsm_bts *bts, enum bts_gprs_mode mode)
{
if (mode != BTS_GPRS_NONE &&
- !osmo_bts_has_feature(&bts->model->features, BTS_FEAT_GPRS)) {
+ !osmo_bts_has_feature(&bts->features, BTS_FEAT_GPRS)) {
return 0;
}
if (mode == BTS_GPRS_EGPRS &&
- !osmo_bts_has_feature(&bts->model->features, BTS_FEAT_EGPRS)) {
+ !osmo_bts_has_feature(&bts->features, BTS_FEAT_EGPRS)) {
return 0;
}
diff --git a/src/osmo-bsc/bts_trx_vty.c b/src/osmo-bsc/bts_trx_vty.c
index 39584a5..27bba2c 100644
--- a/src/osmo-bsc/bts_trx_vty.c
+++ b/src/osmo-bsc/bts_trx_vty.c
@@ -317,7 +317,7 @@
{
struct gsm_bts_trx_ts *ts = vty->index;
- if (!osmo_bts_has_feature(&ts->trx->bts->model->features, BTS_FEAT_MULTI_TSC)) {
+ if (!osmo_bts_has_feature(&ts->trx->bts->features, BTS_FEAT_MULTI_TSC)) {
vty_out(vty, "%% This BTS does not support a TSC != BCC, "
"falling back to BCC%s", VTY_NEWLINE);
ts->tsc = -1;
@@ -341,7 +341,7 @@
struct gsm_bts_trx_ts *ts = vty->index;
int enabled = atoi(argv[0]);
- if (enabled && !osmo_bts_has_feature(&ts->trx->bts->model->features, BTS_FEAT_HOPPING)) {
+ if (enabled && !osmo_bts_has_feature(&ts->trx->bts->features, BTS_FEAT_HOPPING)) {
vty_out(vty, "%% BTS model does not seem to support freq. hopping%s", VTY_NEWLINE);
/* Allow enabling frequency hopping anyway, because the BTS might not have
* connected yet (thus not sent the feature vector), so we cannot know for
diff --git a/src/osmo-bsc/system_information.c b/src/osmo-bsc/system_information.c
index 187678d..48f7453 100644
--- a/src/osmo-bsc/system_information.c
+++ b/src/osmo-bsc/system_information.c
@@ -1270,8 +1270,7 @@
si13_info.cell_opts.ext_info.ccn_active = bts->gprs.ccn.forced_vty ?
bts->gprs.ccn.active :
- osmo_bts_has_feature(&bts->model->features,
- BTS_FEAT_CCN);
+ osmo_bts_has_feature(&bts->features, BTS_FEAT_CCN);
ret = osmo_gsm48_rest_octets_si13_encode(si13->rest_octets, &si13_info);
if (ret < 0)
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27921
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Idf2d933aa8b03b1f708e56a08707fe6c620a97aa
Gerrit-Change-Number: 27921
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27919 )
Change subject: abis_nm: don't compare assumed/reported features
......................................................................
abis_nm: don't compare assumed/reported features
Just log all reported features, instead of comparing them against an
expected set of features and logging mismatches. The point of reporting
features from the BTS at runtime is that the BSC can support various BTS
versions with various feature sets.
Related: SYS#5922, OS#5538
Change-Id: Ibd79bc7ef802d8e95e05d746df182ff974b78e29
---
M src/osmo-bsc/abis_nm.c
1 file changed, 8 insertions(+), 12 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c
index f7882ac..a4976c0 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -601,21 +601,17 @@
memcpy(bts->_features_data, TLVP_VAL(tp, NM_ATT_MANUF_ID), len);
- /* Check each BTS feature in the reported vector */
+ /* Log each BTS feature in the reported vector */
for (i = 0; i < len * 8; i++) {
- bool Frep = osmo_bts_has_feature(&bts->features, i);
- if (i >= _NUM_BTS_FEAT && Frep) {
- LOGPMO(&bts->mo, DNM, LOGL_NOTICE, "Get Attributes Response: "
- "unknown feature 0x%02x. Consider upgrading osmo-bsc.\n", i);
+ if (!osmo_bts_has_feature(&bts->features, i))
continue;
- }
- bool Fexp = osmo_bts_has_feature(&bts->model->features, i);
- if (!Frep && Fexp) {
- LOGPMO(&bts->mo, DNM, LOGL_NOTICE, "Get Attributes Response: "
- "reported feature '%s' is not supported, while we thought it is.\n",
- osmo_bts_features_name(i));
- }
+ if (i >= _NUM_BTS_FEAT)
+ LOGPMO(&bts->mo, DNM, LOGL_NOTICE, "Get Attributes Response: unknown feature 0x%02x is"
+ " supported\n", i);
+ else
+ LOGPMO(&bts->mo, DNM, LOGL_NOTICE, "Get Attributes Response: feature '%s' is"
+ " supported\n", osmo_bts_features_name(i));
}
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27919
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ibd79bc7ef802d8e95e05d746df182ff974b78e29
Gerrit-Change-Number: 27919
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/27937 )
Change subject: Use internal <osmocom/core/talloc.h> everywhere
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
Patchset:
PS1:
> I was trying to build libosmocore with pseudotalloc for an embedded environment, and this patch made […]
Ok then please explain better what was failing in the commit log if possible.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/27937
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If40e1eefcfa88a2b376becfe057836acdd3a1cc2
Gerrit-Change-Number: 27937
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 26 Apr 2022 11:19:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27943 )
Change subject: paging: Check C0 RSL link instead of OML link
......................................................................
paging: Check C0 RSL link instead of OML link
PAging happens over C0 RSL link, not over OML, so let's actually
validate that the C0 RSL link is up before paging instead of the OML
one.
Change-Id: I11e5bb6f952534763935aa01470e514d4af247ed
---
M src/osmo-bsc/paging.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/43/27943/1
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index 214587d..8ce3508 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -195,7 +195,7 @@
}
/* Skip paging if the bts is down. */
- if (!bts->oml_link)
+ if (!bts->c0->rsl_link_primary)
goto sched_next_iter;
/* do while loop: Try send at most first MAX_PAGE_REQ_PER_ITER paging
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27943
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I11e5bb6f952534763935aa01470e514d4af247ed
Gerrit-Change-Number: 27943
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange