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

February 2025

  • 1 participants
  • 1182 discussions
[XS] Change in libosmo-sigtran[master]: asp: Add debug log when transmitting on ASP
by pespin 28 Feb '25

28 Feb '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39649?usp=email ) Change subject: asp: Add debug log when transmitting on ASP ...................................................................... asp: Add debug log when transmitting on ASP Change-Id: I8095ea02fdb063f9928035a20f257dd6bf0e6420 --- M src/osmo_ss7_asp.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/49/39649/1 diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c index e3a6843..4601dd7 100644 --- a/src/osmo_ss7_asp.c +++ b/src/osmo_ss7_asp.c @@ -1172,6 +1172,7 @@ } rate_ctr_inc2(asp->ctrg, SS7_ASP_CTR_PKT_TX_TOTAL); + LOGPASP(asp, DLSS7, LOGL_DEBUG, "Tx %d bytes: %s\n", msg->len, msgb_hexdump(msg)); if (asp->cfg.is_server) { if (!asp->server) { -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39649?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: I8095ea02fdb063f9928035a20f257dd6bf0e6420 Gerrit-Change-Number: 39649 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in libosmo-sigtran[master]: Improve format of logline prefix in LOGAS(P) macro
by pespin 28 Feb '25

28 Feb '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39648?usp=email ) Change subject: Improve format of logline prefix in LOGAS(P) macro ...................................................................... Improve format of logline prefix in LOGAS(P) macro Adding "as-" and "asp" is totally misleading, because it's usual that we name ASs "as-XYZ" and ASPs "asp-XYZ". Intead, better use a usual prefix formatting to indicate the context. Change-Id: Ib7b6652f2a96bf5c2a2233043755e0c639d41544 --- M src/ss7_as.h M src/ss7_asp.h 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/48/39648/1 diff --git a/src/ss7_as.h b/src/ss7_as.h index 9f4be25..4a7c50d 100644 --- a/src/ss7_as.h +++ b/src/ss7_as.h @@ -70,4 +70,4 @@ unsigned int osmo_ss7_as_count_asp(const struct osmo_ss7_as *as); #define LOGPAS(as, subsys, level, fmt, args ...) \ - _LOGSS7((as)->inst, subsys, level, "as-%s: " fmt, (as)->cfg.name, ## args) + _LOGSS7((as)->inst, subsys, level, "AS(%s) " fmt, (as)->cfg.name, ## args) diff --git a/src/ss7_asp.h b/src/ss7_asp.h index a05d870..483c5ea 100644 --- a/src/ss7_asp.h +++ b/src/ss7_asp.h @@ -114,4 +114,4 @@ void osmo_ss7_asp_remove_default_lm(struct osmo_ss7_asp *asp); #define LOGPASP(asp, subsys, level, fmt, args ...) \ - _LOGSS7((asp)->inst, subsys, level, "asp-%s: " fmt, (asp)->cfg.name, ## args) + _LOGSS7((asp)->inst, subsys, level, "ASP(%s) " fmt, (asp)->cfg.name, ## args) -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39648?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: Ib7b6652f2a96bf5c2a2233043755e0c639d41544 Gerrit-Change-Number: 39648 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in libosmo-sigtran[master]: ASP loadsharing: Pass xua_msg down to xua_as_transmit_msg
by pespin 28 Feb '25

28 Feb '25
Attention is currently required from: laforge, osmith, pespin. Hello Jenkins Builder, laforge, osmith, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39398?usp=email to look at the new patch set (#6). 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: ASP loadsharing: Pass xua_msg down to xua_as_transmit_msg ...................................................................... ASP loadsharing: Pass xua_msg down to xua_as_transmit_msg This finally allows having access to msg values such as OPC and SLS at the point in code where decision is taken to route the message to one ASP inside the AS. This will be needed to properly implemented ASP loadsharing within an AS. Related: SYS#7112 Change-Id: I70e5d33c7537dc0b72b5abced876e69018cc0829 --- M src/ipa.c M src/m3ua.c M src/sua.c M src/xua_as_fsm.c M src/xua_as_fsm.h M src/xua_internal.h M src/xua_msg.h 7 files changed, 60 insertions(+), 51 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/98/39398/6 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39398?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: I70e5d33c7537dc0b72b5abced876e69018cc0829 Gerrit-Change-Number: 39398 Gerrit-PatchSet: 6 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-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in libosmo-sigtran[master]: ASP loadsharing: Implement based on VTY configuration
by pespin 28 Feb '25

28 Feb '25
Attention is currently required from: daniel, fixeria, laforge, osmith, pespin. Hello Jenkins Builder, daniel, fixeria, laforge, osmith, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39408?usp=email to look at the new patch set (#5). 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: ASP loadsharing: Implement based on VTY configuration ...................................................................... ASP loadsharing: Implement based on VTY configuration Calculate AS Extended SLS (7 bit) out of OPC (12 bits) and SLS (4 bits) based on VTY configuration. Assign a normal destination ASP for each AS-eSLS and try to use it whenever possible; fallback to an alternative ASP when normal ASP is not available. Related: SYS#7112 Change-Id: I5f47e40b70ed566034cd1533b71e21fc03e94f6c --- M src/osmo_ss7_as.c M src/osmo_ss7_vty.c M src/ss7_as.h M src/xua_as_fsm.c M tests/vty/osmo_stp_test.vty 5 files changed, 223 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/08/39408/5 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39408?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: I5f47e40b70ed566034cd1533b71e21fc03e94f6c Gerrit-Change-Number: 39408 Gerrit-PatchSet: 5 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: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
1 0
0 0
[M] Change in libosmo-sigtran[master]: asp: Make sure asp->fi is set to NULL when freeing the object
by pespin 28 Feb '25

28 Feb '25
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39633?usp=email ) Change subject: asp: Make sure asp->fi is set to NULL when freeing the object ...................................................................... asp: Make sure asp->fi is set to NULL when freeing the object The asp->fi is freed in lots of places through osmo_fsm_inst_term(). Make sure the pointer is actually set to NULL to catch potential accesses to it after being freed. Change-Id: I1e6a25f6db695a16bd05ae4ec481df6e14cf65b5 --- M src/osmo_ss7_asp.c M src/xua_asp_fsm.c M src/xua_asp_fsm.h 3 files changed, 41 insertions(+), 18 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c index 44ffa68..ab772ff 100644 --- a/src/osmo_ss7_asp.c +++ b/src/osmo_ss7_asp.c @@ -716,8 +716,10 @@ /* (re)start the ASP FSM */ if (asp->fi) osmo_fsm_inst_term(asp->fi, OSMO_FSM_TERM_REQUEST, NULL); - asp->fi = xua_asp_fsm_start(asp, asp->cfg.role, LOGL_DEBUG); - + OSMO_ASSERT(!asp->fi); + if ((rc = xua_asp_fsm_start(asp, asp->cfg.role, LOGL_DEBUG)) < 0) + return rc; + OSMO_ASSERT(asp->fi); return 0; } diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c index 089c31c..12640d6 100644 --- a/src/xua_asp_fsm.c +++ b/src/xua_asp_fsm.c @@ -714,7 +714,13 @@ { struct xua_asp_fsm_priv *xafp = fi->priv; + if (!xafp) + return; + osmo_timer_del(&xafp->t_ack.timer); + + if (xafp->asp) + xafp->asp->fi = NULL; } static const struct osmo_fsm_state xua_asp_states[] = { @@ -779,16 +785,16 @@ .cleanup = xua_asp_fsm_cleanup, }; -static struct osmo_fsm_inst *ipa_asp_fsm_start(struct osmo_ss7_asp *asp, - enum osmo_ss7_asp_role role, int log_level); +static int ipa_asp_fsm_start(struct osmo_ss7_asp *asp, + enum osmo_ss7_asp_role role, int log_level); -/*! \brief Start a new ASP finite stae machine for given ASP +/*! \brief Start a new ASP finite stae machine for given ASP (stored in asp->fi) * \param[in] asp Application Server Process for which to start FSM * \param[in] role Role (ASP, SG, IPSP) of this FSM * \param[in] log_level Logging Level for ASP FSM logging - * \returns FSM instance on success; NULL on error */ -struct osmo_fsm_inst *xua_asp_fsm_start(struct osmo_ss7_asp *asp, - enum osmo_ss7_asp_role role, int log_level) + * \returns 0 on success; negative on error */ +int xua_asp_fsm_start(struct osmo_ss7_asp *asp, + enum osmo_ss7_asp_role role, int log_level) { struct osmo_fsm_inst *fi; struct xua_asp_fsm_priv *xafp; @@ -802,14 +808,17 @@ xafp = talloc_zero(fi, struct xua_asp_fsm_priv); if (!xafp) { osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); - return NULL; + return -ENOMEM; } xafp->role = role; xafp->asp = asp; fi->priv = xafp; - return fi; + /* Attach FSM to ASP: */ + asp->fi = fi; + + return 0; } @@ -1124,6 +1133,14 @@ return -1; } +static void ipa_asp_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + struct ipa_asp_fsm_priv *iafp = fi->priv; + + if (iafp && iafp->asp) + iafp->asp->fi = NULL; +} + static const struct osmo_fsm_state ipa_asp_states[] = { [IPA_ASP_S_DOWN] = { .in_event_mask = S(XUA_ASP_E_M_ASP_UP_REQ) | @@ -1200,16 +1217,17 @@ S(XUA_ASP_E_ASPSM_BEAT_ACK) | S(XUA_ASP_E_AS_ASSIGNED), .allstate_action = ipa_asp_allstate, + .cleanup = ipa_asp_fsm_cleanup, }; -/*! \brief Start a new ASP finite state machine for given ASP +/*! \brief Start a new ASP finite state machine for given ASP (stored on asp->fi) * \param[in] asp Application Server Process for which to start FSM * \param[in] role Role (ASP, SG, IPSP) of this FSM * \param[in] log_level Logging Level for ASP FSM logging - * \returns FSM instance on success; NULL on error */ -static struct osmo_fsm_inst *ipa_asp_fsm_start(struct osmo_ss7_asp *asp, - enum osmo_ss7_asp_role role, int log_level) + * \returns 0 on success; negative on error */ +static int ipa_asp_fsm_start(struct osmo_ss7_asp *asp, + enum osmo_ss7_asp_role role, int log_level) { struct osmo_fsm_inst *fi; struct ipa_asp_fsm_priv *iafp; @@ -1223,7 +1241,7 @@ iafp = talloc_zero(fi, struct ipa_asp_fsm_priv); if (!iafp) { osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); - return NULL; + return -ENOMEM; } if (as) { @@ -1251,8 +1269,11 @@ fi->priv = iafp; + /* Attach FSM to ASP: */ + asp->fi = fi; + if (can_start && role == OSMO_SS7_ASP_ROLE_ASP) osmo_fsm_inst_dispatch(fi, XUA_ASP_E_M_ASP_UP_REQ, NULL); - return fi; + return 0; } diff --git a/src/xua_asp_fsm.h b/src/xua_asp_fsm.h index ca44514..ab19e36 100644 --- a/src/xua_asp_fsm.h +++ b/src/xua_asp_fsm.h @@ -42,5 +42,5 @@ extern struct osmo_fsm xua_asp_fsm; extern struct osmo_fsm ipa_asp_fsm; -struct osmo_fsm_inst *xua_asp_fsm_start(struct osmo_ss7_asp *asp, - enum osmo_ss7_asp_role role, int log_level); +int xua_asp_fsm_start(struct osmo_ss7_asp *asp, + enum osmo_ss7_asp_role role, int log_level); -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39633?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: I1e6a25f6db695a16bd05ae4ec481df6e14cf65b5 Gerrit-Change-Number: 39633 Gerrit-PatchSet: 1 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-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in libosmo-sigtran[master]: asp: Refactor osmo_ss7_asp_restart() into smaller chunks
by pespin 28 Feb '25

28 Feb '25
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39634?usp=email ) Change subject: asp: Refactor osmo_ss7_asp_restart() into smaller chunks ...................................................................... asp: Refactor osmo_ss7_asp_restart() into smaller chunks This is a preparation patch towards fixing osmo_ss7_asp_restart() doing too many things at the same time, like tearing down the stream, FSMs, recreating them etc, not always in the best order. This function split steps into functions, better ordering the steps in the process. For instance, when reopening the stream_cli, make sure to close it beforehand. This would anyway be done inside osmo_stream_cli_open() but then all events (and hence logging) even weird, due to disconnect_cb triggering in the middle of the creation and then calling osmo_ss7_asp_restart() again while it is being called. The later will be fixed in a follow-up commit. Change-Id: I5c3461b724924f528b46f7fe815f017a5b4a1ff5 --- M src/osmo_ss7_asp.c M src/ss7_asp.h 2 files changed, 124 insertions(+), 90 deletions(-) Approvals: osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c index ab772ff..faf4a0a 100644 --- a/src/osmo_ss7_asp.c +++ b/src/osmo_ss7_asp.c @@ -612,95 +612,82 @@ static int xua_cli_disconnect_cb(struct osmo_stream_cli *cli); static int xua_cli_close_and_reconnect(struct osmo_stream_cli *cli); -int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp) + +static int ss7_asp_start_client(struct osmo_ss7_asp *asp) { - int rc; - char bufloc[512], bufrem[512]; uint8_t byte; + int rc; - OSMO_ASSERT(ss7_initialized); - ss7_asp_peer_snprintf(bufloc, sizeof(bufloc), &asp->cfg.local); - ss7_asp_peer_snprintf(bufrem, sizeof(bufrem), &asp->cfg.remote); - LOGPASP(asp, DLSS7, LOGL_INFO, "Restarting ASP %s, r=%s<->l=%s\n", - asp->cfg.name, bufrem, bufloc); - - if (!asp->cfg.is_server) { - /* We are in client mode now */ - if (asp->server) { - /* if we previously were in server mode, - * destroy it */ - osmo_stream_srv_destroy(asp->server); - asp->server = NULL; - } - if (!asp->client) - asp->client = osmo_stream_cli_create(asp); - if (!asp->client) { - LOGPASP(asp, DLSS7, LOGL_ERROR, "Unable to create stream" - " client for ASP %s\n", asp->cfg.name); - return -1; - } - osmo_stream_cli_set_name(asp->client, asp->cfg.name); - osmo_stream_cli_set_nodelay(asp->client, true); - osmo_stream_cli_set_addrs(asp->client, (const char **)asp->cfg.remote.host, asp->cfg.remote.host_cnt); - osmo_stream_cli_set_port(asp->client, asp->cfg.remote.port); - osmo_stream_cli_set_local_addrs(asp->client, (const char **)asp->cfg.local.host, asp->cfg.local.host_cnt); - osmo_stream_cli_set_local_port(asp->client, asp->cfg.local.port); - osmo_stream_cli_set_proto(asp->client, asp->cfg.trans_proto); - osmo_stream_cli_set_reconnect_timeout(asp->client, 5); - osmo_stream_cli_set_connect_cb(asp->client, xua_cli_connect_cb); - osmo_stream_cli_set_disconnect_cb(asp->client, xua_cli_disconnect_cb); - switch (asp->cfg.proto) { - case OSMO_SS7_ASP_PROT_IPA: - OSMO_ASSERT(asp->cfg.trans_proto == IPPROTO_TCP); - osmo_stream_cli_set_read_cb2(asp->client, ipa_cli_read_cb); - osmo_stream_cli_set_segmentation_cb(asp->client, osmo_ipa_segmentation_cb); - break; - case OSMO_SS7_ASP_PROT_M3UA: - if (asp->cfg.trans_proto == IPPROTO_SCTP) { - osmo_stream_cli_set_read_cb2(asp->client, xua_cli_read_cb); - osmo_stream_cli_set_segmentation_cb(asp->client, NULL); - } else if (asp->cfg.trans_proto == IPPROTO_TCP) { - osmo_stream_cli_set_read_cb2(asp->client, m3ua_tcp_cli_read_cb); - osmo_stream_cli_set_segmentation_cb(asp->client, xua_tcp_segmentation_cb); - } else - OSMO_ASSERT(0); - break; - default: - OSMO_ASSERT(asp->cfg.trans_proto == IPPROTO_SCTP); + if (!asp->client) + asp->client = osmo_stream_cli_create(asp); + if (!asp->client) { + LOGPASP(asp, DLSS7, LOGL_ERROR, "Unable to create stream" + " client for ASP %s\n", asp->cfg.name); + return -1; + } + osmo_stream_cli_set_name(asp->client, asp->cfg.name); + osmo_stream_cli_set_nodelay(asp->client, true); + osmo_stream_cli_set_addrs(asp->client, (const char **)asp->cfg.remote.host, asp->cfg.remote.host_cnt); + osmo_stream_cli_set_port(asp->client, asp->cfg.remote.port); + osmo_stream_cli_set_local_addrs(asp->client, (const char **)asp->cfg.local.host, asp->cfg.local.host_cnt); + osmo_stream_cli_set_local_port(asp->client, asp->cfg.local.port); + osmo_stream_cli_set_proto(asp->client, asp->cfg.trans_proto); + osmo_stream_cli_set_reconnect_timeout(asp->client, 5); + osmo_stream_cli_set_connect_cb(asp->client, xua_cli_connect_cb); + osmo_stream_cli_set_disconnect_cb(asp->client, xua_cli_disconnect_cb); + switch (asp->cfg.proto) { + case OSMO_SS7_ASP_PROT_IPA: + OSMO_ASSERT(asp->cfg.trans_proto == IPPROTO_TCP); + osmo_stream_cli_set_read_cb2(asp->client, ipa_cli_read_cb); + osmo_stream_cli_set_segmentation_cb(asp->client, osmo_ipa_segmentation_cb); + break; + case OSMO_SS7_ASP_PROT_M3UA: + if (asp->cfg.trans_proto == IPPROTO_SCTP) { osmo_stream_cli_set_read_cb2(asp->client, xua_cli_read_cb); osmo_stream_cli_set_segmentation_cb(asp->client, NULL); - break; - } - osmo_stream_cli_set_data(asp->client, asp); - byte = 1; /*AUTH is needed by ASCONF. enable, don't abort socket creation if AUTH can't be enabled */ - osmo_stream_cli_set_param(asp->client, OSMO_STREAM_CLI_PAR_SCTP_SOCKOPT_AUTH_SUPPORTED, &byte, sizeof(byte)); - byte = 1; /* enable, don't abort socket creation if ASCONF can't be enabled */ - osmo_stream_cli_set_param(asp->client, OSMO_STREAM_CLI_PAR_SCTP_SOCKOPT_ASCONF_SUPPORTED, &byte, sizeof(byte)); - if (asp->cfg.sctp_init.num_ostreams_present) - osmo_stream_cli_set_param(asp->client, OSMO_STREAM_CLI_PAR_SCTP_INIT_NUM_OSTREAMS, - &asp->cfg.sctp_init.num_ostreams_value, - sizeof(asp->cfg.sctp_init.num_ostreams_value)); - if (asp->cfg.sctp_init.max_instreams_present) - osmo_stream_cli_set_param(asp->client, OSMO_STREAM_CLI_PAR_SCTP_INIT_MAX_INSTREAMS, - &asp->cfg.sctp_init.max_instreams_value, - sizeof(asp->cfg.sctp_init.max_instreams_value)); - if (asp->cfg.sctp_init.max_attempts_present) - osmo_stream_cli_set_param(asp->client, OSMO_STREAM_CLI_PAR_SCTP_INIT_MAX_ATTEMPTS, - &asp->cfg.sctp_init.max_attempts_value, - sizeof(asp->cfg.sctp_init.max_attempts_value)); - if (asp->cfg.sctp_init.max_init_timeo_present) - osmo_stream_cli_set_param(asp->client, OSMO_STREAM_CLI_PAR_SCTP_INIT_TIMEOUT, - &asp->cfg.sctp_init.max_init_timeo_value, - sizeof(asp->cfg.sctp_init.max_init_timeo_value)); - rc = osmo_stream_cli_open(asp->client); - if (rc < 0) { - LOGPASP(asp, DLSS7, LOGL_ERROR, "Unable to open stream" - " client for ASP %s, %s ==> %s\n", asp->cfg.name, bufloc, bufrem); - /* we don't return error in here because osmo_stream_cli_open() - will continue to retry (due to timeout being explicitly set with - osmo_stream_cli_set_reconnect_timeout() above) to connect so the error is transient */ - } - } else { + } else if (asp->cfg.trans_proto == IPPROTO_TCP) { + osmo_stream_cli_set_read_cb2(asp->client, m3ua_tcp_cli_read_cb); + osmo_stream_cli_set_segmentation_cb(asp->client, xua_tcp_segmentation_cb); + } else + OSMO_ASSERT(0); + break; + default: + OSMO_ASSERT(asp->cfg.trans_proto == IPPROTO_SCTP); + osmo_stream_cli_set_read_cb2(asp->client, xua_cli_read_cb); + osmo_stream_cli_set_segmentation_cb(asp->client, NULL); + break; + } + osmo_stream_cli_set_data(asp->client, asp); + byte = 1; /*AUTH is needed by ASCONF. enable, don't abort socket creation if AUTH can't be enabled */ + osmo_stream_cli_set_param(asp->client, OSMO_STREAM_CLI_PAR_SCTP_SOCKOPT_AUTH_SUPPORTED, &byte, sizeof(byte)); + byte = 1; /* enable, don't abort socket creation if ASCONF can't be enabled */ + osmo_stream_cli_set_param(asp->client, OSMO_STREAM_CLI_PAR_SCTP_SOCKOPT_ASCONF_SUPPORTED, &byte, sizeof(byte)); + if (asp->cfg.sctp_init.num_ostreams_present) + osmo_stream_cli_set_param(asp->client, OSMO_STREAM_CLI_PAR_SCTP_INIT_NUM_OSTREAMS, + &asp->cfg.sctp_init.num_ostreams_value, + sizeof(asp->cfg.sctp_init.num_ostreams_value)); + if (asp->cfg.sctp_init.max_instreams_present) + osmo_stream_cli_set_param(asp->client, OSMO_STREAM_CLI_PAR_SCTP_INIT_MAX_INSTREAMS, + &asp->cfg.sctp_init.max_instreams_value, + sizeof(asp->cfg.sctp_init.max_instreams_value)); + if (asp->cfg.sctp_init.max_attempts_present) + osmo_stream_cli_set_param(asp->client, OSMO_STREAM_CLI_PAR_SCTP_INIT_MAX_ATTEMPTS, + &asp->cfg.sctp_init.max_attempts_value, + sizeof(asp->cfg.sctp_init.max_attempts_value)); + if (asp->cfg.sctp_init.max_init_timeo_present) + osmo_stream_cli_set_param(asp->client, OSMO_STREAM_CLI_PAR_SCTP_INIT_TIMEOUT, + &asp->cfg.sctp_init.max_init_timeo_value, + sizeof(asp->cfg.sctp_init.max_init_timeo_value)); + rc = osmo_stream_cli_open(asp->client); + return rc; +} + +/* Force stream disconnection, which should trigger disconnect_cb/close_cb() and + * announce disconnection to upper layers. */ +int ss7_asp_disconnect_stream(struct osmo_ss7_asp *asp) +{ + /* First tear down previous state if existing: */ + if (asp->cfg.is_server) { /* We are in server mode now */ if (asp->client) { /* if we previously were in client mode, @@ -708,18 +695,64 @@ osmo_stream_cli_destroy(asp->client); asp->client = NULL; } - /* FIXME: ensure we have a SCTP server */ - LOGPASP(asp, DLSS7, LOGL_NOTICE, "ASP Restart for server " - "not implemented yet!\n"); + } else { + /* We are in client mode now */ + if (asp->server) { + /* if we previously were in server mode, + * destroy it */ + osmo_stream_srv_destroy(asp->server); + asp->server = NULL; + } + if (asp->client) { + /* Make sure we close the previous stream before starting a new one: */ + osmo_stream_cli_close(asp->client); + } } + return 0; +} - /* (re)start the ASP FSM */ - if (asp->fi) +int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp) +{ + int rc; + char bufloc[512], bufrem[512]; + + OSMO_ASSERT(ss7_initialized); + ss7_asp_peer_snprintf(bufloc, sizeof(bufloc), &asp->cfg.local); + ss7_asp_peer_snprintf(bufrem, sizeof(bufrem), &asp->cfg.remote); + LOGPASP(asp, DLSS7, LOGL_INFO, "Restarting ASP %s, r=%s<->l=%s\n", + asp->cfg.name, bufrem, bufloc); + + /* First tear down previous state if existing: */ + ss7_asp_disconnect_stream(asp); + + /* The ASP FSM must be terminated *after* tearing down the conn, so that + * DISCONNECT events go up the stack */ + if (asp->fi) { osmo_fsm_inst_term(asp->fi, OSMO_FSM_TERM_REQUEST, NULL); - OSMO_ASSERT(!asp->fi); + OSMO_ASSERT(!asp->fi); + } if ((rc = xua_asp_fsm_start(asp, asp->cfg.role, LOGL_DEBUG)) < 0) return rc; OSMO_ASSERT(asp->fi); + + /* Now start the new stream: */ + + if (asp->cfg.is_server) { + /* We are in server mode now */ + /* FIXME: ensure we have a SCTP server */ + LOGPASP(asp, DLSS7, LOGL_NOTICE, "ASP Restart for server " + "not implemented yet!\n"); + } else { + /* We are in client mode now */ + rc = ss7_asp_start_client(asp); + if (rc < 0) { + LOGPASP(asp, DLSS7, LOGL_ERROR, "Unable to open stream" + " client for ASP %s, %s ==> %s\n", asp->cfg.name, bufloc, bufrem); + /* we don't return error in here because osmo_stream_cli_open() + will continue to retry (due to timeout being explicitly set with + osmo_stream_cli_set_reconnect_timeout() above) to connect so the error is transient */ + } + } return 0; } diff --git a/src/ss7_asp.h b/src/ss7_asp.h index e2bd46d..377274a 100644 --- a/src/ss7_asp.h +++ b/src/ss7_asp.h @@ -103,6 +103,7 @@ bool ss7_asp_set_default_peer_hosts(struct osmo_ss7_asp *asp); bool ss7_asp_is_started(const struct osmo_ss7_asp *asp); int ss7_asp_get_fd(const struct osmo_ss7_asp *asp); +int ss7_asp_disconnect_stream(struct osmo_ss7_asp *asp); int ss7_asp_apply_peer_primary_address(const struct osmo_ss7_asp *asp); int ss7_asp_apply_primary_address(const struct osmo_ss7_asp *asp); -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39634?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: I5c3461b724924f528b46f7fe815f017a5b4a1ff5 Gerrit-Change-Number: 39634 Gerrit-PatchSet: 1 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-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in libosmo-sigtran[master]: asp: Log close&reconnect triggered from stream
by pespin 28 Feb '25

28 Feb '25
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39632?usp=email ) Change subject: asp: Log close&reconnect triggered from stream ...................................................................... asp: Log close&reconnect triggered from stream This helps a lot in debugging the cascade of events happening when something goes wrong, since the xua_cli_close_and_reconnect() is called from several places. Change-Id: I05ffa0b21ad7b694899982901d9b94bdcf4e7999 --- M src/osmo_ss7_asp.c 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, approved laforge: Looks good to me, but someone else must approve diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c index d81d25c..44ffa68 100644 --- a/src/osmo_ss7_asp.c +++ b/src/osmo_ss7_asp.c @@ -609,6 +609,7 @@ static int ipa_cli_read_cb(struct osmo_stream_cli *conn, int res, struct msgb *msg); static int m3ua_tcp_cli_read_cb(struct osmo_stream_cli *conn, int res, struct msgb *msg); static int xua_cli_connect_cb(struct osmo_stream_cli *cli); +static int xua_cli_disconnect_cb(struct osmo_stream_cli *cli); static int xua_cli_close_and_reconnect(struct osmo_stream_cli *cli); int osmo_ss7_asp_restart(struct osmo_ss7_asp *asp) @@ -647,7 +648,7 @@ osmo_stream_cli_set_proto(asp->client, asp->cfg.trans_proto); osmo_stream_cli_set_reconnect_timeout(asp->client, 5); osmo_stream_cli_set_connect_cb(asp->client, xua_cli_connect_cb); - osmo_stream_cli_set_disconnect_cb(asp->client, xua_cli_close_and_reconnect); + osmo_stream_cli_set_disconnect_cb(asp->client, xua_cli_disconnect_cb); switch (asp->cfg.proto) { case OSMO_SS7_ASP_PROT_IPA: OSMO_ASSERT(asp->cfg.trans_proto == IPPROTO_TCP); @@ -980,6 +981,14 @@ return 0; } +static int xua_cli_disconnect_cb(struct osmo_stream_cli *cli) +{ + struct osmo_ss7_asp *asp = osmo_stream_cli_get_data(cli); + LOGPASP(asp, DLSS7, LOGL_NOTICE, "disconnect_cb() from lower layers, reconnecting\n"); + xua_cli_close_and_reconnect(cli); + return 0; +} + /* read call-back for IPA/SCCPlite socket */ static int ipa_cli_read_cb(struct osmo_stream_cli *conn, int res, struct msgb *msg) { -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39632?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: I05ffa0b21ad7b694899982901d9b94bdcf4e7999 Gerrit-Change-Number: 39632 Gerrit-PatchSet: 1 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-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in libosmo-sigtran[master]: xua_rkm: Fix dynamic AS destroyed when multiple ASPs are associated
by pespin 28 Feb '25

28 Feb '25
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39630?usp=email ) Change subject: xua_rkm: Fix dynamic AS destroyed when multiple ASPs are associated ...................................................................... xua_rkm: Fix dynamic AS destroyed when multiple ASPs are associated If more than 1 ASP was assigned to a dynamic ASP, when one of the ASP would go down it would incorrectly tear down the associated dynamic AS. This is wrong and should only happen when the last of the ASPs associated to the AS is destroyed. Change-Id: I986044944282cea9a13ed59424f2220fee6fe567 --- M src/osmo_ss7_as.c M src/ss7_as.h M src/xua_rkm.c 3 files changed, 20 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved osmith: Looks good to me, but someone else must approve diff --git a/src/osmo_ss7_as.c b/src/osmo_ss7_as.c index eb655ca..076cc35 100644 --- a/src/osmo_ss7_as.c +++ b/src/osmo_ss7_as.c @@ -199,6 +199,21 @@ return false; } +/*! Determine amount of ASPs associated to an AS. + * \param[in] as Application Server. + * \returns number of ASPs associated to as */ +unsigned int osmo_ss7_as_count_asp(const struct osmo_ss7_as *as) +{ + unsigned int i; + unsigned int cnt = 0; + + for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { + if (as->cfg.asps[i]) + cnt++; + } + return cnt; +} + /*! Determine if given AS is in the active state. * \param[in] as Application Server. * \returns true in case as is active; false otherwise. */ diff --git a/src/ss7_as.h b/src/ss7_as.h index 504818c..9f4be25 100644 --- a/src/ss7_as.h +++ b/src/ss7_as.h @@ -67,5 +67,7 @@ } cfg; }; +unsigned int osmo_ss7_as_count_asp(const struct osmo_ss7_as *as); + #define LOGPAS(as, subsys, level, fmt, args ...) \ _LOGSS7((as)->inst, subsys, level, "as-%s: " fmt, (as)->cfg.name, ## args) diff --git a/src/xua_rkm.c b/src/xua_rkm.c index 9a3918e..dd07db2 100644 --- a/src/xua_rkm.c +++ b/src/xua_rkm.c @@ -601,10 +601,11 @@ llist_for_each_entry_safe(as, as2, &inst->as_list, list) { if (!osmo_ss7_as_has_asp(as, asp)) continue; - /* FIXME: check if there are no other ASPs! */ if (!as->rkm_dyn_allocated) continue; - osmo_ss7_as_destroy(as); + /* If there are no other ASPs, destroy the AS: */ + if (osmo_ss7_as_count_asp(as) == 1) + osmo_ss7_as_destroy(as); } } -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39630?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: I986044944282cea9a13ed59424f2220fee6fe567 Gerrit-Change-Number: 39630 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(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
[S] Change in libosmo-sigtran[master]: default_lm_fsm: Trigger ASP restart by disconnecting the stream
by pespin 28 Feb '25

28 Feb '25
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39635?usp=email ) Change subject: default_lm_fsm: Trigger ASP restart by disconnecting the stream ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39635?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: I21ebc3cd716a0bcc74da0a789032570f038e119d Gerrit-Change-Number: 39635 Gerrit-PatchSet: 1 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-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 28 Feb 2025 16:19:11 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in libosmo-sigtran[master]: asp: Refactor osmo_ss7_asp_restart() into smaller chunks
by pespin 28 Feb '25

28 Feb '25
pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39634?usp=email ) Change subject: asp: Refactor osmo_ss7_asp_restart() into smaller chunks ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39634?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: I5c3461b724924f528b46f7fe815f017a5b4a1ff5 Gerrit-Change-Number: 39634 Gerrit-PatchSet: 1 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-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 28 Feb 2025 16:19:08 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • 5
  • ...
  • 119
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.