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

August 2025

  • 1 participants
  • 1086 discussions
[M] Change in osmo-sgsn[master]: routing area: prefix GERAN functions with geran
by laforge 18 Aug '25

18 Aug '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40811?usp=email ) Change subject: routing area: prefix GERAN functions with geran ...................................................................... routing area: prefix GERAN functions with geran Make it easier to understand the purpose of the functions. Change-Id: Ic616bd8f9afe6cd3702cd4af08706b7b36987f42 --- M include/osmocom/sgsn/gprs_routing_area.h M src/sgsn/gprs_bssgp.c M src/sgsn/gprs_ns.c M src/sgsn/gprs_routing_area.c M tests/gprs_routing_area/gprs_routing_area_test.c 5 files changed, 60 insertions(+), 61 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sgsn/gprs_routing_area.h b/include/osmocom/sgsn/gprs_routing_area.h index 2626216..a807227 100644 --- a/include/osmocom/sgsn/gprs_routing_area.h +++ b/include/osmocom/sgsn/gprs_routing_area.h @@ -88,27 +88,29 @@ struct sgsn_ra *sgsn_ra_alloc(const struct osmo_routing_area_id *rai, enum sgsn_ra_ran_type ran_type); struct sgsn_ra *sgsn_ra_find_or_create(const struct osmo_routing_area_id *rai, enum sgsn_ra_ran_type ran_type); +struct sgsn_ra *sgsn_ra_get_ra(const struct osmo_routing_area_id *rai); void sgsn_ra_free(struct sgsn_ra *ra); struct sgsn_ra_cell *sgsn_ra_cell_alloc_geran(struct sgsn_ra *ra, uint16_t cell_id, uint16_t nsei, uint16_t bvci); void sgsn_ra_cell_free(struct sgsn_ra_cell *cell); /* GERAN */ /* Called by BSSGP layer to inform about a reset on a PtP BVCI */ -int sgsn_ra_bvc_cell_reset_ind(uint16_t nsei, uint16_t bvci, struct osmo_cell_global_id_ps *cgi_ps); +int sgsn_ra_geran_bvc_cell_reset_ind(uint16_t nsei, uint16_t bvci, struct osmo_cell_global_id_ps *cgi_ps); /* Called by BSSGP layer to inform about a reset on a Signal BVCI */ -void sgsn_ra_bvc_sign_reset_ind(uint16_t nsei); +void sgsn_ra_geran_bvc_sign_reset_ind(uint16_t nsei); /* FIXME: handle BVC BLOCK/UNBLOCK/UNAVAILABLE */ /* Called by NS-VC layer to inform about an unavailable NSEI (and all BVCI on them) */ -int sgsn_ra_nsei_failure_ind(uint16_t nsei); +int sgsn_ra_geran_nsei_failure_ind(uint16_t nsei); -struct sgsn_ra_cell *sgsn_ra_get_cell_by_cgi_ps(const struct osmo_cell_global_id_ps *cgi_ps); -struct sgsn_ra_cell *sgsn_ra_get_cell_by_lai(const struct osmo_location_area_id *lai, uint16_t cell_id); -struct sgsn_ra_cell *sgsn_ra_get_cell_by_cgi(const struct osmo_cell_global_id *cgi); -struct sgsn_ra_cell *sgsn_ra_get_cell_by_ra(const struct sgsn_ra *ra, uint16_t cell_id); -struct sgsn_ra_cell *sgsn_ra_get_cell_by_gb(uint16_t nsei, uint16_t bvci); -struct sgsn_ra *sgsn_ra_get_ra(const struct osmo_routing_area_id *rai); -struct sgsn_ra *sgsn_ra_get_ra_geran(const struct osmo_routing_area_id *rai); +struct sgsn_ra_cell *sgsn_ra_geran_get_cell_by_cgi_ps(const struct osmo_cell_global_id_ps *cgi_ps); +struct sgsn_ra_cell *sgsn_ra_geran_get_cell_by_lai(const struct osmo_location_area_id *lai, uint16_t cell_id); +struct sgsn_ra_cell *sgsn_ra_geran_get_cell_by_cgi(const struct osmo_cell_global_id *cgi); +struct sgsn_ra_cell *sgsn_ra_geran_get_cell_by_ra(const struct sgsn_ra *ra, uint16_t cell_id); +struct sgsn_ra_cell *sgsn_ra_geran_get_cell_by_gb(uint16_t nsei, uint16_t bvci); +struct sgsn_ra *sgsn_ra_geran_get_ra(const struct osmo_routing_area_id *rai); +/* Page the whole routing area for this mmctx */ +int sgsn_ra_geran_page_ra(const struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx); /* * return value for callbacks. @@ -123,6 +125,3 @@ typedef int (sgsn_ra_cb_t)(struct sgsn_ra_cell *ra_cell, void *cb_data); int sgsn_ra_foreach_cell(struct sgsn_ra *ra, sgsn_ra_cb_t *cb, void *cb_data); int sgsn_ra_foreach_cell2(struct osmo_routing_area_id *rai, sgsn_ra_cb_t *cb, void *cb_data); - -/* Page the whole routing area for this mmctx */ -int sgsn_ra_geran_page_ra(const struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx); diff --git a/src/sgsn/gprs_bssgp.c b/src/sgsn/gprs_bssgp.c index 42cd073..c64e790 100644 --- a/src/sgsn/gprs_bssgp.c +++ b/src/sgsn/gprs_bssgp.c @@ -44,7 +44,7 @@ * PtP BVCI: BVCI != 0, CGI-PS */ if (bp->bvci == 0) { - sgsn_ra_bvc_sign_reset_ind(bp->nsei); + sgsn_ra_geran_bvc_sign_reset_ind(bp->nsei); return 0; } @@ -55,7 +55,7 @@ return -EINVAL; bssgp_parse_cell_id2(&cgi_ps.rai, &cgi_ps.cell_identity, TLVP_VAL(bp->tp, BSSGP_IE_CELL_ID), 8); - return sgsn_ra_bvc_cell_reset_ind(bp->nsei, bp->bvci, &cgi_ps); + return sgsn_ra_geran_bvc_cell_reset_ind(bp->nsei, bp->bvci, &cgi_ps); } /* call-back function for the BSSGP protocol */ diff --git a/src/sgsn/gprs_ns.c b/src/sgsn/gprs_ns.c index 3968128..d38de37 100644 --- a/src/sgsn/gprs_ns.c +++ b/src/sgsn/gprs_ns.c @@ -53,7 +53,7 @@ break; case GPRS_NS2_AFF_CAUSE_FAILURE: LOGP(DGPRS, LOGL_NOTICE, "NS-E %d became unavailable\n", nsp->nsei); - sgsn_ra_nsei_failure_ind(nsp->nsei); + sgsn_ra_geran_nsei_failure_ind(nsp->nsei); break; default: LOGP(DGPRS, LOGL_NOTICE, "NS: %s Unknown prim %d from NS\n", diff --git a/src/sgsn/gprs_routing_area.c b/src/sgsn/gprs_routing_area.c index dae18cd..721f0c9 100644 --- a/src/sgsn/gprs_routing_area.c +++ b/src/sgsn/gprs_routing_area.c @@ -143,7 +143,7 @@ return NULL; } -struct sgsn_ra *sgsn_ra_get_ra_geran(const struct osmo_routing_area_id *rai) +struct sgsn_ra *sgsn_ra_geran_get_ra(const struct osmo_routing_area_id *rai) { struct sgsn_ra *ra = sgsn_ra_get_ra(rai); @@ -156,7 +156,7 @@ return NULL; } -struct sgsn_ra_cell *sgsn_ra_get_cell_by_gb(uint16_t nsei, uint16_t bvci) +struct sgsn_ra_cell *sgsn_ra_geran_get_cell_by_gb(uint16_t nsei, uint16_t bvci) { struct sgsn_ra *ra; struct sgsn_ra_cell *cell; @@ -219,7 +219,7 @@ } /* valid for GERAN */ -struct sgsn_ra_cell *sgsn_ra_get_cell_by_ra(const struct sgsn_ra *ra, uint16_t cell_id) +struct sgsn_ra_cell *sgsn_ra_geran_get_cell_by_ra(const struct sgsn_ra *ra, uint16_t cell_id) { struct sgsn_ra_cell *cell; @@ -238,7 +238,7 @@ } /* valid for GERAN */ -struct sgsn_ra_cell *sgsn_ra_get_cell_by_lai(const struct osmo_location_area_id *lai, uint16_t cell_id) +struct sgsn_ra_cell *sgsn_ra_geran_get_cell_by_lai(const struct osmo_location_area_id *lai, uint16_t cell_id) { struct sgsn_ra *ra; struct sgsn_ra_cell *cell; @@ -269,24 +269,24 @@ * \param cgi_ps * \return the cell or NULL if not found */ -struct sgsn_ra_cell *sgsn_ra_get_cell_by_cgi_ps(const struct osmo_cell_global_id_ps *cgi_ps) +struct sgsn_ra_cell *sgsn_ra_geran_get_cell_by_cgi_ps(const struct osmo_cell_global_id_ps *cgi_ps) { struct sgsn_ra *ra; OSMO_ASSERT(cgi_ps); - ra = sgsn_ra_get_ra_geran(&cgi_ps->rai); + ra = sgsn_ra_geran_get_ra(&cgi_ps->rai); if (!ra) return NULL; - return sgsn_ra_get_cell_by_ra(ra, cgi_ps->cell_identity); + return sgsn_ra_geran_get_cell_by_ra(ra, cgi_ps->cell_identity); } -struct sgsn_ra_cell *sgsn_ra_get_cell_by_cgi(const struct osmo_cell_global_id *cgi) +struct sgsn_ra_cell *sgsn_ra_geran_get_cell_by_cgi(const struct osmo_cell_global_id *cgi) { OSMO_ASSERT(cgi); - return sgsn_ra_get_cell_by_lai(&cgi->lai, cgi->cell_identity); + return sgsn_ra_geran_get_cell_by_lai(&cgi->lai, cgi->cell_identity); } /*! Callback from the BSSGP layer on NM RESET IND for a cell (PtP BVCI). @@ -296,7 +296,7 @@ * \param cgi_ps * \return 0 on success or -ENOMEM */ -int sgsn_ra_bvc_cell_reset_ind(uint16_t nsei, uint16_t bvci, struct osmo_cell_global_id_ps *cgi_ps) +int sgsn_ra_geran_bvc_cell_reset_ind(uint16_t nsei, uint16_t bvci, struct osmo_cell_global_id_ps *cgi_ps) { struct sgsn_ra *ra; struct sgsn_ra_cell *cell; @@ -304,7 +304,7 @@ OSMO_ASSERT(cgi_ps); /* TODO: do we have to move all MS to GMM IDLE state when this happens for a alive cell which got reseted? */ - ra = sgsn_ra_get_ra_geran(&cgi_ps->rai); + ra = sgsn_ra_geran_get_ra(&cgi_ps->rai); if (!ra) { /* TODO: check for UTRAN rai when introducing UTRAN support */ ra = sgsn_ra_find_or_create(&cgi_ps->rai, RA_TYPE_GERAN_Gb); @@ -314,7 +314,7 @@ } if (!ra_created) { - cell = sgsn_ra_get_cell_by_ra(ra, cgi_ps->cell_identity); + cell = sgsn_ra_geran_get_cell_by_ra(ra, cgi_ps->cell_identity); if (cell && cell->ran_type == RA_TYPE_GERAN_Gb) { /* Cell already exist, update NSEI/BVCI */ if (cell->u.geran.bvci != bvci || cell->u.geran.nsei != nsei) { @@ -338,7 +338,7 @@ char new_ra[32]; /* check for the same cell id within the location area. The cell id is also unique for the cell within the LAC * This should only happen when a Cell is changing routing areas */ - cell = sgsn_ra_get_cell_by_lai(&cgi_ps->rai.lac, cgi_ps->cell_identity); + cell = sgsn_ra_geran_get_cell_by_lai(&cgi_ps->rai.lac, cgi_ps->cell_identity); if (cell) { LOGRAI(LOGL_INFO, &cgi_ps->rai, "CGI %s: changed Routing Area. Old: %s, New: %s\n", osmo_cgi_ps_name(cgi_ps), @@ -364,7 +364,7 @@ } /* FIXME: call it on BSSGP BLOCK + unavailable with BVCI */ -int sgsn_ra_nsei_failure_ind(uint16_t nsei) +int sgsn_ra_geran_nsei_failure_ind(uint16_t nsei) { struct sgsn_ra *ra, *ra2; struct sgsn_ra_cell *cell, *cell2; @@ -391,9 +391,9 @@ return found ? 0 : -ENOENT; } -void sgsn_ra_bvc_sign_reset_ind(uint16_t nsei) +void sgsn_ra_geran_bvc_sign_reset_ind(uint16_t nsei) { - sgsn_ra_nsei_failure_ind(nsei); + sgsn_ra_geran_nsei_failure_ind(nsei); } int sgsn_ra_geran_page_ra(const struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx) @@ -404,7 +404,7 @@ rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PAGING_PS)); - ra = sgsn_ra_get_ra_geran(rai); + ra = sgsn_ra_geran_get_ra(rai); if (!ra) return -ENOENT; diff --git a/tests/gprs_routing_area/gprs_routing_area_test.c b/tests/gprs_routing_area/gprs_routing_area_test.c index d8ff07f..b9840b9 100644 --- a/tests/gprs_routing_area/gprs_routing_area_test.c +++ b/tests/gprs_routing_area/gprs_routing_area_test.c @@ -171,19 +171,19 @@ OSMO_ASSERT(cell_a); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); - cell_b = sgsn_ra_get_cell_by_cgi_ps(&cgi_ps); + cell_b = sgsn_ra_geran_get_cell_by_cgi_ps(&cgi_ps); OSMO_ASSERT(cell_b); OSMO_ASSERT(cell_b == cell_a); - cell_b = sgsn_ra_get_cell_by_ra(ra_a, cgi.cell_identity); + cell_b = sgsn_ra_geran_get_cell_by_ra(ra_a, cgi.cell_identity); OSMO_ASSERT(cell_b); OSMO_ASSERT(cell_b == cell_a); - cell_b = sgsn_ra_get_cell_by_cgi(&cgi); + cell_b = sgsn_ra_geran_get_cell_by_cgi(&cgi); OSMO_ASSERT(cell_b); OSMO_ASSERT(cell_b == cell_a); - cell_b = sgsn_ra_get_cell_by_lai(&cgi.lai, cgi.cell_identity); + cell_b = sgsn_ra_geran_get_cell_by_lai(&cgi.lai, cgi.cell_identity); OSMO_ASSERT(cell_b); OSMO_ASSERT(cell_b == cell_a); @@ -202,23 +202,23 @@ OSMO_ASSERT(cell_a); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); - cell_b = sgsn_ra_get_cell_by_cgi_ps(&cgi_ps); + cell_b = sgsn_ra_geran_get_cell_by_cgi_ps(&cgi_ps); OSMO_ASSERT(!cell_b); - cell_b = sgsn_ra_get_cell_by_ra(ra_a, cgi_ps.cell_identity); + cell_b = sgsn_ra_geran_get_cell_by_ra(ra_a, cgi_ps.cell_identity); OSMO_ASSERT(!cell_b); - cell_b = sgsn_ra_get_cell_by_cgi(&cgi); + cell_b = sgsn_ra_geran_get_cell_by_cgi(&cgi); OSMO_ASSERT(!cell_b); - cell_b = sgsn_ra_get_cell_by_lai(&cgi.lai, cgi.cell_identity); + cell_b = sgsn_ra_geran_get_cell_by_lai(&cgi.lai, cgi.cell_identity); OSMO_ASSERT(!cell_b); /* try to find for a different RAC */ cgi_ps.rai.rac = 45; rai.rac = 46; - cell_b = sgsn_ra_get_cell_by_cgi_ps(&cgi_ps); + cell_b = sgsn_ra_geran_get_cell_by_cgi_ps(&cgi_ps); OSMO_ASSERT(!cell_b); ra_b = sgsn_ra_get_ra(&rai); @@ -226,7 +226,7 @@ /* try to find for different LAC */ cgi.lai.lac = 46; - cell_b = sgsn_ra_get_cell_by_cgi(&cgi); + cell_b = sgsn_ra_geran_get_cell_by_cgi(&cgi); OSMO_ASSERT(!cell_b); sgsn_ra_free(ra_a); @@ -268,24 +268,24 @@ OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); OSMO_ASSERT(llist_count(&ra_a->cells_alive_list) == 0); - rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); + rc = sgsn_ra_geran_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); OSMO_ASSERT(rc == 0); OSMO_ASSERT(llist_count(&ra_a->cells_alive_list) == 1); - cell_a = sgsn_ra_get_cell_by_cgi(&cgi); + cell_a = sgsn_ra_geran_get_cell_by_cgi(&cgi); OSMO_ASSERT(cell_a); - rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); + rc = sgsn_ra_geran_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); OSMO_ASSERT(rc == 0); - cell_b = sgsn_ra_get_cell_by_cgi(&cgi); + cell_b = sgsn_ra_geran_get_cell_by_cgi(&cgi); OSMO_ASSERT(cell_b); OSMO_ASSERT(cell_a == cell_b); sgsn_ra_free(ra_a); OSMO_ASSERT(llist_empty(&sgsn->routing_area->ra_list)); - rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); + rc = sgsn_ra_geran_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); OSMO_ASSERT(rc == 0); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -320,17 +320,17 @@ sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); + rc = sgsn_ra_geran_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); OSMO_ASSERT(rc == 0); ra_a = sgsn_ra_get_ra(&cgi_ps.rai); OSMO_ASSERT(llist_count(&ra_a->cells_alive_list) == 1); - rc = sgsn_ra_nsei_failure_ind(nsei); + rc = sgsn_ra_geran_nsei_failure_ind(nsei); OSMO_ASSERT(rc == 0); OSMO_ASSERT(llist_empty(&sgsn->routing_area->ra_list)); - rc = sgsn_ra_nsei_failure_ind(nsei); + rc = sgsn_ra_geran_nsei_failure_ind(nsei); OSMO_ASSERT(rc == -ENOENT); OSMO_ASSERT(llist_empty(&sgsn->routing_area->ra_list)); @@ -402,11 +402,11 @@ g_paging[0].valid = true; g_paging[0].paged = false; - rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); + rc = sgsn_ra_geran_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); OSMO_ASSERT(rc == 0); cgi_ps.cell_identity++; - rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci+1, &cgi_ps); + rc = sgsn_ra_geran_bvc_cell_reset_ind(nsei, bvci+1, &cgi_ps); OSMO_ASSERT(rc == 0); g_paging[1].bvci = bvci+1; @@ -450,13 +450,13 @@ printf("Testing Routing Area GERAN BVCI Signalling Reset Ind\n"); printf(" Registering GERAN RA/cell via BVCI 5/BVC Reset Ind\n"); - sgsn_ra_bvc_sign_reset_ind(nsei); + sgsn_ra_geran_bvc_sign_reset_ind(nsei); - rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); + rc = sgsn_ra_geran_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); OSMO_ASSERT(rc == 0); printf(" Checking cell on BVCI 5\n"); - cell = sgsn_ra_get_cell_by_cgi_ps(&cgi_ps); + cell = sgsn_ra_geran_get_cell_by_cgi_ps(&cgi_ps); OSMO_ASSERT(cell); OSMO_ASSERT(cell->ran_type == RA_TYPE_GERAN_Gb); OSMO_ASSERT(cell->u.geran.bvci == bvci); @@ -468,7 +468,7 @@ OSMO_ASSERT(llist_count(&cell->ra->cells_alive_list) == 1); printf(" Drop all cells via BVC Reset Ind on Signalling BVCI\n"); - sgsn_ra_bvc_sign_reset_ind(nsei); + sgsn_ra_geran_bvc_sign_reset_ind(nsei); printf(" Ensure only 0 RAs are present\n"); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 0); @@ -503,11 +503,11 @@ printf("Testing Routing Area GERAN to GERAN (BVCI change)\n"); printf(" Registering GERAN RA/cell via BVCI A/BVC Reset Ind\n"); - rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci_a, &cgi_ps); + rc = sgsn_ra_geran_bvc_cell_reset_ind(nsei, bvci_a, &cgi_ps); OSMO_ASSERT(rc == 0); printf(" Checking cell on BVCI A\n"); - cell_a = sgsn_ra_get_cell_by_cgi_ps(&cgi_ps); + cell_a = sgsn_ra_geran_get_cell_by_cgi_ps(&cgi_ps); OSMO_ASSERT(cell_a); OSMO_ASSERT(cell_a->ran_type == RA_TYPE_GERAN_Gb); OSMO_ASSERT(cell_a->u.geran.bvci == bvci_a); @@ -519,11 +519,11 @@ OSMO_ASSERT(llist_count(&cell_a->ra->cells_alive_list) == 1); printf(" Registering GERAN RA/cell via BVCI B/BVC Reset Ind\n"); - rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci_b, &cgi_ps); + rc = sgsn_ra_geran_bvc_cell_reset_ind(nsei, bvci_b, &cgi_ps); OSMO_ASSERT(rc == 0); printf(" Checking cell on BVCI B\n"); - cell_b = sgsn_ra_get_cell_by_cgi_ps(&cgi_ps); + cell_b = sgsn_ra_geran_get_cell_by_cgi_ps(&cgi_ps); OSMO_ASSERT(cell_b); OSMO_ASSERT(cell_b->ran_type == RA_TYPE_GERAN_Gb); OSMO_ASSERT(cell_b->u.geran.bvci == bvci_b); -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40811?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ic616bd8f9afe6cd3702cd4af08706b7b36987f42 Gerrit-Change-Number: 40811 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-sgsn[master]: BSSGP: reset cells when receiving a Reset on Signal BVC
by laforge 18 Aug '25

