Change in osmo-bsc[master]: Introduce VTY option to forbid use of TCH for non-voicecall signalling

pespin gerrit-no-reply at lists.osmocom.org
Fri Jul 23 12:26:19 UTC 2021


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

Change subject: Introduce VTY option to forbid use of TCH for non-voicecall signalling
......................................................................

Introduce VTY option to forbid use of TCH for non-voicecall signalling

Usual allocation mechansim, when some signalling channel is needed,
first tries to reserve an SDCCH, and if all of them are exhausted, then
attempts to reserve a TCH as a last resort.
This, however, may cause TCH starvation under certain situations, for
instance if there high load on other services (LU, SMS, etc.).
Hence, it may be desirable for the operator to forbid reservation
of TCH slots once SDCCH become exhausted. This commit is thus adding a
VTY command which allows forbidding it. The default behavior (allow using
TCH timeslots when SDCCHs are exhausted) is kept as before.

The above mentioned prohibition is applied only to non-voicecall related
signalling services. That's because voicecall services will end up
requiring a TCH anyway, and forbidding reservation of TCH straighaway
when SDCCHs are exhausted would mean no voice calls could be initiated
while still TCHs would be available.

Related: SYS#5548
Change-Id: Ib08027125145df26602069bfb51847063b0ccc0c
---
M include/osmocom/bsc/bts.h
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_vty.c
M tests/osmo-bsc.vty
6 files changed, 67 insertions(+), 14 deletions(-)

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



diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 72ef8d9..1d566f5 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -454,6 +454,10 @@
 	 * interference reported in RSL Resource Indication. */
 	bool chan_alloc_avoid_interf;
 
+	/* When true (default), TCH can be allocated to serve
+	 * non-voicecall-related signalling services when SDCCHs are exhausted */
+	bool chan_alloc_allow_tch_for_signalling;
+
 	enum neigh_list_manual_mode neigh_list_manual_mode;
 	/* parameters from which we build SYSTEM INFORMATION */
 	struct {
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 0632944..5a20e72 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -419,6 +419,11 @@
 	GSM_CHREQ_REASON_PDCH,
 };
 
+static inline bool gsm_chreq_reason_is_voicecall(enum gsm_chreq_reason_t reason)
+{
+	return reason == GSM_CHREQ_REASON_EMERG || reason == GSM_CHREQ_REASON_CALL;
+}
+
 /* lchans 0..3 are SDCCH in combined channel configuration,
    use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */
 #define CCCH_LCHAN 4
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 8e4916d..d5b0d53 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -2015,17 +2015,19 @@
 	 * in the code below, all other channel requests will get an SDCCH first
 	 * (if possible). */
 
