Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889?usp=email )
Change subject: add hnb_persistent hashtable: optimize lookup by cell id
......................................................................
Patch Set 1:
(1 comment)
File src/osmo-hnbgw/hnbgw.c:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-16221):
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889/comment/4d78fe92_f4995f57
PS1, Line 589: hash_for_each_possible(g_hnbgw->hnb_persistent_by_id, hnbp, node_by_id, id_hash) {
space required before the open parenthesis '('
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36889?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Iecb81eba28263ecf90a09c108995f6fb6f5f81f2
Gerrit-Change-Number: 36889
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Tue, 21 May 2024 16:28:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: laforge, neels, pespin.
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email )
Change subject: per-HNB GTP-U traffic counters via nft
......................................................................
Patch Set 4:
(6 comments)
File src/osmo-hnbgw/hnbgw.c:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-16220):
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539/comment/27cb50fa_a1c2d0c6
PS4, Line 585: if (getpeername(fd, &osa.u.sa, &socklen)){
space required before the open brace '{'
File src/osmo-hnbgw/nft_kpi.c:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-16220):
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539/comment/cfffabca_cb61ff3e
PS4, Line 193: static const char *nft_thread_req_type_name[] = {
static const char * array should probably be static const char * const
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-16220):
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539/comment/f95be9ba_bdf88f8b
PS4, Line 620: while (1) {
braces {} are not necessary for single statement blocks
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-16220):
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539/comment/d0cc942e_62412f17
PS4, Line 652: if (period_us < 1)
suspect code indent for conditional statements (7, 15)
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-16220):
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539/comment/cfff3b06_24b62f7b
PS4, Line 653: period_us = 1;
code indent should use tabs where possible
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-16220):
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539/comment/4075a7e7_9e0e6e81
PS4, Line 653: period_us = 1;
please, no spaces at the start of a line
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ib2f0a9252715ea4b2fe9c367aa65f771357768ca
Gerrit-Change-Number: 36539
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 21 May 2024 16:25:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: laforge, neels, pespin.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Code-Review+1 by pespin, Verified+1 by Jenkins Builder
Change subject: per-HNB GTP-U traffic counters via nft
......................................................................
per-HNB GTP-U traffic counters via nft
Add optional feature: retrieve GTP-U traffic counters per hNodeB (not
per individual subscriber!) using nftables, to provide new rate_ctr
stats.
This is a "workaround" to get performance indicators per hNodeB, without
needing a UPF that supports URR.
When an hNodeB registers, set up nftables rules to count GTP-U packets
(UDP port 2152) to and from that hNodeB's address -- we are assuming
that it is the same address that Iuh is connecting from.
From the per-hNodeB packet and byte counters from nftables, also derive
a "UE bytes" counter, which is counting only the GTP-U payload. Assume
IP header of 20 bytes; UDP and GTP-U headers are 8 bytes each:
ue_bytes = total_bytes - packets * (20 + 8 + 8)
Query these periodically, as configurable by new timer X34. Default is
one second of wait time between querying counters (excluding the time it
takes to retrieve and update the counters).
Add compile-time switch --enable-nftables, to build with/without
external dependency libnftables. Default is without, as before.
Add jenkins axis NFTABLES to switch --enable-nftables.
Add cfg file option 'hnbgw' / 'nft-kpi' to enable use of nftables.
This requires osmo-hnbgw to be run with cap_net_admin.
The VTY config commands are always visible -- simplifies VTY testing.
Refuse to start osmo-hnbgw when the user is requesting nft-kpi in the
config but when built without --enable-nftables.
Do nft commands in 2 separate threads. Run the same request queue
implementation twice, with two thread workers to handle them:
- one thread receives all requests to init the nft table, add and remove
hNodeB counters, and start and stop counting for a specific hNodeB.
- Another thread handles all retrieval and parsing of counters from nft.
The main() thread hence never blocks for nftables commands, and services
the responses from nft when they are ready, via an osmo_it_q registered
in the main() select loop.
Persistently keep an nftables named counter for each seen hNodeB cell id
in the nftables ruleset, for the lifetime of a hnb_persistent instance
that holds the target rate_ctrs.
Add the rules to feed into these persistent counters to the ruleset when
the particular cell attaches and detaches via HNBAP HNB (De-)Register.
On hnb_persistent_free(), remove all items relating to this cell id from
nftables, including the persistent named counters.
Loosely related: upcoming patches will implement
- a hashtable for faster cell id lookup (important for updating
counters)
Iecb81eba28263ecf90a09c108995f6fb6f5f81f2
- proper MNC-3-digit support in cell ids (better have a 100% correct
primary key).
Id9a91c80cd2745424a916aef4736993bb7cd8ba0
- idle timeout for disconnected hnbp, so we are sure stale state does
not build up for eternity.
Ic819d7cbc03fb39e98c204b70d016c5170dc6307
Related: SYS#6773
Related: OS#6425
Change-Id: Ib2f0a9252715ea4b2fe9c367aa65f771357768ca
---
M configure.ac
M contrib/jenkins.sh
M debian/control
M debian/rules
M include/osmocom/hnbgw/Makefile.am
M include/osmocom/hnbgw/hnbgw.h
A include/osmocom/hnbgw/nft_kpi.h
M src/osmo-hnbgw/Makefile.am
M src/osmo-hnbgw/hnbgw.c
M src/osmo-hnbgw/hnbgw_hnbap.c
M src/osmo-hnbgw/hnbgw_vty.c
A src/osmo-hnbgw/nft_kpi.c
M src/osmo-hnbgw/osmo_hnbgw_main.c
M src/osmo-hnbgw/tdefs.c
M tests/osmo-hnbgw.vty
15 files changed, 1,299 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/39/36539/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36539?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ib2f0a9252715ea4b2fe9c367aa65f771357768ca
Gerrit-Change-Number: 36539
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36887?usp=email )
Change subject: fixup: compilation error: unused var in map_rua_init_action()
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36887?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I871bc43f6f47d4b78fbf88826615f2dbb8e1f807
Gerrit-Change-Number: 36887
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 21 May 2024 16:16:51 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36888?usp=email )
Change subject: change back dispatch ordering in map_rua_init_action()
......................................................................
change back dispatch ordering in map_rua_init_action()
Before patch I3e1ad7a2aa71674a22a27c31512600f2de139032,
the order was:
case MAP_RUA_EV_RX_CONNECT:
state-chg --> map_rua_fsm_state_chg(MAP_RUA_ST_CONNECTED);
dispatch --> map_sccp_dispatch(map, MAP_SCCP_EV_TX_DATA_REQUEST, ranap_msg);
return;
From that patch on, the order is:
case MAP_RUA_EV_RX_CONNECT:
dispatch --> handle_rx_rua(fi, ranap_msg);
state-chg --> map_rua_fsm_state_chg(MAP_RUA_ST_CONNECTED);
return;
The ordering of event dispatching and state changing is a delicate matter,
because event dispatching might result in an fsm deallocation, especially on
corner case errors. Attempting to modify the state after that may crash.
TODO: insert actual proven reason for this patch here.
TODO: explain why the same ordering one 'case' below is not a problem.
Change-Id: Ie277c46d153bc12dc28a914c241392cdf5ec0aa4
---
M src/osmo-hnbgw/context_map_rua.c
1 file changed, 33 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/88/36888/1
diff --git a/src/osmo-hnbgw/context_map_rua.c b/src/osmo-hnbgw/context_map_rua.c
index 3c6ea1e..67d50d0 100644
--- a/src/osmo-hnbgw/context_map_rua.c
+++ b/src/osmo-hnbgw/context_map_rua.c
@@ -219,9 +219,9 @@
switch (event) {
case MAP_RUA_EV_RX_CONNECT:
+ map_rua_fsm_state_chg(MAP_RUA_ST_CONNECTED);
/* not needed for RAB assignment scanning, but for KPI scanning */
handle_rx_rua(fi, ranap_msg);
- map_rua_fsm_state_chg(MAP_RUA_ST_CONNECTED);
return;
case MAP_RUA_EV_RX_DISCONNECT:
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36888?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ie277c46d153bc12dc28a914c241392cdf5ec0aa4
Gerrit-Change-Number: 36888
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange