dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-iuh/+/26725 )
Change subject: mgw_fsm: add MGW support to osmo-hnbgw ...................................................................... Patch Set 2: (24 comments) I will now update this patch. The comments might vanish due to the new repo? https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/configure.ac File configure.ac: https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/configure.ac@52 PS1, Line 52: PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.9.0) > makes sense. Done https://gerrit.osmocom.org/c/osmo-iuh/+/26725/2/configure.ac File configure.ac: https://gerrit.osmocom.org/c/osmo-iuh/+/26725/2/configure.ac@52 PS2, Line 52: PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.9.0) > Please also make sure that both: […] Done https://gerrit.osmocom.org/c/osmo-iuh/+/26725/2/src/hnbgw.c File src/hnbgw.c: https://gerrit.osmocom.org/c/osmo-iuh/+/26725/2/src/hnbgw.c@376 PS2, Line 376: LOGL_DEBUG > Why debug? All other categories are set to LOGL_NOTICE. I have forgotten to switch that back to LOGL_NOTICE https://gerrit.osmocom.org/c/osmo-iuh/+/26725/2/src/hnbgw.c@379 PS2, Line 379: > ws Done https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/hnbgw_cn.c File src/hnbgw_cn.c: https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/hnbgw_cn.c@367 PS1, Line 367: * its own copy of the message contents, so it is safe to free oph->msg() in sccp_sap_up() below */ > when you say "sccp_sap_up() below", you mean the caller of handle_cn_data_ind > freed the msgb? Yes, see line 542, sccp_sap_up() is the caller. https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/hnbgw_cn.c@369 PS1, Line 369: } else if (msg_len > 2 && msg_data[1] == RANAP_ProcedureCode_id_Iu_Release && !map->is_ps && map->mgw_fi) { > Probably several levels here look far more structured and extensible: […] Ack https://gerrit.osmocom.org/c/osmo-iuh/+/26725/2/src/hnbgw_cn.c File src/hnbgw_cn.c: https://gerrit.osmocom.org/c/osmo-iuh/+/26725/2/src/hnbgw_cn.c@349 PS2, Line 349: uint8_t *msg_data; > const Done https://gerrit.osmocom.org/c/osmo-iuh/+/26725/2/src/hnbgw_cn.c@362 PS2, Line 362: /* Intercept RAB Assignment Request, Setup MGW FSM */ > I am not saying the current approach is wrong, just an alternative variant: > […] Done https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/hnbgw_rua.c File src/hnbgw_rua.c: https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/hnbgw_rua.c@232 PS1, Line 232: /* TODO: Check for map and if this is a RAB Assignment response > what about this? Thats done. I will remove it. https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/hnbgw_rua.c@278 PS1, Line 278: if (map && !release_context_map && msg_len > 2 && msg_data[1] == RANAP_ProcedureCode_id_RAB_Assignment > same, probably splitting into several levels makes it more easy to avoid > future issues when extendin […] Done https://gerrit.osmocom.org/c/osmo-iuh/+/26725/2/src/hnbgw_rua.c File src/hnbgw_rua.c: https://gerrit.osmocom.org/c/osmo-iuh/+/26725/2/src/hnbgw_rua.c@192 PS2, Line 192: uint8_t *msg_data; > const Done https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/hnbgw_vty.c File src/hnbgw_vty.c: https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/hnbgw_vty.c@409 PS1, Line 409: mgcp_client_config_write(vty, " "); > are you sure this prefix is correct? aren't you missing an extra space? There > should probably be two […] Done https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/mgw_fsm.c File src/mgw_fsm.c: https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/mgw_fsm.c@69 PS1, Line 69: MGW_ST_CRCX_HNB, > WAIT_CRCX? It executes the CRCX on enter. I have used the onenter actions here in this FSM to make the FSM more "direct". In the end the state does the complete CRCX - executing it on enter, waiting for the response -> next state. https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/mgw_fsm.c@71 PS1, Line 71: MGW_ST_MDCX_HNB, > WAIT_MDCX? (same as above) https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/mgw_fsm.c@86 PS1, Line 86: uint8_t rab_ass_req[IUH_MSGB_SIZE]; > Use "struct *msgb" here and mgcp_copy()? rua_tx_dt() takes a pointer to the data and the length as parameters. I don't see an advantage to set up an msgb here. https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/mgw_fsm.c@87 PS1, Line 87: unsigned int rab_ass_req_len; > You don't need this field if you copy the msgb. Yes, sure, but its simpler this way. https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/mgw_fsm.c@190 PS1, Line 190: > unneeded space Done https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/mgw_fsm.c@243 PS1, Line 243: osmo_tdef_fsm_inst_state_chg(fi, MGW_ST_CRCX_MSC, mgw_fsm_timeouts, mgw_fsm_T_defs, -1); > You can probably use your own define macro here to only pass fi and new > state, see other FSMs Done https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/mgw_fsm.c@414 PS1, Line 414: .in_event_mask = 0 > I find this "0 |" way quite strange and confusing. […] Some FSMs are use this style some don't. https://git.osmocom.org/osmo-bsc/tree/src/osmo-bsc/lchan_fsm.c#n1527 The one with the 0 is probably less common. https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/mgw_fsm.c@485 PS1, Line 485: .allstate_event_mask = 0 | S(MGW_EV_MGCP_TERM) > Please clean up this line(s). Done https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/mgw_fsm.c@485 PS1, Line 485: .allstate_event_mask = 0 | S(MGW_EV_MGCP_TERM) > Please clean up this line(s). Done https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/mgw_fsm.c@500 PS1, Line 500: struct osmo_fsm_inst *osmo_fsm_inst; > You can probably drop this variable. theoretically yes, but in the current code its needed. https://gerrit.osmocom.org/c/osmo-iuh/+/26725/2/src/mgw_fsm.c File src/mgw_fsm.c: https://gerrit.osmocom.org/c/osmo-iuh/+/26725/2/src/mgw_fsm.c@189 PS2, Line 189: switch (event) { > weird formatting Done https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/tdefs.c File src/tdefs.c: https://gerrit.osmocom.org/c/osmo-iuh/+/26725/1/src/tdefs.c@20 PS1, Line 20: {.T = -1001,.default_val = 5,.desc = "Timeout for HNB side call-leg (to-HNB) creation" }, > missing space after comma in all lines Done -- To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/26725 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Change-Id: Ib9b62e0145184b91c56ce5d8870760bfa49cc5a4 Gerrit-Change-Number: 26725 Gerrit-PatchSet: 2 Gerrit-Owner: dexter <[email protected]> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <[email protected]> Gerrit-Reviewer: neels <[email protected]> Gerrit-CC: fixeria <[email protected]> Gerrit-CC: laforge <[email protected]> Gerrit-CC: pespin <[email protected]> Gerrit-Comment-Date: Thu, 06 Jan 2022 16:31:15 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <[email protected]> Comment-In-Reply-To: pespin <[email protected]> Comment-In-Reply-To: fixeria <[email protected]> Gerrit-MessageType: comment
