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-ci[master]: jobs: manually trigger "git gc" for linux.git
by fixeria 20 Jan '25

20 Jan '25
Attention is currently required from: osmith. fixeria has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ci/+/39373?usp=email ) Change subject: jobs: manually trigger "git gc" for linux.git ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/39373?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: Ic81ae5a1edb0dbe119e06cc3b49ea69ef81b2a5f Gerrit-Change-Number: 39373 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 20 Jan 2025 12:50:59 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-ci[master]: jobs: manually trigger "git gc" for linux.git
by osmith 20 Jan '25

20 Jan '25
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/39373?usp=email ) Change subject: jobs: manually trigger "git gc" for linux.git ...................................................................... jobs: manually trigger "git gc" for linux.git We already use shallow clones for linux.git, and git runs a garbage collector automatically to ensure no longer needed artifacts are removed. But this did not work anymore on build4 for build-kernel-net-next, and it increased up to 8.4 GiB: 8,4 GiB /build-kernel-net-next After running "git gc" again: 3,3 GiB /build-kernel-net-next The reason was that "git gc" did not exit successfully once and wrote a log file, then refused to run again. Run "git gc --auto" explicitly in foreground to let abort in such a case, so it does not go unnoticed in the future. Change-Id: Ic81ae5a1edb0dbe119e06cc3b49ea69ef81b2a5f --- M jobs/build-kernels-testenv.yml M jobs/gerrit-verifications-dahdi.yml M jobs/master-builds-dahdi.yml 3 files changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/73/39373/1 diff --git a/jobs/build-kernels-testenv.yml b/jobs/build-kernels-testenv.yml index d916093..47a9dd9 100644 --- a/jobs/build-kernels-testenv.yml +++ b/jobs/build-kernels-testenv.yml @@ -43,6 +43,9 @@ default: 'master' builders: - shell: |- + git config gc.autoDetach false + git gc --auto + IMAGE="osmocom-build/debian-bookworm-osmo-ttcn3-testenv" podman pull "registry.osmocom.org/$IMAGE" diff --git a/jobs/gerrit-verifications-dahdi.yml b/jobs/gerrit-verifications-dahdi.yml index 2cf9e95..de11b25 100644 --- a/jobs/gerrit-verifications-dahdi.yml +++ b/jobs/gerrit-verifications-dahdi.yml @@ -80,6 +80,9 @@ builders: - shell: | + git -C linux config gc.autoDetach false + git -C linux gc --auto + rm -rf dahdi-linux git init dahdi-linux cd dahdi-linux diff --git a/jobs/master-builds-dahdi.yml b/jobs/master-builds-dahdi.yml index 8f6d070..f72076f 100644 --- a/jobs/master-builds-dahdi.yml +++ b/jobs/master-builds-dahdi.yml @@ -56,6 +56,9 @@ builders: - shell: | + git -C linux config gc.autoDetach false + git -C linux gc --auto + rm -rf dahdi-linux git clone \ --depth=1 \ -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/39373?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: Ic81ae5a1edb0dbe119e06cc3b49ea69ef81b2a5f Gerrit-Change-Number: 39373 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de>
1 0
0 0
[S] Change in pysim[master]: global_platform: fix usage of the Key Version Number (kvn)
by laforge 20 Jan '25

