lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

June 2022

  • 3 participants
  • 1374 discussions
Change in osmo-bsc[master]: lchan_select: prepare a list of timeslots once, iterate over it
by fixeria 17 Jun '22

17 Jun '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28326 ) Change subject: lchan_select: prepare a list of timeslots once, iterate over it ...................................................................... lchan_select: prepare a list of timeslots once, iterate over it The lchan_avail_by_type() attempts to find an unused lchan for the given GSM_LCHAN_* value: TCH/F, TCH/H, or SDCCH. This is achieved by looking up timeslots with compatible GSM_PCHAN_* values. For instance, finding an unused SDCCH lchan may involve: * attempt to find a timeslot with pchan=GSM_PCHAN_CCCH_SDCCH4, * attempt to find a timeslot with pchan=GSM_PCHAN_CCCH_SDCCH4_CBCH, * attempt to find a timeslot with pchan=GSM_PCHAN_SDCCH8_SACCH8C, * attempt to find a timeslot with pchan=GSM_PCHAN_SDCCH8_SACCH8C_CBCH, * attempt to find a timeslot with pchan=GSM_PCHAN_OSMO_DYN (switched), * attempt to find a timeslot with pchan=GSM_PCHAN_OSMO_DYN (not switched). Each attempt involves iterating over all timeslots of each TRX, either in ascending or in descending order (see _lc_dyn_find_bts() and _lc_find_trx()). This patch simplifies the lookup logic by preparing a monolithic array of timeslot pointers once, and then using that array for each GSM_PCHAN_* lookup attempt. This also facilitates adding more complex (than ascending/descending) allocation algorithms. Change-Id: I7ccc56856bfd40fd7c63b7437736de60c2b516ff Related: SYS#5460 --- M src/osmo-bsc/lchan_select.c 1 file changed, 81 insertions(+), 71 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/26/28326/1 diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c index ad45dc7..a322f07 100644 --- a/src/osmo-bsc/lchan_select.c +++ b/src/osmo-bsc/lchan_select.c @@ -2,7 +2,7 @@ * * (C) 2008 by Harald Welte <laforge(a)gnumonks.org> * (C) 2008, 2009 by Holger Hans Peter Freyther <zecke(a)selfish.org> - * (C) 2018 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> + * (C) 2018-2022 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> * * All Rights Reserved * @@ -30,6 +30,11 @@ #include <osmocom/bsc/lchan_select.h> #include <osmocom/bsc/bts.h> +struct lchan_select_ts_list { + struct gsm_bts_trx_ts **list; + unsigned int num; +}; + static struct gsm_lchan *pick_better_lchan(struct gsm_lchan *a, struct gsm_lchan *b) { if (!a) @@ -42,14 +47,13 @@ return a; } -static struct gsm_lchan * -_lc_find_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan, - enum gsm_phys_chan_config as_pchan, bool allow_pchan_switch, bool log) +static struct gsm_lchan *_lc_find(struct lchan_select_ts_list *ts_list, + enum gsm_phys_chan_config pchan, + enum gsm_phys_chan_config as_pchan, + bool allow_pchan_switch, bool log) { struct gsm_lchan *lchan; struct gsm_lchan *found_lchan = NULL; - struct gsm_bts_trx_ts *ts; - int j, start, stop, dir; #define LOGPLCHANALLOC(fmt, args...) do { \ if (log) \ @@ -61,28 +65,10 @@ ## args); \ } while (0) - if (!trx_is_usable(trx)) { - LOGPLCHANALLOC("%s trx not usable\n", gsm_trx_name(trx)); - return NULL; - } - - if (trx->bts->chan_alloc_reverse) { - /* check TS 7..0 */ - start = 7; - stop = -1; - dir = -1; - } else { - /* check TS 0..7 */ - start = 0; - stop = 8; - dir = 1; - } - - for (j = start; j != stop; j += dir) { + for (unsigned int tn = 0; tn < ts_list->num; tn++) { + struct gsm_bts_trx_ts *ts = ts_list->list[tn]; int lchans_as_pchan; - ts = &trx->ts[j]; - if (!ts_is_usable(ts)) - continue; + /* The caller first selects what kind of TS to search in, e.g. looking for exact * GSM_PCHAN_TCH_F, or maybe among dynamic GSM_PCHAN_OSMO_DYN... */ if (ts->pchan_on_init != pchan) { @@ -125,7 +111,7 @@ /* When picking an lchan with least interference, continue to loop across all lchans. When * ignoring interference levels, return the first match. */ - if (found_lchan && !trx->bts->chan_alloc_avoid_interf) + if (found_lchan && !ts->trx->bts->chan_alloc_avoid_interf) return found_lchan; } } @@ -141,44 +127,31 @@ #undef LOGPLCHANALLOC } -static struct gsm_lchan * -_lc_dyn_find_bts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan, - enum gsm_phys_chan_config dyn_as_pchan, bool log) +static struct gsm_lchan *lc_dyn_find(struct lchan_select_ts_list *ts_list, + enum gsm_phys_chan_config pchan, + enum gsm_phys_chan_config dyn_as_pchan, + bool log) { - struct gsm_bts_trx *trx; - struct gsm_lchan *lc; - int allow_pchan_switch; - bool try_pchan_switch; + struct gsm_lchan *lchan; /* First find an lchan that needs no change in its timeslot pchan mode. * In particular, this ensures that handover to a dynamic timeslot in TCH/H favors timeslots that are currently * using only one of two TCH/H, so that we don't switch more dynamic timeslots to TCH/H than necessary. * For non-dynamic timeslots, it is not necessary to do a second pass with allow_pchan_switch == * true, because they never switch anyway. */ - try_pchan_switch = (pchan != dyn_as_pchan); - for (allow_pchan_switch = 0; allow_pchan_switch <= (try_pchan_switch ? 1 : 0); allow_pchan_switch++) { - if (bts->chan_alloc_reverse) { - llist_for_each_entry_reverse(trx, &bts->trx_list, list) { - lc = _lc_find_trx(trx, pchan, dyn_as_pchan, (bool)allow_pchan_switch, log); - if (lc) - return lc; - } - } else { - llist_for_each_entry(trx, &bts->trx_list, list) { - lc = _lc_find_trx(trx, pchan, dyn_as_pchan, (bool)allow_pchan_switch, log); - if (lc) - return lc; - } - } - } + if ((lchan = _lc_find(ts_list, pchan, dyn_as_pchan, false, log))) + return lchan; + if ((lchan = _lc_find(ts_list, pchan, dyn_as_pchan, true, log))) + return lchan; return NULL; } -static struct gsm_lchan * -_lc_find_bts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan, bool log) +static struct gsm_lchan *lc_find(struct lchan_select_ts_list *ts_list, + enum gsm_phys_chan_config pchan, + bool log) { - return _lc_dyn_find_bts(bts, pchan, pchan, log); + return _lc_find(ts_list, pchan, pchan, false, log); } enum gsm_chan_t chan_mode_to_chan_type(enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate) @@ -215,6 +188,35 @@ } } +static void populate_ts_list(struct lchan_select_ts_list *ts_list, + struct gsm_bts *bts, + bool log) +{ + struct gsm_bts_trx *trx; + unsigned int num = 0; + + llist_for_each_entry(trx, &bts->trx_list, list) { + for (unsigned int tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) { + struct gsm_bts_trx_ts *ts = &trx->ts[tn]; + if (ts_is_usable(ts)) + ts_list->list[num++] = ts; + else if (log) + LOGP(DRLL, LOGL_DEBUG, "%s is not usable\n", gsm_ts_name(ts)); + } + } + + ts_list->num = num; + + /* Reverse the timeslot list if required */ + if (bts->chan_alloc_reverse) { + for (unsigned int tn = 0; tn < num / 2; tn++) { + struct gsm_bts_trx_ts *temp = ts_list->list[tn]; + ts_list->list[tn] = ts_list->list[num - tn - 1]; + ts_list->list[num - tn - 1] = temp; + } + } +} + struct gsm_lchan *lchan_select_by_chan_mode(struct gsm_bts *bts, enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate) { @@ -228,10 +230,19 @@ { struct gsm_lchan *lchan = NULL; enum gsm_phys_chan_config first, first_cbch, second, second_cbch; + struct lchan_select_ts_list ts_list; if (log) LOG_BTS(bts, DRLL, LOGL_DEBUG, "lchan_avail_by_type(%s)\n", gsm_lchant_name(type)); + /* Allocate an array with pointers to all timeslots of a BTS */ + ts_list.list = talloc_array_ptrtype(bts, ts_list.list, bts->num_trx * 8); + if (OSMO_UNLIKELY(ts_list.list == NULL)) + return NULL; + + /* Populate this array with the actual pointers */ + populate_ts_list(&ts_list, bts, log); + switch (type) { case GSM_LCHAN_SDCCH: if (bts->chan_alloc_reverse) { @@ -246,46 +257,45 @@ second_cbch = GSM_PCHAN_SDCCH8_SACCH8C_CBCH; } - lchan = _lc_find_bts(bts, first, log); + lchan = lc_find(&ts_list, first, log); if (lchan == NULL) - lchan = _lc_find_bts(bts, first_cbch, log); + lchan = lc_find(&ts_list, first_cbch, log); if (lchan == NULL) - lchan = _lc_find_bts(bts, second, log); + lchan = lc_find(&ts_list, second, log); if (lchan == NULL) - lchan = _lc_find_bts(bts, second_cbch, log); + lchan = lc_find(&ts_list, second_cbch, log); /* No dedicated SDCCH available -- try fully dynamic * TCH/F_TCH/H_SDCCH8_PDCH if BTS supports it: */ if (lchan == NULL && osmo_bts_has_feature(&bts->features, BTS_FEAT_DYN_TS_SDCCH8)) - lchan = _lc_dyn_find_bts(bts, - GSM_PCHAN_OSMO_DYN, - GSM_PCHAN_SDCCH8_SACCH8C, log); + lchan = lc_dyn_find(&ts_list, GSM_PCHAN_OSMO_DYN, + GSM_PCHAN_SDCCH8_SACCH8C, log); break; case GSM_LCHAN_TCH_F: - lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F, log); + lchan = lc_find(&ts_list, GSM_PCHAN_TCH_F, log); /* If we don't have TCH/F available, try dynamic TCH/F_PDCH */ if (!lchan) - lchan = _lc_dyn_find_bts(bts, GSM_PCHAN_TCH_F_PDCH, - GSM_PCHAN_TCH_F, log); + lchan = lc_dyn_find(&ts_list, GSM_PCHAN_TCH_F_PDCH, + GSM_PCHAN_TCH_F, log); /* Try fully dynamic TCH/F_TCH/H_PDCH as TCH/F... */ if (!lchan && bts->network->dyn_ts_allow_tch_f) - lchan = _lc_dyn_find_bts(bts, - GSM_PCHAN_OSMO_DYN, - GSM_PCHAN_TCH_F, log); + lchan = lc_dyn_find(&ts_list, GSM_PCHAN_OSMO_DYN, + GSM_PCHAN_TCH_F, log); break; case GSM_LCHAN_TCH_H: - lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H, log); + lchan = lc_find(&ts_list, GSM_PCHAN_TCH_H, log); /* No dedicated TCH/x available -- try fully dynamic * TCH/F_TCH/H_PDCH */ if (!lchan) - lchan = _lc_dyn_find_bts(bts, - GSM_PCHAN_OSMO_DYN, - GSM_PCHAN_TCH_H, log); + lchan = lc_dyn_find(&ts_list, GSM_PCHAN_OSMO_DYN, + GSM_PCHAN_TCH_H, log); break; default: LOG_BTS(bts, DRLL, LOGL_ERROR, "Unknown gsm_chan_t %u\n", type); } + talloc_free(ts_list.list); + return lchan; } -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28326 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I7ccc56856bfd40fd7c63b7437736de60c2b516ff Gerrit-Change-Number: 28326 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-bsc[master]: lchan_select: allow different alloc order for assignment and handover
by fixeria 17 Jun '22

