[M] Change in osmo-hnbgw[master]: Introduce concept of per-HNB persistent data structure

2024-03-07 Thread pespin
Attention is currently required from: laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email )

Change subject: Introduce concept of per-HNB persistent data structure
..


Patch Set 3:

(1 comment)

File src/osmo-hnbgw/hnbgw_vty.c:

https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081/comment/08d1c707_a9cf51af
PS2, Line 825:   "hnb UMTS_CELL_ID",
> I would keep the single-string option even if there was a different method in 
> addition to it. […]
ok as you see.



--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ife89a7a206836bd89334d19d3cf8c92969dd74de
Gerrit-Change-Number: 36081
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 23:31:35 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


[M] Change in osmo-hnbgw[master]: Introduce concept of per-HNB persistent data structure

2024-03-07 Thread laforge
Attention is currently required from: pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email )

Change subject: Introduce concept of per-HNB persistent data structure
..


Patch Set 3:

(1 comment)

File src/osmo-hnbgw/hnbgw_vty.c:

https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081/comment/92966a6c_dea48d5a
PS2, Line 825:   "hnb UMTS_CELL_ID",
> Ok, the data structures can be kept like this and mangled/renamed at a later 
> point. […]
I would keep the single-string option even if there was a different method in 
addition to it.  The single string can be copy+pasted from log files or from 
stats counter naemes, etc.



--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ife89a7a206836bd89334d19d3cf8c92969dd74de
Gerrit-Change-Number: 36081
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 07 Mar 2024 21:02:41 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


[M] Change in osmo-mgw[master]: migrate mgcp_client from osmo_wqueue to osmo_io

2024-03-07 Thread pespin
Attention is currently required from: dexter, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/36142?usp=email )

Change subject: migrate mgcp_client from osmo_wqueue to osmo_io
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/36142?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I766224da4691695c023d4d08d042a4bbeba05e47
Gerrit-Change-Number: 36142
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 07 Mar 2024 19:50:19 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-hnbgw[master]: Introduce concept of per-HNB persistent data structure

2024-03-07 Thread pespin
Attention is currently required from: laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email )

Change subject: Introduce concept of per-HNB persistent data structure
..


Patch Set 3: Code-Review+1

(1 comment)

File src/osmo-hnbgw/hnbgw_vty.c:

https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081/comment/3d5deced_40a72fe0
PS2, Line 825:   "hnb UMTS_CELL_ID",
> > Also not blocking, but I have to say I'm not really liking this concept of 
> > "persistent structure"  […]
Ok, the data structures can be kept like this and mangled/renamed at a later 
point.
But I'd really move the 1-string-param to be separated fields. You can do that 
in a follow-up commit but I would avoid merging this one and later on changing 
the vty interface.



--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ife89a7a206836bd89334d19d3cf8c92969dd74de
Gerrit-Change-Number: 36081
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 19:48:51 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


[M] Change in osmo-mgw[master]: migrate mgcp_client from osmo_wqueue to osmo_io

2024-03-07 Thread laforge
Attention is currently required from: dexter, jolly.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/36142?usp=email )

Change subject: migrate mgcp_client from osmo_wqueue to osmo_io
..


Patch Set 1:

(3 comments)

File src/libosmo-mgcp-client/mgcp_client.c:

https://gerrit.osmocom.org/c/osmo-mgw/+/36142/comment/31653e2b_713d7085
PS1, Line 731: mgcp_do_read
> mgcp_read_cb
Done


https://gerrit.osmocom.org/c/osmo-mgw/+/36142/comment/50ad686c_49bb9120
PS1, Line 790: errno
> uring IO does not set errno. "res" is used instead and carries -errno. […]
Done


https://gerrit.osmocom.org/c/osmo-mgw/+/36142/comment/8933d98b_0066f444
PS1, Line 826: errno
> dito. […]
Done



--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/36142?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I766224da4691695c023d4d08d042a4bbeba05e47
Gerrit-Change-Number: 36142
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: jolly 
Gerrit-Attention: jolly 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 07 Mar 2024 18:45:26 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jolly 
Gerrit-MessageType: comment


[M] Change in osmo-mgw[master]: migrate mgcp_client from osmo_wqueue to osmo_io

2024-03-07 Thread laforge
Attention is currently required from: dexter, laforge.

Hello Jenkins Builder, dexter, jolly,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-mgw/+/36142?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Code-Review+1 by dexter, Verified+1 by Jenkins Builder, Verified+1 by dexter


Change subject: migrate mgcp_client from osmo_wqueue to osmo_io
..

migrate mgcp_client from osmo_wqueue to osmo_io

The new osmo_io framework means that we can [optionally] make use
of the io_uring backend, which greatly reduces the syscall load
compared to the legacy osmo_wqueue + osmo_select_main + read/write.

We only use features already present in the intiial osmo_io support
of libosmocore 1.9.0, so no entry in TODO-RELEASE is needed.

Closes: OS#5754
Related: OS#5755
Change-Id: I766224da4691695c023d4d08d042a4bbeba05e47
---
M include/osmocom/mgcp_client/mgcp_client_internal.h
M src/libosmo-mgcp-client/mgcp_client.c
M src/libosmo-mgcp-client/mgcp_client_vty.c
3 files changed, 75 insertions(+), 55 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/42/36142/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/36142?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I766224da4691695c023d4d08d042a4bbeba05e47
Gerrit-Change-Number: 36142
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: dexter 
Gerrit-MessageType: newpatchset


[M] Change in osmo-hnbgw[master]: Introduce concept of per-HNB persistent data structure

2024-03-07 Thread laforge
Attention is currently required from: pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email )

Change subject: Introduce concept of per-HNB persistent data structure
..


Patch Set 3:

(1 comment)

File src/osmo-hnbgw/hnbgw_vty.c:

https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081/comment/0aabdb1d_8b2ff2a6
PS2, Line 825:   "hnb UMTS_CELL_ID",
> Also not blocking, but I have to say I'm not really liking this concept of 
> "persistent structure" you are adding. I'd probably go for something more 
> similar to what we do with ASPs in libosmo-sccp. The same structure is used 
> to handle everything related to that entity, and if it is dynamically created 
> then a "hnb->dynamic=true" is added to it, so that it is not written back to 
> the config file.

I actually like the approach here.  Sure, one can rename structures to improve 
naming if that's a concern.  But fundamentally the persistent ddata like 
counters is different from the dynamic (connection) part.  I see no reason to 
mix those two.

btw: in libosmo-sigtran the dynamic ASP is also gone after it has disconnected, 
therefore no persistent counters.  So it's not a solution.

Having another syntax to enter the hnb node on the VTY is fine with me, and one 
can even have multiple different formats to do that.  But let's focus on the 
important part of implementing the persistent counters/statistics first.



--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ife89a7a206836bd89334d19d3cf8c92969dd74de
Gerrit-Change-Number: 36081
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 07 Mar 2024 18:42:41 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


[M] Change in osmo-hnbgw[master]: Introduce concept of per-HNB persistent data structure

2024-03-07 Thread pespin
Attention is currently required from: laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email )

Change subject: Introduce concept of per-HNB persistent data structure
..


Patch Set 3:

(1 comment)

File src/osmo-hnbgw/hnbgw_vty.c:

https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081/comment/f3321b40_0d19a3ec
PS2, Line 825:   "hnb UMTS_CELL_ID",
> Ack fine then. […]
Extra bonus for using several VTY parameters: You can specify the cmd so that 
it accepts both hex and dec format for any field.



--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ife89a7a206836bd89334d19d3cf8c92969dd74de
Gerrit-Change-Number: 36081
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 18:02:36 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


[M] Change in osmo-hnbgw[master]: Various new per-hnb RANAP and RUA counters

2024-03-07 Thread pespin
Attention is currently required from: laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36083?usp=email )

Change subject: Various new per-hnb RANAP and RUA counters
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36083?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I61bd4f51ec88fd93d8640d39228ac85f5ac5b69b
Gerrit-Change-Number: 36083
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 18:00:45 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-hnbgw[master]: New per-hnb rate_ctr and stat_item groups; track uptime

2024-03-07 Thread pespin
Attention is currently required from: laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36082?usp=email )

Change subject: New per-hnb rate_ctr and stat_item groups; track uptime
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36082?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I26d7c3657cdaf7c6ba5aa10a0677381ab099f8dd
Gerrit-Change-Number: 36082
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 17:59:25 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-hnbgw[master]: New per-hnb rate_ctr and stat_item groups; track uptime

2024-03-07 Thread pespin
Attention is currently required from: laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36082?usp=email )

Change subject: New per-hnb rate_ctr and stat_item groups; track uptime
..


Patch Set 3:

(1 comment)

Commit Message:

https://gerrit.osmocom.org/c/osmo-hnbgw/+/36082/comment/66ba0db6_3089ecec
PS3, Line 9: Let's asd a per-hnb rate_ctr and stat_item group.  Only one initial
add



--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36082?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I26d7c3657cdaf7c6ba5aa10a0677381ab099f8dd
Gerrit-Change-Number: 36082
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 17:56:36 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmo-hnbgw[master]: Introduce concept of per-HNB persistent data structure

2024-03-07 Thread pespin
Attention is currently required from: laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email )

Change subject: Introduce concept of per-HNB persistent data structure
..


Patch Set 3:

(2 comments)

Patchset:

PS3:
I


File src/osmo-hnbgw/hnbgw_vty.c:

https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081/comment/5a0ae855_8205f5d7
PS2, Line 825:   "hnb UMTS_CELL_ID",
> the way we do it in the BSC was based around the idea that there is a 0-255 
> bts_nr, which in turn ha […]
Ack fine then. But the fact that xxx-yyy-Llac-Rrac-Ssac-Ccid needs to be passed 
as a string in VTY is a bit weird imho, since you are basically skipping the 
"vty parameter" functionality that VTY provides, which makes it easier for user 
to figure out each field by introspecting, etc.

Also not blocking, but I have to say I'm not really liking this concept of 
"persistent structure" you are adding. I'd probably go for something more 
similar to what we do with ASPs in libosmo-sccp. The same structure is used to 
handle everything related to that entity, and if it is dynamically created then 
a "hnb->dynamic=true" is added to it, so that it is not written back to the 
config file.
Maybe the problem is that we shouldn't be destroying the other structure upon 
reconnect, even for dynamic ones.
The difference is that dynamic ones become gone once the process exits.

Maybe the problem is that hnb_context should be renamed to hnb_conn and your 
persistent one be named hnb_context or simply "hnb".



--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ife89a7a206836bd89334d19d3cf8c92969dd74de
Gerrit-Change-Number: 36081
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 17:54:42 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


[M] Change in osmo-hnbgw[master]: Various new per-hnb RANAP and RUA counters

2024-03-07 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36083?usp=email )

Change subject: Various new per-hnb RANAP and RUA counters
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36083?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I61bd4f51ec88fd93d8640d39228ac85f5ac5b69b
Gerrit-Change-Number: 36083
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Thu, 07 Mar 2024 17:46:59 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmo-hnbgw[master]: New per-hnb rate_ctr and stat_item groups; track uptime

2024-03-07 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36082?usp=email )

Change subject: New per-hnb rate_ctr and stat_item groups; track uptime
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36082?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I26d7c3657cdaf7c6ba5aa10a0677381ab099f8dd
Gerrit-Change-Number: 36082
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Thu, 07 Mar 2024 17:46:55 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[M] Change in osmo-hnbgw[master]: Introduce concept of per-HNB persistent data structure

2024-03-07 Thread laforge
Attention is currently required from: pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email )

Change subject: Introduce concept of per-HNB persistent data structure
..


Patch Set 3:

(1 comment)

File src/osmo-hnbgw/hnbgw_vty.c:

https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081/comment/8ee08c8b_e745aa8d
PS2, Line 825:   "hnb UMTS_CELL_ID",
> why doing it this way instead of doing it like in osmo-bsc? Just wondering, 
> I'm fine with this too.
the way we do it in the BSC was based around the idea that there is a 0-255 
bts_nr, which in turn has its basis in TS 12.21 OML.  Here we don't have an 
equivalent to that.  Any number/index we come up with is completely arbitrary.

So rather than inventing some new number that is not resembled anywhere, lets 
use something that appears in reality.  That's either the umts cell identity, 
or the identity string sent during HNBAP register.

I originally had used the identity string in an earlier version of the patch, 
but during discussion with a customer I had to agree with them that the "UMTS 
CGI equivalent" is the better _primary key_, as it is unique for each cell in 
the network.  The identity string of the hNodeB is something usually determined 
by the manufacturer, and it has no inherent meaning to the operator (like 
MAC-address derived strings, manufacturer serial numbers, ...)



--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ife89a7a206836bd89334d19d3cf8c92969dd74de
Gerrit-Change-Number: 36081
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 07 Mar 2024 17:46:45 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


[S] Change in osmo-hnbgw[master]: umts_cell_id_name: Use 3-digit MCC and 2/3-digit MNC based on VTY config

2024-03-07 Thread pespin
Attention is currently required from: laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36202?usp=email )

Change subject: umts_cell_id_name: Use 3-digit MCC and 2/3-digit MNC based on 
VTY config
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36202?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I015ad84a6f61b4420f6bfdaa60e8e1b53a71589c
Gerrit-Change-Number: 36202
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 17:44:03 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-hnbgw[master]: Introduce concept of per-HNB persistent data structure

2024-03-07 Thread laforge
Attention is currently required from: laforge.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email )

Change subject: Introduce concept of per-HNB persistent data structure
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36081?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ife89a7a206836bd89334d19d3cf8c92969dd74de
Gerrit-Change-Number: 36081
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 17:42:48 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in osmo-hnbgw[master]: osmo_hnbgw_main: Install our usual SIGUSR1/SIGUSR2/SIGABRT handlers

2024-03-07 Thread laforge
Attention is currently required from: laforge.

Hello Jenkins Builder, fixeria, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-hnbgw/+/36203?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder

The change is no longer submittable: Verified is unsatisfied now.


Change subject: osmo_hnbgw_main: Install our usual SIGUSR1/SIGUSR2/SIGABRT 
handlers
..

osmo_hnbgw_main: Install our usual SIGUSR1/SIGUSR2/SIGABRT handlers

I just wanted to get a talloc report from osmo-hnbgw by sending SIGUSR1
and the process terminated.  Clearly not the desired behaviour...

Change-Id: I1209a2fadacf62afd5027480426285f527249788
---
M src/osmo-hnbgw/osmo_hnbgw_main.c
1 file changed, 45 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/03/36203/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36203?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I1209a2fadacf62afd5027480426285f527249788
Gerrit-Change-Number: 36203
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-MessageType: newpatchset