20 Jan '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/39225?usp=email ) Change subject: global_platform: fix usage of the Key Version Number (kvn) ...................................................................... global_platform: fix usage of the Key Version Number (kvn) The kvn parameter is used to select a keyset when establishin a secure channel. At the moment this is a mandatory parameter and it must be within a certain range. However GPC_SPE_034 explicitly defines a reserved kvn value 0, that always refers to the first available key. That effectively makes it an optional parameter and the commandline interface should have the --key-ver parameter as an optional parameter. The ranges also have to be extended to allow 0 as kvn value. We also have to put a range to support the sysmoUSIM-SJS1, which uses kvn value 1, which is a non standard value. Related: OS#6679 Change-Id: I42be2438c7f199b238f2ec7a9434cec5393210a7 --- M pySim/global_platform/__init__.py M pySim/global_platform/scp.py 2 files changed, 40 insertions(+), 5 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/pySim/global_platform/__init__.py b/pySim/global_platform/__init__.py index c0607ae..f2bec81 100644 --- a/pySim/global_platform/__init__.py +++ b/pySim/global_platform/__init__.py @@ -795,7 +795,7 @@ return self._cmd.lchan.scc.send_apdu_checksw(cmd_hex) est_scp02_parser = argparse.ArgumentParser() - est_scp02_parser.add_argument('--key-ver', type=auto_uint8, required=True, help='Key Version Number (KVN)') + est_scp02_parser.add_argument('--key-ver', type=auto_uint8, default=0, help='Key Version Number (KVN)') est_scp02_parser.add_argument('--host-challenge', type=is_hexstr, help='Hard-code the host challenge; default: random') est_scp02_parser.add_argument('--security-level', type=auto_uint8, default=0x01, @@ -900,7 +900,9 @@ class GpCardKeyset: """A single set of GlobalPlatform card keys and the associated KVN.""" def __init__(self, kvn: int, enc: bytes, mac: bytes, dek: bytes): - assert 0 < kvn < 256 + # The Key Version Number is an 8 bit integer number, where 0 refers to the first available key, + # see also: GPC_SPE_034, section E.5.1.3 + assert 0 <= kvn < 256 assert len(enc) == len(mac) == len(dek) self.kvn = kvn self.enc = enc diff --git a/pySim/global_platform/scp.py b/pySim/global_platform/scp.py index 3fe7601..72aed24 100644 --- a/pySim/global_platform/scp.py +++ b/pySim/global_platform/scp.py @@ -113,7 +113,39 @@ class SCP(SecureChannel, abc.ABC): """Abstract base class containing some common interface + functionality for SCP protocols.""" def __init__(self, card_keys: 'GpCardKeyset', lchan_nr: int = 0): - if hasattr(self, 'kvn_range'): + + # Spec references that explain KVN ranges: + # TS 102 225 Annex A.1 states KVN 0x01..0x0F shall be used for SCP80 + # GPC_GUI_003 states + # * For the Issuer Security Domain, this is initially Key Version Number 'FF' which has been deliberately + # chosen to be outside of the allowable range ('01' to '7F') for a Key Version Number. + # * It is logical that the initial keys in the Issuer Security Domain be replaced by an initial issuer Key + # Version Number in the range '01' to '6F'. + # * Key Version Numbers '70' to '72' and '74' to '7F' are reserved for future use. + # * On an implementation supporting Supplementary Security Domains, the RSA public key with a Key Version + # Number '73' and a Key Identifier of '01' has the following functionality in a Supplementary Security + # Domain with the DAP Verification privilege [...] + # GPC_GUI_010 V1.0.1 Section 6 states + # * Key Version number range ('20' to '2F') is reserved for SCP02 + # * Key Version 'FF' is reserved for use by an Issuer Security Domain supporting SCP02, and cannot be used + # for SCP80. This initial key set shall be replaced by a key set with a Key Version Number in the + # ('20' to '2F') range. + # * Key Version number range ('01' to '0F') is reserved for SCP80 + # * Key Version number '70' with Key Identifier '01' is reserved for the Token Key, which is either a RSA + # public key or a DES key + # * Key Version number '71' with Key Identifier '01' is reserved for the Receipt Key, which is a DES key + # * Key Version Number '11' is reserved for DAP as specified in ETSI TS 102 226 [2] + # * Key Version Number '73' with Key Identifier '01' is reserved for the DAP verification key as specified + # in sections 3.3.3 and 4 of [4], which is either an RSA public key or DES key + # * Key Version Number '74' is reserved for the CASD Keys (cf. section 9.2) + # * Key Version Number '75' with Key Identifier '01' is reserved for the key used to decipher the Ciphered + # Load File Data Block described in section 4.8 of [5]. + + if card_keys.kvn == 0: + # Key Version Number 0x00 refers to the first available key, so we won't carry out + # a range check in this case. See also: GPC_SPE_034, section E.5.1.3 + pass + elif hasattr(self, 'kvn_range'): if not card_keys.kvn in range(self.kvn_range[0], self.kvn_range[1]+1): raise ValueError('%s cannot be used with KVN outside range 0x%02x..0x%02x' % (self.__class__.__name__, self.kvn_range[0], self.kvn_range[1])) @@ -224,8 +256,9 @@ constr_iur = Struct('key_div_data'/Bytes(10), 'key_ver'/Int8ub, Const(b'\x02'), 'seq_counter'/Int16ub, 'card_challenge'/Bytes(6), 'card_cryptogram'/Bytes(8)) - # The 0x70 is a non-spec special-case of sysmoISIM-SJA2/SJA5 and possibly more sysmocom products - kvn_ranges = [[0x20, 0x2f], [0x70, 0x70]] + # Key Version Number 0x70 is a non-spec special-case of sysmoISIM-SJA2/SJA5 and possibly more sysmocom products + # Key Version Number 0x01 is a non-spec special-case of sysmoUSIM-SJS1 + kvn_ranges = [[0x01, 0x01], [0x20, 0x2f], [0x70, 0x70]] def __init__(self, *args, **kwargs): self.overhead = 8 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/39225?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I42be2438c7f199b238f2ec7a9434cec5393210a7 Gerrit-Change-Number: 39225 Gerrit-PatchSet: 5 Gerrit-Owner: dexter <pmaier(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 pysim[master]: global_platform: fix usage of the Key Version Number (kvn)
by laforge 20 Jan '25

