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

March 2026

  • 1 participants
  • 1933 discussions
[S] Change in ...osmo-s1gw[master]: rest_server: fix TOC/TOU race when listing/fetching E-RABs
by fixeria 19 Mar '26

19 Mar '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42450?usp=email ) Change subject: rest_server: fix TOC/TOU race when listing/fetching E-RABs ...................................................................... rest_server: fix TOC/TOU race when listing/fetching E-RABs The list of E-RAB FSM pids is a snapshot taken at one point in time. By the time we interrogate each erab_fsm process individually, any of them may have already terminated (e.g. bearer released mid-request). The current code fails to generate a response if this happens. * fetch_erab_info/1: add a pid() clause that wraps erab_list_item/1 in a try/catch, returning 'error' if the process is gone. * fetch_erab_info/1: catch both exit forms ** `{noproc, _}` raised by gen_statem:call/2 on a monitored pid, and ** the bare noproc atom for other code paths. * fetch_erab_list/1: switch from lists:map to lists:filtermap and call fetch_erab_info/1 per E-RAB, silently dropping any that died between the snapshot and the per-process interrogation. Change-Id: I160b413aa535f2379ad4e40a3ae8f37c5bce2067 Related: SYS#7066 --- M src/rest_server.erl 1 file changed, 14 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/50/42450/1 diff --git a/src/rest_server.erl b/src/rest_server.erl index bc9a4a9..cbdd6e6 100644 --- a/src/rest_server.erl +++ b/src/rest_server.erl @@ -523,14 +523,17 @@ error. --spec fetch_erab_info(binary()) -> {ok, erab_fsm:erab_info()} | error. +-spec fetch_erab_info(binary() | pid()) -> {ok, erab_fsm:erab_info()} | error. fetch_erab_info(<< "pid:", Val/bytes >>) -> - Pid = parse_pid(Val), - %% guard against non-existent process IDs - %% TODO: check if the given Pid is actually an erab_fsm + fetch_erab_info(parse_pid(Val)); + +fetch_erab_info(Pid) when is_pid(Pid) -> + %% erab_fsm process may have already terminated + %% guard against that by catching noproc try erab_list_item({pid, Pid}) of ErabInfo -> {ok, ErabInfo} catch + exit:noproc -> error; exit:{noproc, _} -> error end; @@ -542,12 +545,17 @@ -spec fetch_erab_list(enb_registry:enb_info()) -> [map()]. fetch_erab_list(#{pid := EnbPid}) -> ERABs = enb_proxy:fetch_erab_list(EnbPid), - lists:map(fun erab_list_item/1, ERABs). + lists:filtermap( + fun({_, Pid}) -> + case fetch_erab_info(Pid) of + {ok, ErabInfo} -> {true, ErabInfo}; + error -> false + end + end, ERABs). -spec erab_list_item({term(), pid()}) -> map(). erab_list_item({_, Pid}) -> - %% XXX: E-RAB FSM process might be dead here Info = erab_fsm:fetch_info(Pid), {MmeUeId, ErabId} = maps:get(uid, Info), M0 = #{mme_ue_id => MmeUeId, -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42450?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I160b413aa535f2379ad4e40a3ae8f37c5bce2067 Gerrit-Change-Number: 42450 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in ...osmo-s1gw[master]: [REST] Add PLMN/eNB IDs to EnbItem
by fixeria 19 Mar '26

19 Mar '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42449?usp=email ) Change subject: [REST] Add PLMN/eNB IDs to EnbItem ...................................................................... [REST] Add PLMN/eNB IDs to EnbItem Change-Id: I79690223a34afea5e6661125ac04f98462dadb03 Related: SYS#7066 --- M contrib/openapi.yaml M priv/openapi.json M src/rest_server.erl 3 files changed, 27 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/49/42449/1 diff --git a/contrib/openapi.yaml b/contrib/openapi.yaml index d1aaba9..c0d28f1 100644 --- a/contrib/openapi.yaml +++ b/contrib/openapi.yaml @@ -416,7 +416,15 @@ type: string pattern: '^[0-9]{3}-[0-9]{2,3}-[0-9]+$' example: 001-01-1337 - description: Global-eNB-ID + description: Global-eNB-ID (MCC-MNC-eNBId) + plmn_id: + type: string + pattern: '^[0-9]{3}-[0-9]{2,3}$' + example: 001-01 + description: PLMN identifier (MCC-MNC) + enb_id: + type: integer + description: eNB identifier enb_saddr: type: string description: Source (remote) address of the eNB diff --git a/priv/openapi.json b/priv/openapi.json index bcec82b..d5b12cd 100644 --- a/priv/openapi.json +++ b/priv/openapi.json @@ -616,7 +616,17 @@ "type": "string", "pattern": "^[0-9]{3}-[0-9]{2,3}-[0-9]+$", "example": "001-01-1337", - "description": "Global-eNB-ID" + "description": "Global-eNB-ID (MCC-MNC-eNBId)" + }, + "plmn_id": { + "type": "string", + "pattern": "^[0-9]{3}-[0-9]{2,3}$", + "example": "001-01", + "description": "PLMN identifier (MCC-MNC)" + }, + "enb_id": { + "type": "integer", + "description": "eNB identifier" }, "enb_saddr": { "type": "string", diff --git a/src/rest_server.erl b/src/rest_server.erl index 0107427..6e40627 100644 --- a/src/rest_server.erl +++ b/src/rest_server.erl @@ -440,9 +440,13 @@ -spec enb_item_add_enb_info(map(), enb_registry:enb_info()) -> map(). -enb_item_add_enb_info(M0, #{genb_id_str := GlobalENBId}) -> - %% TODO: add enb_id and plmn_id - M0#{genb_id => GlobalENBId}; +enb_item_add_enb_info(M0, #{genb_id_str := GlobalENBId, + genb_id := #{plmn_id := {MCC, MNC}, + enb_id := ENBId}}) -> + M0#{genb_id => GlobalENBId, + plmn_id => MCC ++ "-" ++ MNC, + enb_id => ENBId + }; enb_item_add_enb_info(M0, _) -> M0. -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42449?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I79690223a34afea5e6661125ac04f98462dadb03 Gerrit-Change-Number: 42449 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[XS] Change in ...osmo-s1gw[master]: s1ap_proxy: add public erab_list() type
by fixeria 19 Mar '26

19 Mar '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42448?usp=email ) Change subject: s1ap_proxy: add public erab_list() type ...................................................................... s1ap_proxy: add public erab_list() type Change-Id: I21a674537d1d9f16fdb319aaf2d758ba0906b407 --- M src/enb_proxy.erl M src/s1ap_proxy.erl 2 files changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/48/42448/1 diff --git a/src/enb_proxy.erl b/src/enb_proxy.erl index 40d446a..5dfa0ff 100644 --- a/src/enb_proxy.erl +++ b/src/enb_proxy.erl @@ -112,7 +112,7 @@ gen_statem:call(Pid, ?FUNCTION_NAME). --spec fetch_erab_list(pid()) -> [{term(), pid()}]. +-spec fetch_erab_list(pid()) -> s1ap_proxy:erab_list(). fetch_erab_list(Pid) -> gen_statem:call(Pid, ?FUNCTION_NAME). diff --git a/src/s1ap_proxy.erl b/src/s1ap_proxy.erl index ef7665e..dcd053e 100644 --- a/src/s1ap_proxy.erl +++ b/src/s1ap_proxy.erl @@ -65,6 +65,7 @@ -type enb_ue_id() :: 0..16#ffffff. -type erab_id() :: 0..16#ff. -type erab_uid() :: {mme_ue_id(), erab_id()}. +-type erab_list() :: [{erab_uid(), pid()}]. -record(proxy_state, {owner :: pid(), erabs :: dict:dict(K :: erab_uid(), @@ -79,7 +80,8 @@ -type proxy_state() :: #proxy_state{}. -type proxy_action() :: forward | reply | drop. --export_type([proxy_action/0]). +-export_type([proxy_action/0, + erab_list/0]). %% ------------------------------------------------------------------ @@ -109,7 +111,7 @@ %% Fetch all E-RABs from the registry in form of a list --spec fetch_erab_list(pid()) -> [{erab_uid(), pid()}]. +-spec fetch_erab_list(pid()) -> erab_list(). fetch_erab_list(Pid) -> gen_server:call(Pid, ?FUNCTION_NAME). -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42448?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I21a674537d1d9f16fdb319aaf2d758ba0906b407 Gerrit-Change-Number: 42448 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in ...osmo-s1gw[master]: enb_{proxy,registry}: signal MME conn info on SCTP comm_up
by fixeria 19 Mar '26

