pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39675?usp=email )
Change subject: as: Introduce internal ss7_as_add_asp() to avoid unnecessary asp lookup
......................................................................
as: Introduce internal ss7_as_add_asp() to avoid unnecessary asp lookup
Change-Id: Id75fde04e39747fd3a7a1b169f7b925e5a8064d9
---
M src/osmo_ss7_as.c
M src/sccp_user.c
M src/ss7_as.h
M src/xua_asp_fsm.c
M src/xua_rkm.c
5 files changed, 26 insertions(+), 14 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/75/39675/1
diff --git a/src/osmo_ss7_as.c b/src/osmo_ss7_as.c
index ab48ca8..6aadb8f 100644
--- a/src/osmo_ss7_as.c
+++ b/src/osmo_ss7_as.c
@@ -110,21 +110,16 @@
* \param[in] as Application Server to which \ref asp is added
* \param[in] asp Application Server Process to be added to \ref as
* \returns 0 on success; negative in case of error */
-int osmo_ss7_as_add_asp(struct osmo_ss7_as *as, const char *asp_name)
+int ss7_as_add_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp)
{
- struct osmo_ss7_asp *asp;
unsigned int i;
-
- OSMO_ASSERT(ss7_initialized);
- asp = osmo_ss7_asp_find_by_name(as->inst, asp_name);
- if (!asp)
- return -ENODEV;
-
- LOGPAS(as, DLSS7, LOGL_INFO, "Adding ASP %s to AS\n", asp->cfg.name);
+ OSMO_ASSERT(asp);
if (osmo_ss7_as_has_asp(as, asp))
return 0;
+ LOGPAS(as, DLSS7, LOGL_INFO, "Adding ASP %s to AS\n", asp->cfg.name);
+
for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) {
if (!as->cfg.asps[i]) {
as->cfg.asps[i] = asp;
@@ -137,6 +132,22 @@
return -ENOSPC;
}
+/*! \brief Add given ASP to given AS
+ * \param[in] as Application Server to which \ref asp is added
+ * \param[in] asp_name Name of Application Server Process to be added to \ref as
+ * \returns 0 on success; negative in case of error */
+int osmo_ss7_as_add_asp(struct osmo_ss7_as *as, const char *asp_name)
+{
+ struct osmo_ss7_asp *asp;
+
+ OSMO_ASSERT(ss7_initialized);
+ asp = osmo_ss7_asp_find_by_name(as->inst, asp_name);
+ if (!asp)
+ return -ENODEV;
+
+ return ss7_as_add_asp(as, asp);
+}
+
/*! \brief Delete given ASP from given AS
* \param[in] as Application Server from which \ref asp is deleted
* \param[in] asp Application Server Process to delete from \ref as
diff --git a/src/sccp_user.c b/src/sccp_user.c
index d60d66a..a32bbaa 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -633,7 +633,7 @@
asp = asp_i;
LOGP(DLSCCP, LOGL_NOTICE, "%s: ASP %s for %s is not associated with any AS, using it\n",
name, asp->cfg.name, osmo_ss7_asp_protocol_name(prot));
- osmo_ss7_as_add_asp(as, asp->cfg.name);
+ ss7_as_add_asp(as, asp);
break;
}
if (!asp) {
@@ -657,7 +657,7 @@
ss7_asp_peer_set_hosts(&asp->cfg.local, asp, &default_local_ip, 1);
if (default_remote_ip)
ss7_asp_peer_set_hosts(&asp->cfg.remote, asp, &default_remote_ip, 1);
- osmo_ss7_as_add_asp(as, asp->cfg.name);
+ ss7_as_add_asp(as, asp);
/* Make sure proper defaults are applied if app didn't
provide specific default values, then restart the ASP: */
ss7_asp_restart_after_reconfigure(asp);
@@ -866,7 +866,7 @@
goto out_asp;
asp->cfg.is_server = true;
asp->cfg.role = OSMO_SS7_ASP_ROLE_SG;
- osmo_ss7_as_add_asp(as, asp_name);
+ ss7_as_add_asp(as, asp);
talloc_free(asp_name);
talloc_free(as_name);
osmo_ss7_asp_restart(asp);
diff --git a/src/ss7_as.h b/src/ss7_as.h
index 4a7c50d..db7372c 100644
--- a/src/ss7_as.h
+++ b/src/ss7_as.h
@@ -68,6 +68,7 @@
};
unsigned int osmo_ss7_as_count_asp(const struct osmo_ss7_as *as);
+int ss7_as_add_asp(struct osmo_ss7_as *as, struct osmo_ss7_asp *asp);
#define LOGPAS(as, subsys, level, fmt, args ...) \
_LOGSS7((as)->inst, subsys, level, "AS(%s) " fmt, (as)->cfg.name, ## args)
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index 0e39b0d..9ad9dce 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -958,7 +958,7 @@
iafp->ipa_unit->unit_name);
goto out_err;
}
- osmo_ss7_as_add_asp(as, asp->cfg.name);
+ ss7_as_add_asp(as, asp);
/* TODO: OAP Authentication? */
/* Send ID_ACK */
if (fd >= 0) {
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index 9e77095..98f41c5 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -297,7 +297,7 @@
}
/* Success: Add just-create AS to connected ASP + report success */
- osmo_ss7_as_add_asp(as, asp->cfg.name);
+ ss7_as_add_asp(as, asp);
msgb_append_reg_res(resp, rk_id, M3UA_RKM_REG_SUCCESS, rctx);
/* append to list of newly assigned as */
newly_assigned_as[(*nas_idx)++] = as;
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39675?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: Id75fde04e39747fd3a7a1b169f7b925e5a8064d9
Gerrit-Change-Number: 39675
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39676?usp=email )
Change subject: sccp_user: Fix ASP not restarted after associating a new AS to it
......................................................................
sccp_user: Fix ASP not restarted after associating a new AS to it
Recent commit introduced a regression when applying
default_layer_manager to all ASPs in m3ua-mode ASP.
The call to osmo_ss7_asp_restart() was moved to an inner code path but
I failed to figure out the ASP restart is also needed in this code path.
Fixes: ce63d3b2027cefb8412179497100d14ed3fee0dd
Change-Id: I5cccad3347dbea33433028e17571b1c16ecaf719
---
M src/sccp_user.c
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/76/39676/1
diff --git a/src/sccp_user.c b/src/sccp_user.c
index a32bbaa..b869dab 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -634,6 +634,11 @@
LOGP(DLSCCP, LOGL_NOTICE, "%s: ASP %s for %s is not associated with any AS, using it\n",
name, asp->cfg.name, osmo_ss7_asp_protocol_name(prot));
ss7_as_add_asp(as, asp);
+ /* ASP became associated to a new AS, hence it needs to be
+ * restarted to announce/register its Routing Context.
+ * Make sure proper defaults are applied if app didn't
+ * provide specific default values, then restart the ASP: */
+ ss7_asp_restart_after_reconfigure(asp);
break;
}
if (!asp) {
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39676?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: I5cccad3347dbea33433028e17571b1c16ecaf719
Gerrit-Change-Number: 39676
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: daniel, laforge, osmith.
Hello Jenkins Builder, laforge, osmith,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-sigtran/+/39406?usp=email
to look at the new patch set (#9).
The following approvals got outdated and were removed:
Code-Review+1 by laforge, Code-Review+1 by osmith, Verified+1 by Jenkins Builder
Change subject: AS loadsharing: Introduce AS rate_ctr rx:msu:sls:*
......................................................................
AS loadsharing: Introduce AS rate_ctr rx:msu:sls:*
Related: SYS#7112
Change-Id: I695bd3933a116323db45ab7f45dcf539791139aa
---
M src/ipa.c
M src/m3ua.c
M src/osmo_ss7_as.c
M src/ss7_as.h
M src/sua.c
5 files changed, 43 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/06/39406/9
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39406?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I695bd3933a116323db45ab7f45dcf539791139aa
Gerrit-Change-Number: 39406
Gerrit-PatchSet: 9
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Attention is currently required from: daniel.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39406?usp=email )
Change subject: AS loadsharing: Introduce AS rate_ctr rx:msu:sls:*
......................................................................
Patch Set 8:
(1 comment)
File src/m3ua.c:
https://gerrit.osmocom.org/c/libosmo-sigtran/+/39406/comment/e2a4c3bb_653f8… :
PS8, Line 620: rate_ctr_inc2(as->ctrg, SS7_AS_CTR_RX_MSU_SLS_0 + xua->mtp.sls);
> It should, but I agree it makes sense to add an ASSERT.
Done
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39406?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I695bd3933a116323db45ab7f45dcf539791139aa
Gerrit-Change-Number: 39406
Gerrit-PatchSet: 8
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 04 Mar 2025 16:39:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39674?usp=email )
Change subject: sccp_user: Move lookup to helper function to simplify code
......................................................................
sccp_user: Move lookup to helper function to simplify code
Keep lookup logic separate from already complex function with lots of
logic involved.
Change-Id: Ia2c8f9598e28be747bb3f1a61a1d8b0aa3d267b3
---
M src/sccp_user.c
1 file changed, 15 insertions(+), 10 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/74/39674/1
diff --git a/src/sccp_user.c b/src/sccp_user.c
index cada057..d60d66a 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -491,6 +491,18 @@
* Convenience function for CLIENT
***********************************************************************/
+ /* Returns whether AS is already associated to any AS.
+ * Helper function for osmo_sccp_simple_client_on_ss7_id(). */
+static bool asp_serves_some_as(const struct osmo_ss7_asp *asp)
+{
+ struct osmo_ss7_as *as_i;
+ llist_for_each_entry(as_i, &asp->inst->as_list, list) {
+ if (osmo_ss7_as_has_asp(as_i, asp))
+ return true;
+ }
+ return false;
+}
+
/*! \brief request an sccp client instance
* \param[in] ctx talloc context
* \param[in] ss7_id of the SS7/CS7 instance
@@ -610,18 +622,11 @@
/* Check if the user has created an ASP for this proto that is not added on any AS yet. */
struct osmo_ss7_asp *asp_i;
llist_for_each_entry(asp_i, &ss7->asp_list, list) {
- struct osmo_ss7_as *as_i;
- bool is_on_as = false;
if (asp_i->cfg.proto != prot)
continue;
- llist_for_each_entry(as_i, &ss7->as_list, list) {
- if (!osmo_ss7_as_has_asp(as_i, asp_i))
- continue;
- is_on_as = true;
- break;
- }
- if (is_on_as) {
- /* This ASP is already on another AS. If it was on this AS, we'd have found it above. */
+ if (asp_serves_some_as(asp_i)) {
+ /* This ASP is already on another AS.
+ * If it was on this AS, we'd have found it above. */
continue;
}
/* This ASP matches the protocol and is not yet associated to any AS. Use it. */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39674?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: Ia2c8f9598e28be747bb3f1a61a1d8b0aa3d267b3
Gerrit-Change-Number: 39674
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39671?usp=email )
Change subject: sccp_user: Fix dynamic ASP not associated to AS
......................................................................
sccp_user: Fix dynamic ASP not associated to AS
Recent commit introduced a regression when applying
default_layer_manager to all ASPs in m3ua-mode ASP.
The call to osmo_ss7_as_add_asp() was moved to an inner code path but
forgot to add it in another code path.
Fixes: ce63d3b2027cefb8412179497100d14ed3fee0dd
Change-Id: I16371ef813c2e12993caae16a1626d10ae8ded54
---
M src/sccp_user.c
1 file changed, 1 insertion(+), 0 deletions(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
daniel: Looks good to me, but someone else must approve
diff --git a/src/sccp_user.c b/src/sccp_user.c
index b5b6b4b..cada057 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -652,6 +652,7 @@
ss7_asp_peer_set_hosts(&asp->cfg.local, asp, &default_local_ip, 1);
if (default_remote_ip)
ss7_asp_peer_set_hosts(&asp->cfg.remote, asp, &default_remote_ip, 1);
+ osmo_ss7_as_add_asp(as, asp->cfg.name);
/* Make sure proper defaults are applied if app didn't
provide specific default values, then restart the ASP: */
ss7_asp_restart_after_reconfigure(asp);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39671?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I16371ef813c2e12993caae16a1626d10ae8ded54
Gerrit-Change-Number: 39671
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(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>
Attention is currently required from: daniel.
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39406?usp=email )
Change subject: AS loadsharing: Introduce AS rate_ctr rx:msu:sls:*
......................................................................
Patch Set 8:
(1 comment)
File src/m3ua.c:
https://gerrit.osmocom.org/c/libosmo-sigtran/+/39406/comment/86a8db1e_a01a9… :
PS8, Line 620: rate_ctr_inc2(as->ctrg, SS7_AS_CTR_RX_MSU_SLS_0 + xua->mtp.sls);
> Is xua->mtp.sls <= 0x0f already guaranteed here? Same in sua. […]
It should, but I agree it makes sense to add an ASSERT.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39406?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I695bd3933a116323db45ab7f45dcf539791139aa
Gerrit-Change-Number: 39406
Gerrit-PatchSet: 8
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 04 Mar 2025 16:14:38 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>
Attention is currently required from: laforge, pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39671?usp=email )
Change subject: sccp_user: Fix dynamic ASP not associated to AS
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39671?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I16371ef813c2e12993caae16a1626d10ae8ded54
Gerrit-Change-Number: 39671
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(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-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 04 Mar 2025 16:11:06 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes