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

September 2024

  • 1 participants
  • 1983 discussions
[S] Change in osmo-sgsn[osmith/1.12.1]: Fix double free during RAU with unexpected Old RAI
by osmith 16 Sep '24

16 Sep '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/38155?usp=email ) Change subject: Fix double free during RAU with unexpected Old RAI ...................................................................... Fix double free during RAU with unexpected Old RAI If an MS which had an MMCTX at the SGSN sent RAU update with an unexpected Old RA field, the RAU was rejected and LLME (LLC layer) unassigned (freed), because no MMCTX was found matching the wrong old RA. However, an MMCTX may actually exist pointing to that LLME, and hence when the LLME is freed, it stayed unnoticed with a dangling pointer to the freed LLME in ctx->gb.llme. Let's try to harder to avoid this kind of bugs which make osmo-sgsn crash. Once we properly split the code into separate independent layers (LLC, MMCTX, etc.) each holding their own structs, this kind of bugs shouldn't happen anymore. Related: OS#6441 Change-Id: I5a4328c6e945b85dd815215724feecadba59c435 (cherry picked from commit 868d818e6e9c39fcd4acb362708dc162cb4ee7f4) --- M include/osmocom/sgsn/mmctx.h M src/sgsn/gprs_gmm.c M src/sgsn/mmctx.c 3 files changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/55/38155/1 diff --git a/include/osmocom/sgsn/mmctx.h b/include/osmocom/sgsn/mmctx.h index c19f599..5e4662f 100644 --- a/include/osmocom/sgsn/mmctx.h +++ b/include/osmocom/sgsn/mmctx.h @@ -257,6 +257,7 @@ struct sgsn_mm_ctx *sgsn_mm_ctx_by_ptmsi(uint32_t tmsi); struct sgsn_mm_ctx *sgsn_mm_ctx_by_imsi(const char *imsi); struct sgsn_mm_ctx *sgsn_mm_ctx_by_ue_ctx(const void *uectx); +struct sgsn_mm_ctx *sgsn_mm_ctx_by_llme(const struct gprs_llc_llme *llme); /* look-up by matching TLLI and P-TMSI (think twice before using this) */ struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli_and_ptmsi(uint32_t tlli, diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c index ab8b7ef..911d42d 100644 --- a/src/sgsn/gprs_gmm.c +++ b/src/sgsn/gprs_gmm.c @@ -1748,6 +1748,21 @@ * in the MS */ LOGGBP(llme, DMM, LOGL_NOTICE, "LLC XID RESET\n"); gprs_llgmm_reset_oldmsg(msg, GPRS_SAPI_GMM, llme); + + /* The RAU didn't come from expected TLLI+RAI, so it's for sure bad and should be rejected. + * In any case, before unassigning (freeing) the LLME during the REJECT below, make sure + * beforehand that if there's an mmctx relating to that llme it is also freed. + * Otherwise it would be kept pointining at a dangling freed llme object. + */ + mmctx = sgsn_mm_ctx_by_llme(llme); + if (mmctx) { + char old_ra_id_name[32]; + osmo_rai_name_buf(old_ra_id_name, sizeof(old_ra_id_name), &old_ra_id); + LOGMMCTXP(LOGL_NOTICE, mmctx, + "Rx RA Update Request with unexpected TLLI=%08x Old RA=%s (expected Old RA: %s)!\n", + msgb_tlli(msg), old_ra_id_name, osmo_rai_name(&mmctx->ra)); + /* mmctx will be released (and its llme un assigned) after REJECT below. */ + } } /* The MS has to perform GPRS attach */ /* Device is still IMSI attached for CS but initiate GPRS ATTACH, diff --git a/src/sgsn/mmctx.c b/src/sgsn/mmctx.c index 0e93092..459f6cf 100644 --- a/src/sgsn/mmctx.c +++ b/src/sgsn/mmctx.c @@ -105,6 +105,21 @@ return NULL; } + +/* look-up an SGSN MM context based on Gb LLME context (struct gprs_llc_llme)*/ +struct sgsn_mm_ctx *sgsn_mm_ctx_by_llme(const struct gprs_llc_llme *llme) +{ + struct sgsn_mm_ctx *ctx; + + llist_for_each_entry (ctx, &sgsn->mm_list, list) { + if (ctx->ran_type == MM_CTX_T_GERAN_Gb + && llme == ctx->gb.llme) + return ctx; + } + + return NULL; +} + /* look-up a SGSN MM context based on TLLI + RAI */ struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli(uint32_t tlli, const struct gprs_ra_id *raid) -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/38155?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-sgsn Gerrit-Branch: osmith/1.12.1 Gerrit-Change-Id: I5a4328c6e945b85dd815215724feecadba59c435 Gerrit-Change-Number: 38155 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-sgsn[osmith/1.12.1]: Fix DeactPDPCtxAcc when UE goes PMM ENABLED but lost its PDP context
by osmith 16 Sep '24

