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 -----
  • 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

July 2025

  • 1 participants
  • 1492 discussions
[M] Change in ...osmo-s1gw[master]: s1ap_proxy: support using NFT KPI UL/DL address from SCTP
by fixeria 21 Jul '25

21 Jul '25
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40547?usp=email ) Change subject: s1ap_proxy: support using NFT KPI UL/DL address from SCTP ...................................................................... s1ap_proxy: support using NFT KPI UL/DL address from SCTP In some deployments the source address of UL GTP-U packets may be different from the bind address indicated by an eNB during E-RAB establishment. Allow the operator to configure the source, from where UL/DL addresses are to be learned: * s1ap - learn from S1AP PDUs (default), * sctp - learn from SCTP address of the eNB. Change-Id: Iae92a42b0ccb1a4bc34f06d969f5270a304b1d3a Related: SYS#7307 --- M config/sys.config M src/s1ap_proxy.erl M src/sctp_proxy.erl M test/s1ap_proxy_test.erl 4 files changed, 54 insertions(+), 14 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified fixeria: Looks good to me, approved osmith: Looks good to me, but someone else must approve diff --git a/config/sys.config b/config/sys.config index 57cb61c..ef5a7d7 100644 --- a/config/sys.config +++ b/config/sys.config @@ -23,6 +23,8 @@ %% Optional NFT KPI configuration %% {enft_kpi_enable, true}, %% whether to enable the NFT KPI module (default: false) %% {enft_kpi_table_name, "osmo-s1gw"}, %% the NFT table name to be used by this process +%% {enft_kpi_ul_addr, s1ap}, %% GTP-U UL address: s1ap | sctp (default: learn from S1AP) +%% {enft_kpi_dl_addr, s1ap}, %% GTP-U DL address: s1ap | sctp (default: learn from S1AP) %% {enft_kpi_interval, 3000} %% counter reporting interval (ms) ]}, %% ================================================================================ diff --git a/src/s1ap_proxy.erl b/src/s1ap_proxy.erl index d2c1b0a..e7a65e5 100644 --- a/src/s1ap_proxy.erl +++ b/src/s1ap_proxy.erl @@ -40,7 +40,7 @@ handle_call/3, handle_cast/2, terminate/2]). --export([start_link/0, +-export([start_link/1, process_pdu/2, fetch_erab/2, fetch_erab_list/1, @@ -70,7 +70,8 @@ -type plmn_id() :: {MCC :: nonempty_string(), MNC :: nonempty_string()}. --record(proxy_state, {erabs :: dict:dict(), +-record(proxy_state, {conn_info :: sctp_server:conn_info(), + erabs :: dict:dict(), enb_id :: undefined | non_neg_integer(), plmn_id :: undefined | plmn_id(), mme_ue_id :: undefined | mme_ue_id(), @@ -89,9 +90,11 @@ %% public API %% ------------------------------------------------------------------ --spec start_link() -> gen_server:start_ret(). -start_link() -> - gen_server:start_link(?MODULE, [], []). +-spec start_link(ConnInfo) -> Result + when ConnInfo :: sctp_server:conn_info(), + Result :: gen_server:start_ret(). +start_link(ConnInfo) -> + gen_server:start_link(?MODULE, [ConnInfo], []). -type process_pdu_result() :: {proxy_action(), binary()}. @@ -121,9 +124,10 @@ %% gen_server API %% ------------------------------------------------------------------ -init([]) -> +init([ConnInfo]) -> process_flag(trap_exit, true), - {ok, #proxy_state{erabs = dict:new(), + {ok, #proxy_state{conn_info = ConnInfo, + erabs = dict:new(), path = []}}. @@ -364,10 +368,11 @@ handle_pdu({successfulOutcome, #'SuccessfulOutcome'{procedureCode = ?'id-S1Setup'}}, S) -> ?LOG_DEBUG("Processing S1 SETUP RESPONSE"), - ok = enft_kpi:enb_register(genb_id_str(S)), + enft_kpi_enb_register(S), %% there's nothing to patch in this PDU, so we forward it as-is {forward, S}; + %% 9.1.3.1 E-RAB SETUP REQUEST handle_pdu({Outcome = initiatingMessage, #'InitiatingMessage'{procedureCode = ?'id-E-RABSetup', @@ -691,8 +696,7 @@ 'transportLayerAddress' = TLA_In, 'gTP-TEID' = << TEID_In:32/big >>} = C0, S) -> %% indicate eNB's address to the enft_kpi module - enft_kpi:enb_set_addr({ul, tla_str(TLA_In)}), - enft_kpi:enb_set_addr({dl, tla_str(TLA_In)}), + enft_kpi_enb_set_addr({s1ap, tla_str(TLA_In)}), %% poke E-RAB FSM case erab_fsm_find(ERABId, S) of {ok, Pid} -> @@ -981,8 +985,7 @@ 'transportLayerAddress' = TLA_In, 'gTP-TEID' = << TEID_In:32/big >>} = C0, S) -> %% indicate eNB's address to the enft_kpi module - enft_kpi:enb_set_addr({ul, tla_str(TLA_In)}), - enft_kpi:enb_set_addr({dl, tla_str(TLA_In)}), + enft_kpi_enb_set_addr({s1ap, tla_str(TLA_In)}), %% poke E-RAB FSM case erab_fsm_find(ERABId, S) of {ok, Pid} -> @@ -1090,4 +1093,38 @@ UID = erab_uid(RABId, S), dict:find(UID, ERABs). + +-spec enft_kpi_enb_register(proxy_state()) -> ok. +enft_kpi_enb_register(#proxy_state{conn_info = ConnInfo} = S) -> + %% register eNB using its Global-eNB-ID + ok = enft_kpi:enb_register(genb_id_str(S)), + %% indicate UL/DL addresses + EnbAddr = inet:ntoa(maps:get(addr, ConnInfo)), + enft_kpi_enb_set_addr({sctp, EnbAddr}). + + +-spec enft_kpi_enb_set_addr({Source, EnbAddr}) -> ok + when Source :: s1ap | sctp, + EnbAddr :: string(). +enft_kpi_enb_set_addr({Source, EnbAddr}) -> + enft_kpi_enb_set_addr(enft_kpi_ul_addr, {Source, ul, EnbAddr}), + enft_kpi_enb_set_addr(enft_kpi_dl_addr, {Source, dl, EnbAddr}), + ok. + + +-spec enft_kpi_enb_set_addr(EnvParam, {Source, ULDL, EnbAddr}) -> ok + when EnvParam :: atom(), + Source :: s1ap | sctp, + ULDL :: ul | dl, + EnbAddr :: string(). +enft_kpi_enb_set_addr(EnvParam, {Source, ULDL, EnbAddr}) -> + case osmo_s1gw:get_env(EnvParam, s1ap) of + Source -> + ?LOG_DEBUG("NFT KPI ~p address ~p learned from ~p", + [ULDL, EnbAddr, Source]), + enft_kpi:enb_set_addr({ULDL, EnbAddr}); + Mode -> + ?LOG_DEBUG("NFT KPI ~p address mode ~p != ~p", [ULDL, Mode, Source]) + end. + %% vim:set ts=4 sw=4 et: diff --git a/src/sctp_proxy.erl b/src/sctp_proxy.erl index 14c3a03..d475b20 100644 --- a/src/sctp_proxy.erl +++ b/src/sctp_proxy.erl @@ -85,7 +85,7 @@ %% ------------------------------------------------------------------ init([ConnInfo, ConnCfg]) -> - {ok, Pid} = s1ap_proxy:start_link(), + {ok, Pid} = s1ap_proxy:start_link(ConnInfo), {ok, connecting, #{enb_aid => maps:get(aid, ConnInfo), conn_cfg => ConnCfg, diff --git a/test/s1ap_proxy_test.erl b/test/s1ap_proxy_test.erl index dd1638b..1fc66f5 100644 --- a/test/s1ap_proxy_test.erl +++ b/test/s1ap_proxy_test.erl @@ -24,7 +24,8 @@ exometer:start(), s1gw_metrics:init(), enft_kpi:start_link(#{enable => false}), - {ok, Pid} = s1ap_proxy:start_link(), + {ok, Pid} = s1ap_proxy:start_link(#{addr => {127,0,0,0}, + port => 1337}), #{handler => Pid}. -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40547?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: Iae92a42b0ccb1a4bc34f06d969f5270a304b1d3a Gerrit-Change-Number: 40547 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in ...osmo-s1gw[master]: Rename enft_kpi -> gtpu_kpi
by fixeria 21 Jul '25