[L] Change in osmo-hnbgw[master]: [cosmetic] re-order hnbgw.c to group code in major blocks

2024-03-07 Thread pespin
Attention is currently required from: laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email )

Change subject: [cosmetic] re-order hnbgw.c to group code in major blocks
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ia7ce60e6f80d10b7712de1aa6d8a30dd61690dcc
Gerrit-Change-Number: 36080
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 17:35:49 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[L] Change in osmo-hnbgw[master]: [cosmetic] re-order hnbgw.c to group code in major blocks

2024-03-07 Thread pespin
Attention is currently required from: laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email )

Change subject: [cosmetic] re-order hnbgw.c to group code in major blocks
..


Patch Set 2:

(1 comment)

Patchset:

PS1:
> Sorry, not now, I have just spent multiple hours 
> rebasing/weaving/merge-conflict-resolving. […]
Fine, just sharing thoughts.



--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ia7ce60e6f80d10b7712de1aa6d8a30dd61690dcc
Gerrit-Change-Number: 36080
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 17:35:44 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


[S] Change in libosmo-netif[master]: stream_cli: Correctly setup and free osmo_io client instance

2024-03-07 Thread pespin
Attention is currently required from: daniel, dexter, jolly.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email )

Change subject: stream_cli: Correctly setup and free osmo_io client instance
..


Patch Set 8: Code-Review+1

(1 comment)

File src/stream_cli.c:

https://gerrit.osmocom.org/c/libosmo-netif/+/35979/comment/3b620ec1_8f176641
PS8, Line 950: #ifdef HAVE_LIBSCTP
All this code starting from here and below can be cleaned up a bit in another 
patch. It's difficult to follow with the ifdefs and the "if (!cli->iofd)" 
afterwards...



--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I91a6a76b9ff96034a7b333edf87af27490202932
Gerrit-Change-Number: 35979
Gerrit-PatchSet: 8
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: daniel 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 07 Mar 2024 17:32:10 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[L] Change in osmo-hnbgw[master]: [cosmetic] re-order hnbgw.c to group code in major blocks

2024-03-07 Thread laforge
Attention is currently required from: pespin.

Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder


Change subject: [cosmetic] re-order hnbgw.c to group code in major blocks
..

[cosmetic] re-order hnbgw.c to group code in major blocks

Change-Id: Ia7ce60e6f80d10b7712de1aa6d8a30dd61690dcc
---
M src/osmo-hnbgw/hnbgw.c
1 file changed, 203 insertions(+), 173 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/80/36080/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ia7ce60e6f80d10b7712de1aa6d8a30dd61690dcc
Gerrit-Change-Number: 36080
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Attention: pespin 
Gerrit-MessageType: newpatchset


[L] Change in osmo-hnbgw[master]: [cosmetic] re-order hnbgw.c to group code in major blocks

2024-03-07 Thread laforge
Attention is currently required from: pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email )

Change subject: [cosmetic] re-order hnbgw.c to group code in major blocks
..


Patch Set 1:

(1 comment)

This change is ready for review.

Patchset:

PS1:
> You could even take the chance to split hnb_context to its own file. […]
Sorry, not now, I have just spent multiple hours 
rebasing/weaving/merge-conflict-resolving.   That should be done at a time when 
there's not significant changes piled on top of it.



--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ia7ce60e6f80d10b7712de1aa6d8a30dd61690dcc
Gerrit-Change-Number: 36080
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 07 Mar 2024 17:25:16 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


[S] Change in osmo-hnbgw[master]: Introduce umts_cell_id_from_str() as inverse of umts_cell_id_name()

2024-03-07 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36204?usp=email )


Change subject: Introduce umts_cell_id_from_str() as inverse of 
umts_cell_id_name()
..

Introduce umts_cell_id_from_str() as inverse of umts_cell_id_name()

We are about to introduce the stringified UMTS cell identifier to the
VTY, and for that we need to not only print but also parse the related
string.

Related: SYS#6773
Change-Id: I6da947d1f2316241e44e53bb6aaec4221cfaa2c0
---
M include/osmocom/hnbgw/hnbgw.h
M src/osmo-hnbgw/hnbgw.c
2 files changed, 41 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/04/36204/1

diff --git a/include/osmocom/hnbgw/hnbgw.h b/include/osmocom/hnbgw/hnbgw.h
index f4f7dc1..62b548c 100644
--- a/include/osmocom/hnbgw/hnbgw.h
+++ b/include/osmocom/hnbgw/hnbgw.h
@@ -79,6 +79,7 @@
uint32_t cid;   /*!< Cell ID */
 };
 const char *umts_cell_id_name(const struct umts_cell_id *ucid);
+int umts_cell_id_from_str(struct umts_cell_id *ucid, const char *instr);

 struct hnbgw_context_map;

diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index 8b00ecb..4fc4e3d 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -202,6 +202,32 @@
   ucid->sac, ucid->cid);
 }

+/* parse a string representation of an umts_cell_id into its decoded 
representation */
+int umts_cell_id_from_str(struct umts_cell_id *ucid, const char *instr)
+{
+   int rc = sscanf(instr, "%hu-%hu-L%hu-R%hu-S%hu-C%u", >mcc, 
>mnc, >lac, >rac, >sac, >cid);
+   if (rc < 0)
+   return -errno;
+
+   if (rc != 6)
+   return -EINVAL;
+
+   if (ucid->mcc > 999)
+   return -EINVAL;
+
+   if (ucid->mnc > 999)
+   return -EINVAL;
+
+   if (ucid->lac == 0 || ucid->lac == 0x)
+   return -EINVAL;
+
+   /* CellIdentity in the ASN.1 syntax is a bit-string of 28 bits length */
+   if (ucid->cid >= (1 << 28))
+   return -EINVAL;
+
+   return 0;
+}
+
 const char *hnb_context_name(struct hnb_context *ctx)
 {
char *result;

--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36204?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I6da947d1f2316241e44e53bb6aaec4221cfaa2c0
Gerrit-Change-Number: 36204
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


[S] Change in osmo-hnbgw[master]: osmo_hnbgw_main: Install our usual SIGUSR1/SIGUSR2/SIGABRT handlers

2024-03-07 Thread fixeria
Attention is currently required from: laforge.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36203?usp=email )

Change subject: osmo_hnbgw_main: Install our usual SIGUSR1/SIGUSR2/SIGABRT 
handlers
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36203?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I1209a2fadacf62afd5027480426285f527249788
Gerrit-Change-Number: 36203
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 16:57:24 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmo-netif[master]: stream_cli: Correctly setup and free osmo_io client instance

2024-03-07 Thread laforge
Attention is currently required from: daniel, dexter, jolly, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email )

Change subject: stream_cli: Correctly setup and free osmo_io client instance
..


Patch Set 8: Code-Review+1

(1 comment)

Patchset:

PS7:
> I don't get it.  osmo_iofd_setup is somtehing you  call once for allocation 
> and configuration. […]
ok, so normally osmo_stream_cli_create() should be calling osmo_iofd_setup().  
In osmo_stream_cli_open() we should only call osmo_iofd_register().  That way 
we could do any number of open/close (vs. register/unregister) cycles without 
having to allocate a new iofd.

The reason we're not using osmo_iofd as it is expected to use is probably 
because in osmo_stream_cli_create() we don't yet know the mode, and hence don't 
know if we should go the osmo_fd or the osmo_iofd route.

Therefore we need to work-around this by doing osmo_iofd_setup() every time we 
go through osmo_stream_cli_open() - and hence we also need to free it.  Sad, 
but we need to work around the mode not being known earlier.  We might add some 
comments to explain the unusual use of osmo_iofd



--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I91a6a76b9ff96034a7b333edf87af27490202932
Gerrit-Change-Number: 35979
Gerrit-PatchSet: 8
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: pespin 
Gerrit-Attention: daniel 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 07 Mar 2024 16:45:50 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: jolly 
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: daniel 
Gerrit-MessageType: comment


[S] Change in libosmo-netif[master]: stream_cli: Correctly setup and free osmo_io client instance

2024-03-07 Thread laforge
Attention is currently required from: daniel, dexter, jolly, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email )

Change subject: stream_cli: Correctly setup and free osmo_io client instance
..


Patch Set 8:

(1 comment)

Patchset:

PS7:
> osmo_iofd_setup() creates a new osmi_io instance. […]
I don't get it.  osmo_iofd_setup is somtehing you  call once for allocation and 
configuration.  you can then many times do 
osmo_iofd_register/unregister/register/unregister with different 
file-descriptors.  Why do we need more functions as you say?



--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I91a6a76b9ff96034a7b333edf87af27490202932
Gerrit-Change-Number: 35979
Gerrit-PatchSet: 8
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: pespin 
Gerrit-Attention: daniel 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 07 Mar 2024 16:40:57 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jolly 
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: daniel 
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Don't pretend to support backends without close_cb

2024-03-07 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36191?usp=email )

Change subject: osmo_io: Don't pretend to support backends without close_cb
..

osmo_io: Don't pretend to support backends without close_cb

Let's not pretend we support backends without a close_cb.  In such
situations nobody would actually close(2) the file descriptor,
but we would set iofd->fd to -1, effectively creating a file descriptor
leak.

Both of our two back-ends provide a close_cb, and we don't need to
consider hypothetical future back-ends that would not like to register
such a call-back.

Related: OS#6393
Change-Id: Id285f1d7b73ae5805aa618897016ae8b73bf892d
---
M src/core/osmo_io.c
1 file changed, 21 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  jolly: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved




diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index bcd4add..8b53aa6 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -787,8 +787,8 @@

iofd->pending = NULL;

-   if (osmo_iofd_ops.close)
-   rc = osmo_iofd_ops.close(iofd);
+   OSMO_ASSERT(osmo_iofd_ops.close);
+   rc = osmo_iofd_ops.close(iofd);
iofd->fd = -1;
return rc;
 }

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36191?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id285f1d7b73ae5805aa618897016ae8b73bf892d
Gerrit-Change-Number: 36191
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in libosmocore[master]: osmo_io: Guard osmo_iofd_register() with invalid file descriptor

2024-03-07 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email )

Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor
..

osmo_io: Guard osmo_iofd_register() with invalid file descriptor

Let's return an error if both osmo_iofd_setup() and osmo_iofd_register()
are called with an invalid file descriptor like -1.  Either one of them
must have been called with a valid file descriptor.

Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
---
M src/core/osmo_io.c
1 file changed, 18 insertions(+), 0 deletions(-)

Approvals:
  dexter: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  jolly: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved




diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index 5a5e05c..f0d213c 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -672,6 +672,11 @@

if (fd >= 0)
iofd->fd = fd;
+   else if (iofd->fd < 0) {
+   /* this might happen if both osmo_iofd_setup() and 
osmo_iofd_register() are called with -1 */
+   LOGPIO(iofd, LOGL_ERROR, "Cannot register io_fd using invalid 
fd == %d\n", iofd->fd);
+   return -EBADF;
+   }
 
if (osmo_iofd_ops.register_fd)
rc = osmo_iofd_ops.register_fd(iofd);

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
Gerrit-Change-Number: 36188
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in libosmocore[master]: osmo_io: Avoid implementing non-existant situations

2024-03-07 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36193?usp=email )

Change subject: osmo_io: Avoid implementing non-existant situations
..

osmo_io: Avoid implementing non-existant situations

Both of our back-ends have a register_fd and unregister_fd back-end.

Let's simplify the code by not treating them as optional, which
introduces code paths that we never take, adds small runtime overhead
and makes the code harder to follow.

Should we ever introduce more backends which might not need those
call-backs, we can either have empty functions or think about how to
make them optional.

Change-Id: I0077151eb676f61320b3fa2124448852aa8fd4a9
---
M src/core/osmo_io.c
1 file changed, 23 insertions(+), 7 deletions(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  jolly: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved




diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index d52d601..57eba6c 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -106,6 +106,8 @@
}

OSMO_ASSERT(osmo_iofd_ops.close);
+   OSMO_ASSERT(osmo_iofd_ops.register_fd);
+   OSMO_ASSERT(osmo_iofd_ops.unregister_fd);
OSMO_ASSERT(osmo_iofd_ops.write_enable);
OSMO_ASSERT(osmo_iofd_ops.write_disable);
OSMO_ASSERT(osmo_iofd_ops.read_enable);
@@ -695,8 +697,7 @@
return -EBADF;
}

-   if (osmo_iofd_ops.register_fd)
-   rc = osmo_iofd_ops.register_fd(iofd);
+   rc = osmo_iofd_ops.register_fd(iofd);
if (rc)
return rc;

@@ -720,11 +721,7 @@
  */
 int osmo_iofd_unregister(struct osmo_io_fd *iofd)
 {
-   if (osmo_iofd_ops.unregister_fd)
-   return osmo_iofd_ops.unregister_fd(iofd);
-   IOFD_FLAG_SET(iofd, IOFD_FLAG_CLOSED);
-
-   return 0;
+   return osmo_iofd_ops.unregister_fd(iofd);
 }

 /*! Get the number of messages in the tx queue.

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36193?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0077151eb676f61320b3fa2124448852aa8fd4a9
Gerrit-Change-Number: 36193
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in libosmocore[master]: osmo_io: Log error message in case call-backs incompatible with mode

2024-03-07 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email )

Change subject: osmo_io: Log error message in case call-backs incompatible with 
mode
..

osmo_io: Log error message in case call-backs incompatible with mode

Change-Id: I50ba6a76c0144f249d67488874a6c4edf01ec6f2
---
M include/osmocom/core/osmo_io.h
M src/core/libosmocore.map
M src/core/osmo_io.c
3 files changed, 29 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  jolly: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved




diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h
index 8a7e53a..8e613fa 100644
--- a/include/osmocom/core/osmo_io.h
+++ b/include/osmocom/core/osmo_io.h
@@ -36,6 +36,10 @@
 static inline const char *osmo_io_backend_name(enum osmo_io_backend val)
 { return get_value_string(osmo_io_backend_names, val); }

+extern const struct value_string osmo_iofd_mode_names[];
+static inline const char *osmo_iofd_mode_name(enum osmo_io_fd_mode val)
+{ return get_value_string(osmo_iofd_mode_names, val); }
+
 struct osmo_io_ops {
/* mode OSMO_IO_FD_MODE_READ_WRITE: */
struct {
diff --git a/src/core/libosmocore.map b/src/core/libosmocore.map
index 72a6038..072efee 100644
--- a/src/core/libosmocore.map
+++ b/src/core/libosmocore.map
@@ -264,6 +264,7 @@
 osmo_iofd_set_name;
 osmo_iofd_get_priv_nr;
 osmo_iofd_init;
+osmo_iofd_mode_names;
 osmo_iofd_ops;
 osmo_iofd_register;
 osmo_iofd_sendto_msgb;
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index f0d213c..bcd4add 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -51,6 +51,13 @@
{ 0, NULL }
 };