16 Sep '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/38154?usp=email ) Change subject: Fix DeactPDPCtxAcc when UE goes PMM ENABLED but lost its PDP context ...................................................................... Fix DeactPDPCtxAcc when UE goes PMM ENABLED but lost its PDP context Scenario: UE activates a PDP context, then after a while goes PMM IDLE (Iu conn is destroyed but PDP is kept). When UE connects through Iu again, it sends eg. RAU or ServiceRequest with pdp_status bitmask statis the active NSAPIs. If some NSAPI (PDP context) is enabled at SGSN but doesn't show up in the bitmask, SGSN will destroy the PDP context with GGSN (DeletePDPContextReq) towards GGSN prior to re-creating it. When SGSN receives the DeletePDPContextResp, it would forward a DeactivatePDPContextReq to the UE for a PDP context which was not known by the UE anymore, this is wrong. With this patch, the state of the NSAPI/PDP at the UE side is tracked, and used to know whether when the PDP gets deleted on the GGSN side then it needs to also be deleted on the Iu side. Change-Id: I0ccd9228d71c29248b5f510356dbfdb09565dc30 (cherry picked from commit 4ced617eb6bb6608b6fcc14f359366551e636923) --- M include/osmocom/sgsn/pdpctx.h M src/sgsn/gprs_gmm.c M src/sgsn/sgsn_libgtp.c 3 files changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/54/38154/1 diff --git a/include/osmocom/sgsn/pdpctx.h b/include/osmocom/sgsn/pdpctx.h index 255a77d..f3cf0ed 100644 --- a/include/osmocom/sgsn/pdpctx.h +++ b/include/osmocom/sgsn/pdpctx.h @@ -68,6 +68,7 @@ //uint32_t qos_profile_neg; uint8_t radio_prio; //uint32_t charging_id; + bool ue_pdp_active; /* PDP Context is active for this NSAPI? */ struct osmo_timer_list timer; unsigned int T; /* Txxxx number */ diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c index 653c425..ab8b7ef 100644 --- a/src/sgsn/gprs_gmm.c +++ b/src/sgsn/gprs_gmm.c @@ -1591,6 +1591,7 @@ LOGMMCTXP(LOGL_NOTICE, mmctx, "Dropping PDP context for NSAPI=%u " "due to PDP CTX STATUS IE=0x%02x%02x\n", pdp->nsapi, pdp_status[1], pdp_status[0]); + pdp->ue_pdp_active = false; if (pdp->ggsn) sgsn_delete_pdp_ctx(pdp); else /* GTP side already detached, freeing */ diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c index 9edd0c6..4885ada 100644 --- a/src/sgsn/sgsn_libgtp.c +++ b/src/sgsn/sgsn_libgtp.c @@ -378,6 +378,7 @@ rc = gsm48_tx_gsm_act_pdp_acc(pctx); if (rc < 0) return rc; + pctx->ue_pdp_active = true; if (pctx->mm->ran_type == MM_CTX_T_GERAN_Gb) { /* Send SNDCP XID to MS */ @@ -567,9 +568,11 @@ return -ENOTSUP; #endif } - - /* Confirm deactivation of PDP context to MS */ - rc = gsm48_tx_gsm_deact_pdp_acc(pctx); + if (pctx->ue_pdp_active) { + /* Confirm deactivation of PDP context to MS */ + rc = gsm48_tx_gsm_deact_pdp_acc(pctx); + pctx->ue_pdp_active = false; + } } else { LOGPDPCTXP(LOGL_NOTICE, pctx, "Not deactivating SNDCP layer since the MM context " -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/38154?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-sgsn Gerrit-Branch: osmith/1.12.1 Gerrit-Change-Id: I0ccd9228d71c29248b5f510356dbfdb09565dc30 Gerrit-Change-Number: 38154 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-smlc[master]: Bump version: 0.3.0.1-7445-dirty → 0.3.1
by osmith 16 Sep '24

