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 pysim[master]: esim/http_json_api: allow URL rewriting
by fixeria 17 Mar '26

17 Mar '26
Attention is currently required from: dexter, laforge, neels. fixeria has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/42274?usp=email ) Change subject: esim/http_json_api: allow URL rewriting ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42274?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: Id2713a867079cc140517fe312189e5e2162608a5 Gerrit-Change-Number: 42274 Gerrit-PatchSet: 4 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Tue, 17 Mar 2026 10:42:08 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in pysim[master]: esim/http_json_api: allow URL rewriting
by dexter 17 Mar '26

17 Mar '26
Attention is currently required from: dexter, fixeria, laforge, neels. Hello Jenkins Builder, laforge, neels, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/42274?usp=email to look at the new patch set (#4). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: esim/http_json_api: allow URL rewriting ...................................................................... esim/http_json_api: allow URL rewriting The URL used when HTTP requests are performed is defined statically with the url_prefix passed to the constructor of JsonHttpApiClient together with the path property in JsonHttpApiFunction. For applications that require dynamic URLs there is no way to rewrite the URL. Let's add a mechanism that allows API users to apply custom URL reqriting rules by adding a rewrite_url method to JsonHttpApiFunction. API users may then overload this method with a custom implementation as needed. Related: SYS#7918 Change-Id: Id2713a867079cc140517fe312189e5e2162608a5 --- M pySim/esim/http_json_api.py 1 file changed, 33 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/74/42274/4 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42274?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Id2713a867079cc140517fe312189e5e2162608a5 Gerrit-Change-Number: 42274 Gerrit-PatchSet: 4 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder 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: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
1 0
0 0
[S] Change in ...osmo-s1gw[master]: mme_registry: add backwards compat for old sctp_client config
by fixeria 17 Mar '26

17 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42352?usp=email ) Change subject: mme_registry: add backwards compat for old sctp_client config ...................................................................... mme_registry: add backwards compat for old sctp_client config When 'mme_pool' is absent from the config, automatically populate the MME pool with a single 'default' entry derived from the 'sctp_client' section (including legacy mme_loc_addr/mme_rem_addr params), and emit a deprecation warning. osmo_s1gw_sup:init/1 normalises 'sctp_client' in the app env (with all defaults applied) before children start, so mme_registry can safely read it without duplicating the parsing logic. Change-Id: Ia97fb61bbb5ace6f43d1a6768fb5fb6883158532 Related: SYS#7052 --- M src/mme_registry.erl M src/osmo_s1gw_sup.erl 2 files changed, 33 insertions(+), 6 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve diff --git a/src/mme_registry.erl b/src/mme_registry.erl index 291c767..d9ca43a 100644 --- a/src/mme_registry.erl +++ b/src/mme_registry.erl @@ -270,8 +270,13 @@ -spec mme_list_from_env() -> mme_list(). mme_list_from_env() -> - MMEs = osmo_s1gw:get_env(mme_pool, []), - lists:foldl(fun mme_add_from_env/2, [], MMEs). + case application:get_env(osmo_s1gw, mme_pool) of + {ok, MMEs} -> + lists:foldl(fun mme_add_from_env/2, [], MMEs); + undefined -> + %% no mme_pool configured, fall back to sctp_client for compat + mme_list_from_sctp_client() + end. -spec mme_add_from_env(mme_info(), mme_list()) -> mme_list(). @@ -280,4 +285,18 @@ MMEs1. +-spec mme_list_from_sctp_client() -> mme_list(). +mme_list_from_sctp_client() -> + %% osmo_s1gw_sup:init/1 sets 'sctp_client' with all fields populated + Cfg = osmo_s1gw:get_env(sctp_client, #{ }), + ?LOG_WARNING("'mme_pool' is not configured; falling back to 'sctp_client' " + "{laddr, raddr, rport} (deprecated, please use 'mme_pool' instead)"), + MmeInfo = #{name => "default", + laddr => maps:get(laddr, Cfg), + raddr => maps:get(raddr, Cfg), + rport => maps:get(rport, Cfg)}, + {ok, MMEs} = mme_add(MmeInfo, []), + MMEs. + + %% vim:set ts=4 sw=4 et: diff --git a/src/osmo_s1gw_sup.erl b/src/osmo_s1gw_sup.erl index d661af6..875e19b 100644 --- a/src/osmo_s1gw_sup.erl +++ b/src/osmo_s1gw_sup.erl @@ -66,6 +66,14 @@ PfcpLocAddr = osmo_s1gw:get_env(pfcp_loc_addr, ?ENV_DEFAULT_PFCP_LOC_ADDR), PfcpRemAddr = osmo_s1gw:get_env(pfcp_rem_addr, ?ENV_DEFAULT_PFCP_REM_ADDR), + ClientCfg = client_cfg(), + ServerCfg = server_cfg(ClientCfg), + + %% Set a complete 'sctp_client' section with all fields populated. + %% This may be used by mme_registry:mme_list_from_sctp_client/0 + %% if the 'mme_pool' is missing in the configuration file. + osmo_s1gw:set_env(sctp_client, ClientCfg), + EnbRegistry = {enb_registry, {enb_registry, start_link, []}, permanent, 5000, @@ -76,7 +84,7 @@ 5000, worker, [mme_registry]}, - SctpServer = {sctp_server, {sctp_server, start_link, [server_cfg()]}, + SctpServer = {sctp_server, {sctp_server, start_link, [ServerCfg]}, permanent, 5000, worker, @@ -136,8 +144,8 @@ sockopts => sctp_common:gen_sockopts(SockOpts)}. --spec server_cfg() -> sctp_server:cfg(). -server_cfg() -> +-spec server_cfg(term()) -> sctp_server:cfg(). +server_cfg(Priv) -> %% parse old/legacy environment options, if any DefCfg = parse_env_map(#{laddr => s1gw_bind_addr, lport => s1gw_bind_port}), @@ -151,7 +159,7 @@ lport => maps:get(lport, Cfg, ?ENV_DEFAULT_S1GW_BIND_PORT), sockopts => sctp_common:gen_sockopts(SockOpts), handler => enb_proxy, - priv => client_cfg()}. + priv => Priv}. -spec gtpu_kpi_cfg() -> gtpu_kpi:cfg(). -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42352?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ia97fb61bbb5ace6f43d1a6768fb5fb6883158532 Gerrit-Change-Number: 42352 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in ...osmo-s1gw[master]: enb_proxy: add initial MME pooling support
by fixeria 17 Mar '26