+const struct value_string osmo_iofd_mode_names[] = {
+   { OSMO_IO_FD_MODE_READ_WRITE, "read/write" },
+   { OSMO_IO_FD_MODE_RECVFROM_SENDTO, "recvfrom/sendto" },
+   { OSMO_IO_FD_MODE_RECVMSG_SENDMSG, "recvmsg/sendmsg" },
+   { 0, NULL }
+};
+
 static enum osmo_io_backend g_io_backend;

 /* Used by some tests, can't be static */
@@ -619,8 +626,11 @@
return NULL;
}

-   if (ioops && !check_mode_callback_compat(mode, ioops))
+   if (ioops && !check_mode_callback_compat(mode, ioops)) {
+   LOGP(DLIO, LOGL_ERROR, "iofd(%s): rejecting call-backs 
incompatible with mode %s\n",
+   name ? name : "unknown", osmo_iofd_mode_name(mode));
return NULL;
+   }

iofd = talloc_zero(ctx, struct osmo_io_fd);
if (!iofd)
@@ -868,8 +878,11 @@
  *  \param[in] ioops osmo_io_ops structure to be set */
 int osmo_iofd_set_ioops(struct osmo_io_fd *iofd, const struct osmo_io_ops 
*ioops)
 {
-   if (!check_mode_callback_compat(iofd->mode, ioops))
+   if (!check_mode_callback_compat(iofd->mode, ioops)) {
+   LOGPIO(iofd, LOGL_ERROR, "rejecting call-backs incompatible 
with mode %s\n",
+   osmo_iofd_mode_name(iofd->mode));
return -EINVAL;
+   }

iofd->io_ops = *ioops;


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I50ba6a76c0144f249d67488874a6c4edf01ec6f2
Gerrit-Change-Number: 36190
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in libosmocore[master]: osmo_io: avoid OSMO_ASSERT one each API call

2024-03-07 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36192?usp=email )

Change subject: osmo_io: avoid OSMO_ASSERT one each API call
..

osmo_io: avoid OSMO_ASSERT one each API call

There's only one way to set the osmo_iofd_ops, which is by environment
variable during the constructor time at shared library load time.

There's hence no point in doing OSMO_ASSERT() on each and every call to
osmo_iofd_notify_connected() at runtime.  We can move those kind of
asserts to the one-time load-time constructor instead.

At the same time, we can extend those asserts to all the mandatory
call-backs to be provided by the backend.

Change-Id: Id9005ac6bb260236c88670373816bf7ee6a627f1
---
M src/core/osmo_io.c
1 file changed, 26 insertions(+), 2 deletions(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  jolly: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index 8b53aa6..d52d601 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -105,6 +105,13 @@
exit(1);
}

+   OSMO_ASSERT(osmo_iofd_ops.close);
+   OSMO_ASSERT(osmo_iofd_ops.write_enable);
+   OSMO_ASSERT(osmo_iofd_ops.write_disable);
+   OSMO_ASSERT(osmo_iofd_ops.read_enable);
+   OSMO_ASSERT(osmo_iofd_ops.read_disable);
+   OSMO_ASSERT(osmo_iofd_ops.notify_connected);
+
osmo_iofd_init();
 }

@@ -787,7 +794,6 @@

iofd->pending = NULL;

-   OSMO_ASSERT(osmo_iofd_ops.close);
rc = osmo_iofd_ops.close(iofd);
iofd->fd = -1;
return rc;
@@ -927,7 +933,6 @@
 {
OSMO_ASSERT(iofd->mode == OSMO_IO_FD_MODE_READ_WRITE ||
iofd->mode == OSMO_IO_FD_MODE_RECVMSG_SENDMSG);
-   OSMO_ASSERT(osmo_iofd_ops.notify_connected);
osmo_iofd_ops.notify_connected(iofd);
 }


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36192?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id9005ac6bb260236c88670373816bf7ee6a627f1
Gerrit-Change-Number: 36192
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in libosmocore[master]: osmo_io: Avoid implementing non-existant situations

2024-03-07 Thread laforge
Attention is currently required from: daniel.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36193?usp=email )

Change subject: osmo_io: Avoid implementing non-existant situations
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36193?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0077151eb676f61320b3fa2124448852aa8fd4a9
Gerrit-Change-Number: 36193
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 16:39:26 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: avoid OSMO_ASSERT one each API call

2024-03-07 Thread laforge
Attention is currently required from: daniel.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36192?usp=email )

Change subject: osmo_io: avoid OSMO_ASSERT one each API call
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36192?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id9005ac6bb260236c88670373816bf7ee6a627f1
Gerrit-Change-Number: 36192
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 16:39:24 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Don't pretend to support backends without close_cb

2024-03-07 Thread laforge
Attention is currently required from: daniel.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36191?usp=email )

Change subject: osmo_io: Don't pretend to support backends without close_cb
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36191?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id285f1d7b73ae5805aa618897016ae8b73bf892d
Gerrit-Change-Number: 36191
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 16:39:20 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Guard osmo_iofd_register() with invalid file descriptor

2024-03-07 Thread laforge
Attention is currently required from: daniel.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email )

Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
Gerrit-Change-Number: 36188
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 16:39:14 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-hnbgw[master]: osmo_hnbgw_main: Install our usual SIGUSR1/SIGUSR2/SIGABRT handlers

2024-03-07 Thread pespin
Attention is currently required from: laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36203?usp=email )

Change subject: osmo_hnbgw_main: Install our usual SIGUSR1/SIGUSR2/SIGABRT 
handlers
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36203?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I1209a2fadacf62afd5027480426285f527249788
Gerrit-Change-Number: 36203
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 16:34:03 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-hnbgw[master]: osmo_hnbgw_main: Install our usual SIGUSR1/SIGUSR2/SIGABRT handlers

2024-03-07 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36203?usp=email )


Change subject: osmo_hnbgw_main: Install our usual SIGUSR1/SIGUSR2/SIGABRT 
handlers
..

osmo_hnbgw_main: Install our usual SIGUSR1/SIGUSR2/SIGABRT handlers

I just wanted to get a talloc report from osmo-hnbgw by sending SIGUSR1
and the process terminated.  Clearly not the desired behaviour...

Change-Id: I1209a2fadacf62afd5027480426285f527249788
---
M src/osmo-hnbgw/osmo_hnbgw_main.c
1 file changed, 45 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/03/36203/1

diff --git a/src/osmo-hnbgw/osmo_hnbgw_main.c b/src/osmo-hnbgw/osmo_hnbgw_main.c
index d371914..377ee47 100644
--- a/src/osmo-hnbgw/osmo_hnbgw_main.c
+++ b/src/osmo-hnbgw/osmo_hnbgw_main.c
@@ -1,6 +1,6 @@
 /* OsmoHNBGW main routine */

-/* (C) 2015 by Harald Welte 
+/* (C) 2015-2024 by Harald Welte 
  * (C) 2016-2023 by sysmocom s.f.m.c. GmbH 
  * All Rights Reserved
  *
@@ -19,6 +19,7 @@
  *
  */
 
+#include 
 #include 

 #include "config.h"
@@ -64,6 +65,32 @@
NULL,
 };

+static void signal_handler(int signum)
+{
+   fprintf(stdout, "signal %u received\n", signum);
+
+   switch (signum) {
+   case SIGABRT:
+   /* in case of abort, we want to obtain a talloc report and
+* then run default SIGABRT handler, who will generate coredump
+* and abort the process. abort() should do this for us after we
+* return, but program wouldn't exit if an external SIGABRT is
+* received.
+*/
+   talloc_report(tall_vty_ctx, stderr);
+   talloc_report_full(g_hnbgw, stderr);
+   signal(SIGABRT, SIG_DFL);
+   raise(SIGABRT);
+   break;
+   case SIGUSR1:
+   talloc_report(tall_vty_ctx, stderr);
+   talloc_report_full(g_hnbgw, stderr);
+   break;
+   default:
+   break;
+   }
+}
+
 static void print_usage(void)
 {
printf("Usage: osmo-hnbgw\n");
@@ -313,6 +340,11 @@
}
}

+   signal(SIGABRT, _handler);
+   signal(SIGUSR1, _handler);
+   signal(SIGUSR2, _handler);
+   osmo_init_ignore_signals();
+
while (1) {
rc = osmo_select_main_ctx(0);
if (rc < 0)

--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36203?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I1209a2fadacf62afd5027480426285f527249788
Gerrit-Change-Number: 36203
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


[S] Change in osmo-hnbgw[master]: umts_cell_id_name: Use 3-digit MCC and 2/3-digit MNC based on VTY config

2024-03-07 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36202?usp=email )


Change subject: umts_cell_id_name: Use 3-digit MCC and 2/3-digit MNC based on 
VTY config
..

umts_cell_id_name: Use 3-digit MCC and 2/3-digit MNC based on VTY config

Printing the PLMN 001-01 as "1-1" like the existing code is just weird,
and also doesn't differentiate between 2-digit and 3-digit MNC in the
output.

Change-Id: I015ad84a6f61b4420f6bfdaa60e8e1b53a71589c
---
M src/osmo-hnbgw/hnbgw.c
1 file changed, 19 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/02/36202/1

diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index 695822e..8b00ecb 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -193,7 +193,12 @@
 
 const char *umts_cell_id_name(const struct umts_cell_id *ucid)
 {
-   return talloc_asprintf(OTC_SELECT, "%u-%u-L%u-R%u-S%u-C%u", ucid->mcc, 
ucid->mnc, ucid->lac, ucid->rac,
+   const char *fmtstr = "%03u-%02u-L%u-R%u-S%u-C%u";
+
+   if (g_hnbgw->config.plmn.mnc_3_digits)
+   fmtstr = "%03u-%03u-L%u-R%u-S%u-C%u";
+
+   return talloc_asprintf(OTC_SELECT, fmtstr, ucid->mcc, ucid->mnc, 
ucid->lac, ucid->rac,
   ucid->sac, ucid->cid);
 }


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36202?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I015ad84a6f61b4420f6bfdaa60e8e1b53a71589c
Gerrit-Change-Number: 36202
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


[S] Change in libosmocore[master]: osmo_io: Guard osmo_iofd_register() with invalid file descriptor

2024-03-07 Thread dexter
Attention is currently required from: daniel, laforge.

dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email )

Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
Gerrit-Change-Number: 36188
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 16:22:46 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-ci[master]: jobs/ttcn: Run ttcn3-epdg-test only under debian12

2024-03-07 Thread pespin
Attention is currently required from: laforge, lynxis lazus, osmith.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ci/+/36201?usp=email )

Change subject: jobs/ttcn: Run ttcn3-epdg-test only under debian12
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/36201?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I247853cbefa0864f54bad5e5b6597556c46a51e3
Gerrit-Change-Number: 36201
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Attention: osmith 
Gerrit-Attention: laforge 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 07 Mar 2024 16:17:53 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-ci[master]: jobs/ttcn: Run ttcn3-epdg-test only under debian12

2024-03-07 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ci/+/36201?usp=email )

Change subject: jobs/ttcn: Run ttcn3-epdg-test only under debian12
..

jobs/ttcn: Run ttcn3-epdg-test only under debian12

Test EPDG_Tests.TC_mt_ipv4_echo_req fails when running under debian11
(node build2-deb11build-ansible), most probably due to some kernel bug
fixed later on.
Since anyway osmo-epdg requires OTP from debian12, it makes no sense to
attempt to support older kernel version from debian11, so simply avoid
picking debian11 to run the tests.

Change-Id: I247853cbefa0864f54bad5e5b6597556c46a51e3
---
M jobs/ttcn3-testsuites.yml
1 file changed, 18 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved




diff --git a/jobs/ttcn3-testsuites.yml b/jobs/ttcn3-testsuites.yml
index b367c49..fbc0f04 100644
--- a/jobs/ttcn3-testsuites.yml
+++ b/jobs/ttcn3-testsuites.yml
@@ -136,6 +136,8 @@
   timer: H 07 * * *
   - ttcn3-epdg-test:
   timer: H 07 * * *
+  # osmo-epdg requires OTP and kernel >= debian12:
+  node: build4-deb12build-ansible

   # debian latest stable
   - nplab-m3ua-test-latest:

--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/36201?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I247853cbefa0864f54bad5e5b6597556c46a51e3
Gerrit-Change-Number: 36201
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in osmo-ci[master]: jobs/ttcn: Run ttcn3-epdg-test only under debian12

2024-03-07 Thread fixeria
Attention is currently required from: laforge, lynxis lazus, osmith, pespin.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ci/+/36201?usp=email )

Change subject: jobs/ttcn: Run ttcn3-epdg-test only under debian12
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/36201?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I247853cbefa0864f54bad5e5b6597556c46a51e3
Gerrit-Change-Number: 36201
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: osmith 
Gerrit-Attention: osmith 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 07 Mar 2024 16:01:13 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-ci[master]: jobs/ttcn: Run ttcn3-epdg-test only under debian12

2024-03-07 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ci/+/36201?usp=email )


Change subject: jobs/ttcn: Run ttcn3-epdg-test only under debian12
..

jobs/ttcn: Run ttcn3-epdg-test only under debian12

Test EPDG_Tests.TC_mt_ipv4_echo_req fails when running under debian11
(node build2-deb11build-ansible), most probably due to some kernel bug
fixed later on.
Since anyway osmo-epdg requires OTP from debian12, it makes no sense to
attempt to support older kernel version from debian11, so simply avoid
picking debian11 to run the tests.

Change-Id: I247853cbefa0864f54bad5e5b6597556c46a51e3
---
M jobs/ttcn3-testsuites.yml
1 file changed, 18 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/01/36201/1

diff --git a/jobs/ttcn3-testsuites.yml b/jobs/ttcn3-testsuites.yml
index b367c49..fbc0f04 100644
--- a/jobs/ttcn3-testsuites.yml
+++ b/jobs/ttcn3-testsuites.yml
@@ -136,6 +136,8 @@
   timer: H 07 * * *
   - ttcn3-epdg-test:
   timer: H 07 * * *
+  # osmo-epdg requires OTP and kernel >= debian12:
+  node: build4-deb12build-ansible

   # debian latest stable
   - nplab-m3ua-test-latest:

--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/36201?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I247853cbefa0864f54bad5e5b6597556c46a51e3
Gerrit-Change-Number: 36201
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


[S] Change in libosmo-netif[master]: stream_cli: Do not try to send msg, if socket is disconnected