16 Sep '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-smlc/+/38153?usp=email ) Change subject: Bump version: 0.3.0.1-7445-dirty → 0.3.1 ...................................................................... Bump version: 0.3.0.1-7445-dirty → 0.3.1 Change-Id: I52964c60edfc09cf832b8acb2fff61d0ceed3837 --- M TODO-RELEASE M configure.ac M debian/changelog M debian/control 4 files changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-smlc refs/changes/53/38153/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 02843d4..0ed7189 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,4 +7,3 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line -libosmo-sigtran bump dependency to > 1.9.0 / libosmo-sccp package removal diff --git a/configure.ac b/configure.ac index 8bace70..75c4577 100644 --- a/configure.ac +++ b/configure.ac @@ -40,7 +40,7 @@ PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.10.0) PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.10.0) PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.10.0) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 1.9.0) +PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 2.0.0) dnl checks for header files AC_HEADER_STDC diff --git a/debian/changelog b/debian/changelog index 1ae9c4b..e74b87f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +osmo-smlc (0.3.1) unstable; urgency=medium + + [ Harald Welte ] + * remove libosmo-sccp dependency; depend on libosmo-sigtran only + + -- Oliver Smith <osmith(a)sysmocom.de> Mon, 16 Sep 2024 12:04:51 +0200 + osmo-smlc (0.3.0) unstable; urgency=medium [ Andreas Eversberg ] diff --git a/debian/control b/debian/control index 1a7a0d8..cad5540 100644 --- a/debian/control +++ b/debian/control @@ -12,7 +12,7 @@ libsctp-dev, libtalloc-dev, libosmocore-dev (>= 1.10.0), - libosmo-sigtran-dev (>= 1.9.0), + libosmo-sigtran-dev (>= 2.0.0), osmo-gsm-manuals-dev (>= 1.6.0) Standards-Version: 3.9.8 Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-smlc -- To view, visit https://gerrit.osmocom.org/c/osmo-smlc/+/38153?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-smlc Gerrit-Branch: master Gerrit-Change-Id: I52964c60edfc09cf832b8acb2fff61d0ceed3837 Gerrit-Change-Number: 38153 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-msc[master]: Bump version: 1.12.0.5-620c6 → 1.12.1
by laforge 16 Sep '24

16 Sep '24
Attention is currently required from: osmith. laforge has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-msc/+/38152?usp=email ) Change subject: Bump version: 1.12.0.5-620c6 → 1.12.1 ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/38152?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Ieee012f36c8bd230ce96e6c5df3da36a41b03a3d Gerrit-Change-Number: 38152 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 16 Sep 2024 10:04:36 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-msc[master]: Bump version: 1.12.0.5-620c6 → 1.12.1
by pespin 16 Sep '24

16 Sep '24
Attention is currently required from: osmith. pespin has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-msc/+/38152?usp=email ) Change subject: Bump version: 1.12.0.5-620c6 → 1.12.1 ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/38152?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Ieee012f36c8bd230ce96e6c5df3da36a41b03a3d Gerrit-Change-Number: 38152 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 16 Sep 2024 10:03:38 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-msc[master]: Bump version: 1.12.0.5-620c6 → 1.12.1
by osmith 16 Sep '24

16 Sep '24
osmith has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-msc/+/38152?usp=email ) Change subject: Bump version: 1.12.0.5-620c6 → 1.12.1 ...................................................................... Bump version: 1.12.0.5-620c6 → 1.12.1 Change-Id: Ieee012f36c8bd230ce96e6c5df3da36a41b03a3d --- M TODO-RELEASE M configure.ac M debian/changelog M debian/control 4 files changed, 15 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/52/38152/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/38152?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Ieee012f36c8bd230ce96e6c5df3da36a41b03a3d Gerrit-Change-Number: 38152 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-CC: Jenkins Builder
1 0
0 0
[S] Change in osmo-msc[master]: Bump version: 1.12.0.5-620c6 → 1.12.1
by osmith 16 Sep '24

