This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
daniel gerrit-no-reply at lists.osmocom.orgdaniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-gbproxy/+/26219 )
Change subject: gbproxy: Remove duplicate struct gprs_ra_id handling
......................................................................
gbproxy: Remove duplicate struct gprs_ra_id handling
The ra_id as well as the cell_id are already present in struct
gbproxy_cell which is reachable from bvc->cell. Remove the ra_id in
struct gbproxy_bvc and also remove some unused/unneeded code. The FSM
reset_notif callback already takes care of updating the cell.
Related: OS#4894
Change-Id: Ibc9f42a60706612c17e5f8f0468c7faced5ae4c8
---
M include/osmocom/gbproxy/gb_proxy.h
M src/gb_proxy.c
2 files changed, 11 insertions(+), 35 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/19/26219/1
diff --git a/include/osmocom/gbproxy/gb_proxy.h b/include/osmocom/gbproxy/gb_proxy.h
index 07373ad..0657df7 100644
--- a/include/osmocom/gbproxy/gb_proxy.h
+++ b/include/osmocom/gbproxy/gb_proxy.h
@@ -142,9 +142,6 @@
/* Whether this BVC is inactive (removed from BSS-side) */
bool inactive;
- /* Routing Area that this BVC is part of */
- struct gprs_ra_id raid;
-
/* Counter */
struct rate_ctr_group *ctrg;
diff --git a/src/gb_proxy.c b/src/gb_proxy.c
index 9845a09..3d76a33 100644
--- a/src/gb_proxy.c
+++ b/src/gb_proxy.c
@@ -710,7 +710,7 @@
}
/* Reallocate SGSN-side BVCs of the cell, and reset them
- * Removing and reallocating is needed becaus the ra_id/cell_id might have changed */
+ * Removing and reallocating is needed because the ra_id/cell_id might have changed */
hash_for_each(cfg->sgsn_nses, i, sgsn_nse, list) {
struct gbproxy_bvc *sgsn_bvc = gbproxy_bvc_by_bvci(sgsn_nse, bvci);
if (!sgsn_bvc)
@@ -721,7 +721,6 @@
sgsn_bvc = gbproxy_bvc_alloc(sgsn_nse, bvci);
OSMO_ASSERT(sgsn_bvc);
sgsn_bvc->cell = bvc->cell;
- memcpy(&sgsn_bvc->raid, &bvc->cell->id.raid, sizeof(sgsn_bvc->raid));
sgsn_bvc->fi = bssgp_bvc_fsm_alloc_ptp_bss(sgsn_bvc, cfg->nsi, sgsn_nse->nsei,
bvci, ra_id, cell_id);
OSMO_ASSERT(sgsn_bvc->fi);
@@ -888,34 +887,6 @@
bssgp_bvc_fsm_set_max_pdu_len(from_bvc->fi, nse->max_sdu_len);
bssgp_bvc_fsm_set_ops(from_bvc->fi, &bss_ptp_bvc_fsm_ops, from_bvc);
}
-#if 0
- /* Could have moved to a different NSE */
- if (!check_bvc_nsei(from_bvc, nsei)) {
- LOGPBVC(from_bvc, LOGL_NOTICE, "moving bvc to NSE(%05u)\n", nsei);
-
- struct gbproxy_nse *nse_new = gbproxy_nse_by_nsei(cfg, nsei, false);
- if (!nse_new) {
- LOGP(DGPRS, LOGL_NOTICE, "NSE(%05u) Got PtP BVC reset before signalling reset for "
- "BVCI=%05u\n", bvci, nsei);
- tx_status(nse, ns_bvci, BSSGP_CAUSE_PDU_INCOMP_STATE, NULL, msg);
- return 0;
- }
-
- /* Move bvc to different NSE */
- gbproxy_bvc_move(from_bvc, nse_new);
- }
-#endif
- /* FIXME: do we need this, if it happens within FSM? */
- if (TLVP_PRES_LEN(tp, BSSGP_IE_CELL_ID, 8)) {
- struct gprs_ra_id raid;
- /* We have a Cell Identifier present in this
- * PDU, this means we can extend our local
- * state information about this particular cell
- * */
- gsm48_parse_ra(&raid, TLVP_VAL(tp, BSSGP_IE_CELL_ID));
- memcpy(&from_bvc->raid, &raid, sizeof(from_bvc->raid));
- LOGPBVC(from_bvc, LOGL_INFO, "Cell ID %s\n", osmo_rai_name(&raid));
- }
}
/* hand into FSM for further processing */
osmo_fsm_inst_dispatch(from_bvc->fi, BSSGP_BVCFSM_E_RX_RESET, msg);
@@ -1267,7 +1238,11 @@
/* iterate over all bvcs and dispatch the paging to each matching one */
hash_for_each(cfg->bss_nses, i, nse, list) {
hash_for_each(nse->bvcs, j, bss_bvc, list) {
- if (gsm48_ra_equal(&bss_bvc->raid, &raid)) {
+ /* Skip BVCs without a cell (e.g. signalling) */
+ if (!bss_bvc->cell)
+ continue;
+
+ if (gsm48_ra_equal(&bss_bvc->cell->id.raid, &raid)) {
LOGPNSE(nse, LOGL_INFO, "Rx %s: routing to NSE (RAI match)\n",
pdut_name);
gbprox_relay2peer(msg, bss_bvc, ns_bvci);
@@ -1283,7 +1258,11 @@
/* iterate over all bvcs and dispatch the paging to each matching one */
hash_for_each(cfg->bss_nses, i, nse, list) {
hash_for_each(nse->bvcs, j, bss_bvc, list) {
- gsm48_encode_ra(&lac, &bss_bvc->raid);
+ /* Skip BVCs without a cell (e.g. signalling) */
+ if (!bss_bvc->cell)
+ continue;
+
+ gsm48_encode_ra(&lac, &bss_bvc->cell->id.raid);
if (!memcmp(&lac, TLVP_VAL(tp, BSSGP_IE_LOCATION_AREA), 5)) {
LOGPNSE(nse, LOGL_INFO, "Rx %s: routing to NSE (LAI match)\n",
pdut_name);
--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/26219
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: Ibc9f42a60706612c17e5f8f0468c7faced5ae4c8
Gerrit-Change-Number: 26219
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211112/a1849721/attachment.htm>