Change in osmo-bts[master]: add osmo_tdef groups, exposing T timers on VTY config

neels gerrit-no-reply at lists.osmocom.org
Mon Aug 23 20:37:55 UTC 2021


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

Change subject: add osmo_tdef groups, exposing T timers on VTY config
......................................................................

add osmo_tdef groups, exposing T timers on VTY config

We have two osmocom specific timers used in the BTS, X1 and X2. Expose
those on the VTY configuration, as timer group 'bts'.

This prepares for a subsequent patch, where I would like to add another
configurable timer. This provides the basic infrastructure for that.

Related: SYS#5559
Change-Id: I0f56f9425134679219884b0c3c2f29e77aff5e64
---
M include/osmo-bts/gsm_data.h
M src/common/bts.c
M src/common/gsm_data.c
M src/common/vty.c
M tests/osmo-bts.vty
5 files changed, 54 insertions(+), 1 deletion(-)

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



diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 55c3bdf..80f1833 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -9,6 +9,7 @@
 #include <osmocom/core/statistics.h>
 #include <osmocom/core/utils.h>
 #include <osmocom/core/linuxlist.h>
+#include <osmocom/core/tdef.h>
 #include <osmocom/codec/ecu.h>
 #include <osmocom/gsm/lapdm.h>
 #include <osmocom/gsm/gsm23003.h>
@@ -521,6 +522,8 @@
  * OML connection will cause a special warning to be logged. */
 #define OSMO_BTS_OML_CONN_EARLY_DISCONNECT 10	 /* in seconds */
 
+extern struct osmo_tdef_group bts_tdef_groups[];
+extern struct osmo_tdef bts_T_defs[];
 
 extern const struct value_string gsm_pchant_names[13];
 extern const struct value_string gsm_pchant_descs[13];
diff --git a/src/common/bts.c b/src/common/bts.c
index 48adf42..b6af4c6 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -128,7 +128,7 @@
 	cbch_ctr_desc
 };
 