-	if (!lchan) {
-		LOG_BTS(bts, DRSL, LOGL_NOTICE, "CHAN RQD[%s]: no resources for %s 0x%x, retrying with %s\n",
-			get_value_string(gsm_chreq_descs, rqd->reason), gsm_lchant_name(GSM_LCHAN_SDCCH),
-			rqd->ref.ra, gsm_lchant_name(GSM_LCHAN_TCH_H));
-		lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_H);
-	}
-	if (!lchan) {
-		LOG_BTS(bts, DRSL, LOGL_NOTICE, "CHAN RQD[%s]: no resources for %s 0x%x, retrying with %s\n",
-			get_value_string(gsm_chreq_descs, rqd->reason), gsm_lchant_name(GSM_LCHAN_SDCCH),
-			rqd->ref.ra, gsm_lchant_name(GSM_LCHAN_TCH_F));
-		lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_F);
+	if (gsm_chreq_reason_is_voicecall(rqd->reason) || bts->chan_alloc_allow_tch_for_signalling) {
+		if (!lchan) {
+			LOG_BTS(bts, DRSL, LOGL_NOTICE, "CHAN RQD[%s]: no resources for %s 0x%x, retrying with %s\n",
+				get_value_string(gsm_chreq_descs, rqd->reason), gsm_lchant_name(GSM_LCHAN_SDCCH),
+				rqd->ref.ra, gsm_lchant_name(GSM_LCHAN_TCH_H));
+			lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_H);
+		}
+		if (!lchan) {
+			LOG_BTS(bts, DRSL, LOGL_NOTICE, "CHAN RQD[%s]: no resources for %s 0x%x, retrying with %s\n",
+				get_value_string(gsm_chreq_descs, rqd->reason), gsm_lchant_name(GSM_LCHAN_SDCCH),
+				rqd->ref.ra, gsm_lchant_name(GSM_LCHAN_TCH_F));
+			lchan = lchan_select_by_type(bts, GSM_LCHAN_TCH_F);
+		}
 	}
 	if (!lchan) {
 		LOG_BTS(bts, DRSL, LOGL_NOTICE, "CHAN RQD[%s]: no resources for %s 0x%x\n",
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index ec29ac8..c0d6634 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -245,6 +245,7 @@
 	bts->neigh_list_manual_mode = NL_MODE_AUTOMATIC;
 	bts->early_classmark_allowed_3g = true; /* 3g Early Classmark Sending controlled by bts->early_classmark_allowed param */
 	bts->si_unused_send_empty = true;
+	bts->chan_alloc_allow_tch_for_signalling = true;
 	bts->si_common.cell_sel_par.cell_resel_hyst = 2; /* 4 dB */
 	bts->si_common.cell_sel_par.rxlev_acc_min = 0;
 	bts->si_common.si2quater_neigh_list.arfcn = bts->si_common.data.earfcn_list;
diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c
index b8b9f6c..3695d28 100644
--- a/src/osmo-bsc/bts_vty.c
+++ b/src/osmo-bsc/bts_vty.c
@@ -565,6 +565,25 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN_ATTR(cfg_bts_chan_alloc_allow_tch_for_signalling,
+	   cfg_bts_chan_alloc_allow_tch_for_signalling_cmd,
+	   "channel allocator allow-tch-for-signalling (0|1)",
+	   "Channel Allocator\n" "Channel Allocator\n"
+	   "Configure whether TCH/H or TCH/F channels can be used to serve non-call-related signalling if SDCCHs are exhausted\n"
+	   "Forbid use of TCH for non-call-related signalling purposes\n"
+	   "Allow use of TCH for non-call-related signalling purposes (default)\n",
+	   CMD_ATTR_IMMEDIATE)
+{
+	struct gsm_bts *bts = vty->index;
+
+	if (!strcmp(argv[0], "0"))
+		bts->chan_alloc_allow_tch_for_signalling = false;
+	else
+		bts->chan_alloc_allow_tch_for_signalling = true;
+
+	return CMD_SUCCESS;
+}
+
 #define RACH_STR "Random Access Control Channel\n"
 
 DEFUN_USRATTR(cfg_bts_rach_tx_integer,
@@ -3736,6 +3755,8 @@
 		VTY_NEWLINE);
 	if (bts->chan_alloc_avoid_interf)
 		vty_out(vty, "  channel allocator avoid-interference 1%s", VTY_NEWLINE);
+	if (!bts->chan_alloc_allow_tch_for_signalling)
+		vty_out(vty, "  channel allocator allow-tch-for-signalling 0%s", VTY_NEWLINE);
 	vty_out(vty, "  rach tx integer %u%s",
 		bts->si_common.rach_control.tx_integer, VTY_NEWLINE);
 	vty_out(vty, "  rach max transmission %u%s",
@@ -4018,6 +4039,7 @@
 	install_element(BTS_NODE, &cfg_bts_oml_e1_tei_cmd);
 	install_element(BTS_NODE, &cfg_bts_challoc_cmd);
 	install_element(BTS_NODE, &cfg_bts_chan_alloc_interf_cmd);
+	install_element(BTS_NODE, &cfg_bts_chan_alloc_allow_tch_for_signalling_cmd);
 	install_element(BTS_NODE, &cfg_bts_rach_tx_integer_cmd);
 	install_element(BTS_NODE, &cfg_bts_rach_max_trans_cmd);
 	install_element(BTS_NODE, &cfg_bts_rach_max_delay_cmd);
diff --git a/tests/osmo-bsc.vty b/tests/osmo-bsc.vty
index 1d859c3..3bc2707 100644
--- a/tests/osmo-bsc.vty
+++ b/tests/osmo-bsc.vty
@@ -163,14 +163,19 @@
   allocator  Channel Allocator
 
 OsmoBSC(config-net-bts)# channel allocator ?
-  ascending           Allocate Timeslots and Transceivers in ascending order
-  descending          Allocate Timeslots and Transceivers in descending order
-  avoid-interference  Configure whether reported interference levels from RES IND are used in channel allocation
+  ascending                 Allocate Timeslots and Transceivers in ascending order
+  descending                Allocate Timeslots and Transceivers in descending order
+  avoid-interference        Configure whether reported interference levels from RES IND are used in channel allocation
+  allow-tch-for-signalling  Configure whether TCH/H or TCH/F channels can be used to serve non-call-related signalling if SDCCHs are exhausted
 
 OsmoBSC(config-net-bts)# channel allocator avoid-interference ?
   0  Ignore interference levels (default). Always assign lchans in a deterministic order.
   1  In channel allocation, prefer lchans with less interference.
 
+OsmoBSC(config-net-bts)# channel allocator allow-tch-for-signalling ?
+  0  Forbid use of TCH for non-call-related signalling purposes
+  1  Allow use of TCH for non-call-related signalling purposes (default)
+
 OsmoBSC(config-net-bts)# show running-config
 ... !channel allocator avoid-interference
 OsmoBSC(config-net-bts)# channel allocator avoid-interference 1
@@ -184,3 +189,17 @@
 OsmoBSC(config-net-bts)# channel allocator avoid-interference 0
 OsmoBSC(config-net-bts)# show running-config
 ... !channel allocator avoid-interference
+
+OsmoBSC(config-net-bts)# show running-config
+... !channel allocator allow-tch-for-signalling
+OsmoBSC(config-net-bts)# channel allocator allow-tch-for-signalling 0
+OsmoBSC(config-net-bts)# show running-config
+...
+ bts 0
+...
+  channel allocator allow-tch-for-signalling 0
+...
+
+OsmoBSC(config-net-bts)# channel allocator allow-tch-for-signalling 1
+OsmoBSC(config-net-bts)# show running-config
+... !channel allocator allow-tch-for-signalling

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib08027125145df26602069bfb51847063b0ccc0c
Gerrit-Change-Number: 25006
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
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/20210723/c725fac5/attachment.htm>


More information about the gerrit-log mailing list