20 Jan '25
Attention is currently required from: dexter. laforge has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/39225?usp=email ) Change subject: global_platform: fix usage of the Key Version Number (kvn) ...................................................................... Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/39225?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: I42be2438c7f199b238f2ec7a9434cec5393210a7 Gerrit-Change-Number: 39225 Gerrit-PatchSet: 5 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Mon, 20 Jan 2025 12:42:35 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: gbproxy: Don't log the payload size for every DL/UL-UNITDATA
by laforge 20 Jan '25

20 Jan '25
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39372?usp=email ) Change subject: gbproxy: Don't log the payload size for every DL/UL-UNITDATA ...................................................................... gbproxy: Don't log the payload size for every DL/UL-UNITDATA This just wastes memory. We can check the pcaps if a test does fail. Change-Id: I862d67a48f1d694262cf39a1e939033bde0c6eab Related: OS#6704 --- M gbproxy/GBProxy_Tests.ttcn 1 file changed, 0 insertions(+), 3 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, approved diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn index 7a6572a..7f70f96 100644 --- a/gbproxy/GBProxy_Tests.ttcn +++ b/gbproxy/GBProxy_Tests.ttcn @@ -1231,7 +1231,6 @@ /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload); - log("UL-UNITDATA(payload_size=", i); f_pcu2sgsn(pdu_tx, pdu_rx); } setverdict(pass); @@ -1261,7 +1260,6 @@ /* we cannot use pdu_tx as there are some subtle differences in the length field :/ */ var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_UL_UD(g_pars.tlli, bvcc.cell_id, payload); - log("UL-UNITDATA(payload_size=", i); f_pcu2sgsn(pdu_tx, pdu_rx); } setverdict(pass); @@ -1319,7 +1317,6 @@ var template (present) PDU_BSSGP pdu_rx := tr_BSSGP_DL_UD(g_pars.tlli, payload, tr_BSSGP_IMSI(g_pars.imsi)); - log("DL-UNITDATA(payload_size=", i, ")"); f_sgsn2pcu(pdu_tx, pdu_rx); } setverdict(pass); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39372?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I862d67a48f1d694262cf39a1e939033bde0c6eab Gerrit-Change-Number: 39372 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann(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
[XS] Change in osmo-ttcn3-hacks[master]: gbproxy: Don't log the payload size for every DL/UL-UNITDATA
by laforge 20 Jan '25

