laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-pcu/+/22828 )

Change subject: nacc_fsm: nacc_fsm: Support receiving Pkt Cell Change Notify in 
state WAIT_REQUEST_SI
......................................................................

nacc_fsm: nacc_fsm: Support receiving Pkt Cell Change Notify in state 
WAIT_REQUEST_SI

Similar to what's done in the previous commit, but this time when we are
further forward in the resolution process.
This can be triggered for instance because we are taking too much time
to resolve and MS has timer to retransmit the Pkt cell Change Notify in
case no response was received in time.

This commit fixes osmo-pcu exiting due to ASSERT(0) since the event was
already accepted but not being handled in the state function.

Related: SYS#4909
Change-Id: I0c29e5979fec6eebe9dfb151907a4cd2f5e4a737
---
M src/nacc_fsm.c
1 file changed, 32 insertions(+), 16 deletions(-)

Approvals:
  Jenkins Builder: Verified
  daniel: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/nacc_fsm.c b/src/nacc_fsm.c
index 8d5f23d..5bc9c12 100644
--- a/src/nacc_fsm.c
+++ b/src/nacc_fsm.c
@@ -309,6 +309,29 @@
        }
 }

+/* Called on event NACC_EV_RX_CELL_CHG_NOTIFICATION on states after
+ * WAIT_RESOLVE_RAC_CI. Ignore duplicate messages, transition back if target
+ * cell changed.
+ */
+static void handle_retrans_pkt_cell_chg_notif(struct nacc_fsm_ctx *ctx, const 
Packet_Cell_Change_Notification_t *notif)
+{
+       struct gprs_rlcmac_bts *bts = ctx->ms->bts;
+       struct neigh_cache_entry_key neigh_key;
+
+       if (fill_neigh_key_from_bts_pkt_cell_chg_not(&neigh_key, bts, notif) < 
0) {
+               LOGPFSML(ctx->fi, LOGL_NOTICE, "TargetCell type=0x%x not 
supported\n",
+                        notif->Target_Cell.UnionType);
+               nacc_fsm_state_chg(ctx->fi, NACC_ST_TX_CELL_CHG_CONTINUE);
+               return;
+       }
+       /* If tgt cell changed, restart resolving it */
+       if (!neigh_cache_entry_key_eq(&ctx->neigh_key, &neigh_key)) {
+               ctx->neigh_key = neigh_key;
+               nacc_fsm_state_chg(ctx->fi, NACC_ST_WAIT_RESOLVE_RAC_CI);
+       }
+       /* else: ignore it, it's a dup, carry on what we were doing */
+}
+
 ////////////////
 // FSM states //
 ////////////////
@@ -398,28 +421,15 @@
        nacc_fsm_state_chg(fi, NACC_ST_TX_CELL_CHG_CONTINUE);
 }

-
 static void st_wait_resolve_rac_ci(struct osmo_fsm_inst *fi, uint32_t event, 
void *data)
 {
        struct nacc_fsm_ctx *ctx = (struct nacc_fsm_ctx *)fi->priv;
-       struct gprs_rlcmac_bts *bts = ctx->ms->bts;
-       Packet_Cell_Change_Notification_t *notif;
-       struct neigh_cache_entry_key neigh_key;
+       const Packet_Cell_Change_Notification_t *notif;

        switch (event) {
        case NACC_EV_RX_CELL_CHG_NOTIFICATION:
-               notif = (Packet_Cell_Change_Notification_t *)data;
-               if (fill_neigh_key_from_bts_pkt_cell_chg_not(&neigh_key, bts, 
notif) < 0) {
-                       LOGPFSML(fi, LOGL_NOTICE, "TargetCell type=0x%x not 
supported\n",
-                                notif->Target_Cell.UnionType);
-                       nacc_fsm_state_chg(fi, NACC_ST_TX_CELL_CHG_CONTINUE);
-                       return;
-               }
-               /* If tgt cell changed, restart resolving it */
-               if (!neigh_cache_entry_key_eq(&ctx->neigh_key, &neigh_key)) {
-                       ctx->neigh_key = neigh_key;
-                       nacc_fsm_state_chg(fi, NACC_ST_WAIT_RESOLVE_RAC_CI);
-               }
+               notif = (const Packet_Cell_Change_Notification_t *)data;
+               handle_retrans_pkt_cell_chg_notif(ctx, notif);
                break;
        case NACC_EV_RX_RAC_CI:
                /* Assumption: ctx->cgi_ps has been filled by caller of the 
event */
@@ -489,9 +499,14 @@
 static void st_wait_request_si(struct osmo_fsm_inst *fi, uint32_t event, void 
*data)
 {
        struct nacc_fsm_ctx *ctx = (struct nacc_fsm_ctx *)fi->priv;
+       const Packet_Cell_Change_Notification_t *notif;
        struct si_cache_entry *entry;

        switch (event) {
+       case NACC_EV_RX_CELL_CHG_NOTIFICATION:
+               notif = (const Packet_Cell_Change_Notification_t *)data;
+               handle_retrans_pkt_cell_chg_notif(ctx, notif);
+               break;
        case NACC_EV_RX_SI:
                entry = (struct si_cache_entry *)data;
                /* Copy info since cache can be deleted at any point */
@@ -629,6 +644,7 @@
                        X(NACC_EV_RX_CELL_CHG_NOTIFICATION) |
                        X(NACC_EV_RX_SI),
                .out_state_mask =
+                       X(NACC_ST_WAIT_RESOLVE_RAC_CI) |
                        X(NACC_ST_TX_NEIGHBOUR_DATA) |
                        X(NACC_ST_TX_CELL_CHG_CONTINUE),
                .name = "WAIT_REQUEST_SI",

--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/22828
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I0c29e5979fec6eebe9dfb151907a4cd2f5e4a737
Gerrit-Change-Number: 22828
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-MessageType: merged

Reply via email to