19 Mar '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42445?usp=email ) Change subject: enb_{proxy,registry}: signal MME conn info on SCTP comm_up ...................................................................... enb_{proxy,registry}: signal MME conn info on SCTP comm_up Previously, mme_aid/mme_saddr/mme_sport were only signalled to the enb_registry once the S1 Setup procedure completed. This meant the REST API could not show MME connection details for eNBs stuck in wait_s1setup_rsp state (e.g. due to a slow or retrying MME). Add notify_mme_comm_up/2, called at SCTP comm_up, which stores the full conn_info (including mme_aid, mme_saddr, mme_sport) in the registry as soon as the SCTP connection is established. notify_mme_connected/2 is simplified to notify_mme_connected/1: it now only flips the state to 'connected', since conn_info is already stored. Change-Id: Iea9ba4fdf961e6cd262edc154884a2eee3d95355 Related: SYS#7066 --- M src/enb_proxy.erl M src/enb_registry.erl 2 files changed, 22 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/45/42445/1 diff --git a/src/enb_proxy.erl b/src/enb_proxy.erl index 17296bd..6a7254e 100644 --- a/src/enb_proxy.erl +++ b/src/enb_proxy.erl @@ -251,12 +251,14 @@ {ok, {MmeLAddr, MmeLPort}} = inet:sockname(Socket), ?LOG_NOTICE("MME ~p: connection (id=~p, ~p:~p) established", [MmeName, Aid, MmeAddr, MmePort]), + NewS = S#state{mme_aid = Aid, + mme_saddr = MmeLAddr, + mme_sport = MmeLPort}, %% send the S1 SETUP REQUEST PDU to the MME - sctp_send_from_enb(S#state.s1setup_req, - S#state{mme_aid = Aid}), - {next_state, wait_s1setup_rsp, S#state{mme_aid = Aid, - mme_saddr = MmeLAddr, - mme_sport = MmeLPort}}; + sctp_send_from_enb(S#state.s1setup_req, NewS), + %% surface MME connection details before S1 Setup completes + enb_registry:notify_mme_comm_up(S#state.enb_handle, conn_info(NewS)), + {next_state, wait_s1setup_rsp, NewS}; _ -> ?LOG_NOTICE("MME ~p: connection establishment failed: ~p", [MmeName, ConnState]), @@ -352,7 +354,7 @@ %% CONNECTED state connected(enter, OldState, S) -> ?LOG_INFO("State change: ~p -> ~p", [OldState, ?FUNCTION_NAME]), - enb_registry:notify_mme_connected(S#state.enb_handle, conn_info(S)), + enb_registry:notify_mme_connected(S#state.enb_handle), {keep_state, S}; %% Handle an eNB -> MME data forwarding request (forward) diff --git a/src/enb_registry.erl b/src/enb_registry.erl index 0ad20ba..2bf6e47 100644 --- a/src/enb_registry.erl +++ b/src/enb_registry.erl @@ -46,8 +46,9 @@ notify_enb_connected/2, notify_genb_id/2, notify_mme_connecting/2, + notify_mme_comm_up/2, notify_mme_wait_rsp/1, - notify_mme_connected/2, + notify_mme_connected/1, fetch_enb_info/1, fetch_enb_list/0, fetch_enb_list/1, @@ -132,7 +133,15 @@ %% MME connection attempt in progress; stores selected MME info, clears any stale mme_conn_info -spec notify_mme_connecting(enb_handle(), mme_registry:mme_info()) -> ok. notify_mme_connecting(Handle, MmeInfo) -> - enb_update(Handle, [{state, connecting}, {mme_info, MmeInfo}, {mme_conn_info, undefined}]). + enb_update(Handle, [{state, connecting}, + {mme_info, MmeInfo}, + {mme_conn_info, undefined}]). + + +%% MME SCTP comm_up; connection details (aid, saddr, sport) are now known +-spec notify_mme_comm_up(enb_handle(), enb_proxy:conn_info()) -> ok. +notify_mme_comm_up(Handle, ConnInfo) -> + enb_update(Handle, [{mme_conn_info, ConnInfo}]). %% MME SCTP link established; S1 SETUP REQUEST forwarded, awaiting response @@ -142,9 +151,9 @@ %% S1 SETUP complete; eNB is fully operational --spec notify_mme_connected(enb_handle(), enb_proxy:conn_info()) -> ok. -notify_mme_connected(Handle, ConnInfo) -> - enb_update(Handle, [{state, connected}, {mme_conn_info, ConnInfo}]). +-spec notify_mme_connected(enb_handle()) -> ok. +notify_mme_connected(Handle) -> + enb_update(Handle, [{state, connected}]). -spec fetch_enb_info(enb_handle() | pid()) -> {ok, enb_info()} | error. -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42445?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Iea9ba4fdf961e6cd262edc154884a2eee3d95355 Gerrit-Change-Number: 42445 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[M] Change in ...osmo-s1gw[master]: enb_proxy: split conn_info() into mme_conn_info() and proxy_info()
by fixeria 19 Mar '26