20 Jan '25
Attention is currently required from: daniel. laforge has posted comments on this change by daniel. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39372?usp=email ) Change subject: gbproxy: Don't log the payload size for every DL/UL-UNITDATA ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/39372?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I862d67a48f1d694262cf39a1e939033bde0c6eab Gerrit-Change-Number: 39372 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann(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-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Mon, 20 Jan 2025 12:39:53 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in pysim[master]: global_platform: add new command "install_cap"
by fixeria 20 Jan '25

20 Jan '25
Attention is currently required from: dexter, laforge. fixeria has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/pysim/+/39199?usp=email ) Change subject: global_platform: add new command "install_cap" ...................................................................... Patch Set 7: (6 comments) File docs/cap-tutorial.rst: https://gerrit.osmocom.org/c/pysim/+/39199/comment/e70f3a56_000afc68?usp=em… : PS7, Line 5: support "do support ... support" https://gerrit.osmocom.org/c/pysim/+/39199/comment/3b844dd9_e0495a8a?usp=em… : PS7, Line 54: "maximum_length_of_data_field_in_command_message": 255 shouldn't there be an additional indention level? File pySim/global_platform/__init__.py: https://gerrit.osmocom.org/c/pysim/+/39199/comment/151e93f6_b121b29e?usp=em… : PS7, Line 868: install Parameters (GPC_SPE_034, section 11.5.2.3.7, table 11-49 looks like copy paste. Maybe clarify that it's one of the installation params setting the volatile memory quota? https://gerrit.osmocom.org/c/pysim/+/39199/comment/e771db3a_fe185277?usp=em… : PS7, Line 865: install_cap_parser.add_argument('--install-parameters', type=is_hexstr, default='', : help='install Parameters (GPC_SPE_034, section 11.5.2.3.7, table 11-49)') : install_cap_parser.add_argument('--install-parameters-volatile-memory-quota', type=int, default=None, : help='install Parameters (GPC_SPE_034, section 11.5.2.3.7, table 11-49)') : install_cap_parser.add_argument('--install-parameters-non-volatile-memory-quota', type=int, default=None, : help='Install Parameters (GPC_SPE_034, section 11.5.2.3.7, table 11-49)') : install_cap_parser.add_argument('--install-parameters-stk', type=is_hexstr, default=None, : Like in previous patch, define them as mutually exclusive params? https://docs.python.org/3/library/argparse.html#mutual-exclusion. File pySim/global_platform/install_param.py: https://gerrit.osmocom.org/c/pysim/+/39199/comment/525ddd5a_7316dc97?usp=em… : PS7, Line 20: from construct import Optional as COptional : fr none of these used? File tests/unittests/test_globalplatform.py: https://gerrit.osmocom.org/c/pysim/+/39199/comment/7cf3087c_1252dfb5?usp=em… : PS7, Line 24: * you only need `gen_install_parameters()`, so import it alone? Otherwise you're importing everything, including imports of the given module. -- To view, visit https://gerrit.osmocom.org/c/pysim/+/39199?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: I6cbd37f0fad5579b20e83c27349bd5acc129e6d0 Gerrit-Change-Number: 39199 Gerrit-PatchSet: 7 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Mon, 20 Jan 2025 12:37:22 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[M] Change in pysim[master]: global_platform: LOAD and INSTALL [for load] support
by fixeria 20 Jan '25