18 Aug '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40810?usp=email ) Change subject: BSSGP: reset cells when receiving a Reset on Signal BVC ...................................................................... BSSGP: reset cells when receiving a Reset on Signal BVC When a PCU sends a BVC Reset over BSSGP on the Signal BVC, all cells which has been set up previously via PtP BVCs has to be removed. They might be introduced after the Signal BVC reset procedure has finished. Change-Id: I380c8f9ef90d8c7face5c380d923ab5168f5b484 --- M include/osmocom/sgsn/gprs_routing_area.h M src/sgsn/gprs_bssgp.c M src/sgsn/gprs_routing_area.c M tests/gprs_routing_area/gprs_routing_area_test.c M tests/gprs_routing_area/gprs_routing_area_test.ok 5 files changed, 90 insertions(+), 13 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve diff --git a/include/osmocom/sgsn/gprs_routing_area.h b/include/osmocom/sgsn/gprs_routing_area.h index 68be41c..2626216 100644 --- a/include/osmocom/sgsn/gprs_routing_area.h +++ b/include/osmocom/sgsn/gprs_routing_area.h @@ -92,8 +92,11 @@ struct sgsn_ra_cell *sgsn_ra_cell_alloc_geran(struct sgsn_ra *ra, uint16_t cell_id, uint16_t nsei, uint16_t bvci); void sgsn_ra_cell_free(struct sgsn_ra_cell *cell); -/* Called by BSSGP layer to inform about a reset on a BVCI */ -int sgsn_ra_bvc_reset_ind(uint16_t nsei, uint16_t bvci, struct osmo_cell_global_id_ps *cgi_ps); +/* GERAN */ +/* Called by BSSGP layer to inform about a reset on a PtP BVCI */ +int sgsn_ra_bvc_cell_reset_ind(uint16_t nsei, uint16_t bvci, struct osmo_cell_global_id_ps *cgi_ps); +/* Called by BSSGP layer to inform about a reset on a Signal BVCI */ +void sgsn_ra_bvc_sign_reset_ind(uint16_t nsei); /* FIXME: handle BVC BLOCK/UNBLOCK/UNAVAILABLE */ /* Called by NS-VC layer to inform about an unavailable NSEI (and all BVCI on them) */ int sgsn_ra_nsei_failure_ind(uint16_t nsei); diff --git a/src/sgsn/gprs_bssgp.c b/src/sgsn/gprs_bssgp.c index 58aeb75..42cd073 100644 --- a/src/sgsn/gprs_bssgp.c +++ b/src/sgsn/gprs_bssgp.c @@ -40,6 +40,14 @@ { struct osmo_cell_global_id_ps cgi_ps = {}; + /* Signalling: BVCI == 0, no CGI-PS + * PtP BVCI: BVCI != 0, CGI-PS */ + + if (bp->bvci == 0) { + sgsn_ra_bvc_sign_reset_ind(bp->nsei); + return 0; + } + if (!bp->tp) return -EINVAL; @@ -47,7 +55,7 @@ return -EINVAL; bssgp_parse_cell_id2(&cgi_ps.rai, &cgi_ps.cell_identity, TLVP_VAL(bp->tp, BSSGP_IE_CELL_ID), 8); - return sgsn_ra_bvc_reset_ind(bp->nsei, bp->bvci, &cgi_ps); + return sgsn_ra_bvc_cell_reset_ind(bp->nsei, bp->bvci, &cgi_ps); } /* call-back function for the BSSGP protocol */ diff --git a/src/sgsn/gprs_routing_area.c b/src/sgsn/gprs_routing_area.c index 6e449d2..dae18cd 100644 --- a/src/sgsn/gprs_routing_area.c +++ b/src/sgsn/gprs_routing_area.c @@ -289,14 +289,14 @@ return sgsn_ra_get_cell_by_lai(&cgi->lai, cgi->cell_identity); } -/*! Callback from the BSSGP layer on NM RESET IND +/*! Callback from the BSSGP layer on NM RESET IND for a cell (PtP BVCI). * * \param nsei * \param bvci * \param cgi_ps * \return 0 on success or -ENOMEM */ -int sgsn_ra_bvc_reset_ind(uint16_t nsei, uint16_t bvci, struct osmo_cell_global_id_ps *cgi_ps) +int sgsn_ra_bvc_cell_reset_ind(uint16_t nsei, uint16_t bvci, struct osmo_cell_global_id_ps *cgi_ps) { struct sgsn_ra *ra; struct sgsn_ra_cell *cell; @@ -391,6 +391,11 @@ return found ? 0 : -ENOENT; } +void sgsn_ra_bvc_sign_reset_ind(uint16_t nsei) +{ + sgsn_ra_nsei_failure_ind(nsei); +} + int sgsn_ra_geran_page_ra(const struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx) { struct sgsn_ra *ra; diff --git a/tests/gprs_routing_area/gprs_routing_area_test.c b/tests/gprs_routing_area/gprs_routing_area_test.c index 82e2333..d8ff07f 100644 --- a/tests/gprs_routing_area/gprs_routing_area_test.c +++ b/tests/gprs_routing_area/gprs_routing_area_test.c @@ -268,14 +268,14 @@ OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); OSMO_ASSERT(llist_count(&ra_a->cells_alive_list) == 0); - rc = sgsn_ra_bvc_reset_ind(nsei, bvci, &cgi_ps); + rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); OSMO_ASSERT(rc == 0); OSMO_ASSERT(llist_count(&ra_a->cells_alive_list) == 1); cell_a = sgsn_ra_get_cell_by_cgi(&cgi); OSMO_ASSERT(cell_a); - rc = sgsn_ra_bvc_reset_ind(nsei, bvci, &cgi_ps); + rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); OSMO_ASSERT(rc == 0); cell_b = sgsn_ra_get_cell_by_cgi(&cgi); @@ -285,7 +285,7 @@ sgsn_ra_free(ra_a); OSMO_ASSERT(llist_empty(&sgsn->routing_area->ra_list)); - rc = sgsn_ra_bvc_reset_ind(nsei, bvci, &cgi_ps); + rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); OSMO_ASSERT(rc == 0); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -320,7 +320,7 @@ sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - rc = sgsn_ra_bvc_reset_ind(nsei, bvci, &cgi_ps); + rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); OSMO_ASSERT(rc == 0); ra_a = sgsn_ra_get_ra(&cgi_ps.rai); @@ -402,11 +402,11 @@ g_paging[0].valid = true; g_paging[0].paged = false; - rc = sgsn_ra_bvc_reset_ind(nsei, bvci, &cgi_ps); + rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); OSMO_ASSERT(rc == 0); cgi_ps.cell_identity++; - rc = sgsn_ra_bvc_reset_ind(nsei, bvci+1, &cgi_ps); + rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci+1, &cgi_ps); OSMO_ASSERT(rc == 0); g_paging[1].bvci = bvci+1; @@ -424,6 +424,59 @@ cleanup_test(); } +/* check if a GERAN cell got removed when sending a Reset Ind on Sig BVCI */ +void test_routing_area_geran_geran_sig_reset(void) +{ + int rc; + + /* GERAN */ + struct osmo_routing_area_id geran_rai = { + .lac = { + .plmn = { .mcc = 262, .mnc = 42, .mnc_3_digits = false }, + .lac = 24 + }, + .rac = 43 + }; + struct osmo_cell_global_id_ps cgi_ps = { + .rai = geran_rai, + .cell_identity = 9998, + }; + uint16_t nsei = 2, bvci = 5; + + struct sgsn_ra_cell *cell; + + sgsn = sgsn_instance_alloc(tall_sgsn_ctx); + + printf("Testing Routing Area GERAN BVCI Signalling Reset Ind\n"); + + printf(" Registering GERAN RA/cell via BVCI 5/BVC Reset Ind\n"); + sgsn_ra_bvc_sign_reset_ind(nsei); + + rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci, &cgi_ps); + OSMO_ASSERT(rc == 0); + + printf(" Checking cell on BVCI 5\n"); + cell = sgsn_ra_get_cell_by_cgi_ps(&cgi_ps); + OSMO_ASSERT(cell); + OSMO_ASSERT(cell->ran_type == RA_TYPE_GERAN_Gb); + OSMO_ASSERT(cell->u.geran.bvci == bvci); + + printf(" Ensure only 1 RA is present\n"); + OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); + + printf(" Ensure only 1 cell is present\n"); + OSMO_ASSERT(llist_count(&cell->ra->cells_alive_list) == 1); + + printf(" Drop all cells via BVC Reset Ind on Signalling BVCI\n"); + sgsn_ra_bvc_sign_reset_ind(nsei); + + printf(" Ensure only 0 RAs are present\n"); + OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 0); + + cleanup_test(); +} + + /* check if a GERAN cell X can changed it's BVCI by BVC Reset Ind */ void test_routing_area_geran_geran_bvci_change(void) { @@ -450,7 +503,7 @@ printf("Testing Routing Area GERAN to GERAN (BVCI change)\n"); printf(" Registering GERAN RA/cell via BVCI A/BVC Reset Ind\n"); - rc = sgsn_ra_bvc_reset_ind(nsei, bvci_a, &cgi_ps); + rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci_a, &cgi_ps); OSMO_ASSERT(rc == 0); printf(" Checking cell on BVCI A\n"); @@ -466,7 +519,7 @@ OSMO_ASSERT(llist_count(&cell_a->ra->cells_alive_list) == 1); printf(" Registering GERAN RA/cell via BVCI B/BVC Reset Ind\n"); - rc = sgsn_ra_bvc_reset_ind(nsei, bvci_b, &cgi_ps); + rc = sgsn_ra_bvc_cell_reset_ind(nsei, bvci_b, &cgi_ps); OSMO_ASSERT(rc == 0); printf(" Checking cell on BVCI B\n"); @@ -546,6 +599,7 @@ test_routing_area_reset_ind(); test_routing_area_nsei_free(); test_routing_area_paging(); + test_routing_area_geran_geran_sig_reset(); test_routing_area_geran_geran_bvci_change(); printf("Done\n"); diff --git a/tests/gprs_routing_area/gprs_routing_area_test.ok b/tests/gprs_routing_area/gprs_routing_area_test.ok index c506abc..4ce9944 100644 --- a/tests/gprs_routing_area/gprs_routing_area_test.ok +++ b/tests/gprs_routing_area/gprs_routing_area_test.ok @@ -4,6 +4,13 @@ Testing Routing Area BSSGP BVC RESET IND Testing Routing Area nsei failure Testing Routing Area paging +Testing Routing Area GERAN BVCI Signalling Reset Ind + Registering GERAN RA/cell via BVCI 5/BVC Reset Ind + Checking cell on BVCI 5 + Ensure only 1 RA is present + Ensure only 1 cell is present + Drop all cells via BVC Reset Ind on Signalling BVCI + Ensure only 0 RAs are present Testing Routing Area GERAN to GERAN (BVCI change) Registering GERAN RA/cell via BVCI A/BVC Reset Ind Checking cell on BVCI A -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40810?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I380c8f9ef90d8c7face5c380d923ab5168f5b484 Gerrit-Change-Number: 40810 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-sgsn[master]: tests: RA: add test for a GERAN cell to change its BVCI
by laforge 18 Aug '25

