Change in osmo-pcu[master]: Fix configuration of initial_(m)cs

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
Tue Nov 3 16:38:19 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/21032 )


Change subject: Fix configuration of initial_(m)cs
......................................................................

Fix configuration of initial_(m)cs

Properly clip initial_(m)cs values to be lower-equal than maximum
configured.

Regarding initial_mcs, use values provided by BTS, which were not used
before.

Change-Id: Ifc6bc7c2734d1ae404adc2497afec5366e4f9e50
---
M src/bts.h
M src/pcu_l1_if.cpp
M src/pcu_vty.c
3 files changed, 43 insertions(+), 18 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/32/21032/1

diff --git a/src/bts.h b/src/bts.h
index 9f2f898..4d5d0df 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -115,10 +115,11 @@
 	uint8_t initial_cs_dl, initial_cs_ul;
 	uint8_t initial_mcs_dl, initial_mcs_ul;
 	struct { /* Config Values set by VTY */
+		bool force_initial_cs;	/* false=use from BTS true=use from VTY */
+		bool force_initial_mcs;	/* false=use from BTS true=use from VTY */
 		uint8_t max_cs_dl, max_cs_ul;
 		uint8_t max_mcs_dl, max_mcs_ul;
 	} vty;
-	uint8_t force_cs;	/* 0=use from BTS 1=use from VTY */
 	uint16_t force_llc_lifetime; /* overrides lifetime from SGSN */
 	uint32_t llc_discard_csec;
 	uint32_t llc_idle_ack_csec;
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 738d0f1..a984591 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -633,14 +633,38 @@
 	}
 	bts_set_max_mcs(bts, bts->vty.max_mcs_dl, bts->vty.max_mcs_ul); /* recalc max MCS values */
 
-	LOGP(DL1IF, LOGL_DEBUG, " initial_cs=%d\n", info_ind->initial_cs);
-	LOGP(DL1IF, LOGL_DEBUG, " initial_mcs=%d\n", info_ind->initial_mcs);
-	if (!bts->force_cs) {
-		if (info_ind->initial_cs < 1 || info_ind->initial_cs > 4)
-			bts->initial_cs_dl = 1;
-		else
-			bts->initial_cs_dl = info_ind->initial_cs;
-		bts->initial_cs_ul = bts->initial_cs_dl;
+	LOGP(DL1IF, LOGL_DEBUG, " initial_cs=%u%s\n", info_ind->initial_cs,
+	     bts->vty.force_initial_cs ? " (VTY forced, ignoring)" : "");
+	if (!bts->vty.force_initial_cs) {
+		if (info_ind->initial_cs > bts->bts->max_cs_dl()) {
+			LOGP(DL1IF, LOGL_DEBUG, " downgrading initial_cs_dl to %d\n", bts->bts->max_cs_dl());
+			bts->initial_cs_dl = bts->bts->max_cs_dl();
+		} else {
+			bts->initial_cs_dl =  info_ind->initial_cs;
+		}
+		if (info_ind->initial_cs > bts->bts->max_cs_ul()) {
+			LOGP(DL1IF, LOGL_DEBUG, " downgrading initial_cs_ul to %d\n", bts->bts->max_cs_ul());
+			bts->initial_cs_ul = bts->bts->max_cs_ul();
+		} else {
+			bts->initial_cs_ul =  info_ind->initial_cs;
+		}
+	}
+
+	LOGP(DL1IF, LOGL_DEBUG, " initial_mcs=%u%s\n", info_ind->initial_mcs,
+	     bts->vty.force_initial_mcs ? " (VTY forced, ignoring)" : "");
+	if (!bts->vty.force_initial_mcs) {
+		if (info_ind->initial_mcs > bts->bts->max_mcs_dl()) {
+			LOGP(DL1IF, LOGL_DEBUG, " downgrading initial_mcs_dl to %d\n", bts->bts->max_mcs_dl());
+			bts->initial_mcs_dl = bts->bts->max_mcs_dl();
+		} else {
+			bts->initial_mcs_dl =  info_ind->initial_mcs;
+		}
+		if (info_ind->initial_mcs > bts->bts->max_mcs_ul()) {
+			LOGP(DL1IF, LOGL_DEBUG, " downgrading initial_mcs_ul to %d\n", bts->bts->max_mcs_ul());
+			bts->initial_mcs_ul = bts->bts->max_mcs_ul();
+		} else {
+			bts->initial_mcs_ul =  info_ind->initial_mcs;
+		}
 	}
 
 	pcu = gprs_bssgp_init(
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 5e5dfbe..bf45686 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -122,7 +122,7 @@
 	if (bts->fc_ms_leak_rate)
 		vty_out(vty, " flow-control force-ms-leak-rate %d%s",
 			bts->fc_ms_leak_rate, VTY_NEWLINE);
-	if (bts->force_cs) {
+	if (bts->vty.force_initial_cs) {
 		if (bts->initial_cs_ul == bts->initial_cs_dl)
 			vty_out(vty, " cs %d%s", bts->initial_cs_dl,
 				VTY_NEWLINE);
@@ -179,7 +179,7 @@
 		bts->mcs_lqual_ranges[8].low,
 		VTY_NEWLINE);
 
-	if (bts->initial_mcs_dl != 1 && bts->initial_mcs_ul != 1) {
+	if (bts->vty.force_initial_mcs) {
 		if (bts->initial_mcs_ul == bts->initial_mcs_dl)
 			vty_out(vty, " mcs %d%s", bts->initial_mcs_dl,
 				VTY_NEWLINE);
@@ -449,7 +449,7 @@
 	struct gprs_rlcmac_bts *bts = bts_main_data();
 	uint8_t cs = atoi(argv[0]);
 
-	bts->force_cs = 1;
+	bts->vty.force_initial_cs = true;
 	bts->initial_cs_dl = cs;
 	if (argc > 1)
 		bts->initial_cs_ul = atoi(argv[1]);
@@ -467,7 +467,7 @@
 {
 	struct gprs_rlcmac_bts *bts = bts_main_data();
 
-	bts->force_cs = 0;
+	bts->vty.force_initial_cs = false;
 
 	return CMD_SUCCESS;
 }
@@ -517,13 +517,14 @@
 	   CMD_ATTR_IMMEDIATE)
 {
 	struct gprs_rlcmac_bts *bts = bts_main_data();
-	uint8_t cs = atoi(argv[0]);
+	uint8_t mcs = atoi(argv[0]);
 
-	bts->initial_mcs_dl = cs;
+	bts->vty.force_initial_mcs = true;
+	bts->initial_mcs_dl = mcs;
 	if (argc > 1)
 		bts->initial_mcs_ul = atoi(argv[1]);
 	else
-		bts->initial_mcs_ul = cs;
+		bts->initial_mcs_ul = mcs;
 
 	return CMD_SUCCESS;
 }
@@ -536,8 +537,7 @@
 {
 	struct gprs_rlcmac_bts *bts = bts_main_data();
 
-	bts->initial_mcs_dl = 1;
-	bts->initial_mcs_ul = 1;
+	bts->vty.force_initial_mcs = false;
 
 	return CMD_SUCCESS;
 }

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Ifc6bc7c2734d1ae404adc2497afec5366e4f9e50
Gerrit-Change-Number: 21032
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201103/90c6d26d/attachment.htm>


More information about the gerrit-log mailing list