2024-03-07 Thread jolly
jolly has abandoned this change. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/36123?usp=email )

Change subject: stream_cli: Do not try to send msg, if socket is disconnected
..


Abandoned

This patch is not required, as it is allowed to send a message before 
connection is estabished.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/36123?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I9e5f5db9b45615dacb05115c4de8ff3f715815c8
Gerrit-Change-Number: 36123
Gerrit-PatchSet: 6
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-CC: daniel 
Gerrit-CC: pespin 
Gerrit-MessageType: abandon


[S] Change in libosmocore[master]: osmo_io: Log error message in case call-backs incompatible with mode

2024-03-07 Thread pespin
Attention is currently required from: daniel, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email )

Change subject: osmo_io: Log error message in case call-backs incompatible with 
mode
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I50ba6a76c0144f249d67488874a6c4edf01ec6f2
Gerrit-Change-Number: 36190
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 15:17:09 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io_poll: Use -errno as result on write error

2024-03-07 Thread pespin
Attention is currently required from: jolly.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36200?usp=email )

Change subject: osmo_io_poll: Use -errno as result on write error
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36200?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I405094449a6644db37534757f2fbccbcff982f23
Gerrit-Change-Number: 36200
Gerrit-PatchSet: 1
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Comment-Date: Thu, 07 Mar 2024 15:16:26 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Log error message in case call-backs incompatible with mode

2024-03-07 Thread jolly
Attention is currently required from: daniel, laforge, pespin.

jolly has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email )

Change subject: osmo_io: Log error message in case call-backs incompatible with 
mode
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I50ba6a76c0144f249d67488874a6c4edf01ec6f2
Gerrit-Change-Number: 36190
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-CC: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 15:12:11 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Guard osmo_iofd_register() with invalid file descriptor

2024-03-07 Thread jolly
Attention is currently required from: daniel, laforge.

jolly has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email )

Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor
..


Patch Set 2: Code-Review+1

(1 comment)

Commit Message:

https://gerrit.osmocom.org/c/libosmocore/+/36188/comment/14c9c6e6_1371b69e
PS1, Line 9: Let's return an error if both osmo_iofd_setup() and 
osmo_iofd_register()
   : are called with an invalid file descriptor like -1.
> at osmo_iofd_setup() time it is legal to pass -1. […]
Ah ok.



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
Gerrit-Change-Number: 36188
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 15:11:09 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: jolly 
Comment-In-Reply-To: laforge 
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Guard osmo_iofd_register() with invalid file descriptor

2024-03-07 Thread pespin
Attention is currently required from: daniel, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email )

Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
Gerrit-Change-Number: 36188
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 15:09:33 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-mgw[master]: migrate mgcp_client from osmo_wqueue to osmo_io

2024-03-07 Thread jolly
Attention is currently required from: laforge.

jolly has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/36142?usp=email )

Change subject: migrate mgcp_client from osmo_wqueue to osmo_io
..


Patch Set 1:

(3 comments)

File src/libosmo-mgcp-client/mgcp_client.c:

https://gerrit.osmocom.org/c/osmo-mgw/+/36142/comment/43061d55_93e5b21f
PS1, Line 731: mgcp_do_read
mgcp_read_cb


https://gerrit.osmocom.org/c/osmo-mgw/+/36142/comment/cf062976_225b8977
PS1, Line 790: errno
uring IO does not set errno. "res" is used instead and carries -errno. This 
also applies to poll based osmo_io.


https://gerrit.osmocom.org/c/osmo-mgw/+/36142/comment/3f3d2175_2883a617
PS1, Line 826: errno
dito.
see also https://gerrit.osmocom.org/c/libosmocore/+/35984



--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/36142?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I766224da4691695c023d4d08d042a4bbeba05e47
Gerrit-Change-Number: 36142
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: jolly 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Thu, 07 Mar 2024 15:05:38 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io_poll: Use -errno as result on write error

2024-03-07 Thread jolly
jolly has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36200?usp=email )


Change subject: osmo_io_poll: Use -errno as result on write error
..

osmo_io_poll: Use -errno as result on write error

This was done for read error in a previous patch. This is required
because osmo_io_uring does not support errno, instead it uses the
result code. To have a unified API, set the result code equally.

Related: OS#5751
Change-Id: I405094449a6644db37534757f2fbccbcff982f23
---
M src/core/osmo_io_poll.c
1 file changed, 15 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/36200/1

diff --git a/src/core/osmo_io_poll.c b/src/core/osmo_io_poll.c
index 2e726d9..fae552c 100644
--- a/src/core/osmo_io_poll.c
+++ b/src/core/osmo_io_poll.c
@@ -84,7 +84,7 @@
struct iofd_msghdr *msghdr = iofd_txqueue_dequeue(iofd);
if (msghdr) {
rc = sendmsg(ofd->fd, >hdr, msghdr->flags);
-   iofd_handle_send_completion(iofd, rc, msghdr);
+   iofd_handle_send_completion(iofd, (rc < 0 && errno > 0) 
? -errno : rc, msghdr);
} else {
/* Socket is writable, but we have no data to send. A 
non-blocking/async
   connect() is signalled this way. */

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36200?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I405094449a6644db37534757f2fbccbcff982f23
Gerrit-Change-Number: 36200
Gerrit-PatchSet: 1
Gerrit-Owner: jolly 
Gerrit-MessageType: newchange


[S] Change in libosmocore[master]: osmo_io: Log error message in case call-backs incompatible with mode

2024-03-07 Thread laforge
Attention is currently required from: daniel, jolly, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email )

Change subject: osmo_io: Log error message in case call-backs incompatible with 
mode
..


Patch Set 3:

(2 comments)

File src/core/osmo_io.c:

https://gerrit.osmocom.org/c/libosmocore/+/36190/comment/ddbde671_1e44e9b4
PS2, Line 623:  LOGP(DLIO, LOGL_ERROR, "iofd(%s): rejecting call-backs 
incompatible with mode\n",
> ... […]
well, if we print it, we might as well print the string name.


https://gerrit.osmocom.org/c/libosmocore/+/36190/comment/024506f2_60782085
PS2, Line 876:  LOGPIO(iofd, LOGL_ERROR, "rejecting call-backs 
incompatible with mode\n");
> same
Done



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I50ba6a76c0144f249d67488874a6c4edf01ec6f2
Gerrit-Change-Number: 36190
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-CC: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: pespin 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 14:52:53 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Guard osmo_iofd_register() with invalid file descriptor

2024-03-07 Thread laforge
Attention is currently required from: daniel, jolly, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email )

Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor
..


Patch Set 1:

(1 comment)

File src/core/osmo_io.c:

https://gerrit.osmocom.org/c/libosmocore/+/36188/comment/109e5272_3a176a49
PS1, Line 676:  if (iofd->fd < 0) {
> ah I see. In any case, it would be optimal to do: […]
Done



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
Gerrit-Change-Number: 36188
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: pespin 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 14:52:25 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Guard osmo_iofd_register() with invalid file descriptor

2024-03-07 Thread laforge
Attention is currently required from: daniel, jolly, pespin.

Hello Jenkins Builder, daniel, jolly, pespin,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Code-Review+1 by pespin, Verified+1 by Jenkins Builder


Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor
..

osmo_io: Guard osmo_iofd_register() with invalid file descriptor

Let's return an error if both osmo_iofd_setup() and osmo_iofd_register()
are called with an invalid file descriptor like -1.  Either one of them
must have been called with a valid file descriptor.

Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
---
M src/core/osmo_io.c
1 file changed, 18 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/36188/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
Gerrit-Change-Number: 36188
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: pespin 
Gerrit-Attention: daniel 
Gerrit-MessageType: newpatchset


[S] Change in libosmocore[master]: osmo_io: Log error message in case call-backs incompatible with mode

2024-03-07 Thread laforge
Attention is currently required from: daniel, jolly, laforge.

Hello Jenkins Builder, daniel, jolly,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email

to look at the new patch set (#3).

The following approvals got outdated and were removed:
Code-Review+1 by jolly, Verified+1 by Jenkins Builder


Change subject: osmo_io: Log error message in case call-backs incompatible with 
mode
..

osmo_io: Log error message in case call-backs incompatible with mode

Change-Id: I50ba6a76c0144f249d67488874a6c4edf01ec6f2
---
M include/osmocom/core/osmo_io.h
M src/core/libosmocore.map
M src/core/osmo_io.c
3 files changed, 29 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/90/36190/3
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I50ba6a76c0144f249d67488874a6c4edf01ec6f2
Gerrit-Change-Number: 36190
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-CC: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-MessageType: newpatchset


[S] Change in libosmocore[master]: osmo_io: Guard osmo_iofd_register() with invalid file descriptor

2024-03-07 Thread laforge
Attention is currently required from: daniel, jolly.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email )

Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor
..


Patch Set 1:

(1 comment)

Commit Message:

https://gerrit.osmocom.org/c/libosmocore/+/36188/comment/3ad11fab_d679c68c
PS1, Line 9: Let's return an error if both osmo_iofd_setup() and 
osmo_iofd_register()
   : are called with an invalid file descriptor like -1.
> I see the check for osmo_iofd_register(), but not for osmo_iofd_setup() in 
> this patch.
at osmo_iofd_setup() time it is legal to pass -1.  Only at osmo_iofd_register() 
time we can perform a check.  Either iofd->fd is already set from the prior 
osmo_iofd_setup() call (good) or we have been give a valid fd as argument 
(good).  But if neither of those two were valid (>= 0) then we have to bail out 
here.



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
Gerrit-Change-Number: 36188
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 14:43:50 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jolly 
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Guard osmo_iofd_register() with invalid file descriptor

2024-03-07 Thread jolly
Attention is currently required from: daniel, laforge.

jolly has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email )

Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor
..


Patch Set 1:

(1 comment)

Commit Message:

https://gerrit.osmocom.org/c/libosmocore/+/36188/comment/98d7b5a3_bcad24fa
PS1, Line 9: Let's return an error if both osmo_iofd_setup() and 
osmo_iofd_register()
   : are called with an invalid file descriptor like -1.
I see the check for osmo_iofd_register(), but not for osmo_iofd_setup() in this 
patch.



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
Gerrit-Change-Number: 36188
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 14:15:46 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Log error message in case call-backs incompatible with mode

2024-03-07 Thread jolly
Attention is currently required from: daniel, laforge.

jolly has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email )

Change subject: osmo_io: Log error message in case call-backs incompatible with 
mode
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I50ba6a76c0144f249d67488874a6c4edf01ec6f2
Gerrit-Change-Number: 36190
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-CC: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 14:09:58 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Don't pretend to support backends without close_cb

2024-03-07 Thread jolly
Attention is currently required from: daniel, laforge.

jolly has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36191?usp=email )

Change subject: osmo_io: Don't pretend to support backends without close_cb
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36191?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id285f1d7b73ae5805aa618897016ae8b73bf892d
Gerrit-Change-Number: 36191
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 14:07:26 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: avoid OSMO_ASSERT one each API call

2024-03-07 Thread jolly
Attention is currently required from: daniel, laforge.

jolly has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36192?usp=email )

Change subject: osmo_io: avoid OSMO_ASSERT one each API call
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36192?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id9005ac6bb260236c88670373816bf7ee6a627f1
Gerrit-Change-Number: 36192
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 14:06:14 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Avoid implementing non-existant situations

2024-03-07 Thread jolly
Attention is currently required from: daniel, laforge.

jolly has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36193?usp=email )

Change subject: osmo_io: Avoid implementing non-existant situations
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36193?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0077151eb676f61320b3fa2124448852aa8fd4a9
Gerrit-Change-Number: 36193
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 14:03:40 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in ...osmo-epdg[master]: gsup_server: Look up epdg_ue_fsm process each time it needs to be acc...

2024-03-07 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36198?usp=email )


Change subject: gsup_server: Look up epdg_ue_fsm process each time it needs to 
be accessed
..

gsup_server: Look up epdg_ue_fsm process each time it needs to be accessed

This allows simplifying a lot gsup_server state, make it far less prone
to bugs due to state ending up in an unconsistent state.
Nowadays the state is held in the epdg_ue_fsm.
It also allows easily spawning a process per rx msg, since no
start_monitor() is required (monitor would need to be passed to parent
gen_server process then from the per message spawned process).

Change-Id: I80203a7cf0efe82eec3773ee773d25310c07a2c3
---
M src/epdg_ue_fsm.erl
M src/gsup_server.erl
2 files changed, 51 insertions(+), 105 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg 
refs/changes/98/36198/1

diff --git a/src/epdg_ue_fsm.erl b/src/epdg_ue_fsm.erl
index fd0d7f9..fc3a7e9 100644
--- a/src/epdg_ue_fsm.erl
+++ b/src/epdg_ue_fsm.erl
@@ -39,7 +39,7 @@
 -include_lib("gtp_utils.hrl").
 -include("conv.hrl").

--export([start_monitor/1, stop/1]).
+-export([start/1, stop/1]).
 -export([init/1,callback_mode/0,terminate/3]).
 -export([get_server_name_by_imsi/1, get_pid_by_imsi/1]).
 -export([auth_request/2, lu_request/1, tunnel_request/2, purge_ms_request/1]).
@@ -68,10 +68,10 @@
 ServerName = get_server_name_by_imsi(Imsi),
 whereis(ServerName).

-start_monitor(Imsi) ->
+start(Imsi) ->
 ServerName = get_server_name_by_imsi(Imsi),
-lager:info("ue_fsm start_monitor(~p)~n", [ServerName]),
-gen_statem:start_monitor({local, ServerName}, ?MODULE, Imsi, [{debug, 
[trace]}]).
+lager:info("ue_fsm start(~p)~n", [ServerName]),
+gen_statem:start({local, ServerName}, ?MODULE, Imsi, [{debug, 
[trace]}]).

 stop(SrvRef) ->
 try
diff --git a/src/gsup_server.erl b/src/gsup_server.erl
index 4299e95..ef87b67 100644
--- a/src/gsup_server.erl
+++ b/src/gsup_server.erl
@@ -49,14 +49,7 @@
lsocket, % listening socket
lport, % local port. only interesting if we bind with port 0
socket, % current active socket. we only support a single tcp connection
-   ccm_options, % ipa ccm options
-   ues = sets:new()
-   }).
-
--record(gsups_ue, {
-   imsi   :: binary(),
-   pid:: pid(),
-   mref   :: reference()
+   ccm_options % ipa ccm options
}).

 -export([start_link/3]).
@@ -180,9 +173,9 @@
tx_gsup(Socket, Resp),
{noreply, State};