17 Jun '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28327 ) Change subject: lchan_select: allow different alloc order for assignment and handover ...................................................................... lchan_select: allow different alloc order for assignment and handover Change-Id: I3ae73b36ee9433cc768376b56f0765e5f416162f Related: SYS#5460 --- M doc/manuals/chapters/bts-examples.adoc M include/osmocom/bsc/bts.h M include/osmocom/bsc/lchan_select.h M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts_vty.c M src/osmo-bsc/handover_decision_2.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_select.c M tests/handover/handover_test.c M tests/osmo-bsc.vty 12 files changed, 165 insertions(+), 52 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/27/28327/1 diff --git a/doc/manuals/chapters/bts-examples.adoc b/doc/manuals/chapters/bts-examples.adoc index 836dec0..acd748c 100644 --- a/doc/manuals/chapters/bts-examples.adoc +++ b/doc/manuals/chapters/bts-examples.adoc @@ -32,7 +32,9 @@ ms max power 15 cell reselection hysteresis 4 rxlev access min 0 - channel allocator ascending + channel allocator mode chan-req ascending + channel allocator mode assignment ascending + channel allocator mode handover ascending rach tx integer 9 rach max transmission 7 ipa unit-id 1801 0 <4> @@ -110,7 +112,9 @@ ms max power 15 cell reselection hysteresis 4 rxlev access min 0 - channel allocator ascending + channel allocator mode chan-req ascending + channel allocator mode assignment ascending + channel allocator mode handover ascending rach tx integer 9 rach max transmission 7 ipa unit-id 1800 0 <1> @@ -203,7 +207,9 @@ ms max power 15 cell reselection hysteresis 4 rxlev access min 0 - channel allocator ascending + channel allocator mode chan-req ascending + channel allocator mode assignment ascending + channel allocator mode handover ascending rach tx integer 9 rach max transmission 7 oml e1 line 0 timeslot 1 sub-slot full <3> diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index 8abcf13..76945a1 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -517,7 +517,9 @@ /* should the channel allocator allocate channels from high TRX to TRX0, * rather than starting from TRX0 and go upwards? */ - int chan_alloc_reverse; + bool chan_alloc_chan_req_reverse; + bool chan_alloc_assignment_reverse; + bool chan_alloc_handover_reverse; /* When true, interference measurements from the BTS are used in the channel allocator to favor lchans with less * interference reported in RSL Resource Indication. */ diff --git a/include/osmocom/bsc/lchan_select.h b/include/osmocom/bsc/lchan_select.h index 3bb0d1c..b5eb078 100644 --- a/include/osmocom/bsc/lchan_select.h +++ b/include/osmocom/bsc/lchan_select.h @@ -1,9 +1,24 @@ /* Select a suitable lchan from a given cell. */ #pragma once -struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type); +enum lchan_select_reason { + SELECT_FOR_MS_CHAN_REQ, + SELECT_FOR_ASSIGNMENT, + SELECT_FOR_HANDOVER, +}; + +extern const struct value_string lchan_select_reason_names[]; +static inline const char *lchan_select_reason_name(enum lchan_select_reason reason) +{ return get_value_string(lchan_select_reason_names, reason); } + +struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, + enum gsm_chan_t type, + enum lchan_select_reason reason); enum gsm_chan_t chan_mode_to_chan_type(enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate); struct gsm_lchan *lchan_select_by_chan_mode(struct gsm_bts *bts, - enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate); -struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type, bool log); + enum gsm48_chan_mode chan_mode, + enum channel_rate chan_rate, + enum lchan_select_reason reason); +struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type, + enum lchan_select_reason reason, bool log); void lchan_select_set_type(struct gsm_lchan *lchan, enum gsm_chan_t type); diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index f6215d9..7f88096 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -1978,10 +1978,10 @@ ts_for_n_lchans(lchan, ts, ts->max_primary_lchans) { if (lchan->type == GSM_LCHAN_TCH_F || lchan->type == GSM_LCHAN_TCH_H) { if (lchan->fi->state == LCHAN_ST_ESTABLISHED) { - if (!lchan_est || bts->chan_alloc_reverse) + if (!lchan_est || bts->chan_alloc_chan_req_reverse) lchan_est = lchan; } else { - if (!lchan_any || bts->chan_alloc_reverse) + if (!lchan_any || bts->chan_alloc_chan_req_reverse) lchan_any = lchan; } } @@ -2007,12 +2007,12 @@ /* First check the situation on the BTS, if we have TCH/H or TCH/F resources available for another (EMERGENCY) * call. If yes, then no (further) action has to be carried out. */ - if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_F, true)) { + if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_F, SELECT_FOR_MS_CHAN_REQ, true)) { LOG_BTS(rqd->bts, DRSL, LOGL_NOTICE, "CHAN RQD/EMERGENCY-PRIORITY: at least one TCH/F is (now) available!\n"); return false; } - if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_H, true)) { + if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_H, SELECT_FOR_MS_CHAN_REQ, true)) { LOG_BTS(rqd->bts, DRSL, LOGL_NOTICE, "CHAN RQD/EMERGENCY-PRIORITY: at least one TCH/H is (now) available!\n"); return false; @@ -2083,7 +2083,7 @@ int free_tchf, free_tchh; bool needs_dyn_switch; - lchan = lchan_avail_by_type(bts, GSM_LCHAN_SDCCH, false); + lchan = lchan_avail_by_type(bts, GSM_LCHAN_SDCCH, SELECT_FOR_MS_CHAN_REQ, false); if (!lchan) return NULL; @@ -2172,7 +2172,8 @@ if (rqd->reason == GSM_CHREQ_REASON_CALL) { lchan = _select_sdcch_for_call(bts, rqd, lctype); } else if (rqd->reason != GSM_CHREQ_REASON_EMERG) { - lchan = lchan_select_by_type(bts, GSM_LCHAN_SDCCH); + lchan = lchan_select_by_type(bts, GSM_LCHAN_SDCCH, + SELECT_FOR_MS_CHAN_REQ); } /* else: Emergency calls will be put on a free TCH/H or TCH/F directly * in the code below, all other channel requests will get an SDCCH first @@ -2187,13 +2188,15 @@ LOG_BTS(bts, DRSL, LOGL_NOTICE, "CHAN RQD[%s]: no resources for %s 0x%x, retrying with %s\n", get_value_string(gsm_chreq_descs, rqd->reason), gsm_lchant_name(GSM_LCHAN_SDCCH), rqd->ref.ra, gsm_lchant_name(GSM_LCHAN_TCH_H)); - lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_H); + lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_H, + SELECT_FOR_MS_CHAN_REQ); } if (!lchan) { LOG_BTS(bts, DRSL, LOGL_NOTICE, "CHAN RQD[%s]: no resources for %s 0x%x, retrying with %s\n", get_value_string(gsm_chreq_descs, rqd->reason), gsm_lchant_name(GSM_LCHAN_SDCCH), rqd->ref.ra, gsm_lchant_name(GSM_LCHAN_TCH_F)); - lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_F); + lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_F, + SELECT_FOR_MS_CHAN_REQ); } } if (!lchan) { diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index a0d008d..209545f 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -604,7 +604,9 @@ /* Try to allocate a new lchan in order of preference */ for (i = 0; i < req->n_ch_mode_rate; i++) { conn->assignment.new_lchan = lchan_select_by_chan_mode(bts, - req->ch_mode_rate_list[i].chan_mode, req->ch_mode_rate_list[i].chan_rate); + req->ch_mode_rate_list[i].chan_mode, + req->ch_mode_rate_list[i].chan_rate, + SELECT_FOR_ASSIGNMENT); if (!conn->assignment.new_lchan) continue; LOG_ASSIGNMENT(conn, LOGL_DEBUG, "selected new lchan %s for mode[%d] = %s channel_rate=%d\n", diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index fb03d6f..4af7b6e 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -770,7 +770,9 @@ { LOG_LCHAN(from_lchan, LOGL_NOTICE, "Manually triggering Assignment from VTY\n"); if (!to_lchan) { - to_lchan = lchan_select_by_type(from_lchan->ts->trx->bts, from_lchan->type); + struct gsm_bts *bts = from_lchan->ts->trx->bts; + to_lchan = lchan_select_by_type(bts, from_lchan->type, + SELECT_FOR_ASSIGNMENT); vty_out(vty, "Error: cannot find free lchan of type %s%s", gsm_lchant_name(from_lchan->type), VTY_NEWLINE); } @@ -955,7 +957,8 @@ continue; llist_for_each_entry(trx, &bts->trx_list, list) { - struct gsm_lchan *lchan = lchan_select_by_type(bts, free_type); + struct gsm_lchan *lchan = lchan_select_by_type(bts, free_type, + SELECT_FOR_HANDOVER); if (!lchan) continue; diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index c23c14e..46866e0 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -533,20 +533,51 @@ "Channel Allocator\n" \ "Channel Allocator\n" -DEFUN_ATTR(cfg_bts_challoc, - cfg_bts_challoc_cmd, - CHAN_ALLOC_CMD " (ascending|descending)", - CHAN_ALLOC_DESC - "Allocate Timeslots and Transceivers in ascending order\n" - "Allocate Timeslots and Transceivers in descending order\n", - CMD_ATTR_IMMEDIATE) +#define CHAN_ALLOC_ASC_DSC "(ascending|descending)" +#define CHAN_ALLOC_ASC_DSC_DESC \ + "Allocate Timeslots and Transceivers in ascending order\n" \ + "Allocate Timeslots and Transceivers in descending order\n" + +DEFUN_ATTR(cfg_bts_challoc_mode_all, + cfg_bts_challoc_mode_all_cmd, + CHAN_ALLOC_CMD " " CHAN_ALLOC_ASC_DSC, + CHAN_ALLOC_DESC CHAN_ALLOC_ASC_DSC_DESC, + CMD_ATTR_IMMEDIATE | CMD_ATTR_HIDDEN) { + bool reverse = !strcmp(argv[0], "descending"); struct gsm_bts *bts = vty->index; - if (!strcmp(argv[0], "ascending")) - bts->chan_alloc_reverse = 0; - else - bts->chan_alloc_reverse = 1; + bts->chan_alloc_chan_req_reverse = reverse; + bts->chan_alloc_assignment_reverse = reverse; + bts->chan_alloc_handover_reverse = reverse; + + return CMD_SUCCESS; +} + +DEFUN_ATTR(cfg_bts_challoc_mode, + cfg_bts_challoc_mode_cmd, + CHAN_ALLOC_CMD + " mode (set-all|chan-req|assignment|handover) " + CHAN_ALLOC_ASC_DSC, + CHAN_ALLOC_DESC + "Channel allocation mode\n" + "Set a single mode for all variants\n" + "Channel allocation for CHANNEL REQUEST (RACH)\n" + "Channel allocation for assignment\n" + "Channel allocation for handover\n" + CHAN_ALLOC_ASC_DSC_DESC, + CMD_ATTR_IMMEDIATE) +{ + bool reverse = !strcmp(argv[1], "descending"); + bool set_all = !strcmp(argv[0], "set-all"); + struct gsm_bts *bts = vty->index; + + if (set_all || !strcmp(argv[0], "chan-req")) + bts->chan_alloc_chan_req_reverse = reverse; + if (set_all || !strcmp(argv[0], "assignment")) + bts->chan_alloc_assignment_reverse = reverse; + if (set_all || !strcmp(argv[0], "handover")) + bts->chan_alloc_handover_reverse = reverse; return CMD_SUCCESS; } @@ -4212,8 +4243,14 @@ vty_out(vty, " radio-link-timeout %d%s", gsm_bts_get_radio_link_timeout(bts), VTY_NEWLINE); - vty_out(vty, " channel allocator %s%s", - bts->chan_alloc_reverse ? "descending" : "ascending", + vty_out(vty, " channel allocator mode chan-req %s%s", + bts->chan_alloc_chan_req_reverse ? "descending" : "ascending", + VTY_NEWLINE); + vty_out(vty, " channel allocator mode assignment %s%s", + bts->chan_alloc_assignment_reverse ? "descending" : "ascending", + VTY_NEWLINE); + vty_out(vty, " channel allocator mode handover %s%s", + bts->chan_alloc_handover_reverse ? "descending" : "ascending", VTY_NEWLINE); if (bts->chan_alloc_avoid_interf) vty_out(vty, " channel allocator avoid-interference 1%s", VTY_NEWLINE); @@ -4543,7 +4580,8 @@ install_element(BTS_NODE, &cfg_bts_deprecated_stream_id_cmd); install_element(BTS_NODE, &cfg_bts_oml_e1_cmd); install_element(BTS_NODE, &cfg_bts_oml_e1_tei_cmd); - install_element(BTS_NODE, &cfg_bts_challoc_cmd); + install_element(BTS_NODE, &cfg_bts_challoc_mode_cmd); + install_element(BTS_NODE, &cfg_bts_challoc_mode_all_cmd); install_element(BTS_NODE, &cfg_bts_chan_alloc_interf_cmd); install_element(BTS_NODE, &cfg_bts_chan_alloc_tch_signalling_policy_cmd); install_element(BTS_NODE, &cfg_bts_chan_alloc_allow_tch_for_signalling_cmd); diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c index a1a8ffa..3c4b3ba 100644 --- a/src/osmo-bsc/handover_decision_2.c +++ b/src/osmo-bsc/handover_decision_2.c @@ -1050,7 +1050,7 @@ /* Would the next TCH/F lchan occupy a dynamic timeslot that currently counts for free TCH/H timeslots? */ - next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_F, false); + next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_F, SELECT_FOR_HANDOVER, false); if (next_lchan && next_lchan->ts->pchan_on_init == GSM_PCHAN_OSMO_DYN) c->target.next_tchf_reduces_tchh = 2; else @@ -1058,7 +1058,7 @@ /* Would the next TCH/H lchan occupy a dynamic timeslot that currently counts for free TCH/F timeslots? * Note that a dyn TS already in TCH/H mode (half occupied) would not reduce free TCH/F. */ - next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_H, false); + next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_H, SELECT_FOR_HANDOVER, false); if (next_lchan && next_lchan->ts->pchan_on_init == GSM_PCHAN_OSMO_DYN && next_lchan->ts->pchan_is != GSM_PCHAN_TCH_H) c->target.next_tchh_reduces_tchf = 1; diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index a4221c4..0797bf3 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -379,7 +379,9 @@ ho->async = true; gsm_bts_cell_id_list(&ho->target_cell_ids, ho->new_bts); - ho->new_lchan = lchan_select_by_type(ho->new_bts, ho->new_lchan_type); + ho->new_lchan = lchan_select_by_type(ho->new_bts, + ho->new_lchan_type, + SELECT_FOR_HANDOVER); if (ho->scope & HO_INTRA_CELL) { ho_count(bts, CTR_INTRA_CELL_HO_ATTEMPTED); @@ -696,7 +698,10 @@ ch_mode_rate.chan_rate == CH_RATE_FULL ? "full-rate" : "half-rate", gsm0808_channel_type_name(&req->ct)); - lchan = lchan_select_by_chan_mode(bts, ch_mode_rate.chan_mode, ch_mode_rate.chan_rate); + lchan = lchan_select_by_chan_mode(bts, + ch_mode_rate.chan_mode, + ch_mode_rate.chan_rate, + SELECT_FOR_HANDOVER); if (!lchan) { LOG_HO(conn, LOGL_DEBUG, "BTS %u has no matching free channels\n", bts->nr); continue; diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c index a322f07..8b6da40 100644 --- a/src/osmo-bsc/lchan_select.c +++ b/src/osmo-bsc/lchan_select.c @@ -35,6 +35,13 @@ unsigned int num; }; +const struct value_string lchan_select_reason_names[] = { + OSMO_VALUE_STRING(SELECT_FOR_MS_CHAN_REQ), + OSMO_VALUE_STRING(SELECT_FOR_ASSIGNMENT), + OSMO_VALUE_STRING(SELECT_FOR_HANDOVER), + {0, NULL} +}; + static struct gsm_lchan *pick_better_lchan(struct gsm_lchan *a, struct gsm_lchan *b) { if (!a) @@ -190,6 +197,7 @@ static void populate_ts_list(struct lchan_select_ts_list *ts_list, struct gsm_bts *bts, + bool chan_alloc_reverse, bool log) { struct gsm_bts_trx *trx; @@ -208,7 +216,7 @@ ts_list->num = num; /* Reverse the timeslot list if required */ - if (bts->chan_alloc_reverse) { + if (chan_alloc_reverse) { for (unsigned int tn = 0; tn < num / 2; tn++) { struct gsm_bts_trx_ts *temp = ts_list->list[tn]; ts_list->list[tn] = ts_list->list[num - tn - 1]; @@ -218,22 +226,40 @@ } struct gsm_lchan *lchan_select_by_chan_mode(struct gsm_bts *bts, - enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate) + enum gsm48_chan_mode chan_mode, + enum channel_rate chan_rate, + enum lchan_select_reason reason) { enum gsm_chan_t type = chan_mode_to_chan_type(chan_mode, chan_rate); if (type == GSM_LCHAN_NONE) return NULL; - return lchan_select_by_type(bts, type); + return lchan_select_by_type(bts, type, reason); } -struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type, bool log) +struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type, + enum lchan_select_reason reason, bool log) { struct gsm_lchan *lchan = NULL; enum gsm_phys_chan_config first, first_cbch, second, second_cbch; struct lchan_select_ts_list ts_list; + bool chan_alloc_reverse; - if (log) - LOG_BTS(bts, DRLL, LOGL_DEBUG, "lchan_avail_by_type(%s)\n", gsm_lchant_name(type)); + if (log) { + LOG_BTS(bts, DRLL, LOGL_DEBUG, "lchan_avail_by_type(type=%s, reason=%s)\n", + gsm_lchant_name(type), lchan_select_reason_name(reason)); + } + + switch (reason) { + case SELECT_FOR_MS_CHAN_REQ: + chan_alloc_reverse = bts->chan_alloc_chan_req_reverse; + break; + case SELECT_FOR_ASSIGNMENT: + chan_alloc_reverse = bts->chan_alloc_assignment_reverse; + break; + case SELECT_FOR_HANDOVER: + chan_alloc_reverse = bts->chan_alloc_handover_reverse; + break; + } /* Allocate an array with pointers to all timeslots of a BTS */ ts_list.list = talloc_array_ptrtype(bts, ts_list.list, bts->num_trx * 8); @@ -241,11 +267,11 @@ return NULL; /* Populate this array with the actual pointers */ - populate_ts_list(&ts_list, bts, log); + populate_ts_list(&ts_list, bts, chan_alloc_reverse, log); switch (type) { case GSM_LCHAN_SDCCH: - if (bts->chan_alloc_reverse) { + if (chan_alloc_reverse) { first = GSM_PCHAN_SDCCH8_SACCH8C; first_cbch = GSM_PCHAN_SDCCH8_SACCH8C_CBCH; second = GSM_PCHAN_CCCH_SDCCH4; @@ -302,17 +328,20 @@ /* Return a matching lchan from a specific BTS that is currently available. The next logical step is * lchan_activate() on it, which would possibly cause dynamic timeslot pchan switching, taken care of by * the lchan and timeslot FSMs. */ -struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type) +struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, + enum gsm_chan_t type, + enum lchan_select_reason reason) { struct gsm_lchan *lchan = NULL; - LOG_BTS(bts, DRLL, LOGL_DEBUG, "lchan_select_by_type(%s)\n", gsm_lchant_name(type)); + LOG_BTS(bts, DRLL, LOGL_DEBUG, "lchan_select_by_type(type=%s, reason=%s)\n", + gsm_lchant_name(type), lchan_select_reason_name(reason)); - lchan = lchan_avail_by_type(bts, type, true); + lchan = lchan_avail_by_type(bts, type, reason, true); if (!lchan) { - LOG_BTS(bts, DRLL, LOGL_NOTICE, "Failed to select %s channel\n", - gsm_lchant_name(type)); + LOG_BTS(bts, DRLL, LOGL_NOTICE, "Failed to select %s channel (%s)\n", + gsm_lchant_name(type), lchan_select_reason_name(reason)); return NULL; } diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index d82ba9f..77fa371 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -488,7 +488,8 @@ { struct gsm_lchan *lchan; - lchan = lchan_select_by_type(bts, (full_rate) ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H); + lchan = lchan_select_by_type(bts, (full_rate) ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H, + SELECT_FOR_HANDOVER); if (!lchan) { fprintf(stderr, "No resource for lchan\n"); exit(EXIT_FAILURE); diff --git a/tests/osmo-bsc.vty b/tests/osmo-bsc.vty index f2af32b..e0b9bdc 100644 --- a/tests/osmo-bsc.vty +++ b/tests/osmo-bsc.vty @@ -166,11 +166,20 @@ allocator Channel Allocator OsmoBSC(config-net-bts)# channel allocator ? - ascending Allocate Timeslots and Transceivers in ascending order - descending Allocate Timeslots and Transceivers in descending order + mode Channel allocation mode avoid-interference Configure whether reported interference levels from RES IND are used in channel allocation tch-signalling-policy Configure when TCH/H or TCH/F channels can be used to serve signalling if SDCCHs are exhausted +OsmoBSC(config-net-bts)# channel allocator mode ? + set-all Set a single mode for all variants + chan-req Channel allocation for CHANNEL REQUEST (RACH) + assignment Channel allocation for assignment + handover Channel allocation for handover + +OsmoBSC(config-net-bts)# channel allocator mode set-all ? + ascending Allocate Timeslots and Transceivers in ascending order + descending Allocate Timeslots and Transceivers in descending order + OsmoBSC(config-net-bts)# channel allocator avoid-interference ? 0 Ignore interference levels (default). Always assign lchans in a deterministic order. 1 In channel allocation, prefer lchans with less interference. -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28327 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I3ae73b36ee9433cc768376b56f0765e5f416162f Gerrit-Change-Number: 28327 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-bsc[master]: lchan_select: implement dynamic selection mode for assignment
by fixeria 17 Jun '22