18 Aug '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40809?usp=email ) Change subject: tests: RA: add test for a GERAN cell to change its BVCI ...................................................................... tests: RA: add test for a GERAN cell to change its BVCI Change-Id: Idcada8364bf62aae2244b92e0d7a43c120c9c0ad --- M tests/gprs_routing_area/gprs_routing_area_test.c M tests/gprs_routing_area/gprs_routing_area_test.ok 2 files changed, 70 insertions(+), 0 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/gprs_routing_area/gprs_routing_area_test.c b/tests/gprs_routing_area/gprs_routing_area_test.c index a329e87..82e2333 100644 --- a/tests/gprs_routing_area/gprs_routing_area_test.c +++ b/tests/gprs_routing_area/gprs_routing_area_test.c @@ -424,6 +424,66 @@ cleanup_test(); } +/* check if a GERAN cell X can changed it's BVCI by BVC Reset Ind */ +void test_routing_area_geran_geran_bvci_change(void) +{ + int rc; + + /* GERAN */ + struct osmo_routing_area_id geran_rai = { + .lac = { + .plmn = { .mcc = 262, .mnc = 42, .mnc_3_digits = false }, + .lac = 24 + }, + .rac = 43 + }; + struct osmo_cell_global_id_ps cgi_ps = { + .rai = geran_rai, + .cell_identity = 9998, + }; + uint16_t nsei = 2, bvci_a = 3, bvci_b = 4; + + struct sgsn_ra_cell *cell_a, *cell_b; + + sgsn = sgsn_instance_alloc(tall_sgsn_ctx); + + printf("Testing Routing Area GERAN to GERAN (BVCI change)\n"); + + printf(" Registering GERAN RA/cell via BVCI A/BVC Reset Ind\n"); + rc = sgsn_ra_bvc_reset_ind(nsei, bvci_a, &cgi_ps); + OSMO_ASSERT(rc == 0); + + printf(" Checking cell on BVCI A\n"); + cell_a = sgsn_ra_get_cell_by_cgi_ps(&cgi_ps); + OSMO_ASSERT(cell_a); + OSMO_ASSERT(cell_a->ran_type == RA_TYPE_GERAN_Gb); + OSMO_ASSERT(cell_a->u.geran.bvci == bvci_a); + + printf(" Ensure only 1 RA is present\n"); + OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); + + printf(" Ensure only 1 cell is present\n"); + OSMO_ASSERT(llist_count(&cell_a->ra->cells_alive_list) == 1); + + printf(" Registering GERAN RA/cell via BVCI B/BVC Reset Ind\n"); + rc = sgsn_ra_bvc_reset_ind(nsei, bvci_b, &cgi_ps); + OSMO_ASSERT(rc == 0); + + printf(" Checking cell on BVCI B\n"); + cell_b = sgsn_ra_get_cell_by_cgi_ps(&cgi_ps); + OSMO_ASSERT(cell_b); + OSMO_ASSERT(cell_b->ran_type == RA_TYPE_GERAN_Gb); + OSMO_ASSERT(cell_b->u.geran.bvci == bvci_b); + + printf(" Ensure only 1 RA is present\n"); + OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); + + printf(" Ensure only 1 cell is present\n"); + OSMO_ASSERT(llist_count(&cell_b->ra->cells_alive_list) == 1); + + cleanup_test(); +} + static struct log_info_cat gprs_categories[] = { [DMM] = { .name = "DMM", @@ -486,6 +546,7 @@ test_routing_area_reset_ind(); test_routing_area_nsei_free(); test_routing_area_paging(); + test_routing_area_geran_geran_bvci_change(); printf("Done\n"); talloc_report_full(osmo_sgsn_ctx, stderr); diff --git a/tests/gprs_routing_area/gprs_routing_area_test.ok b/tests/gprs_routing_area/gprs_routing_area_test.ok index 78cee7e..c506abc 100644 --- a/tests/gprs_routing_area/gprs_routing_area_test.ok +++ b/tests/gprs_routing_area/gprs_routing_area_test.ok @@ -4,4 +4,13 @@ Testing Routing Area BSSGP BVC RESET IND Testing Routing Area nsei failure Testing Routing Area paging +Testing Routing Area GERAN to GERAN (BVCI change) + Registering GERAN RA/cell via BVCI A/BVC Reset Ind + Checking cell on BVCI A + Ensure only 1 RA is present + Ensure only 1 cell is present + Registering GERAN RA/cell via BVCI B/BVC Reset Ind + Checking cell on BVCI B + Ensure only 1 RA is present + Ensure only 1 cell is present Done -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40809?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Idcada8364bf62aae2244b92e0d7a43c120c9c0ad Gerrit-Change-Number: 40809 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-sgsn[master]: routing area: introduce sgsn_ra_find_or_create()
by laforge 18 Aug '25

18 Aug '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40691?usp=email ) Change subject: routing area: introduce sgsn_ra_find_or_create() ...................................................................... routing area: introduce sgsn_ra_find_or_create() If the RA is the same, return the RA, but if the ran type is different, return NULL instead of allocating a second RA in the other RAT. Change-Id: I6955a09d9d8f3ba4dc3a14d7ed5cd9798d929c61 --- M include/osmocom/sgsn/gprs_routing_area.h M src/sgsn/gprs_routing_area.c M tests/gprs_routing_area/gprs_routing_area_test.c 3 files changed, 28 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_routing_area.h b/include/osmocom/sgsn/gprs_routing_area.h index 3bdc057..9f16559 100644 --- a/include/osmocom/sgsn/gprs_routing_area.h +++ b/include/osmocom/sgsn/gprs_routing_area.h @@ -74,6 +74,7 @@ void sgsn_ra_init(struct sgsn_instance *inst); struct sgsn_ra *sgsn_ra_alloc(const struct osmo_routing_area_id *rai, enum sgsn_ra_ran_type ran_type); +struct sgsn_ra *sgsn_ra_find_or_create(const struct osmo_routing_area_id *rai, enum sgsn_ra_ran_type ran_type); void sgsn_ra_free(struct sgsn_ra *ra); struct sgsn_ra_cell *sgsn_ra_cell_alloc_geran(struct sgsn_ra *ra, uint16_t cell_id, uint16_t nsei, uint16_t bvci); void sgsn_ra_cell_free(struct sgsn_ra_cell *cell); diff --git a/src/sgsn/gprs_routing_area.c b/src/sgsn/gprs_routing_area.c index 4d04ed7..3a39f8d 100644 --- a/src/sgsn/gprs_routing_area.c +++ b/src/sgsn/gprs_routing_area.c @@ -93,6 +93,26 @@ return ra; } +struct sgsn_ra *sgsn_ra_find_or_create(const struct osmo_routing_area_id *rai, enum sgsn_ra_ran_type ran_type) +{ + struct sgsn_ra *ra = sgsn_ra_get_ra(rai); + + if (ra) { + if (ra->ran_type == ran_type) { + LOGP(DRA, LOGL_ERROR, "Trying to create an already existing RA %s with the same ran type %s. Using old RA.\n", + osmo_rai_name2(rai), get_value_string(sgsn_ra_ran_type_names, ra->ran_type)); + + return ra; + } + + LOGP(DRA, LOGL_ERROR, "Failed to create an already existing RA %s with a different ran type %s.\n", + osmo_rai_name2(rai), get_value_string(sgsn_ra_ran_type_names, ra->ran_type)); + return NULL; + } + + return sgsn_ra_alloc(rai, ran_type); +} + struct sgsn_ra_cell *sgsn_ra_cell_alloc_geran(struct sgsn_ra *ra, uint16_t cell_id, uint16_t nsei, uint16_t bvci) { struct sgsn_ra_cell *cell; @@ -287,7 +307,7 @@ ra = sgsn_ra_get_ra_geran(&cgi_ps->rai); if (!ra) { /* TODO: check for UTRAN rai when introducing UTRAN support */ - ra = sgsn_ra_alloc(&cgi_ps->rai, RA_TYPE_GERAN_Gb); + ra = sgsn_ra_find_or_create(&cgi_ps->rai, RA_TYPE_GERAN_Gb); if (!ra) return -ENOMEM; ra_created = true; diff --git a/tests/gprs_routing_area/gprs_routing_area_test.c b/tests/gprs_routing_area/gprs_routing_area_test.c index c43c771..a329e87 100644 --- a/tests/gprs_routing_area/gprs_routing_area_test.c +++ b/tests/gprs_routing_area/gprs_routing_area_test.c @@ -75,7 +75,7 @@ printf("Testing Routing Area create/free\n"); sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - ra = sgsn_ra_alloc(&rai, RA_TYPE_GERAN_Gb); + ra = sgsn_ra_find_or_create(&rai, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -105,7 +105,7 @@ printf("Testing Routing Area create/free\n"); sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - ra = sgsn_ra_alloc(&rai, RA_TYPE_GERAN_Gb); + ra = sgsn_ra_find_or_create(&rai, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -117,7 +117,7 @@ sgsn_ra_free(ra); OSMO_ASSERT(llist_empty(&sgsn->routing_area->ra_list)); - ra = sgsn_ra_alloc(&rai, RA_TYPE_GERAN_Gb); + ra = sgsn_ra_find_or_create(&rai, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -160,7 +160,7 @@ printf("Testing Routing Area find\n"); sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - ra_a = sgsn_ra_alloc(&rai, RA_TYPE_GERAN_Gb); + ra_a = sgsn_ra_find_or_create(&rai, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra_a); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -194,7 +194,7 @@ cgi.cell_identity = cell_id_not_found; cgi_ps.cell_identity = cell_id_not_found; - ra_a = sgsn_ra_alloc(&rai, RA_TYPE_GERAN_Gb); + ra_a = sgsn_ra_find_or_create(&rai, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra_a); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); @@ -263,7 +263,7 @@ printf("Testing Routing Area BSSGP BVC RESET IND\n"); sgsn = sgsn_instance_alloc(tall_sgsn_ctx); - ra_a = sgsn_ra_alloc(&rai, RA_TYPE_GERAN_Gb); + ra_a = sgsn_ra_find_or_create(&rai, RA_TYPE_GERAN_Gb); OSMO_ASSERT(ra_a); OSMO_ASSERT(llist_count(&sgsn->routing_area->ra_list) == 1); OSMO_ASSERT(llist_count(&ra_a->cells_alive_list) == 0); -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40691?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I6955a09d9d8f3ba4dc3a14d7ed5cd9798d929c61 Gerrit-Change-Number: 40691 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> 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
[XS] Change in osmo-sgsn[master]: routing area: sgsn_ra_geran_page_ra: make argument rai const
by laforge 18 Aug '25

18 Aug '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40693?usp=email ) ( 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: routing area: sgsn_ra_geran_page_ra: make argument rai const ...................................................................... routing area: sgsn_ra_geran_page_ra: make argument rai const The second argument mmctx can't made const because of the paging info, which uses non-const fields. Change-Id: I21d7e66e433f2b891c94bae91697aa46198fb20c --- M include/osmocom/sgsn/gprs_routing_area.h M src/sgsn/gprs_routing_area.c 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved pespin: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_routing_area.h b/include/osmocom/sgsn/gprs_routing_area.h index 7406508..68be41c 100644 --- a/include/osmocom/sgsn/gprs_routing_area.h +++ b/include/osmocom/sgsn/gprs_routing_area.h @@ -122,4 +122,4 @@ int sgsn_ra_foreach_cell2(struct osmo_routing_area_id *rai, sgsn_ra_cb_t *cb, void *cb_data); /* Page the whole routing area for this mmctx */ -int sgsn_ra_geran_page_ra(struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx); +int sgsn_ra_geran_page_ra(const struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx); diff --git a/src/sgsn/gprs_routing_area.c b/src/sgsn/gprs_routing_area.c index ae51f90..6e449d2 100644 --- a/src/sgsn/gprs_routing_area.c +++ b/src/sgsn/gprs_routing_area.c @@ -391,7 +391,7 @@ return found ? 0 : -ENOENT; } -int sgsn_ra_geran_page_ra(struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx) +int sgsn_ra_geran_page_ra(const struct osmo_routing_area_id *rai, struct sgsn_mm_ctx *mmctx) { struct sgsn_ra *ra; struct sgsn_ra_cell *cell; -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40693?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I21d7e66e433f2b891c94bae91697aa46198fb20c Gerrit-Change-Number: 40693 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> 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-sgsn[master]: routing area: add LOGRA() logging macro
by laforge 18 Aug '25

18 Aug '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40692?usp=email ) Change subject: routing area: add LOGRA() logging macro ...................................................................... routing area: add LOGRA() logging macro Prepend the routing area in the log message. Change-Id: Ib287b70c34b21ce64bc864f69fcf6af5fa0698b9 --- M include/osmocom/sgsn/gprs_routing_area.h M src/sgsn/gprs_routing_area.c 2 files changed, 25 insertions(+), 12 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/include/osmocom/sgsn/gprs_routing_area.h b/include/osmocom/sgsn/gprs_routing_area.h index 9f16559..7406508 100644 --- a/include/osmocom/sgsn/gprs_routing_area.h +++ b/include/osmocom/sgsn/gprs_routing_area.h @@ -9,6 +9,19 @@ #include <osmocom/core/utils.h> #include <osmocom/gsm/gsm23003.h> +/* rai -> struct osmo_routing_area_id * */ +#define LOGRAI(level, rai, fmt, args...) \ + do {\ + char __log_rai_buf[32]; \ + LOGP(DRA, level, "RA(%s) " fmt, \ + osmo_rai_name2_buf(__log_rai_buf, sizeof(__log_rai_buf), rai), \ + ## args); \ + } while (0) + +/* ra -> struct sgsn_ra * */ +#define LOGRA(level, ra, fmt, args...) \ + LOGRAI(level, (&(ra)->rai), fmt, ## args) + struct sgsn_instance; struct sgsn_mm_ctx; diff --git a/src/sgsn/gprs_routing_area.c b/src/sgsn/gprs_routing_area.c index 3a39f8d..ae51f90 100644 --- a/src/sgsn/gprs_routing_area.c +++ b/src/sgsn/gprs_routing_area.c @@ -99,14 +99,14 @@ if (ra) { if (ra->ran_type == ran_type) { - LOGP(DRA, LOGL_ERROR, "Trying to create an already existing RA %s with the same ran type %s. Using old RA.\n", - osmo_rai_name2(rai), get_value_string(sgsn_ra_ran_type_names, ra->ran_type)); + LOGRAI(LOGL_ERROR, rai, "Trying to create an already existing RA with the same ran type %s. Using old RA.\n", + get_value_string(sgsn_ra_ran_type_names, ra->ran_type)); return ra; } - LOGP(DRA, LOGL_ERROR, "Failed to create an already existing RA %s with a different ran type %s.\n", - osmo_rai_name2(rai), get_value_string(sgsn_ra_ran_type_names, ra->ran_type)); + LOGRAI(LOGL_ERROR, rai, "Failed to create an already existing RA with a different ran type %s.\n", + get_value_string(sgsn_ra_ran_type_names, ra->ran_type)); return NULL; } @@ -318,8 +318,8 @@ if (cell && cell->ran_type == RA_TYPE_GERAN_Gb) { /* Cell already exist, update NSEI/BVCI */ if (cell->u.geran.bvci != bvci || cell->u.geran.nsei != nsei) { - LOGP(DRA, LOGL_INFO, "GERAN Cell changed DLCI. Old: nsei/bvci %05u/%05u New: nsei/bvci %05u/%05u\n", - cell->u.geran.nsei, cell->u.geran.bvci, nsei, bvci); + LOGRA(LOGL_INFO, ra, "GERAN Cell changed DLCI. Old: nsei/bvci %05u/%05u New: nsei/bvci %05u/%05u\n", + cell->u.geran.nsei, cell->u.geran.bvci, nsei, bvci); cell->u.geran.bvci = bvci; cell->u.geran.nsei = nsei; } @@ -328,7 +328,7 @@ if (cell && cell->ran_type != RA_TYPE_GERAN_Gb) { /* How can we have here a RA change? Must be a configuration error. */ - LOGP(DRA, LOGL_INFO, "CGI %s: RAN change detected to GERAN!", osmo_cgi_ps_name(cgi_ps)); + LOGRAI(LOGL_INFO, &cgi_ps->rai, "CGI %s: RAN change detected to GERAN!", osmo_cgi_ps_name(cgi_ps)); _sgsn_ra_cell_free(cell, false); cell = NULL; } @@ -340,10 +340,10 @@ * This should only happen when a Cell is changing routing areas */ cell = sgsn_ra_get_cell_by_lai(&cgi_ps->rai.lac, cgi_ps->cell_identity); if (cell) { - LOGP(DRA, LOGL_INFO, "CGI %s: changed Routing Area. Old: %s, New: %s\n", - osmo_cgi_ps_name(cgi_ps), - osmo_rai_name2_buf(old_ra, sizeof(old_ra), &cell->ra->rai), - osmo_rai_name2_buf(new_ra, sizeof(new_ra), &cgi_ps->rai)); + LOGRAI(LOGL_INFO, &cgi_ps->rai, "CGI %s: changed Routing Area. Old: %s, New: %s\n", + osmo_cgi_ps_name(cgi_ps), + osmo_rai_name2_buf(old_ra, sizeof(old_ra), &cell->ra->rai), + osmo_rai_name2_buf(new_ra, sizeof(new_ra), &cgi_ps->rai)); OSMO_ASSERT(cell->ra != ra); @@ -358,7 +358,7 @@ if (!cell) return -ENOMEM; - LOGP(DRA, LOGL_INFO, "New cell registered %s via nsei/bvci %05u/%05u\n", osmo_cgi_ps_name(cgi_ps), nsei, bvci); + LOGRA(LOGL_INFO, ra, "New cell registered %s via nsei/bvci %05u/%05u\n", osmo_cgi_ps_name(cgi_ps), nsei, bvci); return 0; } -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40692?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ib287b70c34b21ce64bc864f69fcf6af5fa0698b9 Gerrit-Change-Number: 40692 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> 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
[M] Change in osmo-sgsn[master]: BSSGP: reset cells when receiving a Reset on Signal BVC
by laforge 18 Aug '25

18 Aug '25
Attention is currently required from: lynxis lazus. laforge has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40810?usp=email ) Change subject: BSSGP: reset cells when receiving a Reset on Signal BVC ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40810?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I380c8f9ef90d8c7face5c380d923ab5168f5b484 Gerrit-Change-Number: 40810 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Mon, 18 Aug 2025 08:59:51 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-sgsn[master]: routing area: prefix GERAN functions with geran
by pespin 18 Aug '25

18 Aug '25
Attention is currently required from: lynxis lazus. pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40811?usp=email ) Change subject: routing area: prefix GERAN functions with geran ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40811?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ic616bd8f9afe6cd3702cd4af08706b7b36987f42 Gerrit-Change-Number: 40811 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Mon, 18 Aug 2025 08:58:26 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-sgsn[master]: BSSGP: reset cells when receiving a Reset on Signal BVC
by pespin 18 Aug '25

18 Aug '25
Attention is currently required from: lynxis lazus. pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40810?usp=email ) Change subject: BSSGP: reset cells when receiving a Reset on Signal BVC ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40810?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I380c8f9ef90d8c7face5c380d923ab5168f5b484 Gerrit-Change-Number: 40810 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Mon, 18 Aug 2025 08:57:51 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-sgsn[master]: tests: RA: add test for a GERAN cell to change its BVCI
by pespin 18 Aug '25

18 Aug '25
Attention is currently required from: lynxis lazus. pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/40809?usp=email ) Change subject: tests: RA: add test for a GERAN cell to change its BVCI ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/40809?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Idcada8364bf62aae2244b92e0d7a43c120c9c0ad Gerrit-Change-Number: 40809 Gerrit-PatchSet: 2 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Mon, 18 Aug 2025 08:57:03 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • ...
  • 109
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.