19 Mar '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42446?usp=email ) Change subject: enb_proxy: split conn_info() into mme_conn_info() and proxy_info() ...................................................................... enb_proxy: split conn_info() into mme_conn_info() and proxy_info() The old conn_info() conflated two distinct concerns: the MME SCTP connection info stored in enb_registry (aid, saddr, sport) and the broader operational state used for introspection (handler pid, enb connection info, etc.). Mixing them forced enb_registry to hold a handler pid it has no business knowing about, and required rest_server to extract that pid just to reach s1ap_proxy for E-RAB listing. Split into two distinct types: * mme_conn_info() - pure MME SCTP connection info (aid, saddr, sport), stored in the enb_registry and signalled via notify_mme_comm_up/2. The `mme_` prefix is dropped from field names as the type name provides the context. * proxy_info() - richer operational snapshot (handler, enb_handle, enb_conn_info, mme_conn_info, genb_id_str, mme_info), returned by fetch_info/1 for introspection/debugging purposes. Additionally: * Add fetch_erab_list/1 to enb_proxy, delegating internally to s1ap_proxy:fetch_erab_list/1 via the cached handler pid. This allows the rest_server to obtain a list of E-RAB without having to obtain pid of the s1ap_proxy and interact with it. * Remove separate enb_aid/mme_aid/mme_saddr/mme_sport state fields; enb_aid is now read directly from enb_conn_info, and the MME fields are grouped in mme_conn_info. Change-Id: Ia428ceb4762f972211e9b790688dc89fb5b8a274 Related: SYS#7066 --- M src/enb_proxy.erl M src/enb_registry.erl M src/rest_server.erl 3 files changed, 66 insertions(+), 68 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/46/42446/1 diff --git a/src/enb_proxy.erl b/src/enb_proxy.erl index 6a7254e..c281b33 100644 --- a/src/enb_proxy.erl +++ b/src/enb_proxy.erl @@ -47,6 +47,7 @@ -export([start_link/2, send_data/2, fetch_info/1, + fetch_erab_list/1, shutdown/1]). -include_lib("kernel/include/logger.hrl"). @@ -58,18 +59,21 @@ -include("S1AP-Constants.hrl"). --type conn_info() :: #{handler := pid(), - enb_aid := gen_sctp:assoc_id(), - mme_aid => gen_sctp:assoc_id(), - mme_saddr => inet:ip_address(), - mme_sport => inet:port_number() - }. +-type mme_conn_info() :: #{aid := gen_sctp:assoc_id(), + saddr := inet:ip_address(), + sport := inet:port_number() + }. --record(state, {enb_aid :: gen_sctp:assoc_id(), - mme_aid :: undefined | gen_sctp:assoc_id(), - mme_saddr :: undefined | inet:ip_address(), - mme_sport :: undefined | inet:port_number(), - enb_conn_info :: sctp_server:conn_info(), +-type proxy_info() :: #{handler := pid(), + enb_handle := enb_registry:enb_handle(), + enb_conn_info := sctp_server:conn_info(), + mme_conn_info => mme_conn_info(), + mme_info => mme_registry:mme_info(), + genb_id_str => string() + }. + +-record(state, {enb_conn_info :: sctp_server:conn_info(), + mme_conn_info :: undefined | mme_conn_info(), s1setup_req :: undefined | binary(), tried_mmes :: [mme_registry:mme_name()], enb_tacs :: undefined | [s1ap_utils:tac()], @@ -81,7 +85,8 @@ -type state() :: #state{}. --export_type([conn_info/0]). +-export_type([mme_conn_info/0, + proxy_info/0]). %% ------------------------------------------------------------------ @@ -101,11 +106,16 @@ gen_statem:cast(Pid, {send_data, Data}). --spec fetch_info(pid()) -> conn_info(). +-spec fetch_info(pid()) -> proxy_info(). fetch_info(Pid) -> gen_statem:call(Pid, ?FUNCTION_NAME). +-spec fetch_erab_list(pid()) -> [{term(), pid()}]. +fetch_erab_list(Pid) -> + gen_statem:call(Pid, ?FUNCTION_NAME). + + -spec shutdown(pid()) -> ok. shutdown(Pid) -> gen_statem:stop(Pid). @@ -119,10 +129,7 @@ {ok, EnbHandle} = enb_registry:enb_register(), {ok, Pid} = s1ap_proxy:start_link(self()), {ok, wait_s1setup_req, - #state{enb_aid = maps:get(aid, EnbConnInfo), - mme_saddr = undefined, - mme_sport = undefined, - enb_conn_info = EnbConnInfo, + #state{enb_conn_info = EnbConnInfo, enb_handle = EnbHandle, tried_mmes = [], handler = Pid}}. @@ -210,9 +217,7 @@ enb_registry:notify_mme_connecting(S#state.enb_handle, MmeInfo), {next_state, ?FUNCTION_NAME, %% loop transition to enable state_timeout S#state{sock = Sock, - mme_aid = undefined, - mme_saddr = undefined, - mme_sport = undefined, + mme_conn_info = undefined, tried_mmes = [MmeName | TriedMMEs]}, [{state_timeout, 2_000, conn_est_timeout}]}; error -> @@ -251,14 +256,15 @@ {ok, {MmeLAddr, MmeLPort}} = inet:sockname(Socket), ?LOG_NOTICE("MME ~p: connection (id=~p, ~p:~p) established", [MmeName, Aid, MmeAddr, MmePort]), - NewS = S#state{mme_aid = Aid, - mme_saddr = MmeLAddr, - mme_sport = MmeLPort}, + MmeConnInfo = #{aid => Aid, + saddr => MmeLAddr, + sport => MmeLPort}, %% send the S1 SETUP REQUEST PDU to the MME - sctp_send_from_enb(S#state.s1setup_req, NewS), + sctp_send_from_enb(S#state.s1setup_req, + S#state{mme_conn_info = MmeConnInfo}), %% surface MME connection details before S1 Setup completes - enb_registry:notify_mme_comm_up(S#state.enb_handle, conn_info(NewS)), - {next_state, wait_s1setup_rsp, NewS}; + enb_registry:notify_mme_comm_up(S#state.enb_handle, MmeConnInfo), + {next_state, wait_s1setup_rsp, S#state{mme_conn_info = MmeConnInfo}}; _ -> ?LOG_NOTICE("MME ~p: connection establishment failed: ~p", [MmeName, ConnState]), @@ -299,7 +305,7 @@ stream = SID, ssn = SSN, tsn = TSN}], Data}}, - #state{mme_aid = MmeAid} = S) -> + #state{mme_conn_info = #{aid := MmeAid}} = S) -> ?LOG_DEBUG("MME connection (id=~p, ~p:~p) -> eNB: ~p", [MmeAid, MmeAddr, MmePort, #{tsn => TSN, sid => SID, ssn => SSN, @@ -382,7 +388,7 @@ stream = SID, ssn = SSN, tsn = TSN}], Data}}, - #state{mme_aid = MmeAid} = S) -> + #state{mme_conn_info = #{aid := MmeAid}} = S) -> ?LOG_DEBUG("MME connection (id=~p, ~p:~p) -> eNB: ~p", [MmeAid, MmeAddr, MmePort, #{tsn => TSN, sid => SID, ssn => SSN, @@ -401,7 +407,19 @@ %% Event handler for all states handle_event(_State, {call, From}, fetch_info, S) -> - {keep_state_and_data, {reply, From, conn_info(S)}}; + Info = #{handler => S#state.handler, + enb_handle => S#state.enb_handle, + enb_conn_info => S#state.enb_conn_info, + mme_conn_info => S#state.mme_conn_info, + %% TODO: mme_info => S#state.mme_info, + genb_id_str => S#state.genb_id_str + }, + Reply = maps:filter(fun(_K, V) -> V =/= undefined end, Info), + {keep_state_and_data, {reply, From, Reply}}; + +handle_event(_State, {call, From}, fetch_erab_list, S) -> + ERABs = s1ap_proxy:fetch_erab_list(S#state.handler), + {keep_state_and_data, {reply, From, ERABs}}; handle_event(State, {call, From}, EventData, _S) -> ?LOG_ERROR("Unexpected call in state ~p: ~p", [State, EventData]), @@ -445,8 +463,8 @@ -spec sctp_send_from_enb(binary(), state()) -> ok | {error, term()}. sctp_send_from_enb(Data, #state{sock = Sock, - enb_aid = EnbAid, - mme_aid = MmeAid, + enb_conn_info = #{aid := EnbAid}, + mme_conn_info = #{aid := MmeAid}, handler = Pid}) -> case s1ap_proxy:process_pdu(Pid, Data) of {forward, FwdData} -> @@ -462,8 +480,8 @@ -spec sctp_send_from_mme(binary(), state()) -> ok | {error, term()}. sctp_send_from_mme(Data, #state{sock = Sock, - enb_aid = EnbAid, - mme_aid = MmeAid, + enb_conn_info = #{aid := EnbAid}, + mme_conn_info = #{aid := MmeAid}, handler = Pid}) -> case s1ap_proxy:process_pdu(Pid, Data) of {forward, FwdData} -> @@ -475,16 +493,6 @@ end. --spec conn_info(state()) -> conn_info(). -conn_info(S) -> - Info = #{handler => S#state.handler, - enb_aid => S#state.enb_aid, - mme_aid => S#state.mme_aid, - mme_saddr => S#state.mme_saddr, - mme_sport => S#state.mme_sport}, - maps:filter(fun(_K, V) -> V =/= undefined end, Info). - - -spec gtpu_kpi_enb_register(state()) -> ok. gtpu_kpi_enb_register(#state{genb_id_str = GlobalENBId, enb_conn_info = EnbConnInfo}) -> @@ -566,9 +574,9 @@ -spec close_conn(state()) -> ok | {error, term()}. -close_conn(#state{mme_aid = undefined}) -> ok; +close_conn(#state{mme_conn_info = undefined}) -> ok; -close_conn(#state{sock = Sock, mme_aid = MmeAid}) -> +close_conn(#state{sock = Sock, mme_conn_info = #{aid := MmeAid}}) -> sctp_common:shutdown({Sock, MmeAid}). diff --git a/src/enb_registry.erl b/src/enb_registry.erl index 2bf6e47..a65ecbf 100644 --- a/src/enb_registry.erl +++ b/src/enb_registry.erl @@ -66,7 +66,7 @@ -type enb_prop() :: {state, atom()} | {enb_conn_info, sctp_server:conn_info()} - | {mme_conn_info, undefined | enb_proxy:conn_info()} + | {mme_conn_info, undefined | enb_proxy:mme_conn_info()} | {mme_info, mme_registry:mme_info()} | {genb_id, s1ap_utils:genb_id()}. -type enb_proplist() :: [enb_prop()]. @@ -86,7 +86,7 @@ genb_id => s1ap_utils:genb_id(), %% Global-eNB-ID genb_id_str => string(), %% Global-eNB-ID string enb_conn_info => sctp_server:conn_info(), %% eNB -> S1GW connection info - mme_conn_info => enb_proxy:conn_info(), %% S1GW -> MME connection info + mme_conn_info => enb_proxy:mme_conn_info(), %% S1GW -> MME connection info mme_info => mme_registry:mme_info() %% selected MME configuration }. @@ -139,7 +139,7 @@ %% MME SCTP comm_up; connection details (aid, saddr, sport) are now known --spec notify_mme_comm_up(enb_handle(), enb_proxy:conn_info()) -> ok. +-spec notify_mme_comm_up(enb_handle(), enb_proxy:mme_conn_info()) -> ok. notify_mme_comm_up(Handle, ConnInfo) -> enb_update(Handle, [{mme_conn_info, ConnInfo}]). @@ -381,7 +381,7 @@ fun(_, Item) -> enb_filter_by_sub_field({enb_conn_info, aid, Aid}, Item) end; enb_filter({mme_sctp_aid, Aid}) -> - fun(_, Item) -> enb_filter_by_sub_field({mme_conn_info, mme_aid, Aid}, Item) end; + fun(_, Item) -> enb_filter_by_sub_field({mme_conn_info, aid, Aid}, Item) end; enb_filter({enb_addr_port, {Addr, Port}}) -> fun(_, Item) -> enb_filter_by_sub_field({enb_conn_info, addr, Addr}, Item) andalso diff --git a/src/rest_server.erl b/src/rest_server.erl index 0107427..5f6257e 100644 --- a/src/rest_server.erl +++ b/src/rest_server.erl @@ -427,11 +427,12 @@ -spec enb_item(enb_registry:enb_info()) -> map(). enb_item(EnbInfo) -> + ERABs = enb_proxy:fetch_erab_list(maps:get(pid, EnbInfo)), M0 = #{handle => maps:get(handle, EnbInfo), pid => pid_to_list(maps:get(pid, EnbInfo)), state => maps:get(state, EnbInfo), uptime => maps:get(uptime, EnbInfo), - erab_count => 0}, + erab_count => length(ERABs)}, M1 = enb_item_add_enb_info(M0, EnbInfo), M2 = enb_item_add_enb_conn_info(M1, EnbInfo), M3 = enb_item_add_mme_conn_info(M2, EnbInfo), @@ -459,18 +460,10 @@ -spec enb_item_add_mme_conn_info(map(), enb_registry:enb_info()) -> map(). enb_item_add_mme_conn_info(M0, #{mme_conn_info := ConnInfo}) -> - Pid = maps:get(handler, ConnInfo), - ERABs = s1ap_proxy:fetch_erab_list(Pid), - M1 = M0#{erab_count => length(ERABs)}, - %% mme_aid/mme_saddr/mme_sport are only present once the MME SCTP - %% connection is fully established (comm_up); handle them together. - case maps:find(mme_aid, ConnInfo) of - {ok, Aid} -> - M1#{mme_sctp_aid => Aid, - mme_saddr => inet:ntoa(maps:get(mme_saddr, ConnInfo)), - mme_sport => maps:get(mme_sport, ConnInfo)}; - error -> M1 - end; + M0#{mme_saddr => inet:ntoa(maps:get(saddr, ConnInfo)), + mme_sport => maps:get(sport, ConnInfo), + mme_sctp_aid => maps:get(aid, ConnInfo) + }; enb_item_add_mme_conn_info(M0, _) -> M0. @@ -543,12 +536,9 @@ -spec fetch_erab_list(enb_registry:enb_info()) -> [map()]. -fetch_erab_list(#{mme_conn_info := ConnInfo}) -> - Pid = maps:get(handler, ConnInfo), %% s1ap_proxy process pid - ERABs = s1ap_proxy:fetch_erab_list(Pid), - lists:map(fun erab_list_item/1, ERABs); - -fetch_erab_list(_) -> []. +fetch_erab_list(#{pid := EnbPid}) -> + ERABs = enb_proxy:fetch_erab_list(EnbPid), + lists:map(fun erab_list_item/1, ERABs). -spec erab_list_item({term(), pid()}) -> map(). -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42446?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ia428ceb4762f972211e9b790688dc89fb5b8a274 Gerrit-Change-Number: 42446 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in ...osmo-s1gw[master]: enb_proxy: add missing mme_info() to proxy_info()
by fixeria 19 Mar '26

