Attention is currently required from: neels, laforge.
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/30933
to look at the new patch set (#5).
Change subject: uitils: add floored and euclidian modulo functions
......................................................................
uitils: add floored and euclidian modulo functions
C/C++ only implements a so called "truncated modulo" function. Lets also
add a floored and an euclidian modulo function to be more complete.
Change-Id: If61cd54f43643325c45f64531c57fe4c5802a9cf
---
M include/osmocom/core/utils.h
M tests/utils/utils_test.c
M tests/utils/utils_test.ok
3 files changed, 102 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/33/30933/5
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30933
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If61cd54f43643325c45f64531c57fe4c5802a9cf
Gerrit-Change-Number: 30933
Gerrit-PatchSet: 5
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: neels, laforge.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/30933 )
Change subject: uitils: add floored and euclidian modulo functions
......................................................................
Patch Set 5:
(4 comments)
File include/osmocom/core/utils.h:
https://gerrit.osmocom.org/c/libosmocore/+/30933/comment/66c32e20_43167974
PS4, Line 185: .
> would be very helpful to include a brief explanation, sort of like "A modulo where the result always […]
As far as I can see this is not the only property of this modulo function. I don't think that this is helpful. Users are either aware of the mathematical properties and know whats going on here or they don't, then its better for them to look it up in the referenced paper. (I also can't claim for me to fully understand whats going on here, the more I am happy that the paper contains mathematical proofs and test vectors)
https://gerrit.osmocom.org/c/libosmocore/+/30933/comment/d2c46ba3_8fdccf39
PS4, Line 189: x
> you neet to put braces around every single occurence of these parameters like […]
Done
https://gerrit.osmocom.org/c/libosmocore/+/30933/comment/4576e02c_7c864596
PS4, Line 191: )
> "A modulo where the result is always positive" or something
(see above)
https://gerrit.osmocom.org/c/libosmocore/+/30933/comment/03c9e82c_dde1255b
PS4, Line 195: y > 0 ? x % y + y : x % y - y
> please put braces around this section. […]
Done
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30933
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If61cd54f43643325c45f64531c57fe4c5802a9cf
Gerrit-Change-Number: 30933
Gerrit-PatchSet: 5
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Wed, 11 Jan 2023 14:26:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30926 )
Change subject: upf/PFCP: do not imply f_inet_addr()
......................................................................
Patch Set 2:
(3 comments)
File hnbgw/HNBGW_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30926/comment/1a5b60cc_4c54…
PS2, Line 1318: var F_SEID up_f_seid := valueof(ts_PFCP_F_SEID_ipv4(f_inet_addr("127.0.0.1"), '1111111111111111'O));
> yes i realized that recently, already changed the template. […]
Done
File library/PFCP_Templates.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30926/comment/6426d596_a09c…
PS2, Line 423: Create_PDR_list create_pdr,
> yes but separate patch
Done
File upf/UPF_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30926/comment/48c5681e_0870…
PS2, Line 645: PFCP.send(ts_PFCP_Session_Est_Req(ts_PFCP_Node_ID_ipv4(f_inet_addr(g_pars.local_addr)),
> nitpick: no need to call f_inet_addr() twice, you can simply store in a local var.
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30926
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib068831787f4256f70a2189a5f36ca1ea1f40c9e
Gerrit-Change-Number: 30926
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 11 Jan 2023 13:35:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30926 )
Change subject: upf/PFCP: do not imply f_inet_addr()
......................................................................
Patch Set 2:
(3 comments)
File hnbgw/HNBGW_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30926/comment/ac6665f2_8ac9…
PS2, Line 1318: var F_SEID up_f_seid := valueof(ts_PFCP_F_SEID_ipv4(f_inet_addr("127.0.0.1"), '1111111111111111'O));
> tip: if you had written the templates below using "template (value)" as parameter you wouldn't need […]
yes i realized that recently, already changed the template. this caller didn't reflect that yet -- not related to this patch
File library/PFCP_Templates.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30926/comment/c4b9c67a_ef24…
PS2, Line 327: template (value) Outer_Header_Creation ts_PFCP_Outer_Header_Creation_GTP_ipv4(OCT4 remote_teid, OCT4 remote_addr_v4) := {
> here, these params would better be "template (value)" so that they both accept "template (value)" an […]
seems odd for a "native" type like OCT4?
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30926/comment/83bfc739_54f0…
PS2, Line 423: Create_PDR_list create_pdr,
> same here, these can be "template (value)".
yes but separate patch
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30926
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib068831787f4256f70a2189a5f36ca1ea1f40c9e
Gerrit-Change-Number: 30926
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 11 Jan 2023 13:34:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge, dexter.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/30933 )
Change subject: uitils: add floored and euclidian modulo functions
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4:
> (The paper I am referring to can be found at: https://www.microsoft. […]
wikipedia also has a good explanation
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30933
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If61cd54f43643325c45f64531c57fe4c5802a9cf
Gerrit-Change-Number: 30933
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 11 Jan 2023 13:25:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge, dexter.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/30933 )
Change subject: uitils: add floored and euclidian modulo functions
......................................................................
Patch Set 4:
(5 comments)
Commit Message:
https://gerrit.osmocom.org/c/libosmocore/+/30933/comment/8a2bf48e_d52d762c
PS4, Line 10: add a floored and an euclidian modulo function to be more complete.
please name the place where / the reason why you would like to use these ideally with change-id reference to another patch
File include/osmocom/core/utils.h:
https://gerrit.osmocom.org/c/libosmocore/+/30933/comment/10122b9f_a937af90
PS4, Line 185: .
would be very helpful to include a brief explanation, sort of like "A modulo where the result always has the sign of the divisor"
https://gerrit.osmocom.org/c/libosmocore/+/30933/comment/b2a0a2b3_52985edf
PS4, Line 189: x
you neet to put braces around every single occurence of these parameters like
(x) + (y)
It is also a good idea to not use names commonly used in C code, so rather X and Y.
https://gerrit.osmocom.org/c/libosmocore/+/30933/comment/44d5628f_d1fd143a
PS4, Line 191: )
"A modulo where the result is always positive" or something
https://gerrit.osmocom.org/c/libosmocore/+/30933/comment/551df9c7_19a3e717
PS4, Line 195: y > 0 ? x % y + y : x % y - y
please put braces around this section.
also braces around each (x) and (y)
also X and Y
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30933
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If61cd54f43643325c45f64531c57fe4c5802a9cf
Gerrit-Change-Number: 30933
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 11 Jan 2023 13:24:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: laforge.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/30922 )
Change subject: abis_rsl: fix frame number calculation
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> We might want to generalize this and introduce a macro or an inline function for euclidian modulo in […]
Yes that makes sense. I have posted a patch for libosmocore: https://gerrit.osmocom.org/c/libosmocore/+/30933
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30922
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I5fb2b0ada8d409730ac22963741fb4ab0026abdd
Gerrit-Change-Number: 30922
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Wed, 11 Jan 2023 12:39:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: comment