Change in libosmocore[master]: gprs_ns2_vc_fsm: In IP-SNS/ALIVE mode, initial state is ALIVE/UNBLOCKED

laforge gerrit-no-reply at lists.osmocom.org
Wed Mar 24 00:59:13 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/23468 )

Change subject: gprs_ns2_vc_fsm: In IP-SNS/ALIVE mode, initial state is ALIVE/UNBLOCKED
......................................................................

gprs_ns2_vc_fsm: In IP-SNS/ALIVE mode, initial state is ALIVE/UNBLOCKED

Only when the ALIVE procedure fails, we mark a NS-VC as RECOVERING.

Change-Id: Ieb860827c2149306b135c0e6c8b3cd3bbb78851e
---
M src/gb/gprs_ns2_vc_fsm.c
1 file changed, 11 insertions(+), 9 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c
index cca724f..65248ea 100644
--- a/src/gb/gprs_ns2_vc_fsm.c
+++ b/src/gb/gprs_ns2_vc_fsm.c
@@ -245,13 +245,18 @@
 	case GPRS_NS2_EV_REQ_START:
 		switch (priv->nsvc->mode) {
 		case GPRS_NS2_VC_MODE_ALIVE:
-			osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RECOVERING, nsi->timeout[NS_TOUT_TNS_ALIVE], NS_TOUT_TNS_ALIVE);
+			if (priv->nsvc->nse->dialect == GPRS_NS2_DIALECT_SNS) {
+				/* In IP-SNS, the NS-VC are assumed initially alive, until the alive
+				* procedure should fail at some future point */
+				osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_UNBLOCKED, 0, 0);
+			} else {
+				osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RECOVERING, nsi->timeout[NS_TOUT_TNS_ALIVE], NS_TOUT_TNS_ALIVE);
+			}
 			break;
 		case GPRS_NS2_VC_MODE_BLOCKRESET:
 			osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RESET, nsi->timeout[NS_TOUT_TNS_RESET], NS_TOUT_TNS_RESET);
 			break;
 		}
-
 		break;
 	default:
 		OSMO_ASSERT(0);
@@ -428,17 +433,15 @@
 
 	ns2_tx_alive(priv->nsvc);
 	ns2_nse_notify_unblocked(priv->nsvc, false);
-}
-
-static void ns2_st_alive_onleave(struct osmo_fsm_inst *fi, uint32_t next_state)
-{
-	start_test_procedure(fi->priv);
+	start_test_procedure(priv);
 }
 
 static const struct osmo_fsm_state ns2_vc_states[] = {
 	[GPRS_NS2_ST_UNCONFIGURED] = {
 		.in_event_mask = S(GPRS_NS2_EV_REQ_START),
-		.out_state_mask = S(GPRS_NS2_ST_RESET) | S(GPRS_NS2_ST_RECOVERING),
+		.out_state_mask = S(GPRS_NS2_ST_RESET) |
+				  S(GPRS_NS2_ST_RECOVERING) |
+				  S(GPRS_NS2_ST_UNBLOCKED),
 		.name = "UNCONFIGURED",
 		.action = ns2_st_unconfigured,
 		.onenter = ns2_st_unconfigured_onenter,
@@ -483,7 +486,6 @@
 		.name = "RECOVERING",
 		.action = ns2_st_alive,
 		.onenter = ns2_st_alive_onenter,
-		.onleave = ns2_st_alive_onleave,
 	},
 };
 

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ieb860827c2149306b135c0e6c8b3cd3bbb78851e
Gerrit-Change-Number: 23468
Gerrit-PatchSet: 6
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210324/6a28ff6e/attachment.htm>


More information about the gerrit-log mailing list