20 Jan '25
Attention is currently required from: dexter, laforge. fixeria has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/pysim/+/37454?usp=email ) Change subject: global_platform: LOAD and INSTALL [for load] support ...................................................................... Patch Set 7: (6 comments) File pySim/global_platform/__init__.py: https://gerrit.osmocom.org/c/pysim/+/37454/comment/9e121e2d_cb2e3367?usp=em… : PS7, Line 20: import io unused import? (hm, why doesn't the linter complain?) https://gerrit.osmocom.org/c/pysim/+/37454/comment/622c3a16_f8831d53?usp=em… : PS7, Line 772: Prefixed(Int8ub, GreedyBytes This is basically LV structure. Given that it's used several times and can be useful in other places, maybe define it somewhere? Wait, actually it's already defined in pyosmocom: ``` # here we collect some shared / common definitions of data types LV = Prefixed(Int8ub, HexAdapter(GreedyBytes)) ``` It's a bit different, but I assume it works the same way? https://gerrit.osmocom.org/c/pysim/+/37454/comment/9020f333_a7771748?usp=em… : PS7, Line 824: ('--from-hex why not using `type=is_hexstr` here? https://gerrit.osmocom.org/c/pysim/+/37454/comment/391df02d_45717cef?usp=em… : PS7, Line 824: load_parser.add_argument('--from-hex', help='load from hex string') : load_parser.add_argument('--from-file', help='load from binary file') : If these params are mutually-exclusive (only one of these must be supplied), please create a group using `add_mutually_exclusive_group()` and make that group `mandatory=True`. https://gerrit.osmocom.org/c/pysim/+/37454/comment/e066d0cc_23d5c223?usp=em… : PS7, Line 833: formatting https://gerrit.osmocom.org/c/pysim/+/37454/comment/5ededfac_4e9b9779?usp=em… : PS7, Line 835: with open(opts.from_file, 'rb') as f: BTW, argparse does have: https://docs.python.org/3/library/argparse.html#filetype-objects -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37454?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: I924aaeecbb3a72bdb65eefbff6135e4e9570579e Gerrit-Change-Number: 37454 Gerrit-PatchSet: 7 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-CC: dexter <pmaier(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Mon, 20 Jan 2025 12:13:01 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[S] Change in libosmo-netif[master]: stream: Add osmo_stream_srv_link_set_msgb_alloc_info()
by pespin 20 Jan '25