-handle_cast({purge_ms_response, {Imsi, Result}}, State0) ->
+handle_cast({purge_ms_response, {Imsi, Result}}, State) ->
lager:info("purge_ms_response for ~p: ~p~n", [Imsi, Result]),
-   Socket = State0#gsups_state.socket,
+   Socket = State#gsups_state.socket,
case Result of
ok ->
Resp = #{message_type => purge_ms_res,
@@ -196,8 +189,11 @@
}
end,
tx_gsup(Socket, Resp),
-   State1 = delete_gsups_ue_by_imsi(Imsi, State0),
-   {noreply, State1};
+   case epdg_ue_fsm:get_pid_by_imsi(Imsi) of
+   Pid when is_pid(Pid) -> epdg_ue_fsm:stop(Pid);
+   undefined -> ok
+   end,
+   {noreply, State};

 % Our GSUP CEAI implementation for "IKEv2 Information Delete Request"
 handle_cast({cancel_location_request, Imsi}, State) ->
@@ -233,11 +229,6 @@
lager:info("GSUP: Rx ~p~n", [GsupMsgRx]),
rx_gsup(Socket, GsupMsgRx, State);

-handle_info({'DOWN', MRef, process, Pid, Reason}, State0) ->
-   lager:notice("GSUP: epdg_ue_fsm ~p exited, reason: ~p~n", [Pid, 
Reason]),
-   State1 = delete_gsups_ue_by_mref(MRef, State0),
-   {noreply, State1};
-
 handle_info(Info, S) ->
error_logger:error_report(["unknown handle_info", {module, ?MODULE}, 
{info, Info}, {state, S}]),
{noreply, S}.
@@ -274,7 +265,7 @@
 %% --

 % Rx send auth info / requesting authentication tuples
-rx_gsup(Socket, GsupMsgRx = #{message_type := send_auth_info_req, imsi := 
Imsi}, State0) ->
+rx_gsup(Socket, GsupMsgRx = #{message_type := send_auth_info_req, imsi := 
Imsi}, State) ->
case maps:find(pdp_info_list, GsupMsgRx) of
{ok, [PdpInfo]} ->
#{pdp_context_id := _PDPCtxId,
@@ -287,9 +278,12 @@
PdpTypeNr = ?GTP_PDP_ADDR_TYPE_NR_IPv4,
Apn = "*"
end,
-   {UE, State1} = find_or_new_gsups_ue(Imsi, State0),
-   case epdg_ue_fsm:auth_request(UE#gsups_ue.pid, {PdpTypeNr, Apn}) of
-   ok -> State2 = State1;
+   case epdg_ue_fsm:get_pid_by_imsi(Imsi) of
+   undefined -> {ok, Pid} = epdg_ue_fsm:start(Imsi);
+   Pid -> Pid
+   end,
+   case 

[S] Change in ...osmo-epdg[master]: gsup_server: Spawn one process per rx message

2024-03-07 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36199?usp=email )


Change subject: gsup_server: Spawn one process per rx message
..

gsup_server: Spawn one process per rx message

This way if rx path crashes it won't affect the gsup_server socket,
which will just discard the received packet.

Change-Id: Ifb5ece08007be59657d0d2f428e9d991af696026
---
M src/gsup_server.erl
1 file changed, 16 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg 
refs/changes/99/36199/1

diff --git a/src/gsup_server.erl b/src/gsup_server.erl
index ef87b67..0ef7ae7 100644
--- a/src/gsup_server.erl
+++ b/src/gsup_server.erl
@@ -227,7 +227,10 @@
 %% Rx IPA/GSUP message:
 handle_info({ipa, Socket, ?IPAC_PROTO_EXT_GSUP, GsupMsgRx}, State) ->
lager:info("GSUP: Rx ~p~n", [GsupMsgRx]),
-   rx_gsup(Socket, GsupMsgRx, State);
+   misc:spawn_wait_ret(fun() ->
+   rx_gsup(Socket, GsupMsgRx, State)
+   end,
+   {noreply, State});

 handle_info(Info, S) ->
error_logger:error_report(["unknown handle_info", {module, ?MODULE}, 
{info, Info}, {state, S}]),

--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36199?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: erlang/osmo-epdg
Gerrit-Branch: master
Gerrit-Change-Id: Ifb5ece08007be59657d0d2f428e9d991af696026
Gerrit-Change-Number: 36199
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


[M] Change in ...osmo-epdg[master]: Move spawn_wait_ret() to a new misc.erl file

2024-03-07 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36196?usp=email )


Change subject: Move spawn_wait_ret() to a new misc.erl file
..

Move spawn_wait_ret() to a new misc.erl file

It may be reused by other modules spawning process per message, like
gsup_server.erl.

Change-Id: I9777b73942e9dc672dd944a82045710b78893974
---
M src/epdg_gtpc_s2b.erl
A src/misc.erl
2 files changed, 68 insertions(+), 20 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg 
refs/changes/96/36196/1

diff --git a/src/epdg_gtpc_s2b.erl b/src/epdg_gtpc_s2b.erl
index a8a42a2..dce038f 100644
--- a/src/epdg_gtpc_s2b.erl
+++ b/src/epdg_gtpc_s2b.erl
@@ -188,10 +188,10 @@
 %% @callback gen_server
 handle_info({udp, _Socket, IP, InPortNo, RxMsg}, State) ->
 lager:debug("S2b: Rx from IP ~p port ~p: ~p~n", [IP, InPortNo, RxMsg]),
-spawn_wait_ret(fun() ->
-rx_udp(IP, InPortNo, RxMsg, State)
-   end,
-   {noreply, State});
+misc:spawn_wait_ret(fun() ->
+rx_udp(IP, InPortNo, RxMsg, State)
+end,
+{noreply, State});
 handle_info(Info, State) ->
 lager:info("S2b handle_info: ~p ~n", [Info]),
 {noreply, State}.
@@ -378,22 +378,6 @@
 connect(Address) ->
 connect(?SVC_NAME, Address).

-%% Calls Fun on a spawned monitored process and returns Fun ret.
-%% If spawned process crashes, return DefaultRet.
-spawn_wait_ret(Fun, DefaultRet) ->
-MyPID=self(),
-{Pid, MRef} = spawn_monitor(fun() ->
-Ret = Fun(),
-MyPID ! {self(), Ret}
-end),
-receive
-{'DOWN', MRef, process, _, _Reason} ->
-DefaultRet;
-{Pid, Ret} ->
-erlang:demonitor(MRef, [flush]),
-Ret
-end.
-
 rx_udp(IP, InPortNo, RxMsg, State) ->
 Req = gtp_packet:decode(RxMsg),
 lager:debug("S2b: Rx from IP ~p port ~p: ~p~n", [IP, InPortNo, Req]),
diff --git a/src/misc.erl b/src/misc.erl
new file mode 100644
index 000..fd85264
--- /dev/null
+++ b/src/misc.erl
@@ -0,0 +1,52 @@
+% Misc helpers
+% (C) 2023 by sysmocom
+%
+% All Rights Reserved
+%
+% This program is free software; you can redistribute it and/or modify
+% it under the terms of the GNU Affero General Public License as
+% published by the Free Software Foundation; either version 3 of the
+% License, or (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU Affero General Public License
+% along with this program.  If not, see .
+%
+% Additional Permission under GNU AGPL version 3 section 7:
+%
+% If you modify this Program, or any covered work, by linking or
+% combining it with runtime libraries of Erlang/OTP as released by
+% Ericsson on http://www.erlang.org (or a modified version of these
+% libraries), containing parts covered by the terms of the Erlang Public
+% License (http://www.erlang.org/EPLICENSE), the licensors of this
+% Program grant you additional permission to convey the resulting work
+% without the need to license the runtime libraries of Erlang/OTP under
+% the GNU Affero General Public License. Corresponding Source for a
+% non-source form of such a combination shall include the source code
+% for the parts of the runtime libraries of Erlang/OTP used as well as
+% that of the covered work.
+%
+-module(misc).
+-author('Pau Espin Pedrol ').
+
+-export([spawn_wait_ret/2]).
+
+%% Calls Fun on a spawned monitored process and returns Fun ret.
+%% If spawned process crashes, return DefaultRet.
+spawn_wait_ret(Fun, DefaultRet) ->
+MyPID=self(),
+{Pid, MRef} = spawn_monitor(fun() ->
+Ret = Fun(),
+MyPID ! {self(), Ret}
+end),
+receive
+{'DOWN', MRef, process, _, _Reason} ->
+DefaultRet;
+{Pid, Ret} ->
+erlang:demonitor(MRef, [flush]),
+Ret
+end.
\ No newline at end of file

--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36196?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: erlang/osmo-epdg
Gerrit-Branch: master
Gerrit-Change-Id: I9777b73942e9dc672dd944a82045710b78893974
Gerrit-Change-Number: 36196
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


[L] Change in ...osmo-epdg[master]: gsup_server: Move rx_gsup path to its own function

2024-03-07 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36197?usp=email )


Change subject: gsup_server: Move rx_gsup path to its own function
..

gsup_server: Move rx_gsup path to its own function

This is a preparation step to later on spawn one process per rx msg.

Change-Id: Ie551ed14f7ab8c447f25981a6a1d6ed4ddb470b7
---
M src/gsup_server.erl
1 file changed, 132 insertions(+), 118 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-epdg 
refs/changes/97/36197/1

diff --git a/src/gsup_server.erl b/src/gsup_server.erl
index 10495e1..4299e95 100644
--- a/src/gsup_server.erl
+++ b/src/gsup_server.erl
@@ -228,125 +228,10 @@
ipa_proto:unblock(Socket),
{noreply, S#gsups_state{socket=Socket}};

-% send auth info / requesting authentication tuples
-handle_info({ipa, Socket, ?IPAC_PROTO_EXT_GSUP, GsupMsgRx = #{message_type := 
send_auth_info_req, imsi := Imsi}}, State0) ->
+%% Rx IPA/GSUP message:
+handle_info({ipa, Socket, ?IPAC_PROTO_EXT_GSUP, GsupMsgRx}, State) ->
lager:info("GSUP: Rx ~p~n", [GsupMsgRx]),
-   case maps:find(pdp_info_list, GsupMsgRx) of
-   {ok, [PdpInfo]} ->
-   #{pdp_context_id := _PDPCtxId,
- pdp_address := #{address := #{},
-  pdp_type_nr := PdpTypeNr,
-  pdp_type_org := 241},
- access_point_name := Apn
-   } = PdpInfo;
-   error -> % Use some sane defaults:
-   PdpTypeNr = ?GTP_PDP_ADDR_TYPE_NR_IPv4,
-   Apn = "*"
-   end,
-   {UE, State1} = find_or_new_gsups_ue(Imsi, State0),
-   case epdg_ue_fsm:auth_request(UE#gsups_ue.pid, {PdpTypeNr, Apn}) of
-   ok -> State2 = State1;
-   {error, Err} ->
-   lager:error("Auth Req for Imsi ~p failed: ~p~n", [Imsi, Err]),
-   Resp = #{message_type => send_auth_info_err,
-imsi => Imsi,
-message_class => 5,
-cause => ?GSUP_CAUSE_NET_FAIL
-   },
-   tx_gsup(Socket, Resp),
-   State2 = delete_gsups_ue(UE, State1),
-   epdg_ue_fsm:stop(UE#gsups_ue.pid)
-   end,
-   {noreply, State2};
-
-% location update request / when a UE wants to connect to a specific APN. This 
will trigger a AAA->HLR Request Server Assignment Request
-% FIXME: add APN instead of hardcoded internet
-handle_info({ipa, Socket, ?IPAC_PROTO_EXT_GSUP, GsupMsgRx = #{message_type := 
location_upd_req, imsi := Imsi}}, State) ->
-   lager:info("GSUP: Rx ~p~n", [GsupMsgRx]),
-   UE = find_gsups_ue_by_imsi(Imsi, State),
-   case UE of
-   #gsups_ue{imsi = Imsi} ->
-   case epdg_ue_fsm:lu_request(UE#gsups_ue.pid) of
-   ok -> ok;
-   {error, _} ->
-   Resp = #{message_type => location_upd_err,
-imsi => Imsi,
-message_class => 5,
-cause => ?GSUP_CAUSE_NET_FAIL
-   },
-   tx_gsup(Socket, Resp)
-   end;
-   undefined ->
-   Resp = #{message_type => location_upd_err,
-imsi => Imsi,
-message_class => 5,
-cause => ?GSUP_CAUSE_IMSI_UNKNOWN
-   },
-   tx_gsup(Socket, Resp)
-   end,
-   {noreply, State};
-
-% epdg tunnel request / trigger the establishment to the PGW and prepares 
everything for the user traffic to flow
-% When sending a epdg_tunnel_response everything must be ready for the UE 
traffic
-handle_info({ipa, Socket, ?IPAC_PROTO_EXT_GSUP, GsupMsgRx = #{message_type := 
epdg_tunnel_request, imsi := Imsi, pco := PCO}}, State) ->
-   lager:info("GSUP: Rx ~p~n", [GsupMsgRx]),
-   UE = find_gsups_ue_by_imsi(Imsi, State),
-   case UE of
-   #gsups_ue{imsi = Imsi} ->
-   case epdg_ue_fsm:tunnel_request(UE#gsups_ue.pid, PCO) of
-   ok -> ok;
-   {error, _} ->
-   Resp = #{message_type => epdg_tunnel_error,
-   imsi => Imsi,
-   message_class => 5,
-   cause => ?GSUP_CAUSE_NET_FAIL
-   },
-   tx_gsup(Socket, Resp)
-   end;
-   undefined ->
-   Resp = #{message_type => epdg_tunnel_error,
-   imsi => Imsi,
-   message_class => 5,
-   cause => ?GSUP_CAUSE_IMSI_UNKNOWN
-   },
-   tx_gsup(Socket, Resp)
-   end,
-   {noreply, State};
-
-% Purge MS / trigger the delete of session to the PGW
-handle_info({ipa, Socket, ?IPAC_PROTO_EXT_GSUP, GsupMsgRx = #{message_type := 

[S] Change in libosmo-netif[master]: stream_cli: Correctly setup and free osmo_io client instance

2024-03-07 Thread jolly
Attention is currently required from: daniel, dexter, laforge, pespin.

jolly has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email )

Change subject: stream_cli: Correctly setup and free osmo_io client instance
..


Patch Set 8:

(1 comment)

Patchset:

PS7:
> but why must the iofd be freed?  the entire API design is done to facilitate 
> the re-use of an iofd. […]
osmo_iofd_setup() creates a new osmi_io instance. In order to support re-use of 
iofd, it must be split into osmo_iofd_alloc() and osmo_iofd_setup().



--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/35979?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I91a6a76b9ff96034a7b333edf87af27490202932
Gerrit-Change-Number: 35979
Gerrit-PatchSet: 8
Gerrit-Owner: jolly 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Attention: daniel 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 07 Mar 2024 13:21:54 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jolly 
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: daniel 
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Guard osmo_iofd_register() with invalid file descriptor

2024-03-07 Thread pespin
Attention is currently required from: daniel, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email )

Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor
..