17 Jun '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28328 ) Change subject: lchan_select: implement dynamic selection mode for assignment ...................................................................... lchan_select: implement dynamic selection mode for assignment Change-Id: I1b7a0d706976b73cc5c30a8714b830811addfe8d Related: SYS#5460 --- M include/osmocom/bsc/bts.h M include/osmocom/bsc/lchan_select.h M include/osmocom/bsc/meas_rep.h M src/osmo-bsc/abis_rsl.c M src/osmo-bsc/assignment_fsm.c M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/bts.c M src/osmo-bsc/bts_vty.c M src/osmo-bsc/handover_decision_2.c M src/osmo-bsc/handover_fsm.c M src/osmo-bsc/lchan_select.c M src/osmo-bsc/meas_rep.c M tests/osmo-bsc.vty 13 files changed, 270 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/28/28328/1 diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index 76945a1..752a00a 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -521,6 +521,16 @@ bool chan_alloc_assignment_reverse; bool chan_alloc_handover_reverse; + /* Whether to use dynamic allocation mode for assignment */ + bool chan_alloc_assignment_dynamic; + /* Parameters used for dynamic mode of allocation */ + struct { + bool sort_by_trx_power; + uint8_t ul_rxlev_thresh; + uint8_t ul_rxlev_avg_num; + uint8_t c0_chan_load_thresh; + } chan_alloc_dyn_params; + /* When true, interference measurements from the BTS are used in the channel allocator to favor lchans with less * interference reported in RSL Resource Indication. */ bool chan_alloc_avoid_interf; diff --git a/include/osmocom/bsc/lchan_select.h b/include/osmocom/bsc/lchan_select.h index b5eb078..8f1dc62 100644 --- a/include/osmocom/bsc/lchan_select.h +++ b/include/osmocom/bsc/lchan_select.h @@ -13,12 +13,16 @@ struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type, - enum lchan_select_reason reason); + enum lchan_select_reason reason, + void *ctx); enum gsm_chan_t chan_mode_to_chan_type(enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate); struct gsm_lchan *lchan_select_by_chan_mode(struct gsm_bts *bts, enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate, - enum lchan_select_reason reason); -struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type, - enum lchan_select_reason reason, bool log); + enum lchan_select_reason reason, + void *ctx); +struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, + enum gsm_chan_t type, + enum lchan_select_reason reason, + void *ctx, bool log); void lchan_select_set_type(struct gsm_lchan *lchan, enum gsm_chan_t type); diff --git a/include/osmocom/bsc/meas_rep.h b/include/osmocom/bsc/meas_rep.h index 402a888..a01bb2f 100644 --- a/include/osmocom/bsc/meas_rep.h +++ b/include/osmocom/bsc/meas_rep.h @@ -88,4 +88,7 @@ unsigned int meas_rep_idx, unsigned int num_values); +int meas_get_field(const struct gsm_meas_rep *rep, + enum meas_rep_field field); + #endif /* _MEAS_REP_H */ diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index 7f88096..527706a 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -2007,12 +2007,12 @@ /* First check the situation on the BTS, if we have TCH/H or TCH/F resources available for another (EMERGENCY) * call. If yes, then no (further) action has to be carried out. */ - if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_F, SELECT_FOR_MS_CHAN_REQ, true)) { + if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_F, SELECT_FOR_MS_CHAN_REQ, NULL, true)) { LOG_BTS(rqd->bts, DRSL, LOGL_NOTICE, "CHAN RQD/EMERGENCY-PRIORITY: at least one TCH/F is (now) available!\n"); return false; } - if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_H, SELECT_FOR_MS_CHAN_REQ, true)) { + if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_H, SELECT_FOR_MS_CHAN_REQ, NULL, true)) { LOG_BTS(rqd->bts, DRSL, LOGL_NOTICE, "CHAN RQD/EMERGENCY-PRIORITY: at least one TCH/H is (now) available!\n"); return false; @@ -2083,7 +2083,7 @@ int free_tchf, free_tchh; bool needs_dyn_switch; - lchan = lchan_avail_by_type(bts, GSM_LCHAN_SDCCH, SELECT_FOR_MS_CHAN_REQ, false); + lchan = lchan_avail_by_type(bts, GSM_LCHAN_SDCCH, SELECT_FOR_MS_CHAN_REQ, NULL, false); if (!lchan) return NULL; @@ -2173,7 +2173,8 @@ lchan = _select_sdcch_for_call(bts, rqd, lctype); } else if (rqd->reason != GSM_CHREQ_REASON_EMERG) { lchan = lchan_select_by_type(bts, GSM_LCHAN_SDCCH, - SELECT_FOR_MS_CHAN_REQ); + SELECT_FOR_MS_CHAN_REQ, + NULL); } /* else: Emergency calls will be put on a free TCH/H or TCH/F directly * in the code below, all other channel requests will get an SDCCH first @@ -2189,14 +2190,16 @@ get_value_string(gsm_chreq_descs, rqd->reason), gsm_lchant_name(GSM_LCHAN_SDCCH), rqd->ref.ra, gsm_lchant_name(GSM_LCHAN_TCH_H)); lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_H, - SELECT_FOR_MS_CHAN_REQ); + SELECT_FOR_MS_CHAN_REQ, + NULL); } if (!lchan) { LOG_BTS(bts, DRSL, LOGL_NOTICE, "CHAN RQD[%s]: no resources for %s 0x%x, retrying with %s\n", get_value_string(gsm_chreq_descs, rqd->reason), gsm_lchant_name(GSM_LCHAN_SDCCH), rqd->ref.ra, gsm_lchant_name(GSM_LCHAN_TCH_F)); lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_F, - SELECT_FOR_MS_CHAN_REQ); + SELECT_FOR_MS_CHAN_REQ, + NULL); } } if (!lchan) { diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c index 209545f..84f8b38 100644 --- a/src/osmo-bsc/assignment_fsm.c +++ b/src/osmo-bsc/assignment_fsm.c @@ -606,7 +606,7 @@ conn->assignment.new_lchan = lchan_select_by_chan_mode(bts, req->ch_mode_rate_list[i].chan_mode, req->ch_mode_rate_list[i].chan_rate, - SELECT_FOR_ASSIGNMENT); + SELECT_FOR_ASSIGNMENT, conn->lchan); if (!conn->assignment.new_lchan) continue; LOG_ASSIGNMENT(conn, LOGL_DEBUG, "selected new lchan %s for mode[%d] = %s channel_rate=%d\n", diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 4af7b6e..eaa4572 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -772,7 +772,8 @@ if (!to_lchan) { struct gsm_bts *bts = from_lchan->ts->trx->bts; to_lchan = lchan_select_by_type(bts, from_lchan->type, - SELECT_FOR_ASSIGNMENT); + SELECT_FOR_ASSIGNMENT, + from_lchan); vty_out(vty, "Error: cannot find free lchan of type %s%s", gsm_lchant_name(from_lchan->type), VTY_NEWLINE); } @@ -958,7 +959,8 @@ llist_for_each_entry(trx, &bts->trx_list, list) { struct gsm_lchan *lchan = lchan_select_by_type(bts, free_type, - SELECT_FOR_HANDOVER); + SELECT_FOR_HANDOVER, + NULL); if (!lchan) continue; diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c index 2f66611..4976fe6 100644 --- a/src/osmo-bsc/bts.c +++ b/src/osmo-bsc/bts.c @@ -292,6 +292,9 @@ bts->early_classmark_allowed_3g = true; /* 3g Early Classmark Sending controlled by bts->early_classmark_allowed param */ bts->si_unused_send_empty = true; bts->chan_alloc_tch_signalling_policy = BTS_TCH_SIGNALLING_ALWAYS; + bts->chan_alloc_dyn_params.ul_rxlev_thresh = 50; /* >= -60 dBm */ + bts->chan_alloc_dyn_params.ul_rxlev_avg_num = 2; /* at least 2 samples */ + bts->chan_alloc_dyn_params.c0_chan_load_thresh = 60; /* >= 60% */ bts->si_common.cell_sel_par.cell_resel_hyst = 2; /* 4 dB */ bts->si_common.cell_sel_par.rxlev_acc_min = 0; bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list; diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index 46866e0..741a0d7 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -550,6 +550,7 @@ bts->chan_alloc_chan_req_reverse = reverse; bts->chan_alloc_assignment_reverse = reverse; bts->chan_alloc_handover_reverse = reverse; + bts->chan_alloc_assignment_dynamic = false; return CMD_SUCCESS; } @@ -574,14 +575,89 @@ if (set_all || !strcmp(argv[0], "chan-req")) bts->chan_alloc_chan_req_reverse = reverse; - if (set_all || !strcmp(argv[0], "assignment")) + if (set_all || !strcmp(argv[0], "assignment")) { bts->chan_alloc_assignment_reverse = reverse; + bts->chan_alloc_assignment_dynamic = false; + } if (set_all || !strcmp(argv[0], "handover")) bts->chan_alloc_handover_reverse = reverse; return CMD_SUCCESS; } +DEFUN_ATTR(cfg_bts_challoc_mode_ass_dynamic, + cfg_bts_challoc_mode_ass_dynamic_cmd, + CHAN_ALLOC_CMD " mode assignment dynamic", + CHAN_ALLOC_DESC + "Channel allocation mode\n" + "Channel allocation for assignment\n" + "Dynamic lchan selection based on configured parameters\n", + CMD_ATTR_IMMEDIATE) +{ + struct gsm_bts *bts = vty->index; + + bts->chan_alloc_assignment_dynamic = true; + + return CMD_SUCCESS; +} + +#define CHAN_ALLOC_DYN_PARAM_CMD \ + CHAN_ALLOC_CMD " dynamic-param" +#define CHAN_ALLOC_DYN_PARAM_DESC \ + CHAN_ALLOC_DESC \ + "Parameters for dynamic channel allocation mode\n" + +DEFUN_ATTR(cfg_bts_challoc_dynamic_param_sort_by_trx_power, + cfg_bts_challoc_dynamic_param_sort_by_trx_power_cmd, + CHAN_ALLOC_DYN_PARAM_CMD " sort-by-trx-power (0|1)", + CHAN_ALLOC_DYN_PARAM_DESC + "Whether to sort TRX instances by their respective power levels\n" + "Do not sort, use the same order as in the configuration file\n" + "Sort TRX instances by their power levels in descending order\n", + CMD_ATTR_IMMEDIATE) +{ + struct gsm_bts *bts = vty->index; + + bts->chan_alloc_dyn_params.sort_by_trx_power = (argv[0][0] == '1'); + + return CMD_SUCCESS; +} + +DEFUN_ATTR(cfg_bts_challoc_dynamic_param_ul_rxlev, + cfg_bts_challoc_dynamic_param_ul_rxlev_cmd, + CHAN_ALLOC_DYN_PARAM_CMD " ul-rxlev thresh <0-63> avg-num <1-10>", + CHAN_ALLOC_DYN_PARAM_DESC + "Uplink RxLev\n" + "Uplink RxLev threshold\n" + "Uplink RxLev threshold\n" + "Minimum number of RxLev samples for averaging\n" + "Minimum number of RxLev samples for averaging\n", + CMD_ATTR_IMMEDIATE) +{ + struct gsm_bts *bts = vty->index; + + bts->chan_alloc_dyn_params.ul_rxlev_thresh = atoi(argv[0]); + bts->chan_alloc_dyn_params.ul_rxlev_avg_num = atoi(argv[1]); + + return CMD_SUCCESS; +} + +DEFUN_ATTR(cfg_bts_challoc_dynamic_param_c0_chan_load, + cfg_bts_challoc_dynamic_param_c0_chan_load_cmd, + CHAN_ALLOC_DYN_PARAM_CMD " c0-chan-load thresh <0-100>", + CHAN_ALLOC_DYN_PARAM_DESC + "C0 (BCCH carrier) channel load\n" + "Channel load threshold\n" + "Channel load threshold (in %)\n", + CMD_ATTR_IMMEDIATE) +{ + struct gsm_bts *bts = vty->index; + + bts->chan_alloc_dyn_params.c0_chan_load_thresh = atoi(argv[0]); + + return CMD_SUCCESS; +} + DEFUN_ATTR(cfg_bts_chan_alloc_interf, cfg_bts_chan_alloc_interf_cmd, CHAN_ALLOC_CMD " avoid-interference (0|1)", @@ -4246,9 +4322,24 @@ vty_out(vty, " channel allocator mode chan-req %s%s", bts->chan_alloc_chan_req_reverse ? "descending" : "ascending", VTY_NEWLINE); - vty_out(vty, " channel allocator mode assignment %s%s", - bts->chan_alloc_assignment_reverse ? "descending" : "ascending", - VTY_NEWLINE); + if (bts->chan_alloc_assignment_dynamic) { + vty_out(vty, " channel allocator mode assignment dynamic%s", + VTY_NEWLINE); + vty_out(vty, " channel allocator dynamic-param sort-by-trx-power %c%s", + bts->chan_alloc_dyn_params.sort_by_trx_power ? '1' : '0', + VTY_NEWLINE); + vty_out(vty, " channel allocator dynamic-param ul-rxlev thresh %u avg-num %u%s", + bts->chan_alloc_dyn_params.ul_rxlev_thresh, + bts->chan_alloc_dyn_params.ul_rxlev_avg_num, + VTY_NEWLINE); + vty_out(vty, " channel allocator dynamic-param c0-chan-load thresh %u%s", + bts->chan_alloc_dyn_params.c0_chan_load_thresh, + VTY_NEWLINE); + } else { + vty_out(vty, " channel allocator mode assignment %s%s", + bts->chan_alloc_assignment_reverse ? "descending" : "ascending", + VTY_NEWLINE); + } vty_out(vty, " channel allocator mode handover %s%s", bts->chan_alloc_handover_reverse ? "descending" : "ascending", VTY_NEWLINE); @@ -4582,6 +4673,10 @@ install_element(BTS_NODE, &cfg_bts_oml_e1_tei_cmd); install_element(BTS_NODE, &cfg_bts_challoc_mode_cmd); install_element(BTS_NODE, &cfg_bts_challoc_mode_all_cmd); + install_element(BTS_NODE, &cfg_bts_challoc_mode_ass_dynamic_cmd); + install_element(BTS_NODE, &cfg_bts_challoc_dynamic_param_sort_by_trx_power_cmd); + install_element(BTS_NODE, &cfg_bts_challoc_dynamic_param_ul_rxlev_cmd); + install_element(BTS_NODE, &cfg_bts_challoc_dynamic_param_c0_chan_load_cmd); install_element(BTS_NODE, &cfg_bts_chan_alloc_interf_cmd); install_element(BTS_NODE, &cfg_bts_chan_alloc_tch_signalling_policy_cmd); install_element(BTS_NODE, &cfg_bts_chan_alloc_allow_tch_for_signalling_cmd); diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c index 3c4b3ba..a472089 100644 --- a/src/osmo-bsc/handover_decision_2.c +++ b/src/osmo-bsc/handover_decision_2.c @@ -1050,7 +1050,8 @@ /* Would the next TCH/F lchan occupy a dynamic timeslot that currently counts for free TCH/H timeslots? */ - next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_F, SELECT_FOR_HANDOVER, false); + next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_F, + SELECT_FOR_HANDOVER, NULL, false); if (next_lchan && next_lchan->ts->pchan_on_init == GSM_PCHAN_OSMO_DYN) c->target.next_tchf_reduces_tchh = 2; else @@ -1058,7 +1059,8 @@ /* Would the next TCH/H lchan occupy a dynamic timeslot that currently counts for free TCH/F timeslots? * Note that a dyn TS already in TCH/H mode (half occupied) would not reduce free TCH/F. */ - next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_H, SELECT_FOR_HANDOVER, false); + next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_H, + SELECT_FOR_HANDOVER, NULL, false); if (next_lchan && next_lchan->ts->pchan_on_init == GSM_PCHAN_OSMO_DYN && next_lchan->ts->pchan_is != GSM_PCHAN_TCH_H) c->target.next_tchh_reduces_tchf = 1; diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 0797bf3..2f45243 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -381,7 +381,8 @@ ho->new_lchan = lchan_select_by_type(ho->new_bts, ho->new_lchan_type, - SELECT_FOR_HANDOVER); + SELECT_FOR_HANDOVER, + NULL); if (ho->scope & HO_INTRA_CELL) { ho_count(bts, CTR_INTRA_CELL_HO_ATTEMPTED); @@ -701,7 +702,7 @@ lchan = lchan_select_by_chan_mode(bts, ch_mode_rate.chan_mode, ch_mode_rate.chan_rate, - SELECT_FOR_HANDOVER); + SELECT_FOR_HANDOVER, NULL); if (!lchan) { LOG_HO(conn, LOGL_DEBUG, "BTS %u has no matching free channels\n", bts->nr); continue; diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c index 8b6da40..dcea4fc 100644 --- a/src/osmo-bsc/lchan_select.c +++ b/src/osmo-bsc/lchan_select.c @@ -21,6 +21,8 @@ * */ +#include <stdlib.h> + #include <osmocom/bsc/debug.h> #include <osmocom/bsc/gsm_data.h> @@ -195,15 +197,41 @@ } } +static int qsort_func(const void *_a, const void *_b) +{ + const struct gsm_bts_trx *trx_a = *(const struct gsm_bts_trx **)_a; + const struct gsm_bts_trx *trx_b = *(const struct gsm_bts_trx **)_b; + + int pwr_a = trx_a->nominal_power - trx_a->max_power_red; + int pwr_b = trx_b->nominal_power - trx_b->max_power_red; + + /* Sort in descending order */ + return pwr_b - pwr_a; +} + static void populate_ts_list(struct lchan_select_ts_list *ts_list, struct gsm_bts *bts, bool chan_alloc_reverse, + bool sort_by_trx_power, bool log) { + struct gsm_bts_trx **trx_list; struct gsm_bts_trx *trx; unsigned int num = 0; - llist_for_each_entry(trx, &bts->trx_list, list) { + /* Allocate an array with pointers to all TRX instances of a BTS */ + trx_list = talloc_array_ptrtype(bts, trx_list, bts->num_trx); + OSMO_ASSERT(trx_list != NULL); + + llist_for_each_entry(trx, &bts->trx_list, list) + trx_list[trx->nr] = trx; + + /* Sort by TRX power is descending order (if needed) */ + if (sort_by_trx_power) + qsort(&trx_list[0], bts->num_trx, sizeof(trx), &qsort_func); + + for (unsigned int trxn = 0; trxn < bts->num_trx; trxn++) { + trx = trx_list[trxn]; for (unsigned int tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) { struct gsm_bts_trx_ts *ts = &trx->ts[tn]; if (ts_is_usable(ts)) @@ -213,6 +241,7 @@ } } + talloc_free(trx_list); ts_list->num = num; /* Reverse the timeslot list if required */ @@ -225,23 +254,75 @@ } } +static bool chan_alloc_ass_dynamic_reverse(struct gsm_bts *bts, + void *ctx, bool log) +{ + const struct load_counter *ll = &bts->c0->lchan_load; + const struct gsm_lchan *old_lchan = ctx; + unsigned int lchan_load; + int avg_ul_rxlev; + + OSMO_ASSERT(old_lchan != NULL); + OSMO_ASSERT(old_lchan->ts->trx->bts == bts); + +#define LOG_COND(fmt, args...) \ + if (log) { \ + LOG_LCHAN(old_lchan, LOGL_DEBUG, fmt, ## args); \ + } while (0) + + /* Condition a) Channel load on the C0 (BCCH carrier) */ + lchan_load = ll->total ? ll->used * 100 / ll->total : 0; + if (lchan_load < bts->chan_alloc_dyn_params.c0_chan_load_thresh) { + LOG_COND("C0 Channel Load %u%% < thresh %u%% => using ascending order\n", + lchan_load, bts->chan_alloc_dyn_params.c0_chan_load_thresh); + return false; + } + + /* Condition b) average Uplink RxLev */ + avg_ul_rxlev = get_meas_rep_avg(old_lchan, TDMA_MEAS_FIELD_RXLEV, + TDMA_MEAS_DIR_UL, TDMA_MEAS_SET_AUTO, + bts->chan_alloc_dyn_params.ul_rxlev_avg_num); + if (avg_ul_rxlev < 0) { + LOG_COND("Unknown AVG UL RxLev => using ascending order\n"); + return false; + } + if (avg_ul_rxlev < bts->chan_alloc_dyn_params.ul_rxlev_thresh) { + LOG_COND("AVG UL RxLev %u < thresh %u => using ascending order\n", + avg_ul_rxlev, bts->chan_alloc_dyn_params.ul_rxlev_thresh); + return false; + } + + LOG_COND("C0 Channel Load %u%% >= thresh %u%% and " + "AVG UL RxLev %u >= thresh %u => using descending order\n", + lchan_load, bts->chan_alloc_dyn_params.c0_chan_load_thresh, + avg_ul_rxlev, bts->chan_alloc_dyn_params.ul_rxlev_thresh); + +#undef LOG_COND + + return true; +} + struct gsm_lchan *lchan_select_by_chan_mode(struct gsm_bts *bts, enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate, - enum lchan_select_reason reason) + enum lchan_select_reason reason, + void *ctx) { enum gsm_chan_t type = chan_mode_to_chan_type(chan_mode, chan_rate); if (type == GSM_LCHAN_NONE) return NULL; - return lchan_select_by_type(bts, type, reason); + return lchan_select_by_type(bts, type, reason, ctx); } -struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type, - enum lchan_select_reason reason, bool log) +struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, + enum gsm_chan_t type, + enum lchan_select_reason reason, + void *ctx, bool log) { struct gsm_lchan *lchan = NULL; enum gsm_phys_chan_config first, first_cbch, second, second_cbch; struct lchan_select_ts_list ts_list; + bool sort_by_trx_power = false; bool chan_alloc_reverse; if (log) { @@ -254,7 +335,12 @@ chan_alloc_reverse = bts->chan_alloc_chan_req_reverse; break; case SELECT_FOR_ASSIGNMENT: - chan_alloc_reverse = bts->chan_alloc_assignment_reverse; + if (bts->chan_alloc_assignment_dynamic) { + chan_alloc_reverse = chan_alloc_ass_dynamic_reverse(bts, ctx, log); + sort_by_trx_power = bts->chan_alloc_dyn_params.sort_by_trx_power; + } else { + chan_alloc_reverse = bts->chan_alloc_assignment_reverse; + } break; case SELECT_FOR_HANDOVER: chan_alloc_reverse = bts->chan_alloc_handover_reverse; @@ -267,7 +353,7 @@ return NULL; /* Populate this array with the actual pointers */ - populate_ts_list(&ts_list, bts, chan_alloc_reverse, log); + populate_ts_list(&ts_list, bts, chan_alloc_reverse, sort_by_trx_power, log); switch (type) { case GSM_LCHAN_SDCCH: @@ -330,14 +416,15 @@ * the lchan and timeslot FSMs. */ struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type, - enum lchan_select_reason reason) + enum lchan_select_reason reason, + void *ctx) { struct gsm_lchan *lchan = NULL; LOG_BTS(bts, DRLL, LOGL_DEBUG, "lchan_select_by_type(type=%s, reason=%s)\n", gsm_lchant_name(type), lchan_select_reason_name(reason)); - lchan = lchan_avail_by_type(bts, type, reason, true); + lchan = lchan_avail_by_type(bts, type, reason, ctx, true); if (!lchan) { LOG_BTS(bts, DRLL, LOGL_NOTICE, "Failed to select %s channel (%s)\n", diff --git a/src/osmo-bsc/meas_rep.c b/src/osmo-bsc/meas_rep.c index 776c610..ae0cc64 100644 --- a/src/osmo-bsc/meas_rep.c +++ b/src/osmo-bsc/meas_rep.c @@ -24,8 +24,8 @@ #include <osmocom/bsc/gsm_data.h> #include <osmocom/bsc/meas_rep.h> -static int get_field(const struct gsm_meas_rep *rep, - enum meas_rep_field field) +int meas_get_field(const struct gsm_meas_rep *rep, + enum meas_rep_field field) { switch (field) { case MEAS_REP_DL_RXLEV_FULL: @@ -146,7 +146,7 @@ int val; use_field = choose_meas_rep_field(field, dir, set, &lchan->meas_rep[j]); - val = get_field(&lchan->meas_rep[j], use_field); + val = meas_get_field(&lchan->meas_rep[j], use_field); if (val >= 0) { avg += val; @@ -177,7 +177,7 @@ int val; use_field = choose_meas_rep_field(field, dir, set, &lchan->meas_rep[j]); - val = get_field(&lchan->meas_rep[j], use_field); + val = meas_get_field(&lchan->meas_rep[j], use_field); if (val >= be) /* implies that val < 0 will not count */ count++; diff --git a/tests/osmo-bsc.vty b/tests/osmo-bsc.vty index e0b9bdc..4be3d56 100644 --- a/tests/osmo-bsc.vty +++ b/tests/osmo-bsc.vty @@ -167,6 +167,7 @@ OsmoBSC(config-net-bts)# channel allocator ? mode Channel allocation mode + dynamic-param Parameters for dynamic channel allocation mode avoid-interference Configure whether reported interference levels from RES IND are used in channel allocation tch-signalling-policy Configure when TCH/H or TCH/F channels can be used to serve signalling if SDCCHs are exhausted @@ -180,6 +181,31 @@ ascending Allocate Timeslots and Transceivers in ascending order descending Allocate Timeslots and Transceivers in descending order +OsmoBSC(config-net-bts)# channel allocator mode handover ? + ascending Allocate Timeslots and Transceivers in ascending order + descending Allocate Timeslots and Transceivers in descending order + +OsmoBSC(config-net-bts)# channel allocator mode assignment ? + ascending Allocate Timeslots and Transceivers in ascending order + descending Allocate Timeslots and Transceivers in descending order + dynamic Dynamic lchan selection based on configured parameters + +OsmoBSC(config-net-bts)# channel allocator dynamic-param ? + sort-by-trx-power Whether to sort TRX instances by their respective power levels + ul-rxlev Uplink RxLev + c0-chan-load C0 (BCCH carrier) channel load + +OsmoBSC(config-net-bts)# channel allocator dynamic-param sort-by-trx-power ? + 0 Do not sort, use the same order as in the configuration file + 1 Sort TRX instances by their power levels in descending order + +OsmoBSC(config-net-bts)# channel allocator dynamic-param ul-rxlev thresh ? + <0-63> Uplink RxLev threshold +OsmoBSC(config-net-bts)# channel allocator dynamic-param ul-rxlev thresh 50 avg-num ? + <1-10> Minimum number of RxLev samples for averaging +OsmoBSC(config-net-bts)# channel allocator dynamic-param c0-chan-load thresh ? + <0-100> Channel load threshold (in %) + OsmoBSC(config-net-bts)# channel allocator avoid-interference ? 0 Ignore interference levels (default). Always assign lchans in a deterministic order. 1 In channel allocation, prefer lchans with less interference. -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28328 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I1b7a0d706976b73cc5c30a8714b830811addfe8d Gerrit-Change-Number: 28328 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-bsc[master]: VTY: cosmetic: define and use CHAN_ALLOC_{CMD,DESC}
by fixeria 17 Jun '22

