Project

General

Profile

Feature #5753 ยป chatlog.txt

arehbein, 07/02/2023 05:21 PM

 
1
(04:27:29 PM) pespin: arehbein, asdfuser why is all that IPA specific stuff being added inside osmo_stream APIs? doesn't look good to me tbh, at least without knowing more context on why this is envisioned this way
2
(04:28:16 PM) pespin: if really some support needs to be added inside osmo_stream, then at least I would make it so that osmo_stream handles/uses that in a generic way. IMHO it should know about IPA at all
3
(04:28:53 PM) LaF0rge: pespin: We've always used osmonetif/stream for IPA.  Its just that in pre-osmoio code the caller/user/application did the read/recv themselves and had to take care of de-segmentation
4
(04:29:27 PM) asdfuser: pespin: The idea was to not deal with segmentation/reassembly in IPA-based protocols (which are a lot)
5
(04:29:29 PM) LaF0rge: pespin: with osmo_io, the level of abstraction is slightly higher: the read/recv/recvmsg/... is done within osmo_io (possibly io_uring backend) and the application gets a msgb back
6
(04:30:20 PM) LaF0rge: pespin: so if you want to always return a msgb with a full signalling message to a libosmo-netif user, whether it uses a SCTP protocol (like M3UA) or IPA based protocol, then the level of abstraction to the user is always the  same, no matter of the underlying protocol
7
(04:30:27 PM) pespin: asdfuser, then add some sort of generic API in osmo_stream to hook in generic segmentation stuff
8
(04:30:36 PM) pespin: and provide separate APIs/objects to support creating an osmo-stream with IPA on top
9
(04:31:17 PM) LaF0rge: pespin: but in reality to the user (think of SCCPlite vs. AoIP) looks at this as the same boundary / level of abstraction
10
(04:32:20 PM) LaF0rge: I'm not arguing the current detailed API implementation must be exactly this way.  I'm just saying the upper boundary of libosmo-netif is what should provide the same interface no matter if the underlying technology is SCTP or some IPA based protocol
11
(04:33:36 PM) pespin: well to me SCTP vs UDP vs TCP is clearly the same level, while IPA is just a (half) layer on top
12
(04:33:59 PM) LaF0rge: pespin: that's your point of view as a protocol stack implementor
13
(04:34:17 PM) LaF0rge: pespin: the *user application* point of view is "something that transmits a message with message boundary in-order from A to B"
14
(04:34:28 PM) LaF0rge: s/with/while preserving/
15
(04:35:19 PM) pespin: yeah well, that's then a osmo_msg_boundary_in_order, not a osmo_stream :D
16
(04:35:22 PM) LaF0rge: pespin: [very] recent kernels even have support for this kind of functionality inside the kernel (on top of TCP) so the sockets (and hence users) don't have to deal with it
17
(04:35:35 PM) LaF0rge: pespin: and it's still a SOCK_STREAM :P
18
(04:36:16 PM) pespin: yeah but hence my point, you are mixing 2 things (one on top of the other) in the same object, and I think it should be split. Specially IPA-specific logic
19
(04:36:40 PM) LaF0rge: I agree the "Stream" is not an ideal name anymore. but do you really want to copy+paste dozens of functions with a new name and change all programs to use that new name?
20
(04:36:44 PM) pespin: if one wants to add some sort of "message-boundaring-addition" API on top of osmo_stream fine, but I wouldn't start adding tons of IPA specific stuff there
21
(04:37:24 PM) pespin: LaF0rge, no, I want to add APIs which are generic to osmo-stream and leave the "I want to use IPA" part to the user of osmo_stream
22
(04:37:39 PM) pespin: I don't want to read the "IPA" string anywhere in osmo_stream :D
23
(04:38:08 PM) LaF0rge: pespin: this means every current user will have to repeat the same stuff all over again, or have to be ported to a completely new set of APIs
24
(04:38:17 PM) pespin: that's my point of view. That being said, I'm happy to discuss or provide ideas on how to sort out problems
25
(04:38:33 PM) LaF0rge: pespin: right now we have probably 10 different implementations of doing IPA stuff all over our code base
26
(04:38:55 PM) pespin: completely new set of APIs: no, they still use osmo_stream, and anyway they are changing the ipa APIs there now
27
(04:38:58 PM) LaF0rge: exactly due to the fact that every process used to read/write to its sockets directly, ...
28
(04:39:27 PM) pespin: LaF0rge, I'm in favour of unifying that, but I don't think implementing IPA inside osmo_stream is the way to go
29
(04:39:55 PM) LaF0rge: pespin: either every user has to implement the IPA handling internally and use the "pure netif", or they have to switch to a new set of API on top of  netif/stream, which means tons of new symbols doing 99% of the same stuff and lots of code changes everywhere
30
(04:41:13 PM) pespin: tons of new symbols: 1-2-3 symbols from generic callbacks? which anyway are being added now?
31
(04:41:35 PM) pespin: lots of code changes everywhere: afaiu the patches presenting the osmo_netif API is already requiring changes everywhere
32
(04:42:10 PM) LaF0rge: pespin: I'm talking about wrapping osmo_stream_* APIs in somehing else, which carries the state you don't want in 'struct osmo_stream_srv/clnt'
33
(04:42:25 PM) pespin: every user has to implement the IPA handling internally: Not really, helper functions can be added as an extension in libosmo-netif, just not inside osmo_stream
34
(04:42:51 PM) LaF0rge: pespin: the only changes required with the current proposal ar e those that are required anyway (just affecting read/write calls), but not every osmo_stream* call
35
(04:42:54 PM) pespin: LaF0rge, I was not necessarily thinking on wrapping all calls in other objects
36
(04:43:20 PM) LaF0rge: pespin: then how do you want to do it? you need additional state for every connection
37
(04:43:20 PM) LaF0rge: pespin: you don't want that in the osmo_stream_srv etc.
38
(04:43:46 PM) pespin: there's a priv struct. Or another generic one "segmentation_state" can be added, which callbacks, etc.
39
(04:43:53 PM) LaF0rge: pespin: so where will it go? in the application? that's what we want to avoid. the application should not have to care about it.  so you have to wrap every osmo_stream* struct in another new struct and add new apis for all calls...
40
(04:44:20 PM) LaF0rge: https://gerrit.osmocom.org/c/libosmo-netif/+/33197 is just adding a new 'mode' member and the segmentation call-backs are already implemented in a way that IPA is not the only possible user
41
(04:44:45 PM) pespin: It doesn't need to be a wrapper struct, it can be a sibling one which can be added/configured, etc. to interact with osmo_stream
42
(04:45:49 PM) pespin: what about https://gerrit.osmocom.org/c/libosmo-netif/+/33201/5/src/stream.c ?
43
(04:46:26 PM) LaF0rge: what about it?
44
(04:46:46 PM) pespin: IPA logic internally in there, plus new APIs like osmo_stream_srv_send_ipa()
45
(04:46:50 PM) LaF0rge: it adds a convenience wrapper on top of stream_srv_send so yo ucan specify the IPA proto + ext_proto
46
(04:47:07 PM) LaF0rge: exactly what makse sense to me;)
47
(04:47:27 PM) pespin: and cannot that be done generically in osmo_stream API?
48
(04:47:31 PM) LaF0rge: though one could pass the IPA protocol via msgb->cb[] to avoid a new symbol.
49
(04:48:09 PM) pespin: if we later on we want to add more message boundary systems on top of TCP then we add another API, one for each type?
50
(04:48:10 PM) LaF0rge: what's the problem with a function doing some extra stuff (osmo_stream_srv_send_ipa) which then calls osmo_stream_srv_send?
51
(04:48:30 PM) LaF0rge: yes, what's the problem with more convenience functions?  If you don't have that, every user has to implement this privately
52
(04:49:28 PM) pespin: you can have convenience functions, which use generic APIs/callbacks from osmo_stream. But I don't liking filling osmo_stream with IPA specific logic.
53
(04:49:32 PM) asdfuser: The main issue with another layer I think is having a read/write_cb in osmo_io, then one in osmo_stream_* handling the connect logic and then one in the ipa layer handling the decoding (segmentation would be handled in osmo_io already) plus the actual user callback
54
(04:51:10 PM) pespin: asdfuser, my understanding (I may be wrong) is that to support "message-boundary" protocols on top of stream, you need an extra read_cb, write_cb and segmentation_cb to apply extra logic
55
(04:51:19 PM) roh [~roh@osmocom/roh] entered the room.
56
(04:51:57 PM) asdfuser: We could rename to osmo_ipa_stream_cli_send(), but it doesn't make sense to have a struct osmo_ipa_stream_cli
57
(04:52:46 PM) asdfuser: pespin: No, segmentation is built into osmo_io, so from osmo_stream_* POV you only need to set the segmentation_cb
58
(04:52:56 PM) pespin: asdfuser, so my proposal would be to have some sort of generic "message_boundary_cfg" fields in osmo_stream where you can configure the extra logic. And then we can have a separate module osmo_stream_ipa (stream_ipa.h for instance) with those functions which can be passed as pointers
59
(04:53:26 PM) pespin: just to be clear, I'm not saying it should be implemented in one specific way, I'm just sharing my concerns and trying to get something better than what I'm seeing now
60
(04:53:30 PM) asdfuser: The reason read and write_cb are changed in the patchset is because we also want to parse the ipa header
61
(04:55:04 PM) pespin: asdfuser, you want to parse the ipa header because you need it for segmentation iiuc?
62
(04:55:29 PM) pespin: but can't you do that inside the segmentation cb already?
63
(04:56:05 PM) asdfuser: Maybe LaF0rge 's idea of using msg->cb[] also for sending would improve the API. We then wouldn't need an osmo_stream_*_send_ipa function
64
(04:56:28 PM) pespin: asdfuser, can you point me to it?
65
(04:56:35 PM) pespin: or briefly explain
66
(04:56:48 PM) asdfuser: pespin: Well, the segmentation_cb wasn't designed to change the msgb
67
(04:57:14 PM) LaF0rge: https://gerrit.osmocom.org/c/libosmo-netif/+/33201/comments/e7542ad7_700a835c
    (1-1/1)
    Add picture from clipboard (Maximum size: 48.8 MB)