19 Mar '26
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42447?usp=email ) Change subject: enb_proxy: add missing mme_info() to proxy_info() ...................................................................... enb_proxy: add missing mme_info() to proxy_info() As a bonus, `tried_mmes` now only serves its actual purpose - tracking which MMEs have already been tried for selection filtering - rather than being abused as a way to retrieve the current MME name. Change-Id: Ibbb293d9e68b7c3a8c3ca7ee73132dbda3f2bf97 Related: SYS#7066 --- M src/enb_proxy.erl 1 file changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/47/42447/1 diff --git a/src/enb_proxy.erl b/src/enb_proxy.erl index c281b33..40d446a 100644 --- a/src/enb_proxy.erl +++ b/src/enb_proxy.erl @@ -74,6 +74,7 @@ -record(state, {enb_conn_info :: sctp_server:conn_info(), mme_conn_info :: undefined | mme_conn_info(), + mme_info :: undefined | mme_registry:mme_info(), s1setup_req :: undefined | binary(), tried_mmes :: [mme_registry:mme_name()], enb_tacs :: undefined | [s1ap_utils:tac()], @@ -217,6 +218,7 @@ enb_registry:notify_mme_connecting(S#state.enb_handle, MmeInfo), {next_state, ?FUNCTION_NAME, %% loop transition to enable state_timeout S#state{sock = Sock, + mme_info = MmeInfo, mme_conn_info = undefined, tried_mmes = [MmeName | TriedMMEs]}, [{state_timeout, 2_000, conn_est_timeout}]}; @@ -232,9 +234,9 @@ %% Handle connection establishment timeout connecting(state_timeout, conn_est_timeout, S) -> ?LOG_ERROR("MME ~p: timeout establishing connection", - [hd(S#state.tried_mmes)]), + [maps:get(name, S#state.mme_info)]), ctr_inc(?S1GW_CTR_ENB_PROXY_CONN_EST_TIMEOUT, S), - s1gw_metrics:ctr_inc(?S1GW_CTR_MME_CONN_EST_TIMEOUT(hd(S#state.tried_mmes))), + s1gw_metrics:ctr_inc(?S1GW_CTR_MME_CONN_EST_TIMEOUT(maps:get(name, S#state.mme_info))), %% re-enter the state to try again (or another MME) repeat_state_and_data; @@ -250,7 +252,7 @@ {[], #sctp_assoc_change{state = ConnState, assoc_id = Aid}}}, #state{sock = Socket} = S) -> - MmeName = hd(S#state.tried_mmes), + MmeName = maps:get(name, S#state.mme_info), case ConnState of comm_up -> {ok, {MmeLAddr, MmeLPort}} = inet:sockname(Socket), @@ -289,7 +291,7 @@ wait_s1setup_rsp(state_timeout, s1setup_rsp_timeout, S) -> ?LOG_ERROR("Timeout waiting for S1 SETUP RESPONSE from MME"), ctr_inc(?S1GW_CTR_ENB_PROXY_S1_SETUP_RSP_TIMEOUT, S), - s1gw_metrics:ctr_inc(?S1GW_CTR_MME_S1_SETUP_RSP_TIMEOUT(hd(S#state.tried_mmes))), + s1gw_metrics:ctr_inc(?S1GW_CTR_MME_S1_SETUP_RSP_TIMEOUT(maps:get(name, S#state.mme_info))), %% re-enter state 'connecting' to try again (or another MME) {next_state, connecting, S}; @@ -314,13 +316,13 @@ {{?'id-S1Setup', successfulOutcome}, _IEs} -> ?LOG_INFO("Rx S1 SETUP RESPONSE from MME"), ctr_inc(?S1GW_CTR_ENB_PROXY_S1_SETUP_RSP, S), - s1gw_metrics:ctr_inc(?S1GW_CTR_MME_S1_SETUP_RSP(hd(S#state.tried_mmes))), + s1gw_metrics:ctr_inc(?S1GW_CTR_MME_S1_SETUP_RSP(maps:get(name, S#state.mme_info))), sctp_send_from_mme(Data, S), {next_state, connected, S}; {{?'id-S1Setup', unsuccessfulOutcome}, _IEs} -> ?LOG_NOTICE("Rx S1 SETUP FAILURE from MME"), ctr_inc(?S1GW_CTR_ENB_PROXY_S1_SETUP_FAILURE, S), - s1gw_metrics:ctr_inc(?S1GW_CTR_MME_S1_SETUP_FAILURE(hd(S#state.tried_mmes))), + s1gw_metrics:ctr_inc(?S1GW_CTR_MME_S1_SETUP_FAILURE(maps:get(name, S#state.mme_info))), %% do *not* forward the FAILURE to the eNB %% re-enter state 'connecting' to try again (or another MME) {next_state, connecting, S}; @@ -411,7 +413,7 @@ enb_handle => S#state.enb_handle, enb_conn_info => S#state.enb_conn_info, mme_conn_info => S#state.mme_conn_info, - %% TODO: mme_info => S#state.mme_info, + mme_info => S#state.mme_info, genb_id_str => S#state.genb_id_str }, Reply = maps:filter(fun(_K, V) -> V =/= undefined end, Info), -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42447?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ibbb293d9e68b7c3a8c3ca7ee73132dbda3f2bf97 Gerrit-Change-Number: 42447 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: eIM_Tests: align RSP version number in HTTP header
by fixeria 19 Mar '26