Patch Set 1: Code-Review+1

(1 comment)

File src/core/osmo_io.c:

https://gerrit.osmocom.org/c/libosmocore/+/36188/comment/99429b3b_22d43abe
PS1, Line 676:  if (iofd->fd < 0) {
> no. […]
ah I see. In any case, it would be optimal to do:
"else if (iofd->fd < 0) {"

because if the code paths enter the 1st if clause, it's impossible it enters 
the second one.



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
Gerrit-Change-Number: 36188
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:22:37 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


[S] Change in osmo-bts[master]: pcu_sock: forward PCU_VERSION only once

2024-03-07 Thread laforge
Attention is currently required from: dexter, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/36018?usp=email )

Change subject: pcu_sock: forward PCU_VERSION only once
..


Patch Set 1:

(1 comment)

Commit Message:

https://gerrit.osmocom.org/c/osmo-bts/+/36018/comment/2ff3ae74_1c661460
PS1, Line 10: is not active the PCU even sends the version number in regular
> This entire thread and patch are bizarre. […]
is there any update/feedback here?



--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/36018?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Id82fe0504d0cbdf71473c1e7dfe6125a3471bd85
Gerrit-Change-Number: 36018
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-CC: pespin 
Gerrit-Attention: pespin 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:22:27 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Comment-In-Reply-To: dexter 
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: GSUP_Templates: tr_GSUP_SAI_ERR: Allow passing extra params like MSG_...

2024-03-07 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36179?usp=email )

Change subject: GSUP_Templates: tr_GSUP_SAI_ERR: Allow passing extra params 
like MSG_CLASS
..

GSUP_Templates: tr_GSUP_SAI_ERR: Allow passing extra params like MSG_CLASS

Change-Id: I817b079ed380514e067bda1e7f3f7c6177ef314b
---
M library/GSUP_Templates.ttcn
1 file changed, 10 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve




diff --git a/library/GSUP_Templates.ttcn b/library/GSUP_Templates.ttcn
index 6d14b02..dcf086d 100644
--- a/library/GSUP_Templates.ttcn
+++ b/library/GSUP_Templates.ttcn
@@ -376,7 +376,7 @@

 template GSUP_PDU tr_GSUP_SAI_ERR(template hexstring imsi, template (present) 
integer cause := ?) :=
tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, {
-   tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) });
+   tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause), *});

 template (value) GSUP_PDU ts_GSUP_SAI_ERR(hexstring imsi, integer cause) :=
ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, {

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36179?usp=email
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: I817b079ed380514e067bda1e7f3f7c6177ef314b
Gerrit-Change-Number: 36179
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


[S] Change in osmo-ttcn3-hacks[master]: GSUP_Templates: tr_GSUP_SAI_ERR: Allow passing extra params like MSG_...

2024-03-07 Thread laforge
Attention is currently required from: lynxis lazus, osmith, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36179?usp=email )

Change subject: GSUP_Templates: tr_GSUP_SAI_ERR: Allow passing extra params 
like MSG_CLASS
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36179?usp=email
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: I817b079ed380514e067bda1e7f3f7c6177ef314b
Gerrit-Change-Number: 36179
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: osmith 
Gerrit-Attention: osmith 
Gerrit-Attention: pespin 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:18:25 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Guard osmo_iofd_register() with invalid file descriptor

2024-03-07 Thread laforge
Attention is currently required from: daniel, jolly, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email )

Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor
..


Patch Set 1:

(1 comment)

File src/core/osmo_io.c:

https://gerrit.osmocom.org/c/libosmocore/+/36188/comment/8c8084d5_edb08f62
PS1, Line 676:  if (iofd->fd < 0) {
> this is "else" clause for if just immediately above it.
no. iofd->FD might be set previously, and FD argument -1



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
Gerrit-Change-Number: 36188
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: pespin 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:16:32 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: stp: fix -latest: add missing f_osmo_repo_is() checks

2024-03-07 Thread fixeria
Attention is currently required from: pespin.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36195?usp=email )

Change subject: stp: fix -latest: add missing f_osmo_repo_is() checks
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36195?usp=email
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: I9b00d3a72c5a2ad669dbaef65eec792a4c91785d
Gerrit-Change-Number: 36195
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:09:18 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: stp: fix -latest: add missing f_osmo_repo_is() checks

2024-03-07 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36195?usp=email )

Change subject: stp: fix -latest: add missing f_osmo_repo_is() checks
..

stp: fix -latest: add missing f_osmo_repo_is() checks

Change-Id: I9b00d3a72c5a2ad669dbaef65eec792a4c91785d
Related: SYS#5424
---
M stp/STP_Tests_M3UA.ttcn
1 file changed, 28 insertions(+), 0 deletions(-)

Approvals:
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index 9f3bf0c..24b3ae1 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -326,6 +326,12 @@
var OptionList opt_list := {};
var M3uaConfig m3cfg := mp_m3ua_configs[i];

+   /* XXX: M3UA-over-TCP is not supported by osmo-stp <= 1.8.1 */
+   if (not Misc_Helpers.f_osmo_repo_is("nightly") and m3cfg.use_tcp) {
+   log("Not listen()ing m3cfg := ", m3cfg, " (not supported by 
IUT)");
+   return;
+   }
+
if (lengthof(mp_local_m3ua_ip) == 0 ) {
setverdict(fail, "Empty local address trying to bind SCTP 
socket: ",
   mp_local_m3ua_ip);
@@ -365,6 +371,12 @@
}

for (i := 0; i < NR_M3UA; i:=i+1) {
+   /* XXX: M3UA-over-TCP is not supported by osmo-stp <= 1.8.1 */
+   if (not Misc_Helpers.f_osmo_repo_is("nightly") and 
mp_m3ua_configs[i].use_tcp) {
+   log("Not connect()ing m3cfg := ", mp_m3ua_configs[i], " 
(not supported by IUT)");
+   g_m3ua_conn_id[i] := -1;
+   continue;
+   }
map(self:M3UA[i], system:M3UA_CODEC_PT);
if (mp_m3ua_configs[i].use_tcp) {
f_M3UA_connect_tcp(i);
@@ -392,6 +404,12 @@
var PortEvent port_evt;

for (i := NR_M3UA; i < NR_M3UA+NR_M3UA_SRV; i:=i+1) {
+   /* XXX: M3UA-over-TCP is not supported by osmo-stp <= 1.8.1 */
+   if (not Misc_Helpers.f_osmo_repo_is("nightly") and 
mp_m3ua_configs[i].use_tcp) {
+   log("Not listen()ing m3cfg := ", mp_m3ua_configs[i], " 
(not supported by IUT)");
+   g_m3ua_conn_id[i] := -1;
+   continue;
+   }
map(self:M3UA[i], system:M3UA_CODEC_PT);
/* bind+ listen */
f_M3UA_listen(i);

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36195?usp=email
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: I9b00d3a72c5a2ad669dbaef65eec792a4c91785d
Gerrit-Change-Number: 36195
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in osmo-ttcn3-hacks[master]: stp: cosmetic: use m3cfg variable in f_M3UA_listen()

2024-03-07 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36194?usp=email )

Change subject: stp: cosmetic: use m3cfg variable in f_M3UA_listen()
..

stp: cosmetic: use m3cfg variable in f_M3UA_listen()

Change-Id: Ic5550f17e8925c292df5b3b27cf5898edf10fd23
Related: SYS#5424
---
M stp/STP_Tests_M3UA.ttcn
1 file changed, 12 insertions(+), 2 deletions(-)

Approvals:
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index a0162cb..9f3bf0c 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -338,7 +338,7 @@
opt_list := {opt_add_local_addrs};
}

-   if (mp_m3ua_configs[i].use_tcp) {
+   if (m3cfg.use_tcp) {
res := M3UA_CodecPort_CtrlFunct.f_IPL4_listen(M3UA[i], 
mp_local_m3ua_ip[0], m3cfg.local_port,
  {tcp:={}});
} else {
@@ -349,7 +349,7 @@
setverdict(fail, "Could not bind M3UA socket, check your 
configuration");
mtc.stop;
}
-   if (mp_m3ua_configs[i].use_tcp) {
+   if (m3cfg.use_tcp) {
M3UA_CodecPort.f_set_tcp_segmentation(M3UA[i], res.connId);
}
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36194?usp=email
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: Ic5550f17e8925c292df5b3b27cf5898edf10fd23
Gerrit-Change-Number: 36194
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-MessageType: merged


[S] Change in osmo-ttcn3-hacks[master]: stp: cosmetic: use m3cfg variable in f_M3UA_listen()

2024-03-07 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36194?usp=email )

Change subject: stp: cosmetic: use m3cfg variable in f_M3UA_listen()
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36194?usp=email
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: Ic5550f17e8925c292df5b3b27cf5898edf10fd23
Gerrit-Change-Number: 36194
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:09:16 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Avoid implementing non-existant situations

2024-03-07 Thread pespin
Attention is currently required from: daniel, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36193?usp=email )

Change subject: osmo_io: Avoid implementing non-existant situations
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36193?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0077151eb676f61320b3fa2124448852aa8fd4a9
Gerrit-Change-Number: 36193
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:08:14 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: avoid OSMO_ASSERT one each API call

2024-03-07 Thread pespin
Attention is currently required from: daniel, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36192?usp=email )

Change subject: osmo_io: avoid OSMO_ASSERT one each API call
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36192?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id9005ac6bb260236c88670373816bf7ee6a627f1
Gerrit-Change-Number: 36192
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:07:44 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Don't pretend to support backends without close_cb

2024-03-07 Thread pespin
Attention is currently required from: daniel, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36191?usp=email )

Change subject: osmo_io: Don't pretend to support backends without close_cb
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36191?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id285f1d7b73ae5805aa618897016ae8b73bf892d
Gerrit-Change-Number: 36191
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:06:36 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Guard osmo_iofd_register() with invalid file descriptor

2024-03-07 Thread pespin
Attention is currently required from: daniel, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email )

Change subject: osmo_io: Guard osmo_iofd_register() with invalid file descriptor
..


Patch Set 1: Code-Review-1

(1 comment)

File src/core/osmo_io.c:

https://gerrit.osmocom.org/c/libosmocore/+/36188/comment/dc5c9ce7_fb0c29bf
PS1, Line 676:  if (iofd->fd < 0) {
this is "else" clause for if just immediately above it.



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36188?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie4561cefad82e1bf5d37dd1a4815f4bc805343e6
Gerrit-Change-Number: 36188
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:05:39 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: osmo_io: Log error message in case call-backs incompatible with mode

2024-03-07 Thread pespin
Attention is currently required from: daniel, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email )

Change subject: osmo_io: Log error message in case call-backs incompatible with 
mode
..


Patch Set 2:

(2 comments)

File src/core/osmo_io.c:

https://gerrit.osmocom.org/c/libosmocore/+/36190/comment/9e09a831_a941fa42
PS2, Line 623:  LOGP(DLIO, LOGL_ERROR, "iofd(%s): rejecting call-backs 
incompatible with mode\n",
...with mode %u", mode


https://gerrit.osmocom.org/c/libosmocore/+/36190/comment/4898f4d3_2ff28ab8 
PS2, Line 876:  LOGPIO(iofd, LOGL_ERROR, "rejecting call-backs 
incompatible with mode\n");
same



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36190?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I50ba6a76c0144f249d67488874a6c4edf01ec6f2
Gerrit-Change-Number: 36190
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: jolly 
Gerrit-CC: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:03:38 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: GSUP_Templates: tr_GSUP_SAI_ERR: Allow passing extra params like MSG_...

2024-03-07 Thread fixeria
Attention is currently required from: laforge, lynxis lazus, osmith, pespin.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36179?usp=email )

Change subject: GSUP_Templates: tr_GSUP_SAI_ERR: Allow passing extra params 
like MSG_CLASS
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36179?usp=email
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: I817b079ed380514e067bda1e7f3f7c6177ef314b
Gerrit-Change-Number: 36179
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: osmith 
Gerrit-Attention: osmith 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:03:07 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in ...osmo-epdg[master]: Migrate S6b to use new epdg_dia_rc record

2024-03-07 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36182?usp=email )

Change subject: Migrate S6b to use new epdg_dia_rc record
..

Migrate S6b to use new epdg_dia_rc record

Change-Id: I11674ef7b9fb541d7e48a74fa986ee0798042de9
---
M src/aaa_diameter_s6b.erl
M src/aaa_diameter_s6b_cb.erl
M src/aaa_ue_fsm.erl
M src/epdg_ue_fsm.erl
4 files changed, 36 insertions(+), 22 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved




diff --git a/src/aaa_diameter_s6b.erl b/src/aaa_diameter_s6b.erl
index 2792b6a..163ffbd 100644
--- a/src/aaa_diameter_s6b.erl
+++ b/src/aaa_diameter_s6b.erl
@@ -147,13 +147,13 @@
 gen_server:call(?SERVER,
   {sar, {IMSI, Type, APN}}).

-tx_aa_answer(Pid, ResultCode) ->
+tx_aa_answer(Pid, DiaRC) ->
 % handle_request(AAR) was spawned into its own process, and it's blocked 
waiting for AAA:
-Pid ! {aaa, ResultCode}.
+Pid ! {aaa, DiaRC}.

-tx_st_answer(Pid, ResultCode) ->
+tx_st_answer(Pid, DiaRC) ->
 % handle_request(STR) was spawned into its own process, and it's blocked 
waiting for STA:
-Pid ! {sta, ResultCode}.
+Pid ! {sta, DiaRC}.

 result_code_success(2001) -> ok;
 result_code_success(2002) -> ok;
diff --git a/src/aaa_diameter_s6b_cb.erl b/src/aaa_diameter_s6b_cb.erl
index b3fe209..a56a7ca 100644
--- a/src/aaa_diameter_s6b_cb.erl
+++ b/src/aaa_diameter_s6b_cb.erl
@@ -6,6 +6,8 @@
 -include_lib("diameter/include/diameter.hrl").
 -include_lib("diameter_3gpp_ts29_273_s6b.hrl").

+-include("conv.hrl").
+
 %% diameter callbacks
 -export([peer_up/3, peer_down/3, pick_peer/4, prepare_request/3, 
prepare_retransmit/3,
  handle_answer/4, handle_error/4, handle_request/3]).
@@ -67,15 +69,15 @@
 ok = aaa_ue_fsm:ev_rx_s6b_aar(PidRes, {Apn, AgentInfoOpt}),
 lager:debug("Waiting for S6b AAA~n", []),
 receive
-{aaa, ResultCode} -> lager:debug("Rx AAA with ResultCode=~p~n", 
[ResultCode])
+{aaa, DiaRC} -> lager:debug("Rx AAA with DiaRC=~p~n", [DiaRC])
 end;
 undefined -> lager:error("Error looking up FSM for IMSI~n", [Imsi]),
- ResultCode = ?'RULE-FAILURE-CODE_CM_AUTHORIZATION_REJECTED'
+ DiaRC = #epdg_dia_rc{result_code = 
?'RULE-FAILURE-CODE_CM_AUTHORIZATION_REJECTED'}
 end,
 Resp = #'AAA'{'Session-Id'= SessionId,
   'Auth-Application-Id' = AuthAppId,
   'Auth-Request-Type' = AuthReqType,