17 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41624?usp=email ) Change subject: enb_proxy: add initial MME pooling support ...................................................................... enb_proxy: add initial MME pooling support Rework the CONNECTING state to dynamically select an MME from the pool via mme_registry:mme_select/1, passing the eNB's Tracking Area Codes (from the ?'id-SupportedTAs' IE of the S1 SETUP REQUEST) and a list of already-tried MMEs, so successive attempts pick a different candidate. On connection failure (SCTP establishment timeout or error), or when the selected MME rejects the S1 SETUP REQUEST or fails to respond in time, the FSM re-enters the CONNECTING state rather than terminating. This triggers another mme_select/1 call with the failed MME added to the tried_mmes list. S1 SETUP FAILURE PDUs from the MME are intentionally not forwarded to the eNB, so the retry is fully transparent. Once mme_select/1 exhausts all candidates it returns 'error'; at that point the FSM builds and sends an S1 SETUP FAILURE PDU to the eNB and terminates. Other changes: * add close_sock/1, close_conn/1 helpers; simplify terminate/3 * add ?S1GW_CTR_ENB_PROXY_MME_SELECT_ERROR counter Change-Id: I83dc4a78c78a7b87e87f5ca9a941a168d6c1dc36 Related: SYS#7052 --- M include/s1gw_metrics.hrl M src/enb_proxy.erl M src/s1ap_utils.erl M src/s1gw_metrics.erl 4 files changed, 84 insertions(+), 33 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified fixeria: Looks good to me, approved diff --git a/include/s1gw_metrics.hrl b/include/s1gw_metrics.hrl index ecdf315..249bc6c 100644 --- a/include/s1gw_metrics.hrl +++ b/include/s1gw_metrics.hrl @@ -49,6 +49,7 @@ -define(S1GW_CTR_ENB_PROXY_CONN_EST_FAILURE, [ctr, enb_proxy, conn_est, failure]). -define(S1GW_CTR_ENB_PROXY_UNEXPECTED_PDU, [ctr, enb_proxy, unexpected_pdu]). -define(S1GW_CTR_ENB_PROXY_MALFORMED_PDU, [ctr, enb_proxy, malformed_pdu]). +-define(S1GW_CTR_ENB_PROXY_MME_SELECT_ERROR, [ctr, enb_proxy, mme_select, error]). %% SCTP related metrics -define(S1GW_CTR_SCTP_ERROR_ALL, [ctr, sctp, error, all]). diff --git a/src/enb_proxy.erl b/src/enb_proxy.erl index 0aa00db..5ab79d1 100644 --- a/src/enb_proxy.erl +++ b/src/enb_proxy.erl @@ -71,6 +71,8 @@ enb_conn_info :: sctp_server:conn_info(), mme_conn_cfg :: sctp_client:cfg(), s1setup_req :: undefined | binary(), + tried_mmes :: [mme_registry:mme_name()], + enb_tacs :: undefined | [s1ap_utils:tac()], sock :: undefined | gen_sctp:sctp_socket(), enb_handle :: enb_registry:enb_handle(), genb_id_str :: undefined | string(), @@ -121,6 +123,7 @@ enb_conn_info = EnbConnInfo, mme_conn_cfg = MmeConnCfg, enb_handle = EnbHandle, + tried_mmes = [], handler = Pid}}. @@ -161,9 +164,13 @@ s1ap_proxy:set_genb_id(S#state.handler, GlobalENBId), enb_registry:notify_genb_id(S#state.enb_handle, GENBId), gtpu_kpi_enb_register(S#state{genb_id_str = GlobalENBId}), + %% fetch the TAC (Tracking Area Code) list + TACs = proplists:get_value(?'id-SupportedTAs', IEs), + ?LOG_DEBUG("Broadcast TACs: ~p", [TACs]), {next_state, connecting, S#state{s1setup_req = Data, - genb_id_str = GlobalENBId}}; + genb_id_str = GlobalENBId, + enb_tacs = TACs}}; {{Proc, Type}, IEs} -> ?LOG_ERROR("Rx unexpected S1AP PDU from eNB: ~p/~p, ~p", [Proc, Type, IEs]), ctr_inc(?S1GW_CTR_ENB_PROXY_UNEXPECTED_PDU, S), @@ -179,19 +186,47 @@ %% CONNECTING state connecting(enter, OldState, - #state{mme_conn_cfg = MmeConnCfg} = S) -> + #state{tried_mmes = TriedMMEs, + enb_tacs = EnbTACs} = S) -> ?LOG_INFO("State change: ~p -> ~p", [OldState, ?FUNCTION_NAME]), - enb_registry:notify_mme_connecting(S#state.enb_handle), - %% Initiate connection establishment with the MME - {ok, Sock} = sctp_client:connect(MmeConnCfg), - %% loop transition to enable state_timeout - {next_state, ?FUNCTION_NAME, S#state{sock = Sock}, - [{state_timeout, 2_000, conn_est_timeout}]}; + %% Select an MME from the pool + case mme_registry:mme_select(#{tried_mmes => TriedMMEs, + enb_tacs => EnbTACs}) of + {ok, MmeInfo} -> + MmeName = maps:get(name, MmeInfo), + ?LOG_INFO("MME selection: trying ~p", [MmeName]), + %% Close the old connection, if any + close_sock(S), + %% Initiate connection establishment with the MME + MmeSockOpts = maps:get(sockopts, S#state.mme_conn_cfg), + MmeConnCfg = #{laddr => maps:get(laddr, MmeInfo), + raddr => maps:get(raddr, MmeInfo), + rport => maps:get(rport, MmeInfo), + sockopts => MmeSockOpts}, + {ok, Sock} = sctp_client:connect(MmeConnCfg), + enb_registry:notify_mme_connecting(S#state.enb_handle), + {next_state, ?FUNCTION_NAME, %% loop transition to enable state_timeout + S#state{sock = Sock, + mme_aid = undefined, + mme_conn_cfg = MmeConnCfg, + tried_mmes = [MmeName | TriedMMEs]}, + [{state_timeout, 2_000, conn_est_timeout}]}; + error -> + ?LOG_ERROR("Failed to select an MME"), + ctr_inc(?S1GW_CTR_ENB_PROXY_MME_SELECT_ERROR, S), + %% Build and send an S1 SETUP FAILURE PDU + {ok, PDU} = s1ap_utils:build_s1setup_fail_pdu([]), + sctp_send_from_mme(PDU, S), + {stop, {shutdown, mme_select_error}} + end; %% Handle connection establishment timeout connecting(state_timeout, conn_est_timeout, S) -> + ?LOG_ERROR("MME ~p: timeout establishing connection", + [hd(S#state.tried_mmes)]), ctr_inc(?S1GW_CTR_ENB_PROXY_CONN_EST_TIMEOUT, S), - {stop, {shutdown, conn_est_timeout}}; + %% re-enter the state to try again (or another MME) + repeat_state_and_data; %% Handle PDUs coming from the eNB connecting(cast, {send_data, Data}, S) -> @@ -203,18 +238,21 @@ connecting(info, {sctp, _Socket, MmeAddr, MmePort, {[], #sctp_assoc_change{state = ConnState, assoc_id = Aid}}}, S) -> + MmeName = hd(S#state.tried_mmes), case ConnState of comm_up -> - ?LOG_NOTICE("MME connection (id=~p, ~p:~p) established", - [Aid, MmeAddr, MmePort]), + ?LOG_NOTICE("MME ~p: connection (id=~p, ~p:~p) established", + [MmeName, Aid, MmeAddr, MmePort]), %% 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}}; _ -> - ?LOG_NOTICE("MME connection establishment failed: ~p", [ConnState]), + ?LOG_NOTICE("MME ~p: connection establishment failed: ~p", + [MmeName, ConnState]), ctr_inc(?S1GW_CTR_ENB_PROXY_CONN_EST_FAILURE, S), - {stop, {shutdown, conn_est_fail}} + %% re-enter the state to try again (or another MME) + repeat_state_and_data end; connecting(Event, EventData, S) -> @@ -232,7 +270,8 @@ 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), - {stop, {shutdown, s1setup_rsp_timeout}}; + %% re-enter state 'connecting' to try again (or another MME) + {next_state, connecting, S}; %% Handle PDUs coming from the eNB wait_s1setup_rsp(cast, {send_data, Data}, S) -> @@ -260,15 +299,18 @@ {{?'id-S1Setup', unsuccessfulOutcome}, _IEs} -> ?LOG_NOTICE("Rx S1 SETUP FAILURE from MME"), ctr_inc(?S1GW_CTR_ENB_PROXY_S1_SETUP_FAILURE, S), - sctp_send_from_mme(Data, S), - {stop, {shutdown, s1setup_error}}; + %% do *not* forward the FAILURE to the eNB + %% re-enter state 'connecting' to try again (or another MME) + {next_state, connecting, S}; {{Proc, Type}, IEs} -> ?LOG_ERROR("Rx unexpected S1AP PDU from MME: ~p/~p, ~p", [Proc, Type, IEs]), ctr_inc(?S1GW_CTR_ENB_PROXY_UNEXPECTED_PDU, S), - {stop, {shutdown, s1setup_error}}; + %% re-enter state 'connecting' to try again (or another MME) + {next_state, connecting, S}; {error, _Error} -> ctr_inc(?S1GW_CTR_ENB_PROXY_MALFORMED_PDU, S), - {stop, {shutdown, s1setup_error}} + %% re-enter state 'connecting' to try again (or another MME) + {next_state, connecting, S} end; %% Handle an #sctp_assoc_change event (MME connection state) @@ -283,7 +325,8 @@ {keep_state, S}; _ -> ?LOG_NOTICE("MME connection state: ~p", [ConnState]), - {stop, {shutdown, conn_fail}} + %% re-enter state 'connecting' to try again (or another MME) + {next_state, connecting, S} end; wait_s1setup_rsp(Event, EventData, S) -> @@ -369,22 +412,11 @@ terminate(Reason, State, #state{handler = Pid, - enb_handle = Handle, - sock = Sock, - mme_aid = MmeAid}) -> + enb_handle = Handle} = S) -> ?LOG_NOTICE("Terminating in state ~p, reason ~p", [State, Reason]), enb_registry:enb_unregister(Handle), s1ap_proxy:shutdown(Pid), - case Sock of - undefined -> ok; - _ -> - case MmeAid of - undefined -> ok; - _ -> - sctp_common:shutdown({Sock, MmeAid}) - end, - gen_sctp:close(Sock) - end. + close_sock(S). %% ------------------------------------------------------------------ @@ -507,4 +539,19 @@ s1gw_metrics:ctr_inc(C1). +-spec close_sock(state()) -> ok | {error, term()}. +close_sock(#state{sock = undefined}) -> ok; + +close_sock(#state{sock = Sock} = S) -> + close_conn(S), %% terminate the MME connection, if needed + gen_sctp:close(Sock). + + +-spec close_conn(state()) -> ok | {error, term()}. +close_conn(#state{mme_aid = undefined}) -> ok; + +close_conn(#state{sock = Sock, mme_aid = MmeAid}) -> + sctp_common:shutdown({Sock, MmeAid}). + + %% vim:set ts=4 sw=4 et: diff --git a/src/s1ap_utils.erl b/src/s1ap_utils.erl index 5cded8b..ea1e463 100644 --- a/src/s1ap_utils.erl +++ b/src/s1ap_utils.erl @@ -70,13 +70,15 @@ s1ap_pdu_info/0]). +-type tac() :: 0..16#ffff. -type enb_id() :: 0..16#fffffff. -type plmn_id() :: {MCC :: nonempty_string(), MNC :: nonempty_string()}. -type genb_id() :: #{enb_id => enb_id(), plmn_id => plmn_id()}. --export_type([enb_id/0, +-export_type([tac/0, + enb_id/0, plmn_id/0, genb_id/0]). diff --git a/src/s1gw_metrics.erl b/src/s1gw_metrics.erl index 52a5a10..c505a8b 100644 --- a/src/s1gw_metrics.erl +++ b/src/s1gw_metrics.erl @@ -106,6 +106,7 @@ ?S1GW_CTR_ENB_PROXY_CONN_EST_FAILURE, %% MME connection establishment failure ?S1GW_CTR_ENB_PROXY_UNEXPECTED_PDU, %% unexpected PDUs received from eNB/MME ?S1GW_CTR_ENB_PROXY_MALFORMED_PDU, %% malformed PDUs received from eNB/MME + ?S1GW_CTR_ENB_PROXY_MME_SELECT_ERROR, %% failed to select an MME (pool exhaustion) %% SCTP related counters ?S1GW_CTR_SCTP_ERROR_ALL, %% total number of SCTP errors -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/41624?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I83dc4a78c78a7b87e87f5ca9a941a168d6c1dc36 Gerrit-Change-Number: 41624 Gerrit-PatchSet: 8 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in ...osmo-s1gw[master]: enb_proxy/mme_registry: add per-MME counters for connection events
by fixeria 17 Mar '26