17 Jun '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28324 ) Change subject: VTY: cosmetic: define and use CHAN_ALLOC_{CMD,DESC} ...................................................................... VTY: cosmetic: define and use CHAN_ALLOC_{CMD,DESC} Change-Id: I8e906a9c16247788eec8cd8d99f019b08dc5a8f1 Related: SYS#5460 --- M src/osmo-bsc/bts_vty.c 1 file changed, 13 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/24/28324/1 diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index 2ae9d9b..c23c14e 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -528,10 +528,15 @@ return CMD_SUCCESS; } +#define CHAN_ALLOC_CMD "channel allocator" +#define CHAN_ALLOC_DESC \ + "Channel Allocator\n" \ + "Channel Allocator\n" + DEFUN_ATTR(cfg_bts_challoc, cfg_bts_challoc_cmd, - "channel allocator (ascending|descending)", - "Channel Allocator\n" "Channel Allocator\n" + CHAN_ALLOC_CMD " (ascending|descending)", + CHAN_ALLOC_DESC "Allocate Timeslots and Transceivers in ascending order\n" "Allocate Timeslots and Transceivers in descending order\n", CMD_ATTR_IMMEDIATE) @@ -548,8 +553,8 @@ DEFUN_ATTR(cfg_bts_chan_alloc_interf, cfg_bts_chan_alloc_interf_cmd, - "channel allocator avoid-interference (0|1)", - "Channel Allocator\n" "Channel Allocator\n" + CHAN_ALLOC_CMD " avoid-interference (0|1)", + CHAN_ALLOC_DESC "Configure whether reported interference levels from RES IND are used in channel allocation\n" "Ignore interference levels (default). Always assign lchans in a deterministic order.\n" "In channel allocation, prefer lchans with less interference.\n", @@ -567,8 +572,8 @@ DEFUN_ATTR(cfg_bts_chan_alloc_tch_signalling_policy, cfg_bts_chan_alloc_tch_signalling_policy_cmd, - "channel allocator tch-signalling-policy (never|emergency|voice|always)", - "Channel Allocator\n" "Channel Allocator\n" + CHAN_ALLOC_CMD " tch-signalling-policy (never|emergency|voice|always)", + CHAN_ALLOC_DESC "Configure when TCH/H or TCH/F channels can be used to serve signalling if SDCCHs are exhausted\n" "Never allow TCH for signalling purposes\n" "Only allow TCH for signalling purposes when establishing an emergency call\n" @@ -592,8 +597,8 @@ DEFUN_ATTR(cfg_bts_chan_alloc_allow_tch_for_signalling, cfg_bts_chan_alloc_allow_tch_for_signalling_cmd, - "channel allocator allow-tch-for-signalling (0|1)", - "Channel Allocator\n" "Channel Allocator\n" + CHAN_ALLOC_CMD " allow-tch-for-signalling (0|1)", + CHAN_ALLOC_DESC "Configure whether TCH/H or TCH/F channels can be used to serve non-call-related signalling if SDCCHs are exhausted\n" "Forbid use of TCH for non-call-related signalling purposes\n" "Allow use of TCH for non-call-related signalling purposes (default)\n", -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28324 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I8e906a9c16247788eec8cd8d99f019b08dc5a8f1 Gerrit-Change-Number: 28324 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-bsc[master]: bts_chan_load(): also calculate per-TRX channel load
by fixeria 17 Jun '22

