laforge has submitted this change. (
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36312?usp=email )
Change subject: context_map_{rua,sccp}: Re-order to always process KPIs
......................................................................
context_map_{rua,sccp}: Re-order to always process KPIs
Prior to this patch we always decoded CS RANAP, but only decoded PS
RANAP in case PFCP support was enabled. This meant that PS KPIs
were only counted when PFCP was enabled, too.
Let's move to a mode where we unconditionally decode RANAP and always
call the KPI module for updating the rate counters.
Change-Id: I6054b6efcc202ebd71cd6e135e49c279ba616a01
---
M src/osmo-hnbgw/context_map_rua.c
M src/osmo-hnbgw/context_map_sccp.c
2 files changed, 45 insertions(+), 50 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/src/osmo-hnbgw/context_map_rua.c b/src/osmo-hnbgw/context_map_rua.c
index a943a64..f37ded8 100644
--- a/src/osmo-hnbgw/context_map_rua.c
+++ b/src/osmo-hnbgw/context_map_rua.c
@@ -161,39 +161,33 @@
if (!msg_has_l2_data(ranap_msg))
return 0;
- /* See if it is a RAB Assignment Response message from RUA to SCCP, where we need to
change the user plane
- * information, for RTP mapping via MGW, or GTP mapping via UPF. */
- if (!map->is_ps) {
- ranap_message *message = hnbgw_decode_ranap_co(ranap_msg);
- if (message) {
- LOGPFSML(fi, LOGL_DEBUG, "rx from RUA: RANAP %s\n",
- get_value_string(ranap_procedure_code_vals, message->procedureCode));
+ ranap_message *message = hnbgw_decode_ranap_co(ranap_msg);
+ if (message) {
+ LOGPFSML(fi, LOGL_DEBUG, "rx from RUA: RANAP %s\n",
+ get_value_string(ranap_procedure_code_vals, message->procedureCode));
- kpi_ranap_process_ul(map, message);
+ kpi_ranap_process_ul(map, message);
+ if (!map->is_ps) {
+ /* See if it is a RAB Assignment Response message from RUA to SCCP, where we need to
change the user plane
+ * information, for RTP mapping via MGW, or GTP mapping via UPF. */
switch (message->procedureCode) {
case RANAP_ProcedureCode_id_RAB_Assignment:
/* mgw_fsm_handle_rab_ass_resp() takes ownership of prim->oph and (ranap) message
*/
return mgw_fsm_handle_cs_rab_ass_resp(map, ranap_msg, message);
}
- }
+ } else {
#if ENABLE_PFCP
- } else if (hnb_gw_is_gtp_mapping_enabled()) {
- /* map->is_ps == true and PFCP is enabled in osmo-hnbgw.cfg */
- ranap_message *message = hnbgw_decode_ranap_co(ranap_msg);
- if (message) {
- LOGPFSML(fi, LOGL_DEBUG, "rx from RUA: RANAP %s\n",
- get_value_string(ranap_procedure_code_vals, message->procedureCode));
-
- kpi_ranap_process_ul(map, message);
-
- switch (message->procedureCode) {
- case RANAP_ProcedureCode_id_RAB_Assignment:
- /* ps_rab_ass_fsm takes ownership of prim->oph and RANAP message */
- return hnbgw_gtpmap_rx_rab_ass_resp(map, ranap_msg, message);
+ if (hnb_gw_is_gtp_mapping_enabled()) {
+ /* map->is_ps == true and PFCP is enabled in osmo-hnbgw.cfg */
+ switch (message->procedureCode) {
+ case RANAP_ProcedureCode_id_RAB_Assignment:
+ /* ps_rab_ass_fsm takes ownership of prim->oph and RANAP message */
+ return hnbgw_gtpmap_rx_rab_ass_resp(map, ranap_msg, message);
+ }
}
- }
#endif
+ }
}
/* It was not a RAB Assignment Response that needed to be intercepted. Forward as-is to
SCCP. */
diff --git a/src/osmo-hnbgw/context_map_sccp.c b/src/osmo-hnbgw/context_map_sccp.c
index e7e27b6..10ddaf2 100644
--- a/src/osmo-hnbgw/context_map_sccp.c
+++ b/src/osmo-hnbgw/context_map_sccp.c
@@ -204,19 +204,19 @@
/* See if it is a RAB Assignment Request message from SCCP to RUA, where we need to
change the user plane
* information, for RTP mapping via MGW, or GTP mapping via UPF. */
- if (!map->is_ps) {
- ranap_message *message;
- /* Circuit-Switched. Set up mapping of RTP ports via MGW */
- message = talloc_zero(OTC_SELECT, ranap_message);
- rc = ranap_ran_rx_co_decode(message, message, msgb_l2(ranap_msg),
msgb_l2len(ranap_msg));
+ ranap_message *message;
+ message = talloc_zero(OTC_SELECT, ranap_message);
+ rc = ranap_ran_rx_co_decode(message, message, msgb_l2(ranap_msg),
msgb_l2len(ranap_msg));
+ if (rc == 0) {
+ talloc_set_destructor(message, destruct_ranap_ran_rx_co_ies);
- if (rc == 0) {
- talloc_set_destructor(message, destruct_ranap_ran_rx_co_ies);
+ LOGPFSML(fi, LOGL_DEBUG, "rx from SCCP: RANAP %s\n",
+ get_value_string(ranap_procedure_code_vals, message->procedureCode));
- LOGPFSML(fi, LOGL_DEBUG, "rx from SCCP: RANAP %s\n",
- get_value_string(ranap_procedure_code_vals, message->procedureCode));
+ kpi_ranap_process_dl(map, message);
- kpi_ranap_process_dl(map, message);
+ if (!map->is_ps) {
+ /* Circuit-Switched. Set up mapping of RTP ports via MGW */
switch (message->procedureCode) {
case RANAP_ProcedureCode_id_RAB_Assignment:
@@ -228,24 +228,9 @@
mgw_fsm_release(map);
break;
}
- }
#if ENABLE_PFCP
- } else {
- ranap_message *message;
- /* Packet-Switched. Set up mapping of GTP ports via UPF */
- message = talloc_zero(OTC_SELECT, ranap_message);
- rc = ranap_ran_rx_co_decode(message, message, msgb_l2(ranap_msg),
msgb_l2len(ranap_msg));
-
- if (rc == 0) {
- talloc_set_destructor(message, destruct_ranap_ran_rx_co_ies);
-
- LOGPFSML(fi, LOGL_DEBUG, "rx from SCCP: RANAP %s\n",
- get_value_string(ranap_procedure_code_vals, message->procedureCode));
-
- kpi_ranap_process_dl(map, message);
-
+ } else {
switch (message->procedureCode) {
-
case RANAP_ProcedureCode_id_RAB_Assignment:
/* If a UPF is configured, handle the RAB Assignment via ps_rab_ass_fsm, and replace
the
* GTP F-TEIDs in the RAB Assignment message before passing it on to RUA. */
@@ -265,8 +250,8 @@
hnbgw_gtpmap_release(map);
break;
}
- }
#endif
+ }
}
/* It was not a RAB Assignment Request that needed to be intercepted. Forward as-is to
RUA. */
--
To view, visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36312?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: I6054b6efcc202ebd71cd6e135e49c279ba616a01
Gerrit-Change-Number: 36312
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
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-MessageType: merged