17 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42363?usp=email ) Change subject: enb_proxy/mme_registry: add per-MME counters for connection events ...................................................................... enb_proxy/mme_registry: add per-MME counters for connection events Register a set of per-MME counters when an MME is added to the pool, and increment them from enb_proxy at the relevant state transitions: - selected (MME chosen for a connection attempt) - conn_est_timeout (SCTP connection establishment timed out) - conn_est_failure (SCTP connection establishment failed) - s1setup_rsp (S1 SETUP RESPONSE received successfully) - s1setup_failure (S1 SETUP FAILURE received from MME) - s1setup_rsp_timeout (timed out waiting for S1 SETUP RESPONSE) A new global aggregate counter ?S1GW_CTR_ENB_PROXY_MME_SELECTED is also added alongside the existing ?S1GW_CTR_ENB_PROXY_MME_SELECT_ERROR. Change-Id: Ie0149c1ad0754af6d8f5f95d4e8919993eac3760 Related: SYS#7052 --- M include/s1gw_metrics.hrl M src/enb_proxy.erl M src/mme_registry.erl M src/s1gw_metrics.erl 4 files changed, 33 insertions(+), 0 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, approved diff --git a/include/s1gw_metrics.hrl b/include/s1gw_metrics.hrl index 249bc6c..06a9719 100644 --- a/include/s1gw_metrics.hrl +++ b/include/s1gw_metrics.hrl @@ -50,6 +50,17 @@ -define(S1GW_CTR_ENB_PROXY_UNEXPECTED_PDU, [ctr, enb_proxy, unexpected_pdu]). -define(S1GW_CTR_ENB_PROXY_MALFORMED_PDU, [ctr, enb_proxy, malformed_pdu]). -define(S1GW_CTR_ENB_PROXY_MME_SELECT_ERROR, [ctr, enb_proxy, mme_select, error]). +-define(S1GW_CTR_ENB_PROXY_MME_SELECTED, [ctr, enb_proxy, mme_select, ok]). + +%% per-MME counters +%% NOTE: these counters shall not be listed in ?S1GW_COUNTERS, +%% but created dynamically for each registered MME. +-define(S1GW_CTR_MME_SELECTED(N), [ctr, mme, N, selected]). +-define(S1GW_CTR_MME_CONN_EST_TIMEOUT(N), [ctr, mme, N, conn_est, timeout]). +-define(S1GW_CTR_MME_CONN_EST_FAILURE(N), [ctr, mme, N, conn_est, failure]). +-define(S1GW_CTR_MME_S1_SETUP_RSP(N), [ctr, mme, N, s1setup, rsp]). +-define(S1GW_CTR_MME_S1_SETUP_FAILURE(N), [ctr, mme, N, s1setup, failure]). +-define(S1GW_CTR_MME_S1_SETUP_RSP_TIMEOUT(N), [ctr, mme, N, s1setup, rsp, timeout]). %% SCTP related metrics -define(S1GW_CTR_SCTP_ERROR_ALL, [ctr, sctp, error, all]). diff --git a/src/enb_proxy.erl b/src/enb_proxy.erl index 3ce205f..1d479d6 100644 --- a/src/enb_proxy.erl +++ b/src/enb_proxy.erl @@ -195,6 +195,8 @@ {ok, MmeInfo} -> MmeName = maps:get(name, MmeInfo), ?LOG_INFO("MME selection: trying ~p", [MmeName]), + ctr_inc(?S1GW_CTR_ENB_PROXY_MME_SELECTED, S), + s1gw_metrics:ctr_inc(?S1GW_CTR_MME_SELECTED(MmeName)), %% Close the old connection, if any close_sock(S), %% Initiate connection establishment with the MME @@ -225,6 +227,7 @@ ?LOG_ERROR("MME ~p: timeout establishing connection", [hd(S#state.tried_mmes)]), 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))), %% re-enter the state to try again (or another MME) repeat_state_and_data; @@ -253,6 +256,7 @@ ?LOG_NOTICE("MME ~p: connection establishment failed: ~p", [MmeName, ConnState]), ctr_inc(?S1GW_CTR_ENB_PROXY_CONN_EST_FAILURE, S), + s1gw_metrics:ctr_inc(?S1GW_CTR_MME_CONN_EST_FAILURE(MmeName)), %% re-enter the state to try again (or another MME) repeat_state_and_data end; @@ -272,6 +276,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))), %% re-enter state 'connecting' to try again (or another MME) {next_state, connecting, S}; @@ -296,11 +301,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))), 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))), %% do *not* forward the FAILURE to the eNB %% re-enter state 'connecting' to try again (or another MME) {next_state, connecting, S}; diff --git a/src/mme_registry.erl b/src/mme_registry.erl index d9ca43a..d052f0c 100644 --- a/src/mme_registry.erl +++ b/src/mme_registry.erl @@ -199,6 +199,19 @@ lists:subtract(EnbTACs, MmeTACs) == []. +%% Register per-MME metrics +-spec mme_ctr_reg(mme_name()) -> ok. +mme_ctr_reg(MmeName) -> + Ctrs = [?S1GW_CTR_MME_SELECTED(MmeName), + ?S1GW_CTR_MME_CONN_EST_TIMEOUT(MmeName), + ?S1GW_CTR_MME_CONN_EST_FAILURE(MmeName), + ?S1GW_CTR_MME_S1_SETUP_RSP(MmeName), + ?S1GW_CTR_MME_S1_SETUP_FAILURE(MmeName), + ?S1GW_CTR_MME_S1_SETUP_RSP_TIMEOUT(MmeName)], + %% counter may already exist (e.g. MME re-registered), so ignore errors + lists:foreach(fun(C) -> catch exometer:new(C, counter) end, Ctrs). + + %% Add a new MME if it does not already exist -spec mme_add(mme_info(), mme_list()) -> {ok, mme_list()} | {error, term()}. mme_add(MmeInfo0, MMEs) -> @@ -221,6 +234,7 @@ false -> ?LOG_INFO("MME (name=~p, ~p:~p) registered", [MmeName, RAddr, RPort]), + mme_ctr_reg(MmeName), {ok, MMEs ++ [MmeInfo1]} end. diff --git a/src/s1gw_metrics.erl b/src/s1gw_metrics.erl index c505a8b..551b821 100644 --- a/src/s1gw_metrics.erl +++ b/src/s1gw_metrics.erl @@ -107,6 +107,7 @@ ?S1GW_CTR_ENB_PROXY_UNEXPECTED_PDU, %% unexpected PDUs received from eNB/MME ?S1GW_CTR_ENB_PROXY_MALFORMED_PDU, %% malformed PDUs received from eNB/MME ?S1GW_CTR_ENB_PROXY_MME_SELECT_ERROR, %% failed to select an MME (pool exhaustion) + ?S1GW_CTR_ENB_PROXY_MME_SELECTED, %% successfully selected an MME %% SCTP related counters ?S1GW_CTR_SCTP_ERROR_ALL, %% total number of SCTP errors -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42363?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ie0149c1ad0754af6d8f5f95d4e8919993eac3760 Gerrit-Change-Number: 42363 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in ...osmo-s1gw[master]: enb_proxy: fix stale SCTP events misprocessed during MME pool selection
by fixeria 17 Mar '26

17 Mar '26
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42356?usp=email ) Change subject: enb_proxy: fix stale SCTP events misprocessed during MME pool selection ...................................................................... enb_proxy: fix stale SCTP events misprocessed during MME pool selection When closing a connection to one MME and opening a new one to the next, a SHUTDOWN_COMP event from the old (now-closed) socket can still be pending in the process mailbox. The sctp_assoc_change handlers in the 'connecting' and 'wait_s1setup_rsp' states were matching '_Socket', ignoring the socket identity. A stale SHUTDOWN_COMP would therefore fall into the '_ -> repeat_state_and_data' branch, triggering a spurious re-entry of 'connecting', which immediately closed the newly established connection to the next MME and skipped to yet another pool entry. Fix this by matching the Socket against the current S#state.sock in both handlers. Events arriving on a previously closed socket no longer match these clauses and are silently dropped by the catch-all handle_event/4. This was found thanks to the MME pooling TCs in ttcn3-s1gw-test. Change-Id: I4211dd343607f045cf4dd33fa568ed580c79dd9f Related: SYS#7052 --- M src/enb_proxy.erl 1 file changed, 8 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, approved pespin: Looks good to me, but someone else must approve diff --git a/src/enb_proxy.erl b/src/enb_proxy.erl index 5ab79d1..3ce205f 100644 --- a/src/enb_proxy.erl +++ b/src/enb_proxy.erl @@ -235,9 +235,11 @@ keep_state_and_data; %% Handle an #sctp_assoc_change event (connection state) -connecting(info, {sctp, _Socket, MmeAddr, MmePort, +%% Match on Socket to avoid processing stale events from a previously closed socket +connecting(info, {sctp, Socket, MmeAddr, MmePort, {[], #sctp_assoc_change{state = ConnState, - assoc_id = Aid}}}, S) -> + assoc_id = Aid}}}, + #state{sock = Socket} = S) -> MmeName = hd(S#state.tried_mmes), case ConnState of comm_up -> @@ -315,9 +317,11 @@ %% Handle an #sctp_assoc_change event (MME connection state) %% We may loose connection while waiting for the S1 SETUP RESPONSE -wait_s1setup_rsp(info, {sctp, _Socket, MmeAddr, MmePort, +%% Match on Socket to avoid processing stale events from a previously closed socket +wait_s1setup_rsp(info, {sctp, Socket, MmeAddr, MmePort, {[], #sctp_assoc_change{state = ConnState, - assoc_id = Aid}}}, S) -> + assoc_id = Aid}}}, + #state{sock = Socket} = S) -> case ConnState of comm_up -> ?LOG_NOTICE("MME connection (id=~p, ~p:~p) is already established?!?", -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42356?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I4211dd343607f045cf4dd33fa568ed580c79dd9f Gerrit-Change-Number: 42356 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in ...osmo-s1gw[master]: mme_registry: add backwards compat for old sctp_client config
by fixeria 17 Mar '26

17 Mar '26
Attention is currently required from: pespin. fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42352?usp=email ) Change subject: mme_registry: add backwards compat for old sctp_client config ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42352?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ia97fb61bbb5ace6f43d1a6768fb5fb6883158532 Gerrit-Change-Number: 42352 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 17 Mar 2026 10:13:40 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in ...osmo-s1gw[master]: enb_proxy/mme_registry: add per-MME counters for connection events
by osmith 17 Mar '26

17 Mar '26
Attention is currently required from: fixeria. osmith has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42363?usp=email ) Change subject: enb_proxy/mme_registry: add per-MME counters for connection events ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42363?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ie0149c1ad0754af6d8f5f95d4e8919993eac3760 Gerrit-Change-Number: 42363 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 17 Mar 2026 10:07:53 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in ...osmo-s1gw[master]: enb_proxy: fix stale SCTP events misprocessed during MME pool selection
by osmith 17 Mar '26

17 Mar '26
Attention is currently required from: fixeria. osmith has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42356?usp=email ) Change subject: enb_proxy: fix stale SCTP events misprocessed during MME pool selection ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/42356?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: I4211dd343607f045cf4dd33fa568ed580c79dd9f Gerrit-Change-Number: 42356 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 17 Mar 2026 10:05:47 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[L] Change in osmo-trx[master]: device/websdr: add WebSDR transceiver backend and build target
by pespin 17 Mar '26

17 Mar '26
Attention is currently required from: Timur Davydov. pespin has posted comments on this change by Timur Davydov. ( https://gerrit.osmocom.org/c/osmo-trx/+/42411?usp=email ) Change subject: device/websdr: add WebSDR transceiver backend and build target ...................................................................... Patch Set 4: (1 comment) Patchset: PS4: What I'm still missing here in order to properly review, is an explanation on why do you need a new radioInterface class and a new Transceiver class. What are the different requirements and differences in implementation with the existing ones? Why cannot we reuse the existing ones? -- 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: 4 Gerrit-Owner: Timur Davydov <dtv.comp(a)gmail.com> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: Timur Davydov <dtv.comp(a)gmail.com> Gerrit-Comment-Date: Tue, 17 Mar 2026 10:03:02 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • ...
  • 194
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.