Change in osmo-bts[master]: nm_channel_fsm: Release lchans after BTS shutdown

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/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Oct 7 12:26:04 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/25701 )

Change subject: nm_channel_fsm: Release lchans after BTS shutdown
......................................................................

nm_channel_fsm: Release lchans after BTS shutdown

This fixes some TTCN3 tests where some lchan resources were kept from
previous tests.

Change-Id: I78dca32cd061fba86cc88c4c4f323b33d51c58d0
---
M include/osmo-bts/gsm_data.h
M src/common/gsm_data.c
M src/common/nm_channel_fsm.c
3 files changed, 15 insertions(+), 0 deletions(-)

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



diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 85f9089..ad0f78d 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -194,4 +194,6 @@
 
 bool ts_is_pdch(const struct gsm_bts_trx_ts *ts);
 
+void gsm_ts_release(struct gsm_bts_trx_ts *ts);
+
 #endif /* _GSM_DATA_H */
diff --git a/src/common/gsm_data.c b/src/common/gsm_data.c
index 2edeb4d..4446958 100644
--- a/src/common/gsm_data.c
+++ b/src/common/gsm_data.c
@@ -305,3 +305,13 @@
 		return false;
 	}
 }
+
+void gsm_ts_release(struct gsm_bts_trx_ts *ts)
+{
+	unsigned int ln;
+
+	for (ln = 0; ln < ARRAY_SIZE(ts->lchan); ln++) {
+		struct gsm_lchan *lchan = &ts->lchan[ln];
+		gsm_lchan_release(lchan, LCHAN_REL_ACT_OML);
+	}
+}
diff --git a/src/common/nm_channel_fsm.c b/src/common/nm_channel_fsm.c
index f933a16..6456005 100644
--- a/src/common/nm_channel_fsm.c
+++ b/src/common/nm_channel_fsm.c
@@ -193,6 +193,9 @@
 		oml_mo_state_chg(&ts->mo, -1, -1, NM_STATE_SHUTDOWN);
 		break;
 	case NM_EV_SHUTDOWN_FINISH:
+		gsm_ts_release(ts);
+		if (ts->vamos.peer)
+			gsm_ts_release(ts->vamos.peer);
 		nm_chan_fsm_state_chg(fi, NM_CHAN_ST_OP_DISABLED_NOTINSTALLED);
 		break;
 	default:

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I78dca32cd061fba86cc88c4c4f323b33d51c58d0
Gerrit-Change-Number: 25701
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: osmith <osmith 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/20211007/fc393acd/attachment.htm>


More information about the gerrit-log mailing list