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

January 2025

  • 1 participants
  • 1491 discussions
[XS] Change in osmo-dev[master]: gen_makefile: fix f-string without placeholders
by laforge 24 Jan '25

24 Jan '25
Attention is currently required from: osmith. laforge has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-dev/+/39401?usp=email ) Change subject: gen_makefile: fix f-string without placeholders ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/39401?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: I77b38247fb38136f77f89d40669b2df378dca192 Gerrit-Change-Number: 39401 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Fri, 24 Jan 2025 10:02:52 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-dev[master]: gen_makefile: fix variable assigned but never used
by laforge 24 Jan '25

24 Jan '25
Attention is currently required from: osmith. laforge has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-dev/+/39400?usp=email ) Change subject: gen_makefile: fix variable assigned but never used ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/39400?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-dev Gerrit-Branch: master Gerrit-Change-Id: Ib938d3336d395bfed3e5194dcf86ae5d56f99984 Gerrit-Change-Number: 39400 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Fri, 24 Jan 2025 10:02:37 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-trx[master]: comma_delimited_to_vector() optimization CID#465430
by laforge 24 Jan '25

24 Jan '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/39359?usp=email ) Change subject: comma_delimited_to_vector() optimization CID#465430 ...................................................................... comma_delimited_to_vector() optimization CID#465430 (I am not sure about this, just doing as coverity says.) Change-Id: I30e57c6a9df39552bc4f8c18d27bc421f5c60f49 --- M CommonLibs/Utils.cpp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: fixeria: Looks good to me, but someone else must approve Hoernchen: Looks good to me, approved Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve diff --git a/CommonLibs/Utils.cpp b/CommonLibs/Utils.cpp index 3ab598d..6703531 100644 --- a/CommonLibs/Utils.cpp +++ b/CommonLibs/Utils.cpp @@ -28,7 +28,7 @@ { std::string substr; getline(ss, substr, ','); - result.push_back(substr); + result.push_back(std::move(substr)); } return result; } -- To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/39359?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Change-Id: I30e57c6a9df39552bc4f8c18d27bc421f5c60f49 Gerrit-Change-Number: 39359 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: Hoernchen <ewild(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
1 0
0 0
[S] Change in osmo-remsim[master]: Use use new osmo_stream_{cli,srv}_set_segmentation_cb2
by laforge 24 Jan '25

24 Jan '25
Attention is currently required from: pespin. laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-remsim/+/39385?usp=email ) Change subject: Use use new osmo_stream_{cli,srv}_set_segmentation_cb2 ...................................................................... Patch Set 1: (1 comment) File src/rspro_client_fsm.c: https://gerrit.osmocom.org/c/osmo-remsim/+/39385/comment/b50daa86_bf8a9845?… : PS1, Line 142: static int srvc_ipa_segmentation_cb2(struct osmo_stream_cli *cli, struct msgb *msg) : { : return osmo_ipa_segmentation_cb(msg); : } : > @laforge@gnumonks.org While it involves a bit more code I think it's totally fine. […] yeah, let's un-deprecate the old API. thanks. -- To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/39385?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-remsim Gerrit-Branch: master Gerrit-Change-Id: I02c55179a144e3bbd1f760f5429e16c6e327111e Gerrit-Change-Number: 39385 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 24 Jan 2025 10:00:23 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in pysim[master]: euicc: Add euicc_memory_reset shell command
by fixeria 24 Jan '25

24 Jan '25
Attention is currently required from: dexter, laforge. fixeria has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/pysim/+/39409?usp=email ) Change subject: euicc: Add euicc_memory_reset shell command ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/39409?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ib462f5b7de3e500e51c0f3d6e2b9b0c2d3ba7e20 Gerrit-Change-Number: 39409 Gerrit-PatchSet: 1 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-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Fri, 24 Jan 2025 06:39:21 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in pysim[master]: setup.py: Fix missing pySim.esim.saip module
by laforge 23 Jan '25

23 Jan '25
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/39410?usp=email ) Change subject: setup.py: Fix missing pySim.esim.saip module ...................................................................... setup.py: Fix missing pySim.esim.saip module installing the pySim package was missing the pySim.esim.saip sub-module[s]. Change-Id: I5fd30c0ac38003bbc336add9883fa1bbd4b737b2 --- M setup.py 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/10/39410/1 diff --git a/setup.py b/setup.py index e353f8a..6bddb07 100644 --- a/setup.py +++ b/setup.py @@ -8,6 +8,7 @@ 'pySim.apdu', 'pySim.apdu_source', 'pySim.esim', + 'pySim.esim.saip', 'pySim.global_platform', 'pySim.legacy', 'pySim.transport', -- To view, visit https://gerrit.osmocom.org/c/pysim/+/39410?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I5fd30c0ac38003bbc336add9883fa1bbd4b737b2 Gerrit-Change-Number: 39410 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org>
1 0
0 0
[S] Change in pysim[master]: euicc: Add euicc_memory_reset shell command
by laforge 23 Jan '25