21 Jul '25
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40726?usp=email ) Change subject: Rename enft_kpi -> gtpu_kpi ...................................................................... Rename enft_kpi -> gtpu_kpi Change-Id: I8a470d2c40dc4487c4de30b3cceeec333228935b Related: SYS#7307 --- M config/sys.config R src/gtpu_kpi.erl M src/osmo_s1gw_sup.erl M src/s1ap_proxy.erl M test/s1ap_proxy_test.erl 5 files changed, 38 insertions(+), 38 deletions(-) Approvals: fixeria: Looks good to me, approved osmith: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/config/sys.config b/config/sys.config index ef5a7d7..f73b33f 100644 --- a/config/sys.config +++ b/config/sys.config @@ -20,12 +20,12 @@ %% {pfcp_net_inst_core, << 16#09, "core-side" >>}, %% PFCP Network Instance IE value (to core) %% {pfcp_net_inst_access, << 16#0a, "radio-side" >>} %% PFCP Network Instance IE value (to access) %% -%% Optional NFT KPI configuration -%% {enft_kpi_enable, true}, %% whether to enable the NFT KPI module (default: false) -%% {enft_kpi_table_name, "osmo-s1gw"}, %% the NFT table name to be used by this process -%% {enft_kpi_ul_addr, s1ap}, %% GTP-U UL address: s1ap | sctp (default: learn from S1AP) -%% {enft_kpi_dl_addr, s1ap}, %% GTP-U DL address: s1ap | sctp (default: learn from S1AP) -%% {enft_kpi_interval, 3000} %% counter reporting interval (ms) +%% Optional GTP-U KPI configuration +%% {gtpu_kpi_enable, true}, %% whether to enable the GTP-U KPI module (default: false) +%% {gtpu_kpi_table_name, "osmo-s1gw"}, %% the NFT table name to be used by this process +%% {gtpu_kpi_ul_addr, s1ap}, %% GTP-U UL address: s1ap | sctp (default: learn from S1AP) +%% {gtpu_kpi_dl_addr, s1ap}, %% GTP-U DL address: s1ap | sctp (default: learn from S1AP) +%% {gtpu_kpi_interval, 3000} %% counter reporting interval (ms) ]}, %% ================================================================================ %% kernel config diff --git a/src/enft_kpi.erl b/src/gtpu_kpi.erl similarity index 99% rename from src/enft_kpi.erl rename to src/gtpu_kpi.erl index f8cf126..5aeb749 100644 --- a/src/enft_kpi.erl +++ b/src/gtpu_kpi.erl @@ -32,7 +32,7 @@ %% for the parts of the runtime libraries of Erlang/OTP used as well as %% that of the covered work. --module(enft_kpi). +-module(gtpu_kpi). -behaviour(gen_server). -export([init/1, diff --git a/src/osmo_s1gw_sup.erl b/src/osmo_s1gw_sup.erl index c746d7c..2077094 100644 --- a/src/osmo_s1gw_sup.erl +++ b/src/osmo_s1gw_sup.erl @@ -50,9 +50,9 @@ -define(ENV_DEFAULT_MME_REM_PORT, ?S1AP_PORT). -define(ENV_DEFAULT_PFCP_LOC_ADDR, "127.0.1.1"). -define(ENV_DEFAULT_PFCP_REM_ADDR, "127.0.1.2"). --define(ENV_DEFAULT_ENFT_KPI_ENABLE, false). --define(ENV_DEFAULT_ENFT_KPI_TABLE_NAME, "osmo-s1gw"). --define(ENV_DEFAULT_ENFT_KPI_INTERVAL, 3000). +-define(ENV_DEFAULT_GTPU_KPI_ENABLE, false). +-define(ENV_DEFAULT_GTPU_KPI_TABLE_NAME, "osmo-s1gw"). +-define(ENV_DEFAULT_GTPU_KPI_INTERVAL, 3000). %% ------------------------------------------------------------------ %% supervisor API @@ -77,14 +77,14 @@ 5000, worker, [pfcp_peer]}, - EnftKpi = {enft_kpi, {enft_kpi, start_link, [enft_kpi_cfg()]}, + GtpuKpi = {gtpu_kpi, {gtpu_kpi, start_link, [gtpu_kpi_cfg()]}, permanent, 5000, worker, - [enft_kpi]}, + [gtpu_kpi]}, s1gw_metrics:init(), - {ok, {{one_for_one, 5, 10}, [SctpServer, PfcpPeer, EnftKpi]}}. + {ok, {{one_for_one, 5, 10}, [SctpServer, PfcpPeer, GtpuKpi]}}. %% ------------------------------------------------------------------ @@ -115,10 +115,10 @@ priv => client_cfg()}. --spec enft_kpi_cfg() -> enft_kpi:cfg(). -enft_kpi_cfg() -> - #{enable => osmo_s1gw:get_env(enft_kpi_enable, ?ENV_DEFAULT_ENFT_KPI_ENABLE), - table_name => osmo_s1gw:get_env(enft_kpi_table_name, ?ENV_DEFAULT_ENFT_KPI_TABLE_NAME), - interval => osmo_s1gw:get_env(enft_kpi_interval, ?ENV_DEFAULT_ENFT_KPI_INTERVAL)}. +-spec gtpu_kpi_cfg() -> gtpu_kpi:cfg(). +gtpu_kpi_cfg() -> + #{enable => osmo_s1gw:get_env(gput_kpi_enable, ?ENV_DEFAULT_GTPU_KPI_ENABLE), + table_name => osmo_s1gw:get_env(gtpu_kpi_table_name, ?ENV_DEFAULT_GTPU_KPI_TABLE_NAME), + interval => osmo_s1gw:get_env(gtpu_kpi_interval, ?ENV_DEFAULT_GTPU_KPI_INTERVAL)}. %% vim:set ts=4 sw=4 et: diff --git a/src/s1ap_proxy.erl b/src/s1ap_proxy.erl index e7a65e5..17403ec 100644 --- a/src/s1ap_proxy.erl +++ b/src/s1ap_proxy.erl @@ -368,7 +368,7 @@ handle_pdu({successfulOutcome, #'SuccessfulOutcome'{procedureCode = ?'id-S1Setup'}}, S) -> ?LOG_DEBUG("Processing S1 SETUP RESPONSE"), - enft_kpi_enb_register(S), + gtpu_kpi_enb_register(S), %% there's nothing to patch in this PDU, so we forward it as-is {forward, S}; @@ -695,8 +695,8 @@ #'E-RABSetupItemBearerSURes'{'e-RAB-ID' = ERABId, 'transportLayerAddress' = TLA_In, 'gTP-TEID' = << TEID_In:32/big >>} = C0, S) -> - %% indicate eNB's address to the enft_kpi module - enft_kpi_enb_set_addr({s1ap, tla_str(TLA_In)}), + %% indicate eNB's address to the gtpu_kpi module + gtpu_kpi_enb_set_addr({s1ap, tla_str(TLA_In)}), %% poke E-RAB FSM case erab_fsm_find(ERABId, S) of {ok, Pid} -> @@ -984,8 +984,8 @@ #'E-RABSetupItemCtxtSURes'{'e-RAB-ID' = ERABId, 'transportLayerAddress' = TLA_In, 'gTP-TEID' = << TEID_In:32/big >>} = C0, S) -> - %% indicate eNB's address to the enft_kpi module - enft_kpi_enb_set_addr({s1ap, tla_str(TLA_In)}), + %% indicate eNB's address to the gtpu_kpi module + gtpu_kpi_enb_set_addr({s1ap, tla_str(TLA_In)}), %% poke E-RAB FSM case erab_fsm_find(ERABId, S) of {ok, Pid} -> @@ -1094,37 +1094,37 @@ dict:find(UID, ERABs). --spec enft_kpi_enb_register(proxy_state()) -> ok. -enft_kpi_enb_register(#proxy_state{conn_info = ConnInfo} = S) -> +-spec gtpu_kpi_enb_register(proxy_state()) -> ok. +gtpu_kpi_enb_register(#proxy_state{conn_info = ConnInfo} = S) -> %% register eNB using its Global-eNB-ID - ok = enft_kpi:enb_register(genb_id_str(S)), + ok = gtpu_kpi:enb_register(genb_id_str(S)), %% indicate UL/DL addresses EnbAddr = inet:ntoa(maps:get(addr, ConnInfo)), - enft_kpi_enb_set_addr({sctp, EnbAddr}). + gtpu_kpi_enb_set_addr({sctp, EnbAddr}). --spec enft_kpi_enb_set_addr({Source, EnbAddr}) -> ok +-spec gtpu_kpi_enb_set_addr({Source, EnbAddr}) -> ok when Source :: s1ap | sctp, EnbAddr :: string(). -enft_kpi_enb_set_addr({Source, EnbAddr}) -> - enft_kpi_enb_set_addr(enft_kpi_ul_addr, {Source, ul, EnbAddr}), - enft_kpi_enb_set_addr(enft_kpi_dl_addr, {Source, dl, EnbAddr}), +gtpu_kpi_enb_set_addr({Source, EnbAddr}) -> + gtpu_kpi_enb_set_addr(gtpu_kpi_ul_addr, {Source, ul, EnbAddr}), + gtpu_kpi_enb_set_addr(gtpu_kpi_dl_addr, {Source, dl, EnbAddr}), ok. --spec enft_kpi_enb_set_addr(EnvParam, {Source, ULDL, EnbAddr}) -> ok +-spec gtpu_kpi_enb_set_addr(EnvParam, {Source, ULDL, EnbAddr}) -> ok when EnvParam :: atom(), Source :: s1ap | sctp, ULDL :: ul | dl, EnbAddr :: string(). -enft_kpi_enb_set_addr(EnvParam, {Source, ULDL, EnbAddr}) -> +gtpu_kpi_enb_set_addr(EnvParam, {Source, ULDL, EnbAddr}) -> case osmo_s1gw:get_env(EnvParam, s1ap) of Source -> - ?LOG_DEBUG("NFT KPI ~p address ~p learned from ~p", + ?LOG_DEBUG("GTP-U KPI ~p address ~p learned from ~p", [ULDL, EnbAddr, Source]), - enft_kpi:enb_set_addr({ULDL, EnbAddr}); + gtpu_kpi:enb_set_addr({ULDL, EnbAddr}); Mode -> - ?LOG_DEBUG("NFT KPI ~p address mode ~p != ~p", [ULDL, Mode, Source]) + ?LOG_DEBUG("GTP-U KPI ~p address mode ~p != ~p", [ULDL, Mode, Source]) end. %% vim:set ts=4 sw=4 et: diff --git a/test/s1ap_proxy_test.erl b/test/s1ap_proxy_test.erl index 1fc66f5..d606a18 100644 --- a/test/s1ap_proxy_test.erl +++ b/test/s1ap_proxy_test.erl @@ -23,7 +23,7 @@ pfcp_mock:mock_all(), exometer:start(), s1gw_metrics:init(), - enft_kpi:start_link(#{enable => false}), + gtpu_kpi:start_link(#{enable => false}), {ok, Pid} = s1ap_proxy:start_link(#{addr => {127,0,0,0}, port => 1337}), #{handler => Pid}. @@ -32,7 +32,7 @@ stop(#{handler := Pid}) -> s1ap_proxy:shutdown(Pid), exometer:stop(), - enft_kpi:shutdown(), + gtpu_kpi:shutdown(), pfcp_mock:unmock_all(). -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40726?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: I8a470d2c40dc4487c4de30b3cceeec333228935b Gerrit-Change-Number: 40726 Gerrit-PatchSet: 2 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]: Rename enft_kpi -> gtpu_kpi
by fixeria 21 Jul '25

