Change in osmo-bsc[master]: large refactoring: use FSMs for lchans; add inter-BSC HO

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Jun 18 15:36:59 UTC 2018


Hello Jenkins Builder, 

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

    https://gerrit.osmocom.org/9671

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

Change subject: large refactoring: use FSMs for lchans; add inter-BSC HO
......................................................................

large refactoring: use FSMs for lchans; add inter-BSC HO

Add FSMs:

- timeslot_fsm: handle dynamic timeslots and OML+RSL availability.
- lchan_fsm: handle an individual lchan activation, RTP stream and release,
  signal the appropriate calling FSMs on success, failure, release.
- mgw_endpoint_fsm: handle one entire endpoint with several CI.
- assignment_fsm: BSSMAP Assignment Request.
- handover_fsm: all of intra, inter-MO and inter-MT handover.

Above FSMs absorb large parts of the gscon FSM. The gscon FSM was surpassing
the maximum amount events (32), and it is more logical to treat assignment,
handover and MGW procedures in separate FSMs.

- Add logging macros for each FSM type:
  - LOG_TS()
  - LOG_LCHAN()
  - LOG_MGWEP(), LOG_CI()
  - LOG_ASSIGNMENT()
  - LOG_HO()
  These log with the osmo_fsm_inst where present.
  New style decision: logging without a final newline char is awkward,
  especially for gsmtap logging and when other logs interleave LOGPC() calls;
  we have various cases where the final \n goes missing, and also this invokes
  the log category checking N times instead of once.
  So I decided to make these macros *always* append a newline, but only if
  there is no final newline yet. I hope that the compiler optimizes the
  strlen() of the constant format strings away. Thus I can log with or without
  typing "\n" and always get an \n termination anyway.

General:

- replace osmo_timers, state enums and program-wide osmo_signal_dispatch()
  with dedicated FSM timeouts, states and events.

- introduce a common way to handle Tnnn timers: gsm_timers.h/.c: struct T_def.
  These can be used (with some macro magic) to define a state's timeout once,
  and not make mistakes for each osmo_fsm_inst_state_chg().

Details:

bsc_subscr_conn_fsm.c:

- move most states of this FSM to lchan_fsm, assignment_fsm, handover_fsm and
  mgw_endpoint_fsm.

- There is exactly one state for an ongoing Assignment, with all details
  handled in conn->assignment.fi. The state relies on the assignment_fsm's
  timeout.

- There is one state for an ongoing Handover; except for an incoming Handover
  from a remote BSS, the gscon remains in ST_INIT until the new lchan and conn
  are both established.

- move bssmap_add_lcls_status() to osmo_bsc_lcls.c

abis_rsl.c:

- move all dynamic timeslot logic away into timeslot_fsm. Only keep plain send/receive functions in
  abis_rsl.c

- reduce some rsl functions to merely send a message, rename to "_tx_".
  - rsl_ipacc_mdcx(): add '_tx_' in the name; move parts that change the lchan state out into the
    lchan_fsm, the lchan->abis_ip.* are now set there prior to invoking this function.

- move all timers and error/release handling away into various FSMs.

- tweak ipa_smod_s_for_lchan() and ipa_rtp_pt_for_lchan() to not require an
  lchan passed, but just mode,type that they require. Rename to
  ipacc_speech_mode*() and ipacc_payload_type().

- add rsl_forward_layer3_info, used for inter-BSC HO MO, to just send the RR
  message received during BSSMAP Handover Command.

- move various logging to LOG_LCHAN() in order to log with the lchan FSM instance.
  One drawback is that the lchan FSM is limited to one logging category, i.e. this moves some logging
  from DRR to DRSL. It might actually make sense to combine those categories.

- lose LOGP...LOGPC logging cascades: they are bad for gsmtap logging and for performance.

- handle_classmark_chg(): change logging, move cm2 len check out of the cm3 condition (I hope that's
  correct).