-static struct osmo_tdef bts_T_defs[] = {
+struct osmo_tdef bts_T_defs[] = {
 	/* T-1: FIXME: Ideally should be dynamically calculated per trx at
 	 * shutdown start based on params below, and highest trx value taken:
 	 * + VTY's power-ramp step-interval.
diff --git a/src/common/gsm_data.c b/src/common/gsm_data.c
index 7eb6ff1..b1f695b 100644
--- a/src/common/gsm_data.c
+++ b/src/common/gsm_data.c
@@ -40,6 +40,11 @@
 #include <osmo-bts/bts_trx.h>
 #include <osmo-bts/logging.h>
 
+struct osmo_tdef_group bts_tdef_groups[] = {
+	{ .name = "bts", .tdefs = bts_T_defs, .desc = "BTS process timers" },
+	{}
+};
+
 const struct value_string gsm_pchant_names[13] = {
 	{ GSM_PCHAN_NONE,	"NONE" },
 	{ GSM_PCHAN_CCCH,	"CCCH" },
diff --git a/src/common/vty.c b/src/common/vty.c
index fe506a5..4f618d0 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -37,6 +37,7 @@
 #include <osmocom/vty/logging.h>
 #include <osmocom/vty/misc.h>
 #include <osmocom/vty/ports.h>
+#include <osmocom/vty/tdef_vty.h>
 #include <osmocom/core/gsmtap.h>
 #include <osmocom/core/utils.h>
 #include <osmocom/core/sockaddr_str.h>
@@ -384,6 +385,7 @@
 	llist_for_each_entry(bts, &net->bts_list, list)
 		config_write_bts_single(vty, bts);
 
+	osmo_tdef_vty_groups_write(vty, "");
 	return CMD_SUCCESS;
 }
 
@@ -2418,6 +2420,9 @@
 	install_node(&bts_node, config_write_bts);
 	install_element(CONFIG_NODE, &cfg_bts_cmd);
 	install_element(CONFIG_NODE, &cfg_vty_telnet_port_cmd);
+
+	osmo_tdef_vty_groups_init(CONFIG_NODE, bts_tdef_groups);
+
 	install_element(BTS_NODE, &cfg_bts_unit_id_cmd);
 	install_element(BTS_NODE, &cfg_bts_oml_ip_cmd);
 	install_element(BTS_NODE, &cfg_bts_no_oml_ip_cmd);
diff --git a/tests/osmo-bts.vty b/tests/osmo-bts.vty
index 4983967..12a0c77 100644
--- a/tests/osmo-bts.vty
+++ b/tests/osmo-bts.vty
@@ -7,6 +7,7 @@
   show lchan summary [<0-255>] [<0-255>] [<0-7>] [<0-7>]
   show bts <0-255> gprs
 ...
+  show timer [(bts)] [TNNNN]
   show e1_driver
   show e1_line [<0-255>] [stats]
   show e1_timeslot [<0-255>] [<0-31>]
@@ -22,6 +23,7 @@
   trx             Display information about a TRX
   timeslot        Display information about a TS
   lchan           Display information about a logical channel
+  timer           Show timers
   e1_driver       Display information about available E1 drivers
   e1_line         Display information about a E1 line
   e1_timeslot     Display information about a E1 timeslot
@@ -59,6 +61,22 @@
   [<0-7>]  Timeslot Number
 OsmoBTS> show lchan summary 0 0 0 ?
   [<0-7>]  Logical Channel Number
+
+OsmoBTS> show timer ?
+  [bts]  BTS process timers
+OsmoBTS> show timer
+bts: X1 = 300 s	Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
+bts: X2 = 3 s	Time after which osmo-bts exits if requesting transceivers to stop during shut down process does not finish (s) (default: 3 s)
+OsmoBTS> show timer bts ?
+  [TNNNN]  T- or X-timer-number -- 3GPP compliant timer number of the format '1234' or 'T1234' or 't1234'; Osmocom-specific timer number of the format: 'X1234' or 'x1234'.
+OsmoBTS> show timer bts
+bts: X1 = 300 s	Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
+bts: X2 = 3 s	Time after which osmo-bts exits if requesting transceivers to stop during shut down process does not finish (s) (default: 3 s)
+OsmoBTS> show timer bts X1
+bts: X1 = 300 s	Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
+OsmoBTS> show timer bts X2
+bts: X2 = 3 s	Time after which osmo-bts exits if requesting transceivers to stop during shut down process does not finish (s) (default: 3 s)
+
 OsmoBTS> show e1_driver ?
   <cr>  
 OsmoBTS> show e1_line ?
@@ -80,6 +98,7 @@
   show lchan summary [<0-255>] [<0-255>] [<0-7>] [<0-7>]
   show bts <0-255> gprs
 ...
+  show timer [(bts)] [TNNNN]
   bts <0-0> trx <0-255> ts <0-7> (lchan|shadow-lchan) <0-7> rtp jitter-buffer <0-10000>
   test send-failure-event-report <0-255>
   bts <0-255> c0-power-red <0-6>
@@ -99,6 +118,7 @@
   trx             Display information about a TRX
   timeslot        Display information about a TS
   lchan           Display information about a logical channel
+  timer           Show timers
   e1_driver       Display information about available E1 drivers
   e1_line         Display information about a E1 line
   e1_timeslot     Display information about a E1 timeslot
@@ -152,6 +172,7 @@
 ...
   bts BTS_NR
 ...
+  timer [(bts)] [TNNNN] [(<0-2147483647>|default)]
   phy <0-255>
   e1_input
 ...
@@ -159,6 +180,7 @@
 ...
   bts        Select a BTS to configure
 ...
+  timer      Configure or show timers
   phy        Select a PHY to configure
   e1_input   Configure E1/T1/J1 TDM input
 ...
@@ -167,6 +189,24 @@
 OsmoBTS(config)# phy ?
   <0-255>  PHY number
 
+OsmoBTS(config)# timer ?
+  [bts]  BTS process timers
+OsmoBTS(config)# timer bts ?
+  [TNNNN]  T- or X-timer-number -- 3GPP compliant timer number of the format '1234' or 'T1234' or 't1234'; Osmocom-specific timer number of the format: 'X1234' or 'x1234'.
+OsmoBTS(config)# timer bts X1
+bts: X1 = 300 s	Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
+OsmoBTS(config)# timer bts X2
+bts: X2 = 3 s	Time after which osmo-bts exits if requesting transceivers to stop during shut down process does not finish (s) (default: 3 s)
+OsmoBTS(config)# timer bts X1 ?
+  [<0-2147483647>]  New timer value
+  [default]         Set to default timer value
+OsmoBTS(config)# timer bts X1 123
+OsmoBTS(config)# timer bts X1
+bts: X1 = 123 s	Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
+OsmoBTS(config)# timer bts X1 default
+OsmoBTS(config)# timer bts X1
+bts: X1 = 300 s	Time after which osmo-bts exits if regular ramp down during shut down process does not finish (s) (default: 300 s)
+
 OsmoBTS(config)# bts 0
 OsmoBTS(bts)# list
 ...

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I0f56f9425134679219884b0c3c2f29e77aff5e64
Gerrit-Change-Number: 25200
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
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/20210823/decf6db6/attachment.htm>


More information about the gerrit-log mailing list