17 Jun '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28325 ) Change subject: bts_chan_load(): also calculate per-TRX channel load ...................................................................... bts_chan_load(): also calculate per-TRX channel load This is required for the upcoming dynamic channel allocation mode. Change-Id: I220145238c23135f7e68ca2d474764312ffb66c5 Related: SYS#5460 --- M include/osmocom/bsc/bts_trx.h M src/osmo-bsc/bts_trx_vty.c M src/osmo-bsc/chan_alloc.c 3 files changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/25/28325/1 diff --git a/include/osmocom/bsc/bts_trx.h b/include/osmocom/bsc/bts_trx.h index eab5fec..8d2493f 100644 --- a/include/osmocom/bsc/bts_trx.h +++ b/include/osmocom/bsc/bts_trx.h @@ -81,6 +81,7 @@ struct gsm_bts_trx_ts ts[TRX_NR_TS]; struct chan_counts chan_counts; + struct load_counter lchan_load; }; static inline struct gsm_bts_trx *gsm_bts_bb_trx_get_trx(struct gsm_bts_bb_trx *bb_transc) { diff --git a/src/osmo-bsc/bts_trx_vty.c b/src/osmo-bsc/bts_trx_vty.c index 9cf128e..bd13a05 100644 --- a/src/osmo-bsc/bts_trx_vty.c +++ b/src/osmo-bsc/bts_trx_vty.c @@ -747,6 +747,11 @@ vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, trx->rsl_link_primary); } + + const struct load_counter *ll = &trx->lchan_load; + vty_out(vty, " Channel load: %u%%%s", + ll->total ? ll->used * 100 / ll->total : 0, + VTY_NEWLINE); } void config_write_e1_link(struct vty *vty, struct gsm_e1_subslot *e1_link, diff --git a/src/osmo-bsc/chan_alloc.c b/src/osmo-bsc/chan_alloc.c index fea4efd..4fbf8be 100644 --- a/src/osmo-bsc/chan_alloc.c +++ b/src/osmo-bsc/chan_alloc.c @@ -44,8 +44,12 @@ struct gsm_bts_trx *trx; llist_for_each_entry(trx, &bts->trx_list, list) { + struct load_counter *ll = &trx->lchan_load; int i; + /* init per-TRX load counters */ + memset(ll, 0, sizeof(*ll)); + /* skip administratively deactivated transceivers */ if (!trx_is_usable(trx)) continue; @@ -66,6 +70,7 @@ ts->pchan_on_init == GSM_PCHAN_TCH_F_PDCH) && (ts->pchan_is == GSM_PCHAN_NONE || ts->pchan_is == GSM_PCHAN_PDCH)) { + ll->total++; pl->total++; /* Below loop would not count this timeslot, since in PDCH mode it has no usable * timeslots. But let's make it clear that the timeslot must not be counted again: */ @@ -77,11 +82,13 @@ if (lchan->type == GSM_LCHAN_CBCH) continue; + ll->total++; pl->total++; /* lchans under a BORKEN TS should be counted * as used just as BORKEN lchans under a normal TS */ if (ts->fi->state == TS_ST_BORKEN) { + ll->used++; pl->used++; continue; } @@ -90,6 +97,7 @@ case LCHAN_ST_UNUSED: break; default: + ll->used++; pl->used++; break; } -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28325 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I220145238c23135f7e68ca2d474764312ffb66c5 Gerrit-Change-Number: 28325 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in openbsc[master]: update git repository URLs (git->https; gitea)
by laforge 17 Jun '22