- gsm48_send_ho_cmd(): split off gsm48_make_ho_cmd() which doesn't send right away, so that during
  inter-bsc HO we can make an RR Handover Command to send via the MSC to the remote BSS.

assignment_fsm.c:

- the Chan Mode Modify in case of re-using the same lchan is not implemented
  yet, because this was also missing in the previous implementation.

Depends: I03ee7ce840ecfa0b6a33358e7385528aabd4873f
Change-Id: I82e3f918295daa83274a4cf803f046979f284366
---
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/abis_rsl.h
A include/osmocom/bsc/assignment_fsm.h
M include/osmocom/bsc/bsc_api.h
M include/osmocom/bsc/bsc_msc_data.h
M include/osmocom/bsc/bsc_subscr_conn_fsm.h
M include/osmocom/bsc/bsc_subscriber.h
M include/osmocom/bsc/chan_alloc.h
M include/osmocom/bsc/debug.h
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/handover.h
A include/osmocom/bsc/handover_fsm.h
A include/osmocom/bsc/lchan_fsm.h
A include/osmocom/bsc/lchan_select.h
A include/osmocom/bsc/mgw_endpoint_fsm.h
M include/osmocom/bsc/neighbor_ident.h
M include/osmocom/bsc/osmo_bsc.h
M include/osmocom/bsc/osmo_bsc_lcls.h
A include/osmocom/bsc/timeslot_fsm.h
M src/Makefile.am
M src/ipaccess/Makefile.am
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/abis_om2000.c
M src/osmo-bsc/abis_rsl.c
A src/osmo-bsc/assignment_fsm.c
M src/osmo-bsc/bsc_api.c
D src/osmo-bsc/bsc_dyn_ts.c
M src/osmo-bsc/bsc_subscr_conn_fsm.c
M src/osmo-bsc/bsc_subscriber.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts_ericsson_rbs2000.c
M src/osmo-bsc/bts_ipaccess_nanobts.c
M src/osmo-bsc/bts_nokia_site.c
M src/osmo-bsc/bts_siemens_bs11.c
M src/osmo-bsc/chan_alloc.c
M src/osmo-bsc/gsm_04_08_utils.c
M src/osmo-bsc/gsm_data.c
M src/osmo-bsc/handover_decision.c
M src/osmo-bsc/handover_decision_2.c
A src/osmo-bsc/handover_fsm.c
M src/osmo-bsc/handover_logic.c
A src/osmo-bsc/lchan_fsm.c
A src/osmo-bsc/lchan_select.c
M src/osmo-bsc/meas_feed.c
A src/osmo-bsc/mgw_endpoint_fsm.c
M src/osmo-bsc/neighbor_ident_vty.c
M src/osmo-bsc/osmo_bsc_api.c
D src/osmo-bsc/osmo_bsc_audio.c
M src/osmo-bsc/osmo_bsc_bssap.c
M src/osmo-bsc/osmo_bsc_filter.c
M src/osmo-bsc/osmo_bsc_grace.c
M src/osmo-bsc/osmo_bsc_lcls.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc/osmo_bsc_sigtran.c
M src/osmo-bsc/paging.c
M src/osmo-bsc/pcu_sock.c
M src/osmo-bsc/system_information.c
A src/osmo-bsc/timeslot_fsm.c
A src/stubs/lchan_fsm_stubs.c
A src/stubs/ts_fsm_stubs.c
M src/utils/Makefile.am
M tests/abis/Makefile.am
M tests/bsc/Makefile.am
M tests/gsm0408/Makefile.am
M tests/handover/Makefile.am
M tests/handover/handover_test.c
M tests/handover/neighbor_ident_test.c
M tests/nanobts_omlattr/Makefile.am
68 files changed, 8,245 insertions(+), 4,793 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/71/9671/3
-- 
To view, visit https://gerrit.osmocom.org/9671
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I82e3f918295daa83274a4cf803f046979f284366
Gerrit-Change-Number: 9671
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180618/39784daa/attachment.htm>


More information about the gerrit-log mailing list