-  'Result-Code' = ResultCode,
+  'Result-Code' = DiaRC#epdg_dia_rc.result_code,
   'Origin-Host' = OH,
   'Origin-Realm' = OR},
 lager:info("S6b Tx to ~p: ~p~n", [Caps, Resp]),
@@ -97,10 +99,12 @@
 ok ->
 lager:debug("Waiting for S6b STA~n", []),
 receive
-{sta, ResultCode} -> lager:debug("Rx STA with 
ResultCode=~p~n", [ResultCode])
+{sta, DiaRC} ->
+ResultCode = DiaRC#epdg_dia_rc.result_code,
+lager:debug("Rx STA with ResultCode=~p~n", [ResultCode])
 end;
-{ok, DiaRC} when is_integer(DiaRC) ->
-ResultCode = DiaRC;
+{ok, DiaRC} ->
+ResultCode = DiaRC#epdg_dia_rc.result_code;
 {error, Err} when is_integer(Err) ->
 ResultCode = Err;
 {error, _} ->
@@ -119,4 +123,4 @@

 handle_request(Packet, _SvcName, Peer) ->
 lager:error("S6b Rx unexpected msg from ~p: ~p~n", [Peer, Packet]),
-erlang:error({unexpected, ?MODULE, ?LINE}).
+erlang:error({unexpected, ?MODULE, ?LINE}).
\ No newline at end of file
diff --git a/src/aaa_ue_fsm.erl b/src/aaa_ue_fsm.erl
index 4c33567..f06b326 100644
--- a/src/aaa_ue_fsm.erl
+++ b/src/aaa_ue_fsm.erl
@@ -232,12 +232,13 @@
 lager:info("ue_fsm state_authenticated event=rx_s6b_str, ~p~n", 
[Data]),
 case {Data#ue_fsm_data.pgw_sess_active, 
Data#ue_fsm_data.epdg_sess_active} of
 {false, _} -> %% The S6b session is not active...
-DiaRC = 5002, %% UNKNOWN_SESSION_ID
+DiaRC = #epdg_dia_rc{result_code = 5002}, %% UNKNOWN_SESSION_ID
 {keep_state, Data, [{reply,From,{error, DiaRC}}]};
 {true, true} -> %% The other session is still active, no need to send 
SAR Type=USER_DEREGISTRATION
 lager:info("ue_fsm state_authenticated event=rx_s6b_str: ePDG 
session still active, skip updating the HSS~n", []),
 Data1 = Data#ue_fsm_data{pgw_sess_active = false},
-{keep_state, Data1, [{reply,From,{ok, 2001}}]};
+DiaRC = #epdg_dia_rc{result_code = 2001}, %% SUCCESS
+{keep_state, Data1, [{reply,From,{ok, DiaRC}}]};
 {true, false} -> %% All sessions will now be gone, trigger SAR 
Type=USER_DEREGISTRATION
 case 

[S] Change in ...osmo-epdg[master]: aaa_ue_fsm: Fix format error during log

2024-03-07 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36181?usp=email )

Change subject: aaa_ue_fsm: Fix format error during log
..

aaa_ue_fsm: Fix format error during log

Change-Id: Id57156dfb5de0cddf6fb42def5c312c85dff09f8
---
M src/aaa_ue_fsm.erl
1 file changed, 10 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved




diff --git a/src/aaa_ue_fsm.erl b/src/aaa_ue_fsm.erl
index ae7de6b..4c33567 100644
--- a/src/aaa_ue_fsm.erl
+++ b/src/aaa_ue_fsm.erl
@@ -122,7 +122,7 @@
 end.

 ev_rx_s6b_str(Pid) ->
-lager:info("ue_fsm ev_rx_s6b_str: ~p~n", []),
+lager:info("ue_fsm ev_rx_s6b_str~n", []),
 try
 gen_statem:call(Pid, rx_s6b_str)
 catch

--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36181?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: erlang/osmo-epdg
Gerrit-Branch: master
Gerrit-Change-Id: Id57156dfb5de0cddf6fb42def5c312c85dff09f8
Gerrit-Change-Number: 36181
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in ...osmo-epdg[master]: aaa_ue_fsm: Fix format error during log

2024-03-07 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36181?usp=email )

Change subject: aaa_ue_fsm: Fix format error during log
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36181?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: erlang/osmo-epdg
Gerrit-Branch: master
Gerrit-Change-Id: Id57156dfb5de0cddf6fb42def5c312c85dff09f8
Gerrit-Change-Number: 36181
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:02:08 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in ...osmo-epdg[master]: Forward failure SWx MAA -> GSUP AuthInfo Error

2024-03-07 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36180?usp=email )

Change subject: Forward failure SWx MAA -> GSUP AuthInfo Error
..

Forward failure SWx MAA -> GSUP AuthInfo Error

Change-Id: I48066058e601a4ca4d46e239f7a7060bbc20a32b
---
M include/conv.hrl
M src/aaa_diameter_swx_cb.erl
M src/aaa_ue_fsm.erl
M src/conv.erl
M src/epdg_ue_fsm.erl
M src/gsup_server.erl
6 files changed, 104 insertions(+), 35 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved




diff --git a/include/conv.hrl b/include/conv.hrl
index 80b7e5b..786bdff 100644
--- a/include/conv.hrl
+++ b/include/conv.hrl
@@ -31,6 +31,12 @@
 %
 -hrl_name('conv.hrl').

+%% Can Hold information about Result-Code or Experimental-Result:
+-record(epdg_dia_rc, {
+vendor_id  :: non_neg_integer(), %% or undefined if Result-Code
+result_code:: non_neg_integer()
+}).
+
 -record(epdg_eua, {
 type_nr :: non_neg_integer(),
 ipv4:: binary(),
diff --git a/src/aaa_diameter_swx_cb.erl b/src/aaa_diameter_swx_cb.erl
index 0457259..8a6dd08 100644
--- a/src/aaa_diameter_swx_cb.erl
+++ b/src/aaa_diameter_swx_cb.erl
@@ -70,18 +70,27 @@
 %% handle_answer/4
 handle_answer(#diameter_packet{msg = Msg, errors = Errors}, _Request, 
_SvcName, Peer, ReqPid) when is_record(Msg, 'MAA')  ->
 lager:info("SWx Rx MAA ~p: ~p/ Errors ~p ~n", [Peer, Msg, Errors]),
-#'MAA'{'SIP-Auth-Data-Item' = SipAuthTuples} = Msg,
-AuthTuples = lists:map(fun dia_sip2epdg_auth_tuple/1, SipAuthTuples),
-% TODO: handle error case
-aaa_ue_fsm:ev_rx_swx_maa(ReqPid, {ok, AuthTuples}),
+#'MAA'{'Result-Code' = ResultCodeOpt,
+   'Experimental-Result' = ExperimentalResultOpt} = Msg,
+DiaRC = parse_epdg_dia_rc(ResultCodeOpt, ExperimentalResultOpt),
+case dia_rc_success(DiaRC) of
+ok ->
+#'MAA'{'SIP-Auth-Data-Item' = SipAuthTuples} = Msg,
+AuthTuples = lists:map(fun dia_sip2epdg_auth_tuple/1, SipAuthTuples),
+aaa_ue_fsm:ev_rx_swx_maa(ReqPid, {ok, AuthTuples});
+_ ->
+aaa_ue_fsm:ev_rx_swx_maa(ReqPid, {error, DiaRC})
+end,
 {ok, Msg};
 handle_answer(#diameter_packet{msg = Msg, errors = Errors}, Request, _SvcName, 
Peer, ReqPid) when is_record(Msg, 'SAA')  ->
 lager:info("SWx Rx SAA ~p: ~p/ Errors ~p ~n", [Peer, Msg, Errors]),
 % Recover fields from originating request:
 #'SAR'{'Server-Assignment-Type' = SAType} = Request,
 % Retrieve fields from answer:
-#'SAA'{'Result-Code' = [ResultCode]} = Msg,
-case result_code_success(ResultCode) of
+#'SAA'{'Result-Code' = ResultCodeOpt,
+   'Experimental-Result' = ExperimentalResultOpt} = Msg,
+DiaRC = parse_epdg_dia_rc(ResultCodeOpt, ExperimentalResultOpt),
+case dia_rc_success(DiaRC) of
 ok ->
 #'SAA'{'Non-3GPP-User-Data' = N3UA} = Msg,
 PGWAddresses = parse_pgw_addr_from_N3UA(N3UA),
@@ -91,7 +100,7 @@
 end,
 aaa_ue_fsm:ev_rx_swx_saa(ReqPid, {ok, SAType, ResInfo});
 _ ->
-aaa_ue_fsm:ev_rx_swx_saa(ReqPid, {error, SAType, ResultCode})
+aaa_ue_fsm:ev_rx_swx_saa(ReqPid, {error, SAType, DiaRC})
 end,
 {ok, Msg}.
 handle_answer(#diameter_packet{msg = Msg, errors = []}, _Request, _SvcName, 
Peer) ->
@@ -121,9 +130,19 @@
 %% Internal Function Definitions
 %% --

-result_code_success(2001) -> ok;
-result_code_success(2002) -> ok;
-result_code_success(_) -> invalid_result_code.
+dia_rc_success(#epdg_dia_rc{result_code = 2001}) -> ok;
+dia_rc_success(#epdg_dia_rc{result_code = 2002}) -> ok;
+dia_rc_success(_) -> invalid_result_code.
+
+parse_epdg_dia_rc([], []) ->
+#epdg_dia_rc{vendor_id = undefined, result_code = 2001 };
+parse_epdg_dia_rc([ResultCode], []) ->
+#epdg_dia_rc{vendor_id = undefined, result_code = ResultCode };
+parse_epdg_dia_rc([], [ExpResultCode]) ->
+#'Experimental-Result'{'Vendor-Id' = VendorId, 'Experimental-Result-Code' 
= ERC} = ExpResultCode,
+#epdg_dia_rc{vendor_id = VendorId, result_code = ERC };
+parse_epdg_dia_rc([ResultCode], [_ExpResultCode]) ->
+parse_epdg_dia_rc([ResultCode], []).

 dia_sip2epdg_auth_tuple(#'SIP-Auth-Data-Item'{'SIP-Authenticate' = 
[Authenticate],
   'SIP-Authorization' = 
[Authorization],
diff --git a/src/aaa_ue_fsm.erl b/src/aaa_ue_fsm.erl
index 9e41756..ae7de6b 100644
--- a/src/aaa_ue_fsm.erl
+++ b/src/aaa_ue_fsm.erl
@@ -37,6 +37,7 @@
 -include_lib("diameter/include/diameter.hrl").
 -include_lib("diameter_3gpp_ts29_229.hrl").
 -include_lib("diameter_3gpp_ts29_273_s6b.hrl").
+-include("conv.hrl").

 -export([start_link/1]).
 -export([init/1,callback_mode/0,terminate/3]).
@@ -175,7 +176,6 @@
 state_wait_swx_maa({call, From}, {rx_swx_maa, Result}, Data) ->
 lager:info("ue_fsm state_wait_swx_maa event=rx_swx_maa, ~p~n", 

[M] Change in ...osmo-epdg[master]: Migrate S6b to use new epdg_dia_rc record

2024-03-07 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36182?usp=email )

Change subject: Migrate S6b to use new epdg_dia_rc record
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36182?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: erlang/osmo-epdg
Gerrit-Branch: master
Gerrit-Change-Id: I11674ef7b9fb541d7e48a74fa986ee0798042de9
Gerrit-Change-Number: 36182
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:02:10 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in ...osmo-epdg[master]: Forward failure SWx MAA -> GSUP AuthInfo Error

2024-03-07 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36180?usp=email )

Change subject: Forward failure SWx MAA -> GSUP AuthInfo Error
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/erlang/osmo-epdg/+/36180?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: erlang/osmo-epdg
Gerrit-Branch: master
Gerrit-Change-Id: I48066058e601a4ca4d46e239f7a7060bbc20a32b
Gerrit-Change-Number: 36180
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 07 Mar 2024 12:02:06 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in docker-playground[master]: ttcn3-stp-test: enable M3UA-over-TCP testing for master

2024-03-07 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/36151?usp=email )

Change subject: ttcn3-stp-test: enable M3UA-over-TCP testing for master
..

ttcn3-stp-test: enable M3UA-over-TCP testing for master

Change-Id: I210b7d62845075dcfe147f2f77603625cc1e64f9
Depends: osmo-ttcn3-hacks.git I5d0b05aa434c057ad379125ac293f5fc9a240b6f
Related: osmo-ttcn3-hacks.git I1e2a887aa22f317783b3207494fd707d7b426439
Related: SYS#5424
---
M ttcn3-stp-test/jenkins.sh
A ttcn3-stp-test/osmo-stp-tcp.confmerge
2 files changed, 47 insertions(+), 0 deletions(-)

Approvals:
  pespin: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/ttcn3-stp-test/jenkins.sh b/ttcn3-stp-test/jenkins.sh
index 006bb3b..f6768f0 100755
--- a/ttcn3-stp-test/jenkins.sh
+++ b/ttcn3-stp-test/jenkins.sh
@@ -16,6 +16,13 @@
 mkdir $VOL_BASE_DIR/stp
 cp osmo-stp.cfg $VOL_BASE_DIR/stp/

+# XXX: M3UA-over-TCP is not supported by osmo-stp <= 1.8.1
+if image_suffix_is_master; then
+   osmo-config-merge ./osmo-stp.cfg \
+ ./osmo-stp-tcp.confmerge \
+ > "$VOL_BASE_DIR/stp/osmo-stp.cfg"
+fi
+
 network_create
 network_replace_subnet_in_configs