23 Jan '25
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/39409?usp=email ) Change subject: euicc: Add euicc_memory_reset shell command ...................................................................... euicc: Add euicc_memory_reset shell command This implements the ES10c eUICC Memory Reset procedure Change-Id: Ib462f5b7de3e500e51c0f3d6e2b9b0c2d3ba7e20 --- M docs/shell.rst M pySim/euicc.py 2 files changed, 42 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/09/39409/1 diff --git a/docs/shell.rst b/docs/shell.rst index 31689fd..2127f4d 100644 --- a/docs/shell.rst +++ b/docs/shell.rst @@ -1374,6 +1374,13 @@ "delete_result": "ok" } +euicc_memory_reset +~~~~~~~~~~~~~~~~~~ + +.. argparse:: + :module: pySim.euicc + :func: CardApplicationISDR.AddlShellCommands.mem_res_parser + get_eid ~~~~~~~ diff --git a/pySim/euicc.py b/pySim/euicc.py index e9321d6..64eb29c 100644 --- a/pySim/euicc.py +++ b/pySim/euicc.py @@ -268,6 +268,17 @@ class DeleteProfileResp(BER_TLV_IE, tag=0xbf33, nested=[DeleteResult]): pass +# SGP.22 Section 5.7.19: EuiccMemoryReset +class ResetOptions(BER_TLV_IE, tag=0x82): + _construct = FlagsEnum(Byte, deleteOperationalProfiles=0x80, deleteFieldLoadedTestProfiles=0x40, + resetDefaultSmdpAddress=0x20) +class ResetResult(BER_TLV_IE, tag=0x80): + _construct = Enum(Int8ub, ok=0, nothingToDelete=1, undefinedError=127) +class EuiccMemoryResetReq(BER_TLV_IE, tag=0xbf34, nested=[ResetOptions]): + pass +class EuiccMemoryResetResp(BER_TLV_IE, tag=0xbf34, nested=[ResetResult]): + pass + # SGP.22 Section 5.7.20 GetEID class EidValue(BER_TLV_IE, tag=0x5a): _construct = HexAdapter(GreedyBytes) @@ -504,6 +515,30 @@ d = dp.to_dict() self._cmd.poutput_json(flatten_dict_lists(d['delete_profile_resp'])) + mem_res_parser = argparse.ArgumentParser() + mem_res_parser.add_argument('--delete-operational', action='store_true', + help='Delete all operational profiles') + mem_res_parser.add_argument('--delete-test-field-installed', action='store_true', + help='Delete all test profiles, except pre-installed ones') + mem_res_parser.add_argument('--reset-smdp-address', action='store_true', + help='Reset the SM-DP+ address') + + @cmd2.with_argparser(mem_res_parser) + def do_euicc_memory_reset(self, opts): + """Perform an ES10c eUICCMemoryReset function. This will permanently delete the selected subset of + profiles from the eUICC.""" + flags = {} + if opts.delete_operational: + flags['deleteOperationalProfiles'] = True + if opts.delete_test_field_installed: + flags['deleteFieldLoadedTestProfiles'] = True + if opts.reset_smdp_address: + flags['resetDefaultSmdpAddress'] = True + + mr_cmd = EuiccMemoryResetReq(children=[ResetOptions(decoded=flags)]) + mr = CardApplicationISDR.store_data_tlv(self._cmd.lchan.scc, mr_cmd, EuiccMemoryResetResp) + d = mr.to_dict() + self._cmd.poutput_json(flatten_dict_lists(d['euicc_memory_reset_resp'])) def do_get_eid(self, _opts): """Perform an ES10c GetEID function.""" -- To view, visit https://gerrit.osmocom.org/c/pysim/+/39409?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ib462f5b7de3e500e51c0f3d6e2b9b0c2d3ba7e20 Gerrit-Change-Number: 39409 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org>
1 0
0 0
[M] Change in libosmo-sigtran[master]: Implement ASP loadsharing
by pespin 23 Jan '25