17 Jun '22
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/openbsc/+/28323 ) Change subject: update git repository URLs (git->https; gitea) ...................................................................... update git repository URLs (git->https; gitea) Change-Id: I90a948deb27d126220838810f36b86a9a60933c8 --- M debian/control M openbsc/configure.ac 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/23/28323/1 diff --git a/debian/control b/debian/control index c176bee..db1223e 100644 --- a/debian/control +++ b/debian/control @@ -16,8 +16,8 @@ libdbd-sqlite3, libpcap-dev Standards-Version: 3.9.8 -Vcs-Git: git://bs11-abis.gnumonks.org/openbsc.git -Vcs-Browser: http://openbsc.osmocom.org/trac/browser +Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/openbsc +Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/openbsc Homepage: https://projects.osmocom.org/projects/openbsc Package: osmocom-bsc-sccplite diff --git a/openbsc/configure.ac b/openbsc/configure.ac index 5602313..c5d7a3a 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -204,7 +204,7 @@ fi AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes) if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then - AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.]) + AC_MSG_ERROR([Please install https://gitea.osmocom.org/cellular-infrastructure/osmo-python-tests to run the VTY/CTRL tests.]) fi fi AC_MSG_CHECKING([whether to enable VTY/CTRL tests]) -- To view, visit https://gerrit.osmocom.org/c/openbsc/+/28323 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Change-Id: I90a948deb27d126220838810f36b86a9a60933c8 Gerrit-Change-Number: 28323 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ttcn3-hacks[master]: BSC_Tests: add TC_chan_alloc_algo_ass_dynamic
by fixeria 17 Jun '22

