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/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/20627 ) Change subject: BSSMAP RESET: move RESET-ACK into reset fsm ...................................................................... BSSMAP RESET: move RESET-ACK into reset fsm The Lb interface will need the same RESET-ACK logic. Change-Id: Idf4682319a0af5665e867dbc0515d1fe343d9daf --- M include/osmocom/bsc/bssmap_reset.h M src/osmo-bsc/a_reset.c M src/osmo-bsc/bssmap_reset.c M src/osmo-bsc/osmo_bsc_bssap.c M tests/handover/handover_test.c 5 files changed, 51 insertions(+), 10 deletions(-) Approvals: neels: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/bssmap_reset.h b/include/osmocom/bsc/bssmap_reset.h index ba64257..560c543 100644 --- a/include/osmocom/bsc/bssmap_reset.h +++ b/include/osmocom/bsc/bssmap_reset.h @@ -2,6 +2,7 @@ #pragma once enum bssmap_reset_fsm_event { + BSSMAP_RESET_EV_RX_RESET, BSSMAP_RESET_EV_RX_RESET_ACK, BSSMAP_RESET_EV_CONN_CFM_SUCCESS, BSSMAP_RESET_EV_CONN_CFM_FAILURE, @@ -11,6 +12,7 @@ int conn_cfm_failure_threshold; struct { void (*tx_reset)(void *data); + void (*tx_reset_ack)(void *data); void (*link_up)(void *data); void (*link_lost)(void *data); } ops; diff --git a/src/osmo-bsc/a_reset.c b/src/osmo-bsc/a_reset.c index feaf491..2371499 100644 --- a/src/osmo-bsc/a_reset.c +++ b/src/osmo-bsc/a_reset.c @@ -32,6 +32,12 @@ osmo_bsc_sigtran_tx_reset(msc); } +static void a_reset_tx_reset_ack(void *data) +{ + struct bsc_msc_data *msc = data; + osmo_bsc_sigtran_tx_reset_ack(msc); +} + static void a_reset_link_up(void *data) { struct bsc_msc_data *msc = data; @@ -56,6 +62,7 @@ .conn_cfm_failure_threshold = 3, .ops = { .tx_reset = a_reset_tx_reset, + .tx_reset_ack = a_reset_tx_reset_ack, .link_up = a_reset_link_up, .link_lost = a_reset_link_lost, }, diff --git a/src/osmo-bsc/bssmap_reset.c b/src/osmo-bsc/bssmap_reset.c index 98f6b65..9215e90 100644 --- a/src/osmo-bsc/bssmap_reset.c +++ b/src/osmo-bsc/bssmap_reset.c @@ -32,6 +32,7 @@ }; static const struct value_string bssmap_reset_fsm_event_names[] = { + OSMO_VALUE_STRING(BSSMAP_RESET_EV_RX_RESET), OSMO_VALUE_STRING(BSSMAP_RESET_EV_RX_RESET_ACK), OSMO_VALUE_STRING(BSSMAP_RESET_EV_CONN_CFM_FAILURE), OSMO_VALUE_STRING(BSSMAP_RESET_EV_CONN_CFM_SUCCESS), @@ -90,6 +91,12 @@ bssmap_reset->cfg.ops.tx_reset(bssmap_reset->cfg.data); } +static void tx_reset_ack(struct bssmap_reset *bssmap_reset) +{ + if (bssmap_reset->cfg.ops.tx_reset_ack) + bssmap_reset->cfg.ops.tx_reset_ack(bssmap_reset->cfg.data); +} + static void bssmap_reset_disc_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) { struct bssmap_reset *bssmap_reset = (struct bssmap_reset*)fi->priv; @@ -99,7 +106,21 @@ static void bssmap_reset_disc_action(struct osmo_fsm_inst *fi, uint32_t event, void *data) { - bssmap_reset_fsm_state_chg(fi, BSSMAP_RESET_ST_CONN); + struct bssmap_reset *bssmap_reset = (struct bssmap_reset*)fi->priv; + switch (event) { + + case BSSMAP_RESET_EV_RX_RESET: + tx_reset_ack(bssmap_reset); + bssmap_reset_fsm_state_chg(fi, BSSMAP_RESET_ST_CONN); + break; + + case BSSMAP_RESET_EV_RX_RESET_ACK: + bssmap_reset_fsm_state_chg(fi, BSSMAP_RESET_ST_CONN); + break; + + default: + OSMO_ASSERT(false); + } } static void bssmap_reset_conn_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) @@ -115,8 +136,15 @@ switch (event) { + case BSSMAP_RESET_EV_RX_RESET: + /* We were connected, but the remote side has restarted. */ + link_lost(bssmap_reset); + tx_reset_ack(bssmap_reset); + link_up(bssmap_reset); + break; + case BSSMAP_RESET_EV_RX_RESET_ACK: - LOGPFSML(fi, LOGL_INFO, "Ignoring duplicate RESET ACK\n"); + LOGPFSML(fi, LOGL_INFO, "Link is already up, ignoring RESET ACK\n"); break; case BSSMAP_RESET_EV_CONN_CFM_FAILURE: @@ -153,6 +181,7 @@ [BSSMAP_RESET_ST_DISC] = { .name = "DISC", .in_event_mask = 0 + | S(BSSMAP_RESET_EV_RX_RESET) | S(BSSMAP_RESET_EV_RX_RESET_ACK) , .out_state_mask = 0 @@ -165,6 +194,7 @@ [BSSMAP_RESET_ST_CONN] = { .name = "CONN", .in_event_mask = 0 + | S(BSSMAP_RESET_EV_RX_RESET) | S(BSSMAP_RESET_EV_RX_RESET_ACK) | S(BSSMAP_RESET_EV_CONN_CFM_FAILURE) | S(BSSMAP_RESET_EV_CONN_CFM_SUCCESS) diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index d37b3e0..f168b65 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -45,6 +45,7 @@ #include <osmocom/core/socket.h> #include <osmocom/core/sockaddr_str.h> #include <osmocom/bsc/lcs_loc_req.h> +#include <osmocom/bsc/bssmap_reset.h> #define IP_V4_ADDR_LEN 4 @@ -96,17 +97,17 @@ osmo_sccp_addr_name(osmo_ss7_instance_find(msc->a.cs7_instance), &msc->a.msc_addr)); - /* Instruct the bsc to close all open sigtran connections and to - * close all active channels on the BTS side as well */ - osmo_bsc_sigtran_reset(msc); - update_msc_osmux_support(msc, msg, length); - /* Inform the MSC that we have received the reset request and - * that we acted accordingly */ - osmo_bsc_sigtran_tx_reset_ack(msc); + if (!msc->a.bssmap_reset) { + LOGP(DMSC, LOGL_ERROR, "(msc%d) missing RESET FSM\n", msc->nr); + /* Make sure to shut down all open connections, if any */ + osmo_bsc_sigtran_reset(msc); + return -1; + } - return 0; + /* Normal case: let the reset FSM orchestrate link down / link up callbacks. */ + return osmo_fsm_inst_dispatch(msc->a.bssmap_reset->fi, BSSMAP_RESET_EV_RX_RESET, NULL); } /* Page a subscriber based on TMSI and LAC via the specified BTS. diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 230192b..84a48af 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -1816,6 +1816,7 @@ struct gsm_lchan *lchan) { return HO_RESULT_OK; } void bsc_tx_bssmap_ho_failure(struct gsm_subscriber_connection *conn) {} void osmo_bsc_sigtran_tx_reset(void) {} +void osmo_bsc_sigtran_tx_reset_ack(void) {} void osmo_bsc_sigtran_reset(void) {} void bssmap_reset_alloc(void) {} void bssmap_reset_is_conn_ready(void) {} -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/20627 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Idf4682319a0af5665e867dbc0515d1fe343d9daf Gerrit-Change-Number: 20627 Gerrit-PatchSet: 2 Gerrit-Owner: neels <nhofmeyr at sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge at osmocom.org> Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de> Gerrit-Reviewer: pespin <pespin at sysmocom.de> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201015/f3d5f4df/attachment.htm>