23 Jan '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39408?usp=email ) Change subject: Implement ASP loadsharing ...................................................................... Implement ASP loadsharing 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/1 diff --git a/src/osmo_ss7_as.c b/src/osmo_ss7_as.c index eb655ca..ccf929f 100644 --- a/src/osmo_ss7_as.c +++ b/src/osmo_ss7_as.c @@ -33,6 +33,7 @@ #include <osmocom/sigtran/osmo_ss7.h> #include <osmocom/sigtran/protocol/m3ua.h> +#include <osmocom/sigtran/mtp_sap.h> #include "ss7_as.h" #include "ss7_asp.h" @@ -153,6 +154,14 @@ LOGPAS(as, DLSS7, LOGL_INFO, "Removing ASP %s from AS\n", asp->cfg.name); + /* Remove route from AS-eSLS table: */ + for (unsigned int i = 0; i < ARRAY_SIZE(as->aesls_table); i++) { + if (as->aesls_table[i].normal_asp == asp) + as->aesls_table[i].normal_asp = NULL; + if (as->aesls_table[i].alt_asp == asp) + as->aesls_table[i].alt_asp = NULL; + } + for (i = 0; i < ARRAY_SIZE(as->cfg.asps); i++) { if (as->cfg.asps[i] == asp) { as->cfg.asps[i] = NULL; @@ -254,6 +263,83 @@ return asp; } +static as_ext_sls_t osmo_ss7_instance_calc_itu_as_ext_sls(const struct osmo_ss7_as *as, uint32_t opc, uint8_t sls) +{ + uint16_t opc12; + uint8_t opc3; + as_ext_sls_t as_ext_sls; + + if (as->cfg.loadshare.opc_sls) { + /* Take 12 bits from OPC according to config: */ + opc12 = (uint16_t)((opc >> as->cfg.loadshare.opc_shift) & 0x3fff); + + /* Derivate 3-bit value from 12-bit value: */ + opc3 = (((opc12 >> 9) & 0x07) ^ + ((opc12 >> 6) & 0x07) ^ + ((opc12 >> 3) & 0x07) ^ + (opc12 & 0x07)) & 0x07; + + /* Generate 7 bit AS-extended-SLS: 3-bit OPC + 4 bit SLS: */ + as_ext_sls = (opc3 << 4) | ((sls) & 0x0f); + OSMO_ASSERT(as_ext_sls < NUM_AS_EXT_SLS); + } else { + as_ext_sls = sls; + } + + /* Pick extended-SLS bits according to config: */ + as_ext_sls = as_ext_sls >> as->cfg.loadshare.sls_shift; + return as_ext_sls; +} + +/* ITU Q.704 4.2.1: "current signalling link". Pick available already selected ASP */ +static struct osmo_ss7_asp *current_asp(const struct osmo_ss7_as *as, const struct osmo_ss7_as_esls_entry *aeslse) +{ + if (aeslse->normal_asp && osmo_ss7_asp_active(aeslse->normal_asp)) + return aeslse->normal_asp; + if (aeslse->alt_asp && osmo_ss7_asp_active(aeslse->alt_asp)) + return aeslse->alt_asp; + return NULL; +} + +static struct osmo_ss7_asp *ss7_as_select_asp_loadshare(struct osmo_ss7_as *as, const struct osmo_mtp_transfer_param *mtp) +{ + as_ext_sls_t as_ext_sls; + struct osmo_ss7_asp *asp; + + as_ext_sls = osmo_ss7_instance_calc_itu_as_ext_sls(as, mtp->opc, mtp->sls); + struct osmo_ss7_as_esls_entry *aeslse = &as->aesls_table[as_ext_sls]; + + /* First check if we have a cached route for this ESLS */ + asp = current_asp(as, aeslse); + if (asp) { + if (asp == aeslse->normal_asp) { + /* We can transmit over normal ASP. + * Clean up alternative ASP since it's not needed anymore */ + aeslse->alt_asp = NULL; + return asp; + } + /* We can transmit over alternative ASP: */ + return asp; + } + + /* No current ASP available, try to find a new current ASP: */ + + /* No normal route selected yet: */ + if (!aeslse->normal_asp) { + asp = ss7_as_select_asp_roundrobin(as); + /* Either a normal route was selected or none found: */ + aeslse->normal_asp = asp; + return asp; + } + + /* Normal ASP unavailable and no alternative ASP (or unavailable too). + * start ITU Q.704 section 7 "forced rerouting" procedure: */ + asp = ss7_as_select_asp_roundrobin(as); + if (asp) + aeslse->alt_asp = asp; + return asp; +} + /* returns NULL if multiple ASPs would need to be selected. */ static struct osmo_ss7_asp *ss7_as_select_asp_broadcast(struct osmo_ss7_as *as) { @@ -278,7 +364,7 @@ * This function returns NULL too if multiple ASPs would be selected, ie. AS is * configured in broadcast mode and more than one ASP is configured. */ -struct osmo_ss7_asp *osmo_ss7_as_select_asp(struct osmo_ss7_as *as) +struct osmo_ss7_asp *ss7_as_select_asp(struct osmo_ss7_as *as, const struct osmo_mtp_transfer_param *mtp) { struct osmo_ss7_asp *asp = NULL; @@ -287,9 +373,45 @@ asp = ss7_as_select_asp_override(as); break; case OSMO_SS7_AS_TMOD_LOADSHARE: - /* TODO: actually use the SLS value to ensure same SLS goes - * through same ASP. Not strictly required by M3UA RFC, but - * would fit the overall principle. */ + asp = ss7_as_select_asp_loadshare(as, mtp); + case OSMO_SS7_AS_TMOD_ROUNDROBIN: + asp = ss7_as_select_asp_roundrobin(as); + break; + case OSMO_SS7_AS_TMOD_BCAST: + return ss7_as_select_asp_broadcast(as); + case _NUM_OSMO_SS7_ASP_TMOD: + OSMO_ASSERT(false); + } + + if (!asp) { + LOGPFSM(as->fi, "No selectable ASP in AS\n"); + return NULL; + } + return asp; +} +/*! Select an AS to transmit a message, according to AS configuration and ASP availability. + * \param[in] as Application Server. + * \returns asp to send the message to, NULL if no possible asp found + * + * This function returns NULL too if multiple ASPs would be selected, ie. AS is + * configured in broadcast mode and more than one ASP is configured. + */ +struct osmo_ss7_asp *osmo_ss7_as_select_asp(struct osmo_ss7_as *as) +{ + struct osmo_ss7_asp *asp = NULL; + struct osmo_mtp_transfer_param mtp; + + switch (as->cfg.mode) { + case OSMO_SS7_AS_TMOD_OVERRIDE: + asp = ss7_as_select_asp_override(as); + break; + case OSMO_SS7_AS_TMOD_LOADSHARE: + /* We don't have OPC and SLS information in this API (which is + actually only used to route IPA msgs nowadays by osmo-bsc, so we + don't care. Use hardcoded value to provide some fallback for this scenario: */ + mtp = (struct osmo_mtp_transfer_param){0}; + asp = ss7_as_select_asp_loadshare(as, &mtp); + break; case OSMO_SS7_AS_TMOD_ROUNDROBIN: asp = ss7_as_select_asp_roundrobin(as); break; diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 6b404b3..852aca3 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -1916,10 +1916,9 @@ DEFUN_USRATTR(as_traf_mode, as_traf_mode_cmd, OSMO_SCCP_LIB_ATTR_RSTRT_ASP, - "traffic-mode (broadcast | loadshare | roundrobin | override)", + "traffic-mode (broadcast | roundrobin | override)", "Specifies traffic mode of operation of the ASP within the AS\n" "Broadcast to all ASP within AS\n" - "Share Load among all ASP within AS\n" "Round-Robin between all ASP within AS\n" "Override\n") { @@ -1930,6 +1929,36 @@ return CMD_SUCCESS; } +DEFUN_USRATTR(as_traf_mode_loadshare, as_traf_mode_loadshare_cmd, + OSMO_SCCP_LIB_ATTR_RSTRT_ASP, + "traffic-mode loadshare [bindings] [sls] [opc-sls] [opc-shift] [<0-2>]", + "Specifies traffic mode of operation of the ASP within the AS\n" + "Share Load among all ASP within AS\n" + "Configure Loadshare parameters\n" + "Configure Loadshare SLS generation parameters\n" + "Generate extended SLS with OPC information\n" + "Shift OPC bits used during routing decision\n" + "How many bits from ITU OPC field (starting from least-significant-bit) to skip (default=0). 6 bits are always used\n" + ) +{ + struct osmo_ss7_as *as = vty->index; + + as->cfg.mode = OSMO_SS7_AS_TMOD_LOADSHARE; + as->cfg.mode_set_by_vty = true; + if (argc < 3) { + as->cfg.loadshare.opc_sls = false; + as->cfg.loadshare.opc_shift = 0; + return CMD_SUCCESS; + } + as->cfg.loadshare.opc_sls = true; + if (argc < 5) { + as->cfg.loadshare.opc_shift = 0; + return CMD_SUCCESS; + } + as->cfg.loadshare.opc_shift = atoi(argv[4]); + return CMD_SUCCESS; +} + DEFUN_USRATTR(as_no_traf_mode, as_no_traf_mode_cmd, OSMO_SCCP_LIB_ATTR_RSTRT_ASP, "no traffic-mode", @@ -1939,6 +1968,22 @@ as->cfg.mode = 0; as->cfg.mode_set_by_vty = false; + + as->cfg.loadshare.sls_shift = 0; + as->cfg.loadshare.opc_sls = false; + as->cfg.loadshare.opc_shift = 0; + return CMD_SUCCESS; +} + +DEFUN_ATTR(as_sls_shift, as_sls_shift_cmd, + "sls-shift <0-3>", + "Shift SLS bits used during routing decision\n" + "How many bits from SLS field (starting from least-significant-bit) to skip\n", + CMD_ATTR_IMMEDIATE) +{ + struct osmo_ss7_as *as = vty->index; + as->cfg.loadshare.sls_shift = atoi(argv[0]); + return CMD_SUCCESS; } @@ -2157,9 +2202,21 @@ continue; vty_out(vty, " asp %s%s", asp->cfg.name, VTY_NEWLINE); } - if (as->cfg.mode_set_by_vty) - vty_out(vty, " traffic-mode %s%s", - osmo_ss7_as_traffic_mode_name(as->cfg.mode), VTY_NEWLINE); + if (as->cfg.mode_set_by_vty) { + vty_out(vty, " traffic-mode %s", osmo_ss7_as_traffic_mode_name(as->cfg.mode)); + if (as->cfg.mode == OSMO_SS7_AS_TMOD_LOADSHARE) { + if (as->cfg.loadshare.opc_sls) { + vty_out(vty, " bindings sls opc-sls"); + if (as->cfg.loadshare.opc_shift != 0) + vty_out(vty, " opc-shift %u%s", as->cfg.loadshare.opc_shift, VTY_NEWLINE); + } + } + vty_out(vty, "%s", VTY_NEWLINE); + + if (as->cfg.loadshare.sls_shift != 0) + vty_out(vty, " sls-shift %u%s", as->cfg.loadshare.sls_shift, VTY_NEWLINE); + } + if (as->cfg.recovery_timeout_msec != 2000) { vty_out(vty, " recovery-timeout %u%s", as->cfg.recovery_timeout_msec, VTY_NEWLINE); @@ -3092,7 +3149,9 @@ install_lib_element(L_CS7_AS_NODE, &as_asp_cmd); install_lib_element(L_CS7_AS_NODE, &as_no_asp_cmd); install_lib_element(L_CS7_AS_NODE, &as_traf_mode_cmd); + install_lib_element(L_CS7_AS_NODE, &as_traf_mode_loadshare_cmd); install_lib_element(L_CS7_AS_NODE, &as_no_traf_mode_cmd); + install_lib_element(L_CS7_AS_NODE, &as_sls_shift_cmd); install_lib_element(L_CS7_AS_NODE, &as_recov_tout_cmd); install_lib_element(L_CS7_AS_NODE, &as_qos_class_cmd); install_lib_element(L_CS7_AS_NODE, &as_rout_key_cmd); diff --git a/src/ss7_as.h b/src/ss7_as.h index 504818c..dbeb61e 100644 --- a/src/ss7_as.h +++ b/src/ss7_as.h @@ -17,6 +17,7 @@ struct osmo_ss7_instance; struct osmo_ss7_asp; +struct osmo_mtp_transfer_param; enum osmo_ss7_as_patch_sccp_mode { OSMO_SS7_PATCH_NONE, /* no patching of SCCP */ @@ -28,6 +29,15 @@ SS7_AS_CTR_TX_MSU_TOTAL, }; +#define NUM_AS_EXT_SLS 128 +typedef uint8_t as_ext_sls_t; /* range: 0-127, 7 bit */ +struct osmo_ss7_as_esls_entry { + /* ITU Q.704 4.2.1: "normal signallink link" */ + struct osmo_ss7_asp *normal_asp; + /* ITU Q.704 4.2.1: "alternative signallink link" */ + struct osmo_ss7_asp *alt_asp; +}; + struct osmo_ss7_as { /*! entry in 'ref osmo_ss7_instance.as_list */ struct llist_head list; @@ -45,6 +55,9 @@ /*! Rate Counter Group */ struct rate_ctr_group *ctrg; + /* ASP loadshare: */ + struct osmo_ss7_as_esls_entry aesls_table[NUM_AS_EXT_SLS]; + struct { char *name; char *description; @@ -64,8 +77,23 @@ struct osmo_ss7_asp *asps[16]; uint8_t last_asp_idx_sent; /* used for load-sharing traffic mode (round robin implementation) */ + + struct { + /* How many bits from ITU SLS field (starting from least-significant-bit) + * to skip for routing decisions. + * range 0-3, defaults to 0, which means take all 4 bits. */ + uint8_t sls_shift; + /* Whether to generate a extended-SLS with OPC information, see opc_shift below. */ + bool opc_sls; + /* How many bits from ITU OPC field (starting from least-significant-bit) + * to skip for routing decisions (always takes 12 bits). + * range 0-2, defaults to 0, which means take least significant 12 bits. */ + uint8_t opc_shift; + } loadshare; } cfg; }; +struct osmo_ss7_asp *ss7_as_select_asp(struct osmo_ss7_as *as, const struct osmo_mtp_transfer_param *mtp); + #define LOGPAS(as, subsys, level, fmt, args ...) \ _LOGSS7((as)->inst, subsys, level, "as-%s: " fmt, (as)->cfg.name, ## args) diff --git a/src/xua_as_fsm.c b/src/xua_as_fsm.c index 5c2c5e0..e435970 100644 --- a/src/xua_as_fsm.c +++ b/src/xua_as_fsm.c @@ -150,7 +150,7 @@ * strictly required by M3UA RFC, but would fit the overall * principle. */ case OSMO_SS7_AS_TMOD_ROUNDROBIN: - asp = osmo_ss7_as_select_asp(as); + asp = ss7_as_select_asp(as, &xua->mtp); break; case OSMO_SS7_AS_TMOD_BCAST: return xua_as_transmit_msg_broadcast(as, xua); diff --git a/tests/vty/osmo_stp_test.vty b/tests/vty/osmo_stp_test.vty index cb24560..dcde514 100644 --- a/tests/vty/osmo_stp_test.vty +++ b/tests/vty/osmo_stp_test.vty @@ -344,8 +344,10 @@ description .TEXT asp NAME no asp NAME - traffic-mode (broadcast | loadshare | roundrobin | override) + traffic-mode (broadcast | roundrobin | override) + traffic-mode loadshare [bindings] [sls] [opc-sls] [opc-shift] [<0-2>] no traffic-mode + sls-shift <0-3> recovery-timeout <1-2000> qos-class <0-7> routing-key RCONTEXT DPC @@ -361,6 +363,7 @@ asp Specify that a given ASP is part of this AS no Negate a command or set its defaults traffic-mode Specifies traffic mode of operation of the ASP within the AS + sls-shift Shift SLS bits used during routing decision recovery-timeout Specifies the recovery timeout value in milliseconds qos-class Specity QoS Class of AS routing-key Define a routing key -- 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: newchange Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I5f47e40b70ed566034cd1533b71e21fc03e94f6c Gerrit-Change-Number: 39408 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in libosmo-sigtran[master]: AS loadsharing: Introduce AS rate_ctr tx:msu:sls:*
by pespin 23 Jan '25

23 Jan '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39407?usp=email ) Change subject: AS loadsharing: Introduce AS rate_ctr tx:msu:sls:* ...................................................................... AS loadsharing: Introduce AS rate_ctr tx:msu:sls:* Related: SYS#7112 Change-Id: Ia446e11ea24ecb021a3dddf5547aa2b3cdbbe60b --- M src/osmo_ss7_as.c M src/osmo_ss7_hmrt.c M src/ss7_as.h 3 files changed, 35 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/07/39407/1 diff --git a/src/osmo_ss7_as.c b/src/osmo_ss7_as.c index f14fd03..96261c0 100644 --- a/src/osmo_ss7_as.c +++ b/src/osmo_ss7_as.c @@ -55,6 +55,7 @@ }; #define SS7_AS_CTR_RX_MSU_SLS_STR "Number of MSU received on SLS " +#define SS7_AS_CTR_TX_MSU_SLS_STR "Number of MSU transmitted on SLS " static const struct rate_ctr_desc ss7_as_rcd[] = { [SS7_AS_CTR_RX_MSU_TOTAL] = { "rx:msu:total", "Total number of MSU received" }, [SS7_AS_CTR_RX_MSU_SLS_0] = { "rx:msu:sls:0", SS7_AS_CTR_RX_MSU_SLS_STR "0" }, @@ -74,6 +75,22 @@ [SS7_AS_CTR_RX_MSU_SLS_14] = { "rx:msu:sls:14", SS7_AS_CTR_RX_MSU_SLS_STR "14" }, [SS7_AS_CTR_RX_MSU_SLS_15] = { "rx:msu:sls:15", SS7_AS_CTR_RX_MSU_SLS_STR "15" }, [SS7_AS_CTR_TX_MSU_TOTAL] = { "tx:msu:total", "Total number of MSU transmitted" }, + [SS7_AS_CTR_TX_MSU_SLS_0] = { "tx:msu:sls:0", SS7_AS_CTR_TX_MSU_SLS_STR "0" }, + [SS7_AS_CTR_TX_MSU_SLS_1] = { "tx:msu:sls:1", SS7_AS_CTR_TX_MSU_SLS_STR "1" }, + [SS7_AS_CTR_TX_MSU_SLS_2] = { "tx:msu:sls:2", SS7_AS_CTR_TX_MSU_SLS_STR "2" }, + [SS7_AS_CTR_TX_MSU_SLS_3] = { "tx:msu:sls:3", SS7_AS_CTR_TX_MSU_SLS_STR "3" }, + [SS7_AS_CTR_TX_MSU_SLS_4] = { "tx:msu:sls:4", SS7_AS_CTR_TX_MSU_SLS_STR "4" }, + [SS7_AS_CTR_TX_MSU_SLS_5] = { "tx:msu:sls:5", SS7_AS_CTR_TX_MSU_SLS_STR "5" }, + [SS7_AS_CTR_TX_MSU_SLS_6] = { "tx:msu:sls:6", SS7_AS_CTR_TX_MSU_SLS_STR "6" }, + [SS7_AS_CTR_TX_MSU_SLS_7] = { "tx:msu:sls:7", SS7_AS_CTR_TX_MSU_SLS_STR "7" }, + [SS7_AS_CTR_TX_MSU_SLS_8] = { "tx:msu:sls:8", SS7_AS_CTR_TX_MSU_SLS_STR "8" }, + [SS7_AS_CTR_TX_MSU_SLS_9] = { "tx:msu:sls:9", SS7_AS_CTR_TX_MSU_SLS_STR "9" }, + [SS7_AS_CTR_TX_MSU_SLS_10] = { "tx:msu:sls:10", SS7_AS_CTR_TX_MSU_SLS_STR "10" }, + [SS7_AS_CTR_TX_MSU_SLS_11] = { "tx:msu:sls:11", SS7_AS_CTR_TX_MSU_SLS_STR "11" }, + [SS7_AS_CTR_TX_MSU_SLS_12] = { "tx:msu:sls:12", SS7_AS_CTR_TX_MSU_SLS_STR "12" }, + [SS7_AS_CTR_TX_MSU_SLS_13] = { "tx:msu:sls:13", SS7_AS_CTR_TX_MSU_SLS_STR "13" }, + [SS7_AS_CTR_TX_MSU_SLS_14] = { "tx:msu:sls:14", SS7_AS_CTR_TX_MSU_SLS_STR "14" }, + [SS7_AS_CTR_TX_MSU_SLS_15] = { "tx:msu:sls:15", SS7_AS_CTR_TX_MSU_SLS_STR "15" }, }; static const struct rate_ctr_group_desc ss7_as_rcgd = { diff --git a/src/osmo_ss7_hmrt.c b/src/osmo_ss7_hmrt.c index da51e17..2904d7d 100644 --- a/src/osmo_ss7_hmrt.c +++ b/src/osmo_ss7_hmrt.c @@ -246,6 +246,8 @@ } rate_ctr_inc2(as->ctrg, SS7_AS_CTR_TX_MSU_TOTAL); + OSMO_ASSERT(xua->mtp.sls <= 0xf); + rate_ctr_inc2(as->ctrg, SS7_AS_CTR_TX_MSU_SLS_0 + xua->mtp.sls); switch (as->cfg.proto) { case OSMO_SS7_ASP_PROT_M3UA: diff --git a/src/ss7_as.h b/src/ss7_as.h index 5ddd57e..6b67697 100644 --- a/src/ss7_as.h +++ b/src/ss7_as.h @@ -42,6 +42,22 @@ SS7_AS_CTR_RX_MSU_SLS_14, SS7_AS_CTR_RX_MSU_SLS_15, SS7_AS_CTR_TX_MSU_TOTAL, + SS7_AS_CTR_TX_MSU_SLS_0, + SS7_AS_CTR_TX_MSU_SLS_1, + SS7_AS_CTR_TX_MSU_SLS_2, + SS7_AS_CTR_TX_MSU_SLS_3, + SS7_AS_CTR_TX_MSU_SLS_4, + SS7_AS_CTR_TX_MSU_SLS_5, + SS7_AS_CTR_TX_MSU_SLS_6, + SS7_AS_CTR_TX_MSU_SLS_7, + SS7_AS_CTR_TX_MSU_SLS_8, + SS7_AS_CTR_TX_MSU_SLS_9, + SS7_AS_CTR_TX_MSU_SLS_10, + SS7_AS_CTR_TX_MSU_SLS_11, + SS7_AS_CTR_TX_MSU_SLS_12, + SS7_AS_CTR_TX_MSU_SLS_13, + SS7_AS_CTR_TX_MSU_SLS_14, + SS7_AS_CTR_TX_MSU_SLS_15, }; struct osmo_ss7_as { -- To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/39407?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: Ia446e11ea24ecb021a3dddf5547aa2b3cdbbe60b Gerrit-Change-Number: 39407 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in libosmo-sigtran[master]: AS loadsharing: Introduce AS rate_ctr rx:msu:sls:*
by pespin 23 Jan '25

23 Jan '25
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/39406?usp=email ) 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, 40 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/06/39406/1 diff --git a/src/ipa.c b/src/ipa.c index 6ca5b50..4e0180c 100644 --- a/src/ipa.c +++ b/src/ipa.c @@ -238,6 +238,8 @@ } rate_ctr_inc2(as->ctrg, SS7_AS_CTR_RX_MSU_TOTAL); + OSMO_ASSERT(sls <= 0xf); + rate_ctr_inc2(as->ctrg, SS7_AS_CTR_RX_MSU_SLS_0 + sls); /* pull the IPA header */ msgb_pull_to_l2(msg); diff --git a/src/m3ua.c b/src/m3ua.c index 5f94674..5d8349b 100644 --- a/src/m3ua.c +++ b/src/m3ua.c @@ -604,6 +604,7 @@ "%s(): M3UA data header: opc=%u=%s dpc=%u=%s\n", __func__, xua->mtp.opc, osmo_ss7_pointcode_print(asp->inst, xua->mtp.opc), xua->mtp.dpc, osmo_ss7_pointcode_print2(asp->inst, xua->mtp.dpc)); + rate_ctr_inc2(as->ctrg, SS7_AS_CTR_RX_MSU_SLS_0 + xua->mtp.sls); if (rctx_ie) { /* remove ROUTE_CTX as in the routing case we want to add a new diff --git a/src/osmo_ss7_as.c b/src/osmo_ss7_as.c index eb655ca..f14fd03 100644 --- a/src/osmo_ss7_as.c +++ b/src/osmo_ss7_as.c @@ -54,9 +54,26 @@ { 0, NULL } }; +#define SS7_AS_CTR_RX_MSU_SLS_STR "Number of MSU received on SLS " static const struct rate_ctr_desc ss7_as_rcd[] = { - [SS7_AS_CTR_RX_MSU_TOTAL] = { "rx:msu:total", "Total number of MSU received" }, - [SS7_AS_CTR_TX_MSU_TOTAL] = { "tx:msu:total", "Total number of MSU transmitted" }, + [SS7_AS_CTR_RX_MSU_TOTAL] = { "rx:msu:total", "Total number of MSU received" }, + [SS7_AS_CTR_RX_MSU_SLS_0] = { "rx:msu:sls:0", SS7_AS_CTR_RX_MSU_SLS_STR "0" }, + [SS7_AS_CTR_RX_MSU_SLS_1] = { "rx:msu:sls:1", SS7_AS_CTR_RX_MSU_SLS_STR "1" }, + [SS7_AS_CTR_RX_MSU_SLS_2] = { "rx:msu:sls:2", SS7_AS_CTR_RX_MSU_SLS_STR "2" }, + [SS7_AS_CTR_RX_MSU_SLS_3] = { "rx:msu:sls:3", SS7_AS_CTR_RX_MSU_SLS_STR "3" }, + [SS7_AS_CTR_RX_MSU_SLS_4] = { "rx:msu:sls:4", SS7_AS_CTR_RX_MSU_SLS_STR "4" }, + [SS7_AS_CTR_RX_MSU_SLS_5] = { "rx:msu:sls:5", SS7_AS_CTR_RX_MSU_SLS_STR "5" }, + [SS7_AS_CTR_RX_MSU_SLS_6] = { "rx:msu:sls:6", SS7_AS_CTR_RX_MSU_SLS_STR "6" }, + [SS7_AS_CTR_RX_MSU_SLS_7] = { "rx:msu:sls:7", SS7_AS_CTR_RX_MSU_SLS_STR "7" }, + [SS7_AS_CTR_RX_MSU_SLS_8] = { "rx:msu:sls:8", SS7_AS_CTR_RX_MSU_SLS_STR "8" }, + [SS7_AS_CTR_RX_MSU_SLS_9] = { "rx:msu:sls:9", SS7_AS_CTR_RX_MSU_SLS_STR "9" }, + [SS7_AS_CTR_RX_MSU_SLS_10] = { "rx:msu:sls:10", SS7_AS_CTR_RX_MSU_SLS_STR "10" }, + [SS7_AS_CTR_RX_MSU_SLS_11] = { "rx:msu:sls:11", SS7_AS_CTR_RX_MSU_SLS_STR "11" }, + [SS7_AS_CTR_RX_MSU_SLS_12] = { "rx:msu:sls:12", SS7_AS_CTR_RX_MSU_SLS_STR "12" }, + [SS7_AS_CTR_RX_MSU_SLS_13] = { "rx:msu:sls:13", SS7_AS_CTR_RX_MSU_SLS_STR "13" }, + [SS7_AS_CTR_RX_MSU_SLS_14] = { "rx:msu:sls:14", SS7_AS_CTR_RX_MSU_SLS_STR "14" }, + [SS7_AS_CTR_RX_MSU_SLS_15] = { "rx:msu:sls:15", SS7_AS_CTR_RX_MSU_SLS_STR "15" }, + [SS7_AS_CTR_TX_MSU_TOTAL] = { "tx:msu:total", "Total number of MSU transmitted" }, }; static const struct rate_ctr_group_desc ss7_as_rcgd = { diff --git a/src/ss7_as.h b/src/ss7_as.h index 504818c..5ddd57e 100644 --- a/src/ss7_as.h +++ b/src/ss7_as.h @@ -25,6 +25,22 @@ enum ss7_as_ctr { SS7_AS_CTR_RX_MSU_TOTAL, + SS7_AS_CTR_RX_MSU_SLS_0, + SS7_AS_CTR_RX_MSU_SLS_1, + SS7_AS_CTR_RX_MSU_SLS_2, + SS7_AS_CTR_RX_MSU_SLS_3, + SS7_AS_CTR_RX_MSU_SLS_4, + SS7_AS_CTR_RX_MSU_SLS_5, + SS7_AS_CTR_RX_MSU_SLS_6, + SS7_AS_CTR_RX_MSU_SLS_7, + SS7_AS_CTR_RX_MSU_SLS_8, + SS7_AS_CTR_RX_MSU_SLS_9, + SS7_AS_CTR_RX_MSU_SLS_10, + SS7_AS_CTR_RX_MSU_SLS_11, + SS7_AS_CTR_RX_MSU_SLS_12, + SS7_AS_CTR_RX_MSU_SLS_13, + SS7_AS_CTR_RX_MSU_SLS_14, + SS7_AS_CTR_RX_MSU_SLS_15, SS7_AS_CTR_TX_MSU_TOTAL, }; diff --git a/src/sua.c b/src/sua.c index e81c471..636774f 100644 --- a/src/sua.c +++ b/src/sua.c @@ -534,6 +534,7 @@ return rc; rate_ctr_inc2(as->ctrg, SS7_AS_CTR_RX_MSU_TOTAL); + rate_ctr_inc2(as->ctrg, SS7_AS_CTR_RX_MSU_SLS_0 + xua->mtp.sls); switch (xua->hdr.msg_type) { case 0: /* Reserved, permitted by ETSI TS 101 592 5.2.3.2 */ @@ -564,6 +565,7 @@ return rc; rate_ctr_inc2(as->ctrg, SS7_AS_CTR_RX_MSU_TOTAL); + rate_ctr_inc2(as->ctrg, SS7_AS_CTR_RX_MSU_SLS_0 + xua->mtp.sls); switch (xua->hdr.msg_type) { case 0: /* Reserved, permitted by ETSI TS 101 592 5.2.3.2 */ -- 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: newchange Gerrit-Project: libosmo-sigtran Gerrit-Branch: master Gerrit-Change-Id: I695bd3933a116323db45ab7f45dcf539791139aa Gerrit-Change-Number: 39406 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • ...
  • 150
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.