16 Sep '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/38152?usp=email ) Change subject: Bump version: 1.12.0.5-620c6 → 1.12.1 ...................................................................... Bump version: 1.12.0.5-620c6 → 1.12.1 Change-Id: Ieee012f36c8bd230ce96e6c5df3da36a41b03a3d --- M TODO-RELEASE M configure.ac M debian/changelog 3 files changed, 14 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/52/38152/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 02843d4..0ed7189 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,4 +7,3 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line -libosmo-sigtran bump dependency to > 1.9.0 / libosmo-sccp package removal diff --git a/configure.ac b/configure.ac index 49afb7b..05bea8a 100644 --- a/configure.ac +++ b/configure.ac @@ -43,7 +43,7 @@ PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.10.0) PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 1.6.0) PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.5.0) -PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 1.9.0) +PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 2.0.0) PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.13.0) PKG_CHECK_MODULES(LIBOSMOGSUPCLIENT, libosmo-gsup-client >= 1.8.0) diff --git a/debian/changelog b/debian/changelog index d4f562d..9a361cc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +osmo-msc (1.12.1) unstable; urgency=medium + + [ Harald Welte ] + * configure.ac: Remove ibosmo-sccp dependency + + [ Alexander Couzens ] + * vlr.h: remove unused ran_conn out of the header + * vlr.c: drop unused header limits.h + * vlr_auth_fsm.h/vlr_sgs_fsm.h: forward declare struct vlr_subscr + * libvlr/vlr: remove gsm_subscriber.h + + -- Oliver Smith <osmith(a)sysmocom.de> Mon, 16 Sep 2024 11:59:10 +0200 + osmo-msc (1.12.0) unstable; urgency=medium [ Manawyrm ] -- To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/38152?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Change-Id: Ieee012f36c8bd230ce96e6c5df3da36a41b03a3d Gerrit-Change-Number: 38152 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-bsc[master]: Introduce hashtable to lookup bts by <LAC,CI>
by pespin 16 Sep '24