20 Jan '25
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39369?usp=email ) Change subject: stream: Add osmo_stream_srv_link_set_msgb_alloc_info() ...................................................................... stream: Add osmo_stream_srv_link_set_msgb_alloc_info() This is needed so that user can set desired headroom+size info on rx-allocated msgbs, so that osmo_stream_srv can inherit them upon osmo_stream_srv_create2(). Manually obtaining the iofd through osmo_stream_srv_get_iofd() and changing the params directly in the iofd produces undesired effects, since the first msgbs are alredy allocated during osmo_stream_srv_create2 (which calls osmo_iofd_register()) before the object is available to the user. As a result, first rx messages may come with unexpected size/headroom. Ideally we'd had written the osmo_stream_srv APIs to have a 2 step setup, eg _alloc() + _run()/_start(), but too late to do so now. This approach is already follwed by existing osmo_stream_srv_link_set_tx_queue_max_length() API. Change-Id: I80a1c4b227629e3ca0c8c587a103db6057322cb4 --- M TODO-RELEASE M include/osmocom/netif/stream.h M src/stream_srv.c 3 files changed, 34 insertions(+), 0 deletions(-) Approvals: 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 Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index e66b421..dfdbd89 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -11,3 +11,4 @@ libosmo-netif add API osmo-stream_cli_set_tx_queue_max_length(), osmo_stream_srv_link_set_tx_queue_max_length() libosmo-netif add API struct osmo_ipa_ka_fsm_inst libosmo-netif add API osmo_stream_{cli,srv}_set_segmentation_cb2() +libosmo-netif add API osmo_stream_srv_link_set_msgb_alloc_info() diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h index e793a26..83f17d7 100644 --- a/include/osmocom/netif/stream.h +++ b/include/osmocom/netif/stream.h @@ -88,6 +88,7 @@ char *osmo_stream_srv_link_get_sockname(const struct osmo_stream_srv_link *link); struct osmo_fd *osmo_stream_srv_link_get_ofd(struct osmo_stream_srv_link *link); int osmo_stream_srv_link_get_fd(const struct osmo_stream_srv_link *link); +int osmo_stream_srv_link_set_msgb_alloc_info(struct osmo_stream_srv_link *link, unsigned int size, unsigned int headroom); bool osmo_stream_srv_link_is_opened(const struct osmo_stream_srv_link *link); int osmo_stream_srv_link_open(struct osmo_stream_srv_link *link); void osmo_stream_srv_link_close(struct osmo_stream_srv_link *link); diff --git a/src/stream_srv.c b/src/stream_srv.c index c2b187a..261539b 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -69,6 +69,15 @@ * Server side. */ +struct msgb_alloc_info { + /*! Whether it was set by user or we use iofd defaults */ + bool set_by_user; + /*! size of msgb to allocate (excluding headroom) */ + unsigned int size; + /*! headroom to allocate when allocating msgb's */ + unsigned int headroom; +}; + #define OSMO_STREAM_SRV_F_RECONF (1 << 0) #define OSMO_STREAM_SRV_F_NODELAY (1 << 1) @@ -88,6 +97,7 @@ void *data; int flags; unsigned int tx_queue_max_length; /* Max amount of msgbs which can be enqueued */ + struct msgb_alloc_info msgb_alloc; struct osmo_sock_init2_multiaddr_pars ma_pars; }; @@ -506,6 +516,26 @@ link->accept_cb = accept_cb; } +/*! Set the msgb allocation parameters on child osmo_stream_srv objects + * \param[in] link Stream Server Link + * \param[in] size Size of msgb to allocate (excluding headroom) + * \param[in] headroom Headroom to allocate when allocating msgb's + * + * The parameters are applied to osmo_stream_srv objects upon creation. + * Setting both to 0 leaves it as implementation default. + **/ +int osmo_stream_srv_link_set_msgb_alloc_info(struct osmo_stream_srv_link *link, unsigned int size, unsigned int headroom) +{ + if (size == 0 && headroom == 0) { + link->msgb_alloc.set_by_user = false; + } else { + link->msgb_alloc.set_by_user = true; + link->msgb_alloc.headroom = headroom; + link->msgb_alloc.size = size; + } + return 0; +} + /*! Destroy the stream server link. Closes + Releases Memory. * \param[in] link Stream Server Link */ void osmo_stream_srv_link_destroy(struct osmo_stream_srv_link *link) @@ -962,6 +992,8 @@ } osmo_iofd_set_txqueue_max_length(conn->iofd, conn->srv->tx_queue_max_length); + if (conn->srv->msgb_alloc.set_by_user) + osmo_iofd_set_alloc_info(conn->iofd, conn->srv->msgb_alloc.size, conn->srv->msgb_alloc.headroom); if (osmo_iofd_register(conn->iofd, fd) < 0) { LOGSSRV(conn, LOGL_ERROR, "could not register FD %d\n", fd); -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39369?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I80a1c4b227629e3ca0c8c587a103db6057322cb4 Gerrit-Change-Number: 39369 Gerrit-PatchSet: 2 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-netif[master]: stream: Add osmo_stream_srv_link_set_msgb_alloc_info()
by pespin 20 Jan '25

20 Jan '25
Attention is currently required from: daniel. pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39369?usp=email ) Change subject: stream: Add osmo_stream_srv_link_set_msgb_alloc_info() ...................................................................... Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39369?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I80a1c4b227629e3ca0c8c587a103db6057322cb4 Gerrit-Change-Number: 39369 Gerrit-PatchSet: 2 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> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Mon, 20 Jan 2025 11:54:11 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • ...
  • 150
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.