diff --git a/ttcn3-stp-test/osmo-stp-tcp.confmerge 
b/ttcn3-stp-test/osmo-stp-tcp.confmerge
new file mode 100644
index 000..8772c35
--- /dev/null
+++ b/ttcn3-stp-test/osmo-stp-tcp.confmerge
@@ -0,0 +1,28 @@
+cs7 instance 0
+ asp asp-sender-tcp  2905 m3ua tcp
+  local-ip 172.18.19.200
+  local-ip fd02:db8:19::200
+  remote-ip 172.18.19.203
+  remote-ip fd02:db8:19::203
+  role sg
+  transport-role server
+ asp asp-client0-tcp 10002 2906 m3ua tcp
+  local-ip 172.18.19.200
+  local-ip fd02:db8:19::200
+  remote-ip 172.18.19.203
+  remote-ip fd02:db8:19::203
+  role asp
+  transport-role client
+ as as-sender-tcp m3ua
+  asp asp-sender-tcp
+  routing-key 1123 123
+ as as-client-tcp m3ua
+  routing-key 1155 155
+  asp asp-client0-tcp
+ route-table system
+  update route 123 16777215 linkset as-sender-tcp
+  update route 155 16777215 linkset as-client-tcp
+ listen m3ua 2905 tcp
+  local-ip 172.18.19.200
+  local-ip fd02:db8:19::200
+  accept-asp-connections dynamic-permitted

--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36151?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I210b7d62845075dcfe147f2f77603625cc1e64f9
Gerrit-Change-Number: 36151
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in docker-playground[master]: ttcn3-stp-test: enable M3UA-over-TCP testing for master

2024-03-07 Thread pespin
Attention is currently required from: fixeria, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/36151?usp=email )

Change subject: ttcn3-stp-test: enable M3UA-over-TCP testing for master
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36151?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I210b7d62845075dcfe147f2f77603625cc1e64f9
Gerrit-Change-Number: 36151
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Thu, 07 Mar 2024 11:59:39 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: stp: fix -latest: add missing f_osmo_repo_is() checks

2024-03-07 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36195?usp=email )

Change subject: stp: fix -latest: add missing f_osmo_repo_is() checks
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36195?usp=email
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: I9b00d3a72c5a2ad669dbaef65eec792a4c91785d
Gerrit-Change-Number: 36195
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Thu, 07 Mar 2024 11:50:52 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: stp: fix -latest: add missing f_osmo_repo_is() checks

2024-03-07 Thread fixeria
Attention is currently required from: fixeria.

Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36195?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder


Change subject: stp: fix -latest: add missing f_osmo_repo_is() checks
..

stp: fix -latest: add missing f_osmo_repo_is() checks

Change-Id: I9b00d3a72c5a2ad669dbaef65eec792a4c91785d
Related: SYS#5424
---
M stp/STP_Tests_M3UA.ttcn
1 file changed, 26 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/95/36195/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36195?usp=email
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: I9b00d3a72c5a2ad669dbaef65eec792a4c91785d
Gerrit-Change-Number: 36195
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


[S] Change in docker-playground[master]: ttcn3-stp-test: enable M3UA-over-TCP testing for master

2024-03-07 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/36151?usp=email )

Change subject: ttcn3-stp-test: enable M3UA-over-TCP testing for master
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36151?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I210b7d62845075dcfe147f2f77603625cc1e64f9
Gerrit-Change-Number: 36151
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Thu, 07 Mar 2024 11:24:48 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: stp: cosmetic: use m3cfg variable in f_M3UA_listen()

2024-03-07 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36194?usp=email )


Change subject: stp: cosmetic: use m3cfg variable in f_M3UA_listen()
..

stp: cosmetic: use m3cfg variable in f_M3UA_listen()

Change-Id: Ic5550f17e8925c292df5b3b27cf5898edf10fd23
Related: SYS#5424
---
M stp/STP_Tests_M3UA.ttcn
1 file changed, 12 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/94/36194/1

diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index a0162cb..9f3bf0c 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -338,7 +338,7 @@
opt_list := {opt_add_local_addrs};
}

-   if (mp_m3ua_configs[i].use_tcp) {
+   if (m3cfg.use_tcp) {
res := M3UA_CodecPort_CtrlFunct.f_IPL4_listen(M3UA[i], 
mp_local_m3ua_ip[0], m3cfg.local_port,
  {tcp:={}});
} else {
@@ -349,7 +349,7 @@
setverdict(fail, "Could not bind M3UA socket, check your 
configuration");
mtc.stop;
}
-   if (mp_m3ua_configs[i].use_tcp) {
+   if (m3cfg.use_tcp) {
M3UA_CodecPort.f_set_tcp_segmentation(M3UA[i], res.connId);
}
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36194?usp=email
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: Ic5550f17e8925c292df5b3b27cf5898edf10fd23
Gerrit-Change-Number: 36194
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


[S] Change in osmo-ttcn3-hacks[master]: stp: fix -latest: add missing f_osmo_repo_is() checks

2024-03-07 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36195?usp=email )


Change subject: stp: fix -latest: add missing f_osmo_repo_is() checks
..

stp: fix -latest: add missing f_osmo_repo_is() checks

Change-Id: I9b00d3a72c5a2ad669dbaef65eec792a4c91785d
Related: SYS#5424
---
M stp/STP_Tests_M3UA.ttcn
1 file changed, 26 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/95/36195/1

diff --git a/stp/STP_Tests_M3UA.ttcn b/stp/STP_Tests_M3UA.ttcn
index 9f3bf0c..a7dcd78 100644
--- a/stp/STP_Tests_M3UA.ttcn
+++ b/stp/STP_Tests_M3UA.ttcn
@@ -326,6 +326,12 @@
var OptionList opt_list := {};
var M3uaConfig m3cfg := mp_m3ua_configs[i];
 
+   /* XXX: M3UA-over-TCP is not supported by osmo-stp <= 1.8.1 */
+   if (not Misc_Helpers.f_osmo_repo_is("nightly") and m3cfg.use_tcp) {
+   log("Not listen()ing m3cfg := ", m3cfg, " (not supported by 
IUT)");
+   return;
+   }
+
if (lengthof(mp_local_m3ua_ip) == 0 ) {
setverdict(fail, "Empty local address trying to bind SCTP 
socket: ",
   mp_local_m3ua_ip);
@@ -365,6 +371,11 @@
}

for (i := 0; i < NR_M3UA; i:=i+1) {
+   /* XXX: M3UA-over-TCP is not supported by osmo-stp <= 1.8.1 */
+   if (not Misc_Helpers.f_osmo_repo_is("nightly") and 
mp_m3ua_configs[i].use_tcp) {
+   log("Not connect()ing m3cfg := ", m3cfg, " (not 
supported by IUT)");
+   continue;
+   }
map(self:M3UA[i], system:M3UA_CODEC_PT);
if (mp_m3ua_configs[i].use_tcp) {
f_M3UA_connect_tcp(i);
@@ -392,6 +403,11 @@
var PortEvent port_evt;

for (i := NR_M3UA; i < NR_M3UA+NR_M3UA_SRV; i:=i+1) {
+   /* XXX: M3UA-over-TCP is not supported by osmo-stp <= 1.8.1 */
+   if (not Misc_Helpers.f_osmo_repo_is("nightly") and 
mp_m3ua_configs[i].use_tcp) {
+   log("Not listen()ing m3cfg := ", m3cfg, " (not 
supported by IUT)");
+   continue;
+   }
map(self:M3UA[i], system:M3UA_CODEC_PT);
/* bind+ listen */
f_M3UA_listen(i);

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36195?usp=email
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: I9b00d3a72c5a2ad669dbaef65eec792a4c91785d
Gerrit-Change-Number: 36195
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


[S] Change in osmo-e1-hardware[master]: icE1usb fw: Ensure alignement of the structure for the usb_data_write

2024-03-07 Thread tnt
tnt has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36186?usp=email )

Change subject: icE1usb fw: Ensure alignement of the structure for the 
usb_data_write
..

icE1usb fw: Ensure alignement of the structure for the usb_data_write

Signed-off-by: Sylvain Munaut 
Change-Id: Id80468ef95bb908cf34b6eeca04c83f1285fd2f5
---
M firmware/ice40-riscv/icE1usb/usb_gps.c
1 file changed, 11 insertions(+), 1 deletion(-)

Approvals:
  tnt: Looks good to me, approved
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve




diff --git a/firmware/ice40-riscv/icE1usb/usb_gps.c 
b/firmware/ice40-riscv/icE1usb/usb_gps.c
index ad893a5..0fe5c98 100644
--- a/firmware/ice40-riscv/icE1usb/usb_gps.c
+++ b/firmware/ice40-riscv/icE1usb/usb_gps.c
@@ -138,7 +138,7 @@
{
/* Default request */
/* Put as static to work around gcc aliasing bug ... */
-   static struct usb_cdc_notif_serial_state notif = {
+   static struct usb_cdc_notif_serial_state 
__attribute__((aligned(4))) notif = {
.hdr = {
.bmRequestType = USB_REQ_READ | 
USB_REQ_TYPE_CLASS | USB_REQ_RCPT_INTF,
.bRequest  = USB_NOTIF_CDC_SERIAL_STATE,

--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36186?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: Id80468ef95bb908cf34b6eeca04c83f1285fd2f5
Gerrit-Change-Number: 36186
Gerrit-PatchSet: 2
Gerrit-Owner: tnt 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-MessageType: merged


[S] Change in osmo-e1-hardware[master]: gateware/cores: Update no2usb

2024-03-07 Thread tnt
tnt has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36183?usp=email )

Change subject: gateware/cores: Update no2usb
..

gateware/cores: Update no2usb

Mostly to get firmware code fixes

Need some code adaptation in icE1usb firmware to
remove local usb_cdc_notif_serial_state struct
sine tt's included in no2usb cdc proto header now.

Signed-off-by: Sylvain Munaut 
Change-Id: I13e186627077c57329e4a83da11acc01ca5dce35
---
M firmware/ice40-riscv/icE1usb/usb_gps.c
M gateware/cores/no2usb
2 files changed, 17 insertions(+), 7 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  tnt: Looks good to me, approved




diff --git a/firmware/ice40-riscv/icE1usb/usb_gps.c 
b/firmware/ice40-riscv/icE1usb/usb_gps.c
index e219cf8..db188b1 100644
--- a/firmware/ice40-riscv/icE1usb/usb_gps.c
+++ b/firmware/ice40-riscv/icE1usb/usb_gps.c
@@ -46,12 +46,6 @@
 } g_usb_gps;


-struct usb_cdc_notif_serial_state {
-   struct usb_ctrl_req hdr;
-   uint16_t bits;
-} __attribute__((packed,aligned(4)));
-
-
 static void
 _usb_gps_set_active(bool active)
 {
diff --git a/gateware/cores/no2usb b/gateware/cores/no2usb
index fdf42a6..9a3e752 16
--- a/gateware/cores/no2usb
+++ b/gateware/cores/no2usb
@@ -1 +1 @@
-Subproject commit fdf42a6571a4ae49556626e6fffca1582796f7e8
+Subproject commit 9a3e752eab17c8f12a3a1dd6cf291368eaf3161d

--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36183?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: I13e186627077c57329e4a83da11acc01ca5dce35
Gerrit-Change-Number: 36183
Gerrit-PatchSet: 2
Gerrit-Owner: tnt 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-MessageType: merged


[S] Change in osmo-e1-hardware[master]: icE1usb fw: Use proper length for struct usb_cdc_notif_serial_state

2024-03-07 Thread tnt
tnt has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36185?usp=email )

Change subject: icE1usb fw: Use proper length for struct 
usb_cdc_notif_serial_state
..

icE1usb fw: Use proper length for struct usb_cdc_notif_serial_state

Signed-off-by: Sylvain Munaut 
Change-Id: I30d451e76ebd192f037653179b6485b2b43b6dbc
---
M firmware/ice40-riscv/icE1usb/usb_gps.c
1 file changed, 15 insertions(+), 4 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  tnt: Looks good to me, approved




diff --git a/firmware/ice40-riscv/icE1usb/usb_gps.c 
b/firmware/ice40-riscv/icE1usb/usb_gps.c
index db188b1..ad893a5 100644
--- a/firmware/ice40-riscv/icE1usb/usb_gps.c
+++ b/firmware/ice40-riscv/icE1usb/usb_gps.c
@@ -148,6 +148,7 @@
},
.bits = 0x00
};
+   const int notif_len = sizeof(struct usb_cdc_notif_serial_state);

/* Check if PPS occurred */
uint32_t pps_now = time_pps_read();
@@ -159,8 +160,8 @@

/* Queue CD Set */
notif.bits = 1;
-   usb_data_write(ep_regs->bd[0].ptr, , 12);
-   ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | 
USB_BD_LEN(10);
+   usb_data_write(ep_regs->bd[0].ptr, , notif_len);
+   ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | 
USB_BD_LEN(notif_len);

/* Need to clear in the future */
g_usb_gps.pps.set = true;
@@ -169,8 +170,8 @@
{
/* Queue CD Clear */
notif.bits = 0;
-   usb_data_write(ep_regs->bd[0].ptr, , 12);
-   ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | 
USB_BD_LEN(10);
+   usb_data_write(ep_regs->bd[0].ptr, , notif_len);
+   ep_regs->bd[0].csr = USB_BD_STATE_RDY_DATA | 
USB_BD_LEN(notif_len);

/* Cleared */
g_usb_gps.pps.set = false;

--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36185?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: I30d451e76ebd192f037653179b6485b2b43b6dbc
Gerrit-Change-Number: 36185
Gerrit-PatchSet: 2
Gerrit-Owner: tnt 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-MessageType: merged


[S] Change in osmo-e1-hardware[master]: icE1usb fw: Use proper length for struct usb_cdc_notif_serial_state

2024-03-07 Thread tnt
tnt has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36185?usp=email )

Change subject: icE1usb fw: Use proper length for struct 
usb_cdc_notif_serial_state
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36185?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: I30d451e76ebd192f037653179b6485b2b43b6dbc
Gerrit-Change-Number: 36185
Gerrit-PatchSet: 2
Gerrit-Owner: tnt 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-Comment-Date: Thu, 07 Mar 2024 10:06:41 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-e1-hardware[master]: gateware/cores: Update no2usb

2024-03-07 Thread tnt
tnt has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36183?usp=email )

Change subject: gateware/cores: Update no2usb
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/36183?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: I13e186627077c57329e4a83da11acc01ca5dce35
Gerrit-Change-Number: 36183
Gerrit-PatchSet: 2
Gerrit-Owner: tnt 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: tnt 
Gerrit-Comment-Date: Thu, 07 Mar 2024 10:06:34 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


  1   2   >