Attention is currently required from: fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/31354 )
Change subject: layer23: Fix cmdline args not applied ......................................................................
Patch Set 2:
(3 comments)
Commit Message:
https://gerrit.osmocom.org/c/osmocom-bb/+/31354/comment/fa22e9e0_8660ea24 PS2, Line 10: chicken-and-egg problem
It's weird that we ended up having this problem. The usual approach would be: […]
It's as weird as everything else due to this layer23 app concept which adds another layer of indirection and which I'm really hating after having spent so much time in it 😄
The point of having an MS already existing when parsing cmdline opts is the same as for the VTY: it allows setting stuff on the object directly.
The main problem here is that there's a init() function, which I'd like to get called *before* any other call to the layer23app API, so that the app has time to initialize in runtime whatever it wishes. That also includes l23_app_info() which is used during cmd line parsing. If you move cmdline parsing before l23_app_init(), you call l23_app_info() before l23_app_init() which looks wrong to me. But you still need to allocate the MS in some apps at l23_app_init() time because the MS object needs to be available during VTY config parsing. So as I was saying, chicken-and-egg problem.
In here, we either: * [A] Allow layer23 calling apps' l23_app_info() *before* a call to l23_app_init(), which then allows calling handle_options() *before* l23_app_init(). * [B] calling handle_options() *after* l23_app_init(), which means we need to apply some cmdline options to already created objects, VTY style (what I submitted in this patch)
In any case imho those command lines should be deprecated at some point, and VTY commands be used instead for all apps now that we support VTY in the layer23 common code.
I think you seem to prefer option [A], while I prefer option [B].
File src/host/layer23/src/common/main.c:
https://gerrit.osmocom.org/c/osmocom-bb/+/31354/comment/c6c2a2d2_d11c0965 PS2, Line 160: llist_for_each_entry
At the moment only one MS can be using the L1 PHY (accessed via the layer2_socket_path), so it makes […]
It's up to the app to allocate as many structs as it wants. This is not starting the layer2.
https://gerrit.osmocom.org/c/osmocom-bb/+/31354/comment/77aaa73c_5d63622d PS2, Line 165: llist_for_each_entry
Same here. A single SAP socket cannot be used by several MS simultaneously. […]
Same as above.