16 Sep '24
Attention is currently required from: fixeria, laforge. Hello Jenkins Builder, fixeria, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bsc/+/38127?usp=email to look at the new patch set (#3). The following approvals got outdated and were removed: Code-Review+1 by fixeria, Code-Review+1 by laforge, Verified+1 by Jenkins Builder Change subject: Introduce hashtable to lookup bts by <LAC,CI> ...................................................................... Introduce hashtable to lookup bts by <LAC,CI> This is useful to quickly lookup pagings aiming at a LAC+CI. Until now, we first looked up in the LAC hashtable and then iterated over it. However, that means a potential configuration where all BTS share the same LAC will end up in iterating over 256 bts, which is not nice. Change-Id: I47db6c7543e5c6c3b8f0de3ae5ee1b53c2b5f16f Related: SYS#7062 --- M include/osmocom/bsc/bts.h M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/bts.c M src/osmo-bsc/bts_vty.c M src/osmo-bsc/neighbor_ident.c M src/osmo-bsc/osmo_bsc_bssap.c 6 files changed, 20 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/27/38127/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/38127?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I47db6c7543e5c6c3b8f0de3ae5ee1b53c2b5f16f Gerrit-Change-Number: 38127 Gerrit-PatchSet: 3 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: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-bsc[master]: Introduce hashtable to lookup bts by CI
by pespin 16 Sep '24

16 Sep '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/38126?usp=email ) Change subject: Introduce hashtable to lookup bts by CI ...................................................................... Introduce hashtable to lookup bts by CI Change-Id: Ia9d6a38496609fc906cc78124929e594e6a9d06e --- M include/osmocom/bsc/bts.h M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/bts.c M src/osmo-bsc/bts_vty.c M src/osmo-bsc/net_init.c M src/osmo-bsc/osmo_bsc_bssap.c 6 files changed, 11 insertions(+), 2 deletions(-) Approvals: laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index 9e70ee5..308c5b9 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -345,6 +345,8 @@ struct hlist_node node_by_nr; /*! Entry in hash table network->bts_by_lac. */ struct hlist_node node_by_lac; + /*! Entry in hash table network->bts_by_ci. */ + struct hlist_node node_by_ci; /* number of this BTS in network */ gsm_bts_nr_t nr; diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 1dda9ae..98414d0 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -989,6 +989,7 @@ struct llist_head bts_rejected; DECLARE_HASHTABLE(bts_by_nr, 10); DECLARE_HASHTABLE(bts_by_lac, 10); + DECLARE_HASHTABLE(bts_by_ci, 10); /* BTS-based counters when we can't find the actual BTS * e.g. when conn->lchan is NULL */ diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c index d928a4b..9e31167 100644 --- a/src/osmo-bsc/bts.c +++ b/src/osmo-bsc/bts.c @@ -161,6 +161,7 @@ llist_del(&bts->list); hash_del(&bts->node_by_nr); hash_del(&bts->node_by_lac); + hash_del(&bts->node_by_ci); paging_destructor(bts); bts_setup_ramp_remove(bts); @@ -208,6 +209,8 @@ /* Default bts->location_area_code == GSM_LAC_RESERVED_DETACHED, don't add to hashtable: */ INIT_HLIST_NODE(&bts->node_by_lac); + /* Default CI = 0: */ + hash_add(net->bts_by_ci, &bts->node_by_ci, bts->cell_identity); bts->num_trx = 0; INIT_LLIST_HEAD(&bts->trx_list); diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index 4ef582f..d439d72 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -258,7 +258,7 @@ cfg_bts_ci_cmd, X(BSC_VTY_ATTR_RESTART_ABIS_RSL_LINK), "cell_identity <0-65535>", - "Set the Cell identity of this BTS\n" "Cell Identity\n") + "Set the Cell identity of this BTS\n" "Cell Identity (default 0)\n") { struct gsm_bts *bts = vty->index; int ci = atoi(argv[0]); @@ -269,6 +269,8 @@ return CMD_WARNING; } bts->cell_identity = ci; + hash_del(&bts->node_by_ci); + hash_add(bts->network->bts_by_ci, &bts->node_by_ci, bts->cell_identity); return CMD_SUCCESS; } diff --git a/src/osmo-bsc/net_init.c b/src/osmo-bsc/net_init.c index 62b3ee4..79afdc8 100644 --- a/src/osmo-bsc/net_init.c +++ b/src/osmo-bsc/net_init.c @@ -126,6 +126,7 @@ net->num_bts = 0; hash_init(net->bts_by_nr); hash_init(net->bts_by_lac); + hash_init(net->bts_by_ci); net->T_defs = gsm_network_T_defs; osmo_tdefs_reset(net->T_defs); diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 82bdeb7..869a31b 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -201,7 +201,7 @@ uint16_t ci = params->cil.id_list[i].ci; int paged = 0; struct gsm_bts *bts; - llist_for_each_entry(bts, &bsc_gsmnet->bts_list, list) { + hash_for_each_possible(bsc_gsmnet->bts_by_ci, bts, node_by_ci, ci) { if (bts->cell_identity != ci) continue; page_subscriber(params, bts, GSM_LAC_RESERVED_ALL_BTS); -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/38126?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ia9d6a38496609fc906cc78124929e594e6a9d06e Gerrit-Change-Number: 38126 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-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-bsc[master]: Introduce hashtable to lookup bts by LAC
by pespin 16 Sep '24

16 Sep '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/38087?usp=email ) Change subject: Introduce hashtable to lookup bts by LAC ...................................................................... Introduce hashtable to lookup bts by LAC The BTS is not added to the hashtable during allocation, because the default LAC value is 0, which is GSM_LAC_RESERVED_DETACHED (reserved by GSM 04.08), so it's also detached from the hashtable (cannot be found based on a reserved value). Related: SYS#7062 Change-Id: Id523027b49e0f58cd2c8c9b4dee619de415dbd15 --- M include/osmocom/bsc/bts.h M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/bts.c M src/osmo-bsc/bts_vty.c M src/osmo-bsc/neighbor_ident.c M src/osmo-bsc/net_init.c M src/osmo-bsc/osmo_bsc_bssap.c 7 files changed, 17 insertions(+), 7 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index 8e530ef..9e70ee5 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -343,6 +343,8 @@ /*! Entry in hash table network->bts_by_nr. */ struct hlist_node node_by_nr; + /*! Entry in hash table network->bts_by_lac. */ + struct hlist_node node_by_lac; /* number of this BTS in network */ gsm_bts_nr_t nr; diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 5ed339d..1dda9ae 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -988,6 +988,7 @@ struct llist_head bts_list; struct llist_head bts_rejected; DECLARE_HASHTABLE(bts_by_nr, 10); + DECLARE_HASHTABLE(bts_by_lac, 10); /* BTS-based counters when we can't find the actual BTS * e.g. when conn->lchan is NULL */ diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c index 38e5f11..d928a4b 100644 --- a/src/osmo-bsc/bts.c +++ b/src/osmo-bsc/bts.c @@ -160,6 +160,7 @@ llist_del(&bts->list); hash_del(&bts->node_by_nr); + hash_del(&bts->node_by_lac); paging_destructor(bts); bts_setup_ramp_remove(bts); @@ -205,6 +206,9 @@ hash_add(net->bts_by_nr, &bts->node_by_nr, bts->nr); net->num_bts++; + /* Default bts->location_area_code == GSM_LAC_RESERVED_DETACHED, don't add to hashtable: */ + INIT_HLIST_NODE(&bts->node_by_lac); + bts->num_trx = 0; INIT_LLIST_HEAD(&bts->trx_list); bts->network = net; diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index 81c4022..4ef582f 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -278,8 +278,8 @@ X(BSC_VTY_ATTR_RESTART_ABIS_RSL_LINK), "location_area_code (<0-65535>|<0x0000-0xffff>)", "Set the Location Area Code (LAC) of this BTS\n" - "LAC in decimal format\n" - "LAC in hexadecimal format\n") + "LAC in decimal format (default 0, reserved by GSM 04.08)\n" + "LAC in hexadecimal format (default 0x0000, reserved by GSM 04.08)\n") { struct gsm_bts *bts = vty->index; int lac; @@ -293,6 +293,8 @@ } bts->location_area_code = lac; + hash_del(&bts->node_by_lac); + hash_add(bts->network->bts_by_lac, &bts->node_by_lac, bts->location_area_code); return CMD_SUCCESS; } diff --git a/src/osmo-bsc/neighbor_ident.c b/src/osmo-bsc/neighbor_ident.c index 3e42c5f..4d52c50 100644 --- a/src/osmo-bsc/neighbor_ident.c +++ b/src/osmo-bsc/neighbor_ident.c @@ -377,7 +377,7 @@ struct gsm_bts *local_neighbor = NULL; struct gsm0808_cell_id_list2 remote_neighbors = { 0 }; - llist_for_each_entry(bts_tmp, &net->bts_list, list) { + hash_for_each_possible(net->bts_by_lac, bts_tmp, node_by_lac, lac) { if (bts_tmp->location_area_code != lac) continue; if (bts_tmp->cell_identity != cell_id) diff --git a/src/osmo-bsc/net_init.c b/src/osmo-bsc/net_init.c index fc29d43..62b3ee4 100644 --- a/src/osmo-bsc/net_init.c +++ b/src/osmo-bsc/net_init.c @@ -125,6 +125,7 @@ INIT_LLIST_HEAD(&net->bts_list); net->num_bts = 0; hash_init(net->bts_by_nr); + hash_init(net->bts_by_lac); net->T_defs = gsm_network_T_defs; osmo_tdefs_reset(net->T_defs); diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index c9e8e5e..82bdeb7 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -150,7 +150,7 @@ if (!osmo_plmn_cmp(&id->lai.plmn, &bsc_gsmnet->plmn)) { int paged = 0; struct gsm_bts *bts; - llist_for_each_entry(bts, &bsc_gsmnet->bts_list, list) { + hash_for_each_possible(bsc_gsmnet->bts_by_lac, bts, node_by_lac, id->lai.lac) { if (bts->location_area_code != id->lai.lac) continue; if (bts->cell_identity != id->cell_identity) @@ -179,7 +179,7 @@ const struct osmo_lac_and_ci_id *id = &params->cil.id_list[i].lac_and_ci; int paged = 0; struct gsm_bts *bts; - llist_for_each_entry(bts, &bsc_gsmnet->bts_list, list) { + hash_for_each_possible(bsc_gsmnet->bts_by_lac, bts, node_by_lac, id->lac) { if (bts->location_area_code != id->lac) continue; if (bts->cell_identity != id->ci) @@ -222,7 +222,7 @@ if (!osmo_plmn_cmp(&id->plmn, &bsc_gsmnet->plmn)) { int paged = 0; struct gsm_bts *bts; - llist_for_each_entry(bts, &bsc_gsmnet->bts_list, list) { + hash_for_each_possible(bsc_gsmnet->bts_by_lac, bts, node_by_lac, id->lac) { if (bts->location_area_code != id->lac) continue; page_subscriber(params, bts, id->lac); @@ -248,7 +248,7 @@ uint16_t lac = params->cil.id_list[i].lac; int paged = 0; struct gsm_bts *bts; - llist_for_each_entry(bts, &bsc_gsmnet->bts_list, list) { + hash_for_each_possible(bsc_gsmnet->bts_by_lac, bts, node_by_lac, lac) { if (bts->location_area_code != lac) continue; page_subscriber(params, bts, lac); -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/38087?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Id523027b49e0f58cd2c8c9b4dee619de415dbd15 Gerrit-Change-Number: 38087 Gerrit-PatchSet: 4 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>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • ...
  • 199
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.