19 Mar '26
Attention is currently required from: dexter. fixeria has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42434?usp=email ) Change subject: eIM_Tests: align RSP version number in HTTP header ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42434?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I125c3b13697c71d35788e54b7d88a9f943bb7a71 Gerrit-Change-Number: 42434 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Thu, 19 Mar 2026 19:26:36 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in pysim[master]: transport: change APDU format paradigm
by fixeria 19 Mar '26

19 Mar '26
Attention is currently required from: daniel, dexter, laforge, neels. fixeria has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/42441?usp=email ) Change subject: transport: change APDU format paradigm ...................................................................... Patch Set 1: (1 comment) File pySim/commands.py: https://gerrit.osmocom.org/c/pysim/+/42441/comment/9c6e719a_072c902c?usp=em… : PS1, Line 93: Args: You're missing to update API docs here and below (new parameter). -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42441?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I9a531a825def318b28bf58291d811cf119003fab Gerrit-Change-Number: 42441 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Thu, 19 Mar 2026 19:25:37 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[L] Change in pysim[master]: docs/put_key: add tutorial that explains how to manage global platfor...
by fixeria 19 Mar '26

19 Mar '26
Attention is currently required from: daniel, dexter, laforge, neels. fixeria has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/42353?usp=email ) Change subject: docs/put_key: add tutorial that explains how to manage global platform keys ...................................................................... Patch Set 4: (7 comments) File docs/put_key-tutorial.rst: https://gerrit.osmocom.org/c/pysim/+/42353/comment/9a08cf9e_2c3d4711?usp=em… : PS4, Line 16: It It's https://gerrit.osmocom.org/c/pysim/+/42353/comment/7ceaf48a_a1171787?usp=em… : PS4, Line 39: exists [two domains] exist https://gerrit.osmocom.org/c/pysim/+/42353/comment/e1e6bc27_6b31c18e?usp=em… : PS4, Line 46: there will there will be https://gerrit.osmocom.org/c/pysim/+/42353/comment/f176888e_78814630?usp=em… : PS4, Line 67: we simply have `pySim-shell` : into making the GlobalPlatform related commands available something is not right here, do you mean "we simply force pySim-shell"? https://gerrit.osmocom.org/c/pysim/+/42353/comment/580b829a_2579c42a?usp=em… : PS4, Line 91: Along with the card we have received the following keyset: Maybe add an extra warning/clarification here that each card has its own unique keyset, and the given example values are not valid for other cards? https://gerrit.osmocom.org/c/pysim/+/42353/comment/3640903d_6550ce3e?usp=em… : PS4, Line 108: establish_scp02 Don't we need to specify `--key-ver 122` here? https://gerrit.osmocom.org/c/pysim/+/42353/comment/078ef73b_2442bb88?usp=em… : PS4, Line 440: That different schemes are possible shows the second example Looks like the halves of this sentence are swapped. How about: "the second example shows that different ]]ъu are possible"? -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42353?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I163dfedca3df572cb8442e9a4a280e6c5b00327e Gerrit-Change-Number: 42353 Gerrit-PatchSet: 4 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Thu, 19 Mar 2026 19:19:44 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[L] Change in osmo-trx[master]: transceiver: add optional WebSDR device support
by Timur Davydov 19 Mar '26

19 Mar '26
Attention is currently required from: Hoernchen, fixeria, laforge, pespin. Timur Davydov has posted comments on this change by Timur Davydov. ( https://gerrit.osmocom.org/c/osmo-trx/+/42411?usp=email ) Change subject: transceiver: add optional WebSDR device support ...................................................................... Patch Set 10: (1 comment) File Transceiver52M/Transceiver.cpp: https://gerrit.osmocom.org/c/osmo-trx/+/42411/comment/709001f7_55929b8f?usp… : PS10, Line 1132: msgLen = read(mDataSockets[chan], buffer, sizeof(buffer)); > You should instead properly split read/write from/to sockets into its own method. Could you please clarify if I understood you correctly? Do you mean that the socket read/write operations should be split into separate methods, and then overridden in the WebSDR subclass so that, instead of operating on sockets, they would operate on some intermediate buffers? That approach should work, and architecturally it would probably look cleaner. My concern is that in the WebSDR case this would require placing the data into an intermediate buffer before calling method, as example driveTxPriorityQueue, and then reading it back here, which introduces an extra copy and may negatively affect performance. Is that the direction you had in mind? -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/42411?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: Ia0d340c323c2eea28fbe82601ba0af7cfbd68f6d Gerrit-Change-Number: 42411 Gerrit-PatchSet: 10 Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Thu, 19 Mar 2026 19:19:00 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • ...
  • 194
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.