21 Jul '25
fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40726?usp=email ) Change subject: Rename enft_kpi -> gtpu_kpi ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40726?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: I8a470d2c40dc4487c4de30b3cceeec333228935b Gerrit-Change-Number: 40726 Gerrit-PatchSet: 2 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-Comment-Date: Mon, 21 Jul 2025 14:18:06 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in ...osmo-s1gw[master]: s1ap_proxy: support using NFT KPI UL/DL address from SCTP
by fixeria 21 Jul '25

21 Jul '25
Attention is currently required from: laforge, pespin. fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40547?usp=email ) Change subject: s1ap_proxy: support using NFT KPI UL/DL address from SCTP ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40547?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: Iae92a42b0ccb1a4bc34f06d969f5270a304b1d3a Gerrit-Change-Number: 40547 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Jul 2025 14:18:02 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in ...osmo-s1gw[master]: Rename enft_kpi -> gtpu_kpi
by osmith 21 Jul '25

21 Jul '25
Attention is currently required from: fixeria. osmith has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40726?usp=email ) Change subject: Rename enft_kpi -> gtpu_kpi ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40726?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: I8a470d2c40dc4487c4de30b3cceeec333228935b Gerrit-Change-Number: 40726 Gerrit-PatchSet: 2 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: Mon, 21 Jul 2025 14:15:00 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in ...osmo-s1gw[master]: s1ap_proxy: support using NFT KPI UL/DL address from SCTP
by osmith 21 Jul '25

21 Jul '25
Attention is currently required from: fixeria, laforge, pespin. osmith has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40547?usp=email ) Change subject: s1ap_proxy: support using NFT KPI UL/DL address from SCTP ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40547?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: Iae92a42b0ccb1a4bc34f06d969f5270a304b1d3a Gerrit-Change-Number: 40547 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Jul 2025 14:14:15 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in ...osmo-s1gw[master]: s1ap_proxy: support using NFT KPI UL/DL address from SCTP
by fixeria 21 Jul '25

21 Jul '25
Attention is currently required from: pespin. fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40547?usp=email ) Change subject: s1ap_proxy: support using NFT KPI UL/DL address from SCTP ...................................................................... Patch Set 3: (1 comment) File config/sys.config: https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40547/comment/dc404c21_3f32… : PS2, Line 26: %% {enft_kpi_ul_addr, s1ap}, %% GTP-U UL address: s1ap | sctp (default: learn from S1AP) > naming of configs still needs to be addressed here. Other than that, +1. Done -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40547?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: Iae92a42b0ccb1a4bc34f06d969f5270a304b1d3a Gerrit-Change-Number: 40547 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Jul 2025 13:48:38 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in ...osmo-s1gw[master]: enft_kpi: keep NFT counters intact
by fixeria 21 Jul '25

21 Jul '25
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40446?usp=email ) ( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: enft_kpi: keep NFT counters intact ...................................................................... enft_kpi: keep NFT counters intact We don't want to reset counters if an eNB reconnects. This is also what osmo-hnbgw does. Change-Id: Id6db327b445b8597d39a1d838077e7002d538db5 Related: SYS#7307 --- M src/enft_kpi.erl 1 file changed, 16 insertions(+), 22 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/src/enft_kpi.erl b/src/enft_kpi.erl index e251a3b..9086298 100644 --- a/src/enft_kpi.erl +++ b/src/enft_kpi.erl @@ -210,7 +210,7 @@ {ok, #{genb_id := GlobalENBId, mon_ref := MonRef} = ES} -> erlang:demonitor(MonRef, [flush]), - enb_del_nft_counters(ES, Cfg), + enb_del_nft_rules(ES, Cfg), R1 = dict:erase(Pid, R0), ?LOG_INFO("eNB (pid ~p, ~p) has been unregistered", [Pid, GlobalENBId]), @@ -295,7 +295,7 @@ ?LOG_INFO("eNB process ~p terminated with reason ~p", [Pid, Reason]), case dict:find(Pid, R0) of {ok, ES} -> - enb_del_nft_counters(ES, Cfg), + enb_del_nft_rules(ES, Cfg), R1 = dict:erase(Pid, R0), ?LOG_INFO("eNB (pid ~p) has been unregistered", [Pid]), {noreply, S#state{registry = R1}}; @@ -395,37 +395,31 @@ end. --spec enb_del_nft_counters(ES0, Cfg) -> ES1 +-spec enb_del_nft_rules(ES0, Cfg) -> ES1 when Cfg :: cfg(), ES0 :: enb_state(), ES1 :: enb_state(). -enb_del_nft_counters(#{ul := ULS} = ES, Cfg) -> - enb_del_nft_counter(ULS, ES, Cfg), - enb_del_nft_counters(maps:remove(ul, ES), Cfg); +enb_del_nft_rules(#{ul := ULS} = ES, Cfg) -> + enb_del_nft_rule(ULS, Cfg), + enb_del_nft_rules(maps:remove(ul, ES), Cfg); -enb_del_nft_counters(#{dl := DLS} = ES, Cfg) -> - enb_del_nft_counter(DLS, ES, Cfg), - enb_del_nft_counters(maps:remove(dl, ES), Cfg); +enb_del_nft_rules(#{dl := DLS} = ES, Cfg) -> + enb_del_nft_rule(DLS, Cfg), + enb_del_nft_rules(maps:remove(dl, ES), Cfg); %% no UL/DL state => nothing to delete -enb_del_nft_counters(ES, _Cfg) -> ES. +enb_del_nft_rules(ES, _Cfg) -> ES. --spec enb_del_nft_counter(S, ES, Cfg) -> ok | {error, term()} +-spec enb_del_nft_rule(S, Cfg) -> ok | {error, term()} when S :: enb_uldl_state(), - ES :: enb_state(), Cfg :: cfg(). -enb_del_nft_counter(#{uldl := ULDL, handle := Handle}, - #{genb_id := GlobalENBId, pid := Pid}, - #{table_name := TName}) -> - ?LOG_DEBUG("eNB (pid ~p, ~p): deleting NFT counter for ~p", - [Pid, GlobalENBId, ULDL]), - CtrName = enb_nft_counter_name(ULDL, GlobalENBId), +enb_del_nft_rule(#{uldl := ULDL, handle := Handle}, + #{table_name := TName}) -> + %% keep the counter intact, remove the rule only + %% we don't want to reset counters if eNB reconnects CName = enb_nft_chain_name(ULDL), - Counter = enftables:nft_counter(TName, CtrName), - Cmds = [enftables:nft_cmd_del_rule(TName, CName, Handle), - enftables:nft_cmd_del_counter(Counter) - ], + Cmds = [enftables:nft_cmd_del_rule(TName, CName, Handle)], case nft_exec(Cmds) of ok -> ok; {error, Error} -> -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40446?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: Id6db327b445b8597d39a1d838077e7002d538db5 Gerrit-Change-Number: 40446 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in ...osmo-s1gw[master]: enft_kpi: enb_set_addr/1: restrict ULDL values
by fixeria 21 Jul '25

21 Jul '25
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40531?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: enft_kpi: enb_set_addr/1: restrict ULDL values ...................................................................... enft_kpi: enb_set_addr/1: restrict ULDL values Change-Id: I4e6bc5b392db334f5c79f30076e5e864af1db27d Related: SYS#7307 --- M src/enft_kpi.erl 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: laforge: Looks good to me, approved pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/src/enft_kpi.erl b/src/enft_kpi.erl index 9086298..cc2107a 100644 --- a/src/enft_kpi.erl +++ b/src/enft_kpi.erl @@ -119,8 +119,11 @@ -spec enb_set_addr(ULDLAddr) -> ok when ULDLAddr :: uldl_addr(). -enb_set_addr(ULDLAddr) -> - gen_server:cast(?MODULE, {?FUNCTION_NAME, self(), ULDLAddr}). +enb_set_addr({ul, Addr}) -> + gen_server:cast(?MODULE, {?FUNCTION_NAME, self(), {ul, Addr}}); + +enb_set_addr({dl, Addr}) -> + gen_server:cast(?MODULE, {?FUNCTION_NAME, self(), {dl, Addr}}). -spec enb_unregister() -> ok | {error, term()}. -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40531?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: I4e6bc5b392db334f5c79f30076e5e864af1db27d Gerrit-Change-Number: 40531 Gerrit-PatchSet: 3 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in ...osmo-s1gw[master]: enft_kpi: use command/expression templates from enftables
by fixeria 21 Jul '25

21 Jul '25
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40439?usp=email ) ( 5 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: enft_kpi: use command/expression templates from enftables ...................................................................... enft_kpi: use command/expression templates from enftables Change-Id: I421ba5ccc8956586136466d5eb50d6ace69eeb67 Related: SYS#7307 --- M src/enft_kpi.erl 1 file changed, 22 insertions(+), 116 deletions(-) Approvals: pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/enft_kpi.erl b/src/enft_kpi.erl index 901842b..e251a3b 100644 --- a/src/enft_kpi.erl +++ b/src/enft_kpi.erl @@ -147,15 +147,17 @@ TName = maps:get(table_name, Cfg, "osmo-s1gw"), Interval = maps:get(interval, Cfg, 3000), %% ignore (accept) anything but GTPU @ udp/2152 - R1 = [nft_expr_match_ip_proto("udp", ?OP_NEQ), nft_expr_accept()], - R2 = [nft_expr_match_udp_dport(?GTPU_PORT, ?OP_NEQ), nft_expr_accept()], - Cmds = [nft_cmd_add_table(TName), + R1 = [enftables:nft_expr_match_ip_proto("udp", ?OP_NEQ), + enftables:nft_expr_accept()], + R2 = [enftables:nft_expr_match_udp_dport(?GTPU_PORT, ?OP_NEQ), + enftables:nft_expr_accept()], + Cmds = [enftables:nft_cmd_add_table(TName, [<< "owner" >>]), nft_cmd_add_chain(TName, "gtpu-ul", "prerouting"), nft_cmd_add_chain(TName, "gtpu-dl", "postrouting"), - nft_cmd_add_rule(TName, "gtpu-ul", R1), - nft_cmd_add_rule(TName, "gtpu-dl", R1), - nft_cmd_add_rule(TName, "gtpu-ul", R2), - nft_cmd_add_rule(TName, "gtpu-dl", R2) + enftables:nft_cmd_add_rule(TName, "gtpu-ul", R1), + enftables:nft_cmd_add_rule(TName, "gtpu-dl", R1), + enftables:nft_cmd_add_rule(TName, "gtpu-ul", R2), + enftables:nft_cmd_add_rule(TName, "gtpu-dl", R2) ], case nft_exec(Cmds) of ok -> @@ -221,7 +223,7 @@ handle_call(fetch_counters, _From, #state{cfg = #{table_name := TName}} = S) -> ?LOG_DEBUG("Fetching NFT counters"), - Cmds = [nft_cmd_list_counters(TName)], + Cmds = [enftables:nft_cmd_list_counters(TName)], case nft_exec(Cmds) of {ok, Res} -> Ctrs = parse_nft_counters(Res), @@ -272,7 +274,7 @@ #state{cfg = #{table_name := TName}, registry = R0} = S) -> ?LOG_DEBUG("Fetching and reporting NFT counters"), - Cmds = [nft_cmd_list_counters(TName)], + Cmds = [enftables:nft_cmd_list_counters(TName)], case nft_exec(Cmds) of {ok, Res} -> Ctrs = parse_nft_counters(Res), @@ -312,7 +314,7 @@ ?LOG_NOTICE("Terminating, reason ~p", [Reason]), case Cfg of #{enable := true, table_name := TName} -> - nft_exec([nft_cmd_del_table(TName)]), %% delete the table + nft_exec([enftables:nft_cmd_del_table(TName)]), %% delete the table ok; _ -> ok %% stub mode end. @@ -377,10 +379,11 @@ #{table_name := TName}) -> CtrName = enb_nft_counter_name(ULDL, GlobalENBId), CName = enb_nft_chain_name(ULDL), + Counter = enftables:nft_counter(TName, CtrName), Rule = [nft_expr_match_ip_addr({ULDL, Addr}), - nft_expr_counter(CtrName)], - Cmds = [nft_cmd_add_counter(TName, CtrName), - nft_cmd_add_rule(TName, CName, Rule) + enftables:nft_expr_counter(CtrName)], + Cmds = [enftables:nft_cmd_add_counter(Counter), + enftables:nft_cmd_add_rule(TName, CName, Rule) ], case nft_exec(Cmds) of ok -> @@ -419,8 +422,9 @@ [Pid, GlobalENBId, ULDL]), CtrName = enb_nft_counter_name(ULDL, GlobalENBId), CName = enb_nft_chain_name(ULDL), - Cmds = [nft_cmd_del_rule(TName, CName, Handle), - nft_cmd_del_counter(TName, CtrName) + Counter = enftables:nft_counter(TName, CtrName), + Cmds = [enftables:nft_cmd_del_rule(TName, CName, Handle), + enftables:nft_cmd_del_counter(Counter) ], case nft_exec(Cmds) of ok -> ok; @@ -525,7 +529,7 @@ nft_chain_last_handle(TName, CName) -> - Cmds = [nft_cmd_list_chain(TName, CName)], + Cmds = [enftables:nft_cmd_list_chain(TName, CName)], case nft_exec(Cmds) of {ok, Res} -> #{<< "rule" >> := Rule} = lists:last(Res), @@ -536,21 +540,6 @@ end. -nft_cmd_add_table(TName) -> - T = #{family => << "inet" >>, - name => list_to_binary(TName), - flags => [<< "owner" >>] - }, - #{add => #{table => T}}. - - -nft_cmd_del_table(TName) -> - T = #{family => << "inet" >>, - name => list_to_binary(TName) - }, - #{delete => #{table => T}}. - - nft_cmd_add_chain(TName, CName, Hook) -> C = #{family => << "inet" >>, table => list_to_binary(TName), @@ -563,95 +552,12 @@ #{add => #{chain => C}}. -nft_cmd_add_rule(TName, CName, Expr) -> - R = #{family => << "inet" >>, - table => list_to_binary(TName), - chain => list_to_binary(CName), - expr => Expr - }, - #{add => #{rule => R}}. - - -nft_cmd_del_rule(TName, CName, Handle) -> - R = #{family => << "inet" >>, - table => list_to_binary(TName), - chain => list_to_binary(CName), - handle => Handle - }, - #{delete => #{rule => R}}. - - -nft_counter(TName, Name) -> - #{family => << "inet" >>, - table => list_to_binary(TName), - name => list_to_binary(Name) - }. - -nft_cmd_add_counter(TName, Name) -> - #{add => #{counter => nft_counter(TName, Name)}}. - -nft_cmd_del_counter(TName, Name) -> - #{delete => #{counter => nft_counter(TName, Name)}}. - - --spec nft_expr_match_payload({Proto, Field}, Value, Op) -> map() - when Proto :: string(), - Field :: string(), - Value :: term(), - Op :: string(). -nft_expr_match_payload({Proto, Field}, Value, Op) -> - Left = #{payload => #{protocol => list_to_binary(Proto), - field => list_to_binary(Field)}}, - #{match => #{left => Left, - right => Value, - op => list_to_binary(Op)}}. - - -nft_expr_match_ip_proto(Proto, Op) -> - nft_expr_match_payload({"ip", "protocol"}, - list_to_binary(Proto), Op). - -nft_expr_match_ip_saddr(Addr, Op) -> - nft_expr_match_payload({"ip", "saddr"}, - list_to_binary(Addr), Op). - -nft_expr_match_ip_daddr(Addr, Op) -> - nft_expr_match_payload({"ip", "daddr"}, - list_to_binary(Addr), Op). - -nft_expr_match_udp_dport(Port, Op) -> - nft_expr_match_payload({"udp", "dport"}, Port, Op). - - -spec nft_expr_match_ip_addr(uldl_addr()) -> map(). nft_expr_match_ip_addr({ul, Addr}) -> - nft_expr_match_ip_saddr(Addr, ?OP_EQ); + enftables:nft_expr_match_ip_saddr(Addr, ?OP_EQ); nft_expr_match_ip_addr({dl, Addr}) -> - nft_expr_match_ip_daddr(Addr, ?OP_EQ). - - -nft_expr_accept() -> - #{accept => null}. - - -nft_expr_counter(Name) -> - #{counter => list_to_binary(Name)}. - - -nft_cmd_list_chain(TName, CName) -> - C = #{family => << "inet" >>, - table => list_to_binary(TName), - name => list_to_binary(CName) - }, - #{list => #{chain => C}}. - - -nft_cmd_list_counters(TName) -> - T = #{family => << "inet" >>, - name => list_to_binary(TName) - }, - #{list => #{counters => #{table => T}}}. + enftables:nft_expr_match_ip_daddr(Addr, ?OP_EQ). -spec heartbeat(timeout()) -> no_return(). -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40439?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: I421ba5ccc8956586136466d5eb50d6ace69eeb67 Gerrit-Change-Number: 40439 Gerrit-PatchSet: 6 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • ...
  • 150
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.