17 Jun '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28322 ) Change subject: BSC_Tests: add TC_chan_alloc_algo_ass_dynamic ...................................................................... BSC_Tests: add TC_chan_alloc_algo_ass_dynamic This test case verifies the new channel allocation mode, which is expected to switch between ascending and descending modes dynamically based on the following two configurable parameters: * Uplink RxLev threshold (and min number of samples), * C0 (BCCH carrier) channel load threshold. The test case scenario includes: Case a) Unknown Uplink RxLev => fall-back to ascending. Case b) Not enough RxLev samples => use ascending. Case c) Uplink RxLev below the threshold => use ascending. Case d) Uplink RxLev above the threshold => use descending. Case e) Uplink RxLev above the threshold, but C0 load is not. Change-Id: Ia522f37c1c001b3a36f5145b8875fbb88311c2e5 Related: SYS#5460 --- M bsc/BSC_Tests.ttcn M library/RSL_Types.ttcn 2 files changed, 98 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/22/28322/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 6ff4450..1159dbc 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -11637,6 +11637,83 @@ f_shutdown_helper(); } +testcase TC_chan_alloc_algo_ass_dynamic() runs on test_CT { + const BtsTrxIdx TRX0 := {2, 0}; + const BtsTrxIdx TRX3 := {2, 3}; + + /* We need to access BTS2, which has 4 TRXs */ + f_init(nr_bts := 3); + + /* HACK: work around "Couldn't find Expect for CRCX" */ + vc_MGCP.stop; + + f_vty_enter_cfg_bts(BSCVTY, 2); + f_vty_transceive(BSCVTY, "channel allocator mode assignment dynamic"); + f_vty_transceive(BSCVTY, "channel allocator dynamic-param ul-rxlev thresh 50 avg-num 2"); + f_vty_transceive(BSCVTY, "channel allocator dynamic-param c0-chan-load thresh 0"); + f_vty_transceive(BSCVTY, "end"); + + var DchanTuple dt; + + f_logp(BSCVTY, "Case a) Unknown Uplink RxLev, fall-back to ascending"); + dt := f_est_dchan('23'O, 23, '00000000'O, TRX0); + f_TC_chan_alloc_algo(dt, TRX0); + f_perform_clear_test_ct(dt); + + f_logp(BSCVTY, "Case b) Not enough RxLev samples, use ascending"); + dt := f_est_dchan('23'O, 23, '00000000'O, TRX0); + f_ipa_tx(ts_RSL_MEAS_RES_EMPTY(dt.rsl_chan_nr, 0, + ts_RSL_IE_UplinkMeas(30, 0), + ts_RSL_IE_BS_Power(0)), TRX0); + f_TC_chan_alloc_algo(dt, TRX0); + f_perform_clear_test_ct(dt); + + f_logp(BSCVTY, "Case c) Uplink RxLev below the threshold, use ascending"); + dt := f_est_dchan('23'O, 23, '00000000'O, TRX0); + f_ipa_tx(ts_RSL_MEAS_RES_EMPTY(dt.rsl_chan_nr, 0, + ts_RSL_IE_UplinkMeas(45, 0), + ts_RSL_IE_BS_Power(0)), TRX0); + f_ipa_tx(ts_RSL_MEAS_RES_EMPTY(dt.rsl_chan_nr, 1, + ts_RSL_IE_UplinkMeas(48, 0), + ts_RSL_IE_BS_Power(0)), TRX0); + f_TC_chan_alloc_algo(dt, TRX0); + f_perform_clear_test_ct(dt); + + f_logp(BSCVTY, "Case d) Uplink RxLev above the threshold, use descending"); + dt := f_est_dchan('23'O, 23, '00000000'O, TRX0); + f_ipa_tx(ts_RSL_MEAS_RES_EMPTY(dt.rsl_chan_nr, 0, + ts_RSL_IE_UplinkMeas(50, 0), + ts_RSL_IE_BS_Power(0)), TRX0); + f_ipa_tx(ts_RSL_MEAS_RES_EMPTY(dt.rsl_chan_nr, 1, + ts_RSL_IE_UplinkMeas(58, 0), + ts_RSL_IE_BS_Power(0)), TRX0); + f_TC_chan_alloc_algo(dt, TRX3); + f_perform_clear_test_ct(dt); + + f_vty_enter_cfg_bts(BSCVTY, 2); + f_vty_transceive(BSCVTY, "channel allocator dynamic-param c0-chan-load thresh 90"); + f_vty_transceive(BSCVTY, "end"); + + f_logp(BSCVTY, "Case e) Uplink RxLev above the threshold, but C0 load is not"); + dt := f_est_dchan('23'O, 23, '00000000'O, TRX0); + f_ipa_tx(ts_RSL_MEAS_RES_EMPTY(dt.rsl_chan_nr, 0, + ts_RSL_IE_UplinkMeas(50, 0), + ts_RSL_IE_BS_Power(0)), TRX0); + f_ipa_tx(ts_RSL_MEAS_RES_EMPTY(dt.rsl_chan_nr, 1, + ts_RSL_IE_UplinkMeas(58, 0), + ts_RSL_IE_BS_Power(0)), TRX0); + f_TC_chan_alloc_algo(dt, TRX0); + f_perform_clear_test_ct(dt); + + f_vty_enter_cfg_bts(BSCVTY, 2); + f_vty_transceive(BSCVTY, "channel allocator ascending"); + f_vty_transceive(BSCVTY, "end"); + + /* At this point some TCH/F channels are BORKEN, but they will be + * resurrected upon the A-bis/OML link re-establishment. */ + f_shutdown_helper(); +} + control { /* CTRL interface testing */ execute( TC_ctrl_msc_connection_status() ); @@ -11966,6 +12043,7 @@ /* Channel allocator */ execute( TC_chan_alloc_algo_ascending() ); execute( TC_chan_alloc_algo_descending() ); + execute( TC_chan_alloc_algo_ass_dynamic() ); /* Run TC_ho_out_of_this_bsc last, because it may trigger a segfault before osmo-bsc's patch * with change-id I5a3345ab0005a73597f5c27207480912a2f5aae6 */ diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn index 8a4d1fa..84e9375 100644 --- a/library/RSL_Types.ttcn +++ b/library/RSL_Types.ttcn @@ -1542,12 +1542,27 @@ } } - /* Receive template for a measurement report that lacks the measurement report + /* Templates for a measurement report that lacks the measurement report * from the MS (l1_info, l3_info and ms timing offset */ - template RSL_Message tr_RSL_MEAS_RES_EMPTY(template RslChannelNr chan_nr, - template uint8_t meas_res_nr := ?, - template RSL_IE_UplinkMeas ul_meas := ?, - template RSL_IE_BS_Power bs_power := ?) := { + template (value) RSL_Message + ts_RSL_MEAS_RES_EMPTY(template (value) RslChannelNr chan_nr, + template (value) uint8_t meas_res_nr, + template (value) RSL_IE_UplinkMeas ul_meas, + template (value) RSL_IE_BS_Power bs_power) := { + msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), + msg_type := RSL_MT_MEAS_RES, + ies := { + t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), + t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}), + t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}), + t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power}) + } + } + template RSL_Message + tr_RSL_MEAS_RES_EMPTY(template (present) RslChannelNr chan_nr, + template uint8_t meas_res_nr := ?, + template RSL_IE_UplinkMeas ul_meas := ?, + template RSL_IE_BS_Power bs_power := ?) := { msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), msg_type := RSL_MT_MEAS_RES, ies := { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28322 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia522f37c1c001b3a36f5145b8875fbb88311c2e5 Gerrit-Change-Number: 28322 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-upf[master]: add initial FSM design charts
by neels 17 Jun '22

17 Jun '22
neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/28243 ) Change subject: add initial FSM design charts ...................................................................... add initial FSM design charts Related: SYS#5599 Change-Id: I55474daa6bb204a0fe7da0a3bf888bb7d1c46677 --- M configure.ac M doc/Makefile.am A doc/charts/Makefile.am A doc/charts/pfcp_and_gtp.dot A doc/charts/pfcp_cp_peer_fsm.dot A doc/charts/pfcp_cp_session_fsm.dot A doc/charts/pfcp_heartbeat_fsm.dot A doc/charts/pfcp_overview.dot A doc/charts/pfcp_up_peer_fsm.dot A doc/charts/pfcp_up_session_fsm.dot 10 files changed, 205 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 9982028..1b2cdea 100644 --- a/configure.ac +++ b/configure.ac @@ -213,6 +213,7 @@ doc/Makefile doc/examples/Makefile doc/manuals/Makefile + doc/charts/Makefile contrib/Makefile contrib/systemd/Makefile Makefile) diff --git a/doc/Makefile.am b/doc/Makefile.am index 15f36b7..66103ba 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,4 +1,5 @@ SUBDIRS = \ examples \ manuals \ + charts \ $(NULL) diff --git a/doc/charts/Makefile.am b/doc/charts/Makefile.am new file mode 100644 index 0000000..af0736d --- /dev/null +++ b/doc/charts/Makefile.am @@ -0,0 +1,24 @@ +msc: \ + $(builddir)/pfcp_msgs.png \ + $(builddir)/pfcp_msgs_gtp.png \ + $(NULL) + +dot: \ + $(builddir)/pfcp_overview.png \ + $(builddir)/pfcp_cp_peer_fsm.png \ + $(builddir)/pfcp_up_peer_fsm.png \ + $(builddir)/pfcp_heartbeat_fsm.png \ + $(builddir)/pfcp_cp_session_fsm.png \ + $(builddir)/pfcp_up_session_fsm.png \ + $(builddir)/pfcp_and_gtp.png \ + $(NULL) + +$(builddir)/%.png: $(srcdir)/%.msc + mscgen -T png -o $@ $< + +$(builddir)/%.png: $(srcdir)/%.dot + dot -Tpng $< > $@ + +.PHONY: poll +poll: + while true; do $(MAKE) msc dot; sleep 1; done diff --git a/doc/charts/pfcp_and_gtp.dot b/doc/charts/pfcp_and_gtp.dot new file mode 100644 index 0000000..5c160b3 --- /dev/null +++ b/doc/charts/pfcp_and_gtp.dot @@ -0,0 +1,20 @@ +digraph G { +rankdir=LR +labelloc=t; label="PFCP and GTP" + +SGSN [label="SGSN\n123.44.0.9"] +SGWC [label="SGW-C\n123.44.05"] +subgraph cluster_UPF { + label="OsmoUPF"; + SGWU [label="SGW-U\n123.44.0.6"]; + GTPk [label="kernel GTP\n123.44.0.6"] +} + +SGSN -> SGWC [label="S4\nGTPv2-C"] +SGWC -> SGWU [label="Sxa\nPFCP\nSession Establishment:\n"] +SGSN -> GTPk [label="S4\nGTPv1-U",dir=both] + +MS [label="MS\n192.168.104.176"] +MS -> SGSN [dir=both] + +} diff --git a/doc/charts/pfcp_cp_peer_fsm.dot b/doc/charts/pfcp_cp_peer_fsm.dot new file mode 100644 index 0000000..101fe07 --- /dev/null +++ b/doc/charts/pfcp_cp_peer_fsm.dot @@ -0,0 +1,39 @@ +digraph G { +rankdir=TB +labelloc=t; label="PFCP CP peer FSM\nControl Plane side, managing association with remote UP peer" + +cp [label="CP function",shape="box"] + +cp -> WAIT_ASSOC_SETUP_RESP [label="cp_peer_associate()"] + +txrx [label="PFCP socket",shape="box"] +WAIT_ASSOC_SETUP_RESP -> txrx [label="tx_assoc_setup_req()",style=dotted] +txrx -> WAIT_ASSOC_SETUP_RESP [label="EV_RX_ASSOC_SETUP_RESP",style=dotted] +WAIT_ASSOC_SETUP_RESP -> ASSOCIATED [label="Assoc Setup Resp"] + +WAIT_ASSOC_SETUP_RESP -> WAIT_ASSOC_SETUP_RESP [label="retry"] + +heartbeat [label="PFCP heartbeat FSM",shape=box3d] +ASSOCIATED -> heartbeat [label="alloc()",style=dotted] +heartbeat -> ASSOCIATED [label="EV_HEARTBEAT_FAILURE",style=dotted] + +txrx2 [label="PFCP socket",shape="box"] +txrx2 -> ASSOCIATED [label="EV_RX_ASSOC_UPDATE_REQ\n3GPP TS 29.244 6.2.7.3.1",style=dotted] +GRACEFUL_RELEASE -> txrx2 [label="tx_assoc_update_resp()",style=dotted] + +cp_session [label="PFCP CP session FSM",shape=box3d] +cp -> ASSOCIATED [label="cp_peer_session_create()",style=dotted] +ASSOCIATED -> cp_session [label="cp_session_create()",style=dotted] +cp -> cp_session [style=invisible,arrowhead=none] + +ASSOCIATED -> GRACEFUL_RELEASE [label="Association Update\nindicating graceful release"] + +cp -> ASSOCIATED [label="cp_peer_release()",style=dotted] +ASSOCIATED -> term [label="cp_peer_release()\nHeartbeat failure"] + +ASSOCIATED -> WAIT_ASSOC_SETUP_RESP [label="Heartbeat failure"] + +GRACEFUL_RELEASE -> term +term [shape="octagon"] + +} diff --git a/doc/charts/pfcp_cp_session_fsm.dot b/doc/charts/pfcp_cp_session_fsm.dot new file mode 100644 index 0000000..0319608 --- /dev/null +++ b/doc/charts/pfcp_cp_session_fsm.dot @@ -0,0 +1,28 @@ +digraph G { +rankdir=TB +labelloc=t; label="PFCP CP session FSM" + +cp [label="CP function",shape=box] +cp -> WAIT_ESTABLISHMENT_RESP [label="cp_session_create(cp_peer)\niff cp_peer in state ASSOCIATED"] + +txrx [label="PFCP socket",shape=box] + +WAIT_ESTABLISHMENT_RESP -> txrx [label="tx_session_est_req()",style=dotted] +txrx -> WAIT_ESTABLISHMENT_RESP [label="EV_RX_SESSION_EST_RESP",style=dotted] + +WAIT_ESTABLISHMENT_RESP -> ESTABLISHED [label="Est Resp"] + +cp -> ESTABLISHED [label="cp_session_modify()",style=dotted] +ESTABLISHED -> WAIT_MODIFICATION_RESP [label="cp_session_modify()"] +WAIT_MODIFICATION_RESP -> txrx [label="tx_session_mod_req()",style=dotted] +txrx -> WAIT_MODIFICATION_RESP [label="EV_RX_SESSION_MOD_RESP",style=dotted,constraint=false] +WAIT_MODIFICATION_RESP -> ESTABLISHED [label="Mod Resp"] + +cp -> ESTABLISHED [label="cp_session_delete()",style=dotted] +ESTABLISHED -> WAIT_DELETION_RESP [label="cp_session_delete()"] +WAIT_DELETION_RESP -> txrx [label="tx_session_del_req()",style=dotted] +txrx -> WAIT_DELETION_RESP [label="EV_RX_SESSION_DEL_RESP",style=dotted,constraint=false] +WAIT_DELETION_RESP -> term +term [shape="octagon"] + +} diff --git a/doc/charts/pfcp_heartbeat_fsm.dot b/doc/charts/pfcp_heartbeat_fsm.dot new file mode 100644 index 0000000..b5b4584 --- /dev/null +++ b/doc/charts/pfcp_heartbeat_fsm.dot @@ -0,0 +1,21 @@ +digraph G { +rankdir=TB +labelloc=t; label="PFCP heartbeat FSM" + +peer [label="PFCP CP/UP peer FSM",shape=box3d] +txrx [label="PFCP socket",shape=box] + +peer -> IDLE [label="alloc()"] +IDLE -> WAIT_HEARTBEAT_RESP -> IDLE +WAIT_HEARTBEAT_RESP -> term +term [shape="octagon"] + +WAIT_HEARTBEAT_RESP -> txrx [label="tx_heartbeat_req()",style=dotted] +txrx -> WAIT_HEARTBEAT_RESP [label="HEARTBEAT_EV_RX_RESP",style=dotted] + +term -> peer [label="PEER_EV_HEARTBEAT_FAILURE",style=dotted] + +txrx2 [label="PFCP socket",shape=box] +txrx2 -> txrx2 [label="rx Heartbeat Req\ntx Heartbeat Resp",style=dotted] + +} diff --git a/doc/charts/pfcp_overview.dot b/doc/charts/pfcp_overview.dot new file mode 100644 index 0000000..33fa9a0 --- /dev/null +++ b/doc/charts/pfcp_overview.dot @@ -0,0 +1,23 @@ +digraph G { +rankdir=TB +labelloc=t; label="PFCP Overview\n3GPP TS 29.244 3.1, 5.8.1" + +subgraph cluster_N1_CP { + label="Node: Control Plane function";style=dotted + N1_E_CP [label="CP Entity"] +} + +subgraph cluster_N2_UP { + label="Node: User Plane function\nNode ID: my-userplane.com\n(FQDN may provide multiple PFCP Entities)";style=dotted + N2_E_UP [label="UP Entity\n8.7.6.1"] + N2_E_UP2 [label="UP Entity\n8.7.6.2"] +} + +subgraph cluster_N3_UP { + label="Node: User Plane function\nNode ID: 1.2.3.4\n(IP address means only one PFCP Entity)";style=dotted + N3_E_UP [label="UP Entity\n1.2.3.4\n(osmo-upf)"] +} + +N1_E_CP -> N3_E_UP [label="PFCP Request"] +N1_E_CP -> N2_E_UP +} diff --git a/doc/charts/pfcp_up_peer_fsm.dot b/doc/charts/pfcp_up_peer_fsm.dot new file mode 100644 index 0000000..60152f7 --- /dev/null +++ b/doc/charts/pfcp_up_peer_fsm.dot @@ -0,0 +1,27 @@ +digraph G { +rankdir=TB +labelloc=t; label="PFCP UP peer FSM\nUser Plane side, managing association with remote CP peer" + +txrx [label="PFCP socket",shape="box"] + +txrx -> NOT_ASSOCIATED [label="rx PFCP msg from\nnew remote IP"] +txrx -> NOT_ASSOCIATED [label="EV_RX_ASSOC_SETUP_REQ",style=dotted] + +NOT_ASSOCIATED -> ASSOCIATED [label="Assoc Setup Req",shape="box"] + +heartbeat [label="PFCP heartbeat FSM",shape=box3d] +ASSOCIATED -> heartbeat [label="alloc()",style=dotted] +heartbeat -> ASSOCIATED [label="EV_HEARTBEAT_FAILURE",style=dotted] + +txrx -> ASSOCIATED [label="EV_RX_SESSION_EST_REQ",style=dotted] +up_session [label="PFCP UP session FSM",shape=box3d] +ASSOCIATED -> up_session [label="up_session_create()",style=dotted] + +txrx -> ASSOCIATED [label="EV_RX_ASSOC_UPD_REQ",style=dotted] +ASSOCIATED -> GRACEFUL_RELEASE [label="Association Update\nindicating graceful release"] + +ASSOCIATED -> term [label="Heartbeat failure"] +GRACEFUL_RELEASE -> term +term [shape="octagon"] + +} diff --git a/doc/charts/pfcp_up_session_fsm.dot b/doc/charts/pfcp_up_session_fsm.dot new file mode 100644 index 0000000..b4a06f5 --- /dev/null +++ b/doc/charts/pfcp_up_session_fsm.dot @@ -0,0 +1,21 @@ +digraph G { +rankdir=TB +labelloc=t; label="PFCP UP session FSM" + +peer [label="PFCP UP peer FSM",shape=box3d] +peer -> ESTABLISHED [label="rx_session_est_req()"] + +txrx [label="PFCP socket",shape="box"] +txrx2 [label="PFCP socket",shape="box"] + +txrx -> ESTABLISHED [label="EV_RX_SESSION_MOD_REQ",style=dotted] +ESTABLISHED -> txrx [label="tx_session_mod_resp()",style=dotted,constraint=false] +ESTABLISHED -> ESTABLISHED [label="Mod"] + +txrx2 -> ESTABLISHED [label="EV_RX_SESSION_DEL_REQ",style=dotted] +ESTABLISHED -> txrx2 [label="tx_session_del_resp()",style=dotted,constraint=false] + +ESTABLISHED -> term [label="Deletion"] +term [shape="octagon"] + +} -- To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/28243 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-upf Gerrit-Branch: master Gerrit-Change-Id: I55474daa6bb204a0fe7da0a3bf888bb7d1c46677 Gerrit-Change-Number: 28243 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-ttcn3-hacks[master]: cbc: Improve CBSP port configuration
by laforge 17 Jun '22

17 Jun '22
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28304 ) Change subject: cbc: Improve CBSP port configuration ...................................................................... cbc: Improve CBSP port configuration Previous -1 was taken by TTCN3 as default port (9999). Let's keep it excplictly as 9999 by default to avoid changing docker-playground.git. Change-Id: Ia7c599faa2101180089085c6cf5d483d2325ecac --- M cbc/CBC_Tests.ttcn 1 file changed, 5 insertions(+), 4 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/cbc/CBC_Tests.ttcn b/cbc/CBC_Tests.ttcn index 44ce2bb..c408781 100644 --- a/cbc/CBC_Tests.ttcn +++ b/cbc/CBC_Tests.ttcn @@ -16,8 +16,9 @@ modulepar { charstring mp_cbc_host := "127.0.0.1"; - integer mp_cbc_port := 48049; - integer mp_ecbe_port := 12345; + integer mp_cbc_cbsp_port := 48049; + integer mp_cbc_ecbe_port := 12345; + integer mp_local_cbsp_port := 9999; }; type component test_CT extends CBSP_Adapter_CT, http_CT { @@ -132,8 +133,8 @@ } private function f_init(boolean raw := false) runs on test_CT { - f_http_init(mp_cbc_host, mp_ecbe_port); - CBSP_Adapter.f_connect(mp_cbc_host, mp_cbc_port, "", -1); + f_http_init(mp_cbc_host, mp_cbc_ecbe_port); + CBSP_Adapter.f_connect(mp_cbc_host, mp_cbc_cbsp_port, "", mp_local_cbsp_port); if (not raw) { var BSSMAP_FIELD_CellIdentificationList cell_list := { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28304 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia7c599faa2101180089085c6cf5d483d2325ecac Gerrit-Change-Number: 28304 Gerrit-PatchSet: 2 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-MessageType: merged
1 0
0 0
Change in osmo-ttcn3-hacks[master]: cbc: Improve CBSP port configuration
by laforge 17 Jun '22

17 Jun '22
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28304 ) Change subject: cbc: Improve CBSP port configuration ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28304 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ia7c599faa2101180089085c6cf5d483d2325ecac Gerrit-Change-Number: 28304 Gerrit-PatchSet: 1 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-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 17 Jun 2022 20:28:20 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • ...
  • 138
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.