pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/40161?usp=email )
Change subject: cosmetic: Improve ranap_msg passing ownership documentation
......................................................................
cosmetic: Improve ranap_msg passing ownership documentation
In general ranap_msg is made owned by OTC_SELECT, and under RAB
Assignment where PFCP or MGCP is involved the msg ownership is
temporarily stolen to the related FSM instance.
Change-Id: I556e01b26a71b43432c623adb7ea5af2114981e3
---
M include/osmocom/hnbgw/context_map.h
M src/osmo-hnbgw/hnbgw_cn.c
M src/osmo-hnbgw/hnbgw_ranap.c
3 files changed, 18 insertions(+), 11 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/61/40161/1
diff --git a/include/osmocom/hnbgw/context_map.h b/include/osmocom/hnbgw/context_map.h
index f9bd251..41b312d 100644
--- a/include/osmocom/hnbgw/context_map.h
+++ b/include/osmocom/hnbgw/context_map.h
@@ -29,13 +29,17 @@
* - The RANAP message shall be at msgb_l2().
*/
enum map_rua_fsm_event {
- /* Receiving a RUA Connect from HNB. */
+ /* Receiving a RUA Connect from HNB.
+ * Parameter: struct msgb *ranap_msg */
MAP_RUA_EV_RX_CONNECT,
- /* Receiving some data from HNB via RUA, to forward via SCCP to CN. */
+ /* Receiving some data from HNB via RUA, to forward via SCCP to CN.
+ * Parameter: struct msgb *ranap_msg */
MAP_RUA_EV_RX_DIRECT_TRANSFER,
- /* Receiving a RUA Disconnect from HNB. */
+ /* Receiving a RUA Disconnect from HNB.
+ * Parameter: struct msgb *ranap_msg (can be NULL) */
MAP_RUA_EV_RX_DISCONNECT,
- /* SCCP has received some data from CN to forward via RUA to HNB. */
+ /* SCCP has received some data from CN to forward via RUA to HNB.
+ * Parameter: struct msgb *ranap_msg */
MAP_RUA_EV_TX_DIRECT_TRANSFER,
/* The CN side is disconnected (e.g. received an SCCP Released), that means we are going gracefully disconnect
* RUA, too. */
@@ -52,9 +56,11 @@
enum map_sccp_fsm_event {
/* Receiving an SCCP CC from CN. */
MAP_SCCP_EV_RX_CONNECTION_CONFIRM,
- /* Receiving some data from CN via SCCP, to forward via RUA to HNB. */
+ /* Receiving some data from CN via SCCP, to forward via RUA to HNB.
+ * Parameter: struct msgb *ranap_msg */
MAP_SCCP_EV_RX_DATA_INDICATION,
- /* RUA has received some data from HNB to forward via SCCP to CN. */
+ /* RUA has received some data from HNB to forward via SCCP to CN.
+ * Parameter: struct msgb *ranap_msg */
MAP_SCCP_EV_TX_DATA_REQUEST,
/* 3GPP TS 25.468 9.1.5: The RAN side received a RUA Disconnect.
* - Under normal conditions (cause=Normal) the RUA Disconnect contains a RANAP Iu-ReleaseComplete.
diff --git a/src/osmo-hnbgw/hnbgw_cn.c b/src/osmo-hnbgw/hnbgw_cn.c
index 3659b36..686a0e5 100644
--- a/src/osmo-hnbgw/hnbgw_cn.c
+++ b/src/osmo-hnbgw/hnbgw_cn.c
@@ -258,7 +258,8 @@
}
}
-/* Entry point for primitives coming up from SCCP User SAP */
+/* Entry point for primitives coming up from SCCP User SAP.
+ * Ownership of oph->msg is transferred to us. */
static int sccp_sap_up(struct osmo_prim_hdr *oph, void *ctx)
{
struct osmo_sccp_user *scu = ctx;
diff --git a/src/osmo-hnbgw/hnbgw_ranap.c b/src/osmo-hnbgw/hnbgw_ranap.c
index 692cf11..6dc1f06 100644
--- a/src/osmo-hnbgw/hnbgw_ranap.c
+++ b/src/osmo-hnbgw/hnbgw_ranap.c
@@ -252,7 +252,7 @@
}
/* Process a received RANAP PDU through SCCP DATA.ind coming from CN (MSC/SGSN)
- * Takes ownership of ranap_msg? */
+ * ranap_msg is owned by OTC_SELECT. */
int hnbgw_ranap_rx_data_ul(struct hnbgw_context_map *map, struct msgb *ranap_msg)
{
OSMO_ASSERT(map);
@@ -270,7 +270,7 @@
* 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 */
+ /* mgw_fsm_handle_rab_ass_resp() may take ownership of "ranap_msg" (prim->oph) and "message" */
return mgw_fsm_handle_cs_rab_ass_resp(map, ranap_msg, message);
}
} else {
@@ -279,7 +279,7 @@
/* 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 */
+ /* ps_rab_ass_fsm() may take ownership of "ranap_msg" (prim->oph) and "message" */
return hnbgw_gtpmap_rx_rab_ass_resp(map, ranap_msg, message);
}
}
@@ -617,7 +617,7 @@
}
/* Process a received RANAP PDU through SCCP DATA.ind coming from CN (MSC/SGSN)
- * Takes ownership of ranap_msg? */
+ * ranap_msg is owned by OTC_SELECT. */
int hnbgw_ranap_rx_data_dl(struct hnbgw_context_map *map, struct msgb *ranap_msg)
{
OSMO_ASSERT(map);
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/40161?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I556e01b26a71b43432c623adb7ea5af2114981e3
Gerrit-Change-Number: 40161
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/40158?usp=email )
Change subject: ranap: No need to set destructor function twice
......................................................................
ranap: No need to set destructor function twice
talloc destructor function is already being set in
hnbgw_decode_ranap_ran_co(), no need to do it twice. This is a leftover
from recent refactoring.
Fixes: 79c5600bb65e5e940dddfd4b3be50259caa1bd34
Change-Id: I9caaff3bd6435cde51006cd14837f3824c77c68b
---
M src/osmo-hnbgw/hnbgw_ranap.c
1 file changed, 0 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/58/40158/1
diff --git a/src/osmo-hnbgw/hnbgw_ranap.c b/src/osmo-hnbgw/hnbgw_ranap.c
index f97f53f..692cf11 100644
--- a/src/osmo-hnbgw/hnbgw_ranap.c
+++ b/src/osmo-hnbgw/hnbgw_ranap.c
@@ -627,8 +627,6 @@
* information, for RTP mapping via MGW, or GTP mapping via UPF. */
ranap_message *message = hnbgw_decode_ranap_ran_co(ranap_msg);
if (message) {
- talloc_set_destructor(message, destruct_ranap_ran_rx_co_ies);
-
LOG_MAP(map, DCN, LOGL_DEBUG, "rx from SCCP: RANAP %s\n",
get_value_string(ranap_procedure_code_vals, message->procedureCode));
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/40158?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I9caaff3bd6435cde51006cd14837f3824c77c68b
Gerrit-Change-Number: 40158
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40157?usp=email )
Change subject: cosmetic: osmo_sccp_user_bind() clarify prim_cb msgb ownership in documentation
......................................................................
cosmetic: osmo_sccp_user_bind() clarify prim_cb msgb ownership in documentation
Change-Id: I6dcda9221aa77809fe0f10e0e159558aad07885c
---
M src/sccp_user.c
1 file changed, 22 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/57/40157/1
diff --git a/src/sccp_user.c b/src/sccp_user.c
index b869dab..62ae9ed 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -92,9 +92,14 @@
/*! \brief Bind a SCCP User to a given Point Code
* \param[in] inst SCCP Instance
* \param[in] name human-readable name
+ * \param[in] prim_cb User provided callback to pass a primitive/msg up the stack
* \param[in] ssn Sub-System Number to bind to
* \param[in] pc Point Code to bind to, or OSMO_SS7_PC_INVALID if none.
- * \returns Callee-allocated SCCP User on success; negative otherwise */
+ * \returns Callee-allocated SCCP User on success; negative otherwise
+ *
+ * Ownership of oph->msg in prim_cb is transferred to the user of the
+ * registered callback when called.
+ */
static struct osmo_sccp_user *
sccp_user_bind_pc(struct osmo_sccp_instance *inst, const char *name,
osmo_prim_cb prim_cb, uint16_t ssn, uint32_t pc)
@@ -127,9 +132,14 @@
/*! \brief Bind a given SCCP User to a given SSN+PC
* \param[in] inst SCCP Instance
* \param[in] name human-readable name
+ * \param[in] prim_cb User provided callback to pass a primitive/msg up the stack
* \param[in] ssn Sub-System Number to bind to
* \param[in] pc Point Code to bind to
- * \returns Callee-allocated SCCP User on success; negative otherwise */
+ * \returns Callee-allocated SCCP User on success; negative otherwise
+ *
+ * Ownership of oph->msg in prim_cb is transferred to the user of the
+ * registered callback when called.
+ */
struct osmo_sccp_user *
osmo_sccp_user_bind_pc(struct osmo_sccp_instance *inst, const char *name,
osmo_prim_cb prim_cb, uint16_t ssn, uint32_t pc)
@@ -140,8 +150,13 @@
/*! \brief Bind a given SCCP User to a given SSN (at any PC)
* \param[in] inst SCCP Instance
* \param[in] name human-readable name
+ * \param[in] prim_cb User provided callback to pass a primitive/msg up the stack
* \param[in] ssn Sub-System Number to bind to
- * \returns Callee-allocated SCCP User on success; negative otherwise */
+ * \returns Callee-allocated SCCP User on success; negative otherwise
+ *
+ * Ownership of oph->msg in prim_cb is transferred to the user of the
+ * registered callback when called.
+ */
struct osmo_sccp_user *
osmo_sccp_user_bind(struct osmo_sccp_instance *inst, const char *name,
osmo_prim_cb prim_cb, uint16_t ssn)
@@ -175,7 +190,10 @@
/*! \brief Send a SCCP User SAP Primitive up to the User
* \param[in] scu SCCP User to whom to send the primitive
* \param[in] prim Primitive to send to the user
- * \returns return value of the SCCP User's prim_cb() function */
+ * \returns return value of the SCCP User's prim_cb() function
+ *
+ * Ownership of prim->oph->msg is passed to the user of the registered callback
+ */
int sccp_user_prim_up(struct osmo_sccp_user *scu, struct osmo_scu_prim *prim)
{
LOGP(DLSCCP, LOGL_DEBUG, "Delivering %s to SCCP User '%s'\n",
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40157?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I6dcda9221aa77809fe0f10e0e159558aad07885c
Gerrit-Change-Number: 40157
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
fixeria has posted comments on this change by fixeria. ( https://gerrit.osmocom.org/c/osmo-bts/+/40156?usp=email )
Change subject: osmo-bts-trx: trx_fn_timer_cb(): fix misleading shutdown reason
......................................................................
Patch Set 3:
(2 comments)
File src/osmo-bts-trx/scheduler_trx.c:
https://gerrit.osmocom.org/c/osmo-bts/+/40156/comment/c20767e1_e97d25c4?usp… :
PS2, Line 414: const char *reason;
> better NULL it here to avoid some mess in the future if someone changes some code path.
Acknowledged
https://gerrit.osmocom.org/c/osmo-bts/+/40156/comment/3e6d76a4_88c30004?usp… :
PS2, Line 454: reason = "PC clock skew";
> I'd rather change this to something like "PC clock skew too high". […]
Acknowledged
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/40156?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ibbbbc4e919e6eb812882fc60de4be13fa77934b7
Gerrit-Change-Number: 40156
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 25 Apr 2025 14:53:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bts/+/40156?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: osmo-bts-trx: trx_fn_timer_cb(): fix misleading shutdown reason
......................................................................
osmo-bts-trx: trx_fn_timer_cb(): fix misleading shutdown reason
If osmo-bts-trx exit()s due to the PC clock issues, e.g. if the
process stalls, it produces rather confusing logging messages:
DL1C ERROR PC clock skew: elapsed_us=387574, error_us=382959
DOML NOTICE ... Shutting down BTS, exit 1, reason: No clock from osmo-trx
The second message suggests that the transceiver (osmo-trx) is the
culprit, but the first one reflects the actual reason (PC clock skew).
Let's pass proper shutdown reason to avoid confusion.
Change-Id: Ibbbbc4e919e6eb812882fc60de4be13fa77934b7
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 11 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/40156/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/40156?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ibbbbc4e919e6eb812882fc60de4be13fa77934b7
Gerrit-Change-Number: 40156
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>