pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27885 )
Change subject: paging: Submit up to 20 paging requests in a single work iteration
......................................................................
paging: Submit up to 20 paging requests in a single work iteration
Having one paging request being sent every PAGING_TIMER (500msec) is too
slow in case BSC is serving lots of subscribers on a BTS. Hence, we want
to send many paging requests at once while still trying not to fill the
BTS buffer.
Morever, we don't want to send tons of paging requests at once, hence we
limit the amount of paging requests sent in one timer iteration
(MAX_PAGE_REQ_PER_ITER) in order to avoid the BSC doing lots of work
there at once, keeping it busy from processing other tasks.
Related: SYS#5922
Change-Id: I609fa67834b426456f48f6fb2acb601c5905f178
---
M src/osmo-bsc/paging.c
1 file changed, 48 insertions(+), 34 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index 898fa95..f81713e 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -60,6 +60,9 @@
#define PAGING_TIMER 0, 500000
+/* How many paging requests to Tx on RSL at max before going back to main loop */
+#define MAX_PAGE_REQ_PER_ITER 20
+
/*
* Kill one paging request update the internal list...
*/
@@ -182,7 +185,8 @@
*/
static void paging_handle_pending_requests(struct gsm_bts_paging_state *paging_bts)
{
- struct gsm_paging_request *request = NULL;
+ struct gsm_paging_request *request, *initial_request;
+ unsigned int num_paged = 0;
/*
* Determine if the pending_requests list is empty and
@@ -193,43 +197,53 @@
return;
}
- /*
- * In case the BTS does not provide us with load indication and we
- * ran out of slots, call an autofill routine. It might be that the
- * BTS did not like our paging messages and then we have counted down
- * to zero and we do not get any messages.
- */
- if (paging_bts->available_slots == 0) {
- osmo_timer_schedule(&paging_bts->credit_timer, 5, 0);
- return;
- }
-
- request = llist_first_entry(&paging_bts->pending_requests,
- struct gsm_paging_request, entry);
-
- /* we need to determine the number of free channels */
- if (paging_bts->free_chans_need != -1 &&
- can_send_pag_req(request->bts, request->chan_type) != 0) {
- LOG_PAGING_BTS(request, request->bts, DPAG, LOGL_INFO,
- "Paging delayed: not enough free channels (<%d)\n",
- paging_bts->free_chans_need);
- goto skip_paging;
- }
-
/* Skip paging if the bts is down. */
- if (!request->bts->oml_link)
- goto skip_paging;
+ if (!paging_bts->bts->oml_link)
+ goto sched_next_iter;
- /* handle the paging request now */
- page_ms(request);
- paging_bts->available_slots--;
- request->attempts++;
+ /* 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
+ * until we find the first req again, in order to avoid retransmitting
+ * repeated requests until next time paging is scheduled. */
+ initial_request = llist_first_entry(&paging_bts->pending_requests,
+ struct gsm_paging_request, entry);
+ request = initial_request;
+ do {
+ /*
+ * In case the BTS does not provide us with load indication and we
+ * ran out of slots, call an autofill routine. It might be that the
+ * BTS did not like our paging messages and then we have counted down
+ * to zero and we do not get any messages.
+ */
+ if (paging_bts->available_slots == 0) {
+ osmo_timer_schedule(&paging_bts->credit_timer, 5, 0);
+ return;
+ }
- /* take the current and add it to the back */
- llist_del(&request->entry);
- llist_add_tail(&request->entry, &paging_bts->pending_requests);
+ /* we need to determine the number of free channels */
+ if (paging_bts->free_chans_need != -1 &&
+ can_send_pag_req(request->bts, request->chan_type) != 0) {
+ LOG_PAGING_BTS(request, request->bts, DPAG, LOGL_INFO,
+ "Paging delayed: not enough free channels (<%d)\n",
+ paging_bts->free_chans_need);
+ goto sched_next_iter;
+ }
-skip_paging:
+ /* handle the paging request now */
+ page_ms(request);
+ paging_bts->available_slots--;
+ request->attempts++;
+ num_paged++;
+
+ llist_del(&request->entry);
+ llist_add_tail(&request->entry, &paging_bts->pending_requests);
+ request = llist_first_entry(&paging_bts->pending_requests,
+ struct gsm_paging_request, entry);
+ } while (request != initial_request && num_paged < MAX_PAGE_REQ_PER_ITER);
+
+ /* Once done iterating, prepare next scheduling: */
+sched_next_iter:
osmo_timer_schedule(&paging_bts->work_timer, PAGING_TIMER);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27885
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I609fa67834b426456f48f6fb2acb601c5905f178
Gerrit-Change-Number: 27885
Gerrit-PatchSet: 7
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27897 )
Change subject: paging: Prioritize requests for new subscribers over retransmitions
......................................................................
paging: Prioritize requests for new subscribers over retransmitions
Currently, the Tx paging_req queue at the BSC always has new paging
requests adding at the end (as long as the subscriber is not already in
the queue).
That means, if the queue is full of retransmitions, it will take a long
time until the first paging_req is sent towards that subscriber.
The rationale here is that it makes sense to attempt the first paging
ASAP, and give lower prio to paging_req retransmitions, since it may
well be that those other subsribers are not available/reachable and
won't answer.
Related: SYS#5922
Change-Id: I1ae6d97152c458247bc538233b97c2d245196359
---
M src/osmo-bsc/paging.c
1 file changed, 24 insertions(+), 20 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index f81713e..3275473 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -266,20 +266,6 @@
osmo_timer_setup(&bts->paging.credit_timer, paging_give_credit, &bts->paging);
}
-/*! do we have any pending paging requests for given subscriber? */
-static int paging_pending_request(struct gsm_bts_paging_state *bts,
- struct bsc_subscr *bsub)
-{
- struct gsm_paging_request *req;
-
- llist_for_each_entry(req, &bts->pending_requests, entry) {
- if (bsub == req->bsub)
- return 1;
- }
-
- return 0;
-}
-
/*! Call-back once T3113 (paging timeout) expires for given paging_request */
static void paging_T3113_expired(void *data)
{
@@ -342,15 +328,27 @@
static int _paging_request(const struct bsc_paging_params *params, struct gsm_bts *bts)
{
struct gsm_bts_paging_state *bts_entry = &bts->paging;
- struct gsm_paging_request *req;
+ struct gsm_paging_request *req, *last_initial_req = NULL;
unsigned int t3113_timeout_s;
rate_ctr_inc(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_PAGING_ATTEMPTED));
- if (paging_pending_request(bts_entry, params->bsub)) {
- LOG_PAGING_BTS(params, bts, DPAG, LOGL_INFO, "Paging request already pending for this subscriber\n");
- rate_ctr_inc(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_PAGING_ALREADY));
- return -EEXIST;
+ /* Iterate list of pending requests to find if we already have one for
+ * the given subscriber. While on it, find the last
+ * not-yet-ever-once-transmitted request; the new request will be added
+ * immediately after it, giving higher prio to initial transmissions
+ * (no retrans). This avoids new subscribers being paged to be delayed
+ * if the paging queue is full due to a lot of retranmissions.
+ * Retranmissions usually mean MS are not reachable/available, so the
+ * rationale here is to prioritize new subs which may be available. */
+ llist_for_each_entry(req, &bts_entry->pending_requests, entry) {
+ if (params->bsub == req->bsub) {
+ LOG_PAGING_BTS(params, bts, DPAG, LOGL_INFO, "Paging request already pending for this subscriber\n");
+ rate_ctr_inc(rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_PAGING_ALREADY));
+ return -EEXIST;
+ }
+ if (req->attempts == 0)
+ last_initial_req = req;
}
LOG_PAGING_BTS(params, bts, DPAG, LOGL_DEBUG, "Start paging\n");
@@ -364,9 +362,15 @@
req->chan_type = params->chan_needed;
req->msc = params->msc;
osmo_timer_setup(&req->T3113, paging_T3113_expired, req);
+
+ /* there's no initial req (attempts==0), add to the start of the list */
+ if (last_initial_req == NULL)
+ llist_add(&req->entry, &bts_entry->pending_requests);
+ else/* Add in the middle of the list after last_initial_req */
+ __llist_add(&req->entry, &last_initial_req->entry, last_initial_req->entry.next);
+
t3113_timeout_s = calculate_timer_3113(bts);
osmo_timer_schedule(&req->T3113, t3113_timeout_s, 0);
- llist_add_tail(&req->entry, &bts_entry->pending_requests);
paging_schedule_if_needed(bts_entry);
return 0;
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27897
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I1ae6d97152c458247bc538233b97c2d245196359
Gerrit-Change-Number: 27897
Gerrit-PatchSet: 6
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: dexter <pmaier(a)sysmocom.de>
Gerrit-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: merged
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27885 )
Change subject: paging: Submit up to 20 paging requests in a single work iteration
......................................................................
Patch Set 6: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27885
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I609fa67834b426456f48f6fb2acb601c5905f178
Gerrit-Change-Number: 27885
Gerrit-PatchSet: 6
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Apr 2022 14:12:54 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/27929 )
Change subject: Check RSPRO component type; print error if type doesn't match
......................................................................
Check RSPRO component type; print error if type doesn't match
If one component connects to another component, verify that the
remote component type (bank/server/client) matches our expectation.
This is important in order to detect a misconfiguration of port numbers,
for example.
Closes: OS#5548
Change-Id: I89a4fc4331e8a0622f8f146c7fc235d34d990497
---
M src/bankd/bankd_main.c
M src/client/remsim_client.c
2 files changed, 21 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/29/27929/1
diff --git a/src/bankd/bankd_main.c b/src/bankd/bankd_main.c
index fcdbf76..40c1f08 100644
--- a/src/bankd/bankd_main.c
+++ b/src/bankd/bankd_main.c
@@ -174,6 +174,13 @@
switch (pdu->msg.present) {
case RsproPDUchoice_PR_connectBankRes:
+ if (pdu->msg.choice.connectBankRes.identity.type != ComponentType_remsimServer) {
+ LOGPFSML(srvc->fi, LOGL_ERROR, "Server connection to a ComponentType(%u) != RemsimServer? "
+ "Check your IP/Port configuration\n",
+ pdu->msg.choice.connectBankRes.identity.type);
+ osmo_fsm_inst_dispatch(srvc->fi, SRVC_E_DISCONNECT, NULL);
+ return -1;
+ }
/* Store 'identity' of server in srvc->peer_comp_id */
rspro_comp_id_retrieve(&srvc->peer_comp_id, &pdu->msg.choice.connectBankRes.identity);
osmo_fsm_inst_dispatch(srvc->fi, SRVC_E_CLIENT_CONN_RES, (void *) pdu);
diff --git a/src/client/remsim_client.c b/src/client/remsim_client.c
index 8da82ef..19e8f0a 100644
--- a/src/client/remsim_client.c
+++ b/src/client/remsim_client.c
@@ -67,6 +67,13 @@
switch (pdu->msg.present) {
case RsproPDUchoice_PR_connectClientRes:
+ if (pdu->msg.choice.connectClientRes.identity.type != ComponentType_remsimBankd) {
+ LOGPFSML(bankdc->fi, LOGL_ERROR, "Server connection to a ComponentType(%u) != RemsimBankd? "
+ "Check your IP/Port configuration\n",
+ pdu->msg.choice.connectClientRes.identity.type);
+ osmo_fsm_inst_dispatch(bankdc->fi, SRVC_E_DISCONNECT, NULL);
+ return -1;
+ }
/* Store 'identity' of bankd to in peer_comp_id */
rspro_comp_id_retrieve(&bankdc->peer_comp_id, &pdu->msg.choice.connectClientRes.identity);
osmo_fsm_inst_dispatch(bankdc->fi, SRVC_E_CLIENT_CONN_RES, (void *) pdu);
@@ -94,6 +101,13 @@
switch (pdu->msg.present) {
case RsproPDUchoice_PR_connectClientRes:
+ if (pdu->msg.choice.connectClientRes.identity.type != ComponentType_remsimServer) {
+ LOGPFSML(srvc->fi, LOGL_ERROR, "Server connection to a ComponentType(%u) != RemsimServer? "
+ "Check your IP/Port configuration\n",
+ pdu->msg.choice.connectClientRes.identity.type);
+ osmo_fsm_inst_dispatch(srvc->fi, SRVC_E_DISCONNECT, NULL);
+ return -1;
+ }
/* Store 'identity' of server in srvc->peer_comp_id */
rspro_comp_id_retrieve(&srvc->peer_comp_id, &pdu->msg.choice.connectClientRes.identity);
osmo_fsm_inst_dispatch(srvc->fi, SRVC_E_CLIENT_CONN_RES, (void *) pdu);
--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/27929
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I89a4fc4331e8a0622f8f146c7fc235d34d990497
Gerrit-Change-Number: 27929
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27923 )
Change subject: osmobts: list all features of latest osmobts
......................................................................
Patch Set 2:
(1 comment)
File src/osmo-bsc/bts_osmobts.c:
https://gerrit.osmocom.org/c/osmo-bsc/+/27923/comment/75426a0e_324d9a09
PS1, Line 213: osmo_bts_set_feature(&model_osmobts.features, BTS_FEAT_ABIS_OSMO_PCU);
> So in here you are actually putting up to date the expected set of features an up-to-date osmo-bts s […]
Yes. The idea was that we put here everything that OsmoBTS may support the most, and then can use this to verify the VTY commands before the OsmoBTS reported the available features. See channel hopping for example (now in this patch).
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27923
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7fca42a39a4bc98a6ea8b9cfab28c4bad3a6a0aa
Gerrit-Change-Number: 27923
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Apr 2022 13:48:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: pespin.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27919 )
Change subject: abis_nm: don't compare assumed/reported features
......................................................................
Patch Set 2:
(1 comment)
File src/osmo-bsc/abis_nm.c:
https://gerrit.osmocom.org/c/osmo-bsc/+/27919/comment/d5559cdc_82524105
PS1, Line 603: if (i >= _NUM_BTS_FEAT) {
> I'd rather put this check before the osmo_bts_has_feature() one, because otherwise you'll probably n […]
Done in https://gerrit.osmocom.org/c/osmo-bsc/+/27928/1
--
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: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Apr 2022 13:47:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: pespin, fixeria.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27921 )
Change subject: Always use reported features if available
......................................................................
Patch Set 1:
(2 comments)
File src/osmo-bsc/bts.c:
https://gerrit.osmocom.org/c/osmo-bsc/+/27921/comment/2186f4b5_ab576150
PS1, Line 693: !osmo_bts_has_feature(&bts->features, BTS_FEAT_GPRS)) {
> note: model->features field can probably be turned const in the struct definition?
This would need some refactoring, currently the various bts models make use of osmo_bts_set_feature(&model.features to set the model's features on initialization.
File src/osmo-bsc/bts_trx_vty.c:
https://gerrit.osmocom.org/c/osmo-bsc/+/27921/comment/9f822830_16cb1905
PS1, Line 346: return CMD_WARNING;
> Have you tested that starting osmo-bsc with 'model osmo-bts' and hopping parameters is still possibl […]
Right, only the later patch https://gerrit.osmocom.org/c/osmo-bsc/+/27923/1 will make the features available in the bts model (so they are used before the bts reports its features). I've moved the change with "return CMD_WARNING" to that patch.
--
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: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 25 Apr 2022 13:46:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment