aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bts.cpp3
-rw-r--r--src/bts.h3
-rw-r--r--src/gprs_bssgp_pcu.cpp4
-rw-r--r--src/gprs_ms.c9
-rw-r--r--src/gprs_pcu.c3
-rw-r--r--src/gprs_pcu.h3
-rw-r--r--src/pcu_vty.c20
-rw-r--r--src/tbf_dl.cpp4
-rw-r--r--tests/ms/MsTest.cpp2
9 files changed, 22 insertions, 29 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index 5eefc369..3795ca2c 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -201,9 +201,6 @@ static void bts_init(struct gprs_rlcmac_bts *bts, BTS* bts_obj)
bts->n3103 = 4;
bts->n3105 = 8;
bts->si13_is_set = false;
- bts->cs_adj_enabled = 1;
- bts->cs_adj_upper_limit = 33; /* Decrease CS if the error rate is above */
- bts->cs_adj_lower_limit = 10; /* Increase CS if the error rate is below */
/* CS-1 to CS-4 */
bts->cs_lqual_ranges[0].low = -256;
bts->cs_lqual_ranges[0].high = 6;
diff --git a/src/bts.h b/src/bts.h
index b46621af..ea218f7a 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -109,9 +109,6 @@ struct gprs_rlcmac_bts {
uint8_t si13[GSM_MACBLOCK_LEN];
bool si13_is_set;
- uint8_t cs_adj_enabled; /* whether cs_adj_{upper,lower}_limit are used to adjust DL CS */
- uint8_t cs_adj_upper_limit; /* downgrade DL CS if error rate above its value */
- uint8_t cs_adj_lower_limit; /* upgrade DL CS if error rate below its value */
/* downgrade DL CS when less than specified octets are left in tx queue. Optimization, see paper:
"Theoretical Analysis of GPRS Throughput and Delay" */
uint16_t cs_downgrade_threshold;
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index cfaee73d..0db6a51f 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -755,7 +755,7 @@ static enum CodingScheme max_coding_scheme_dl(struct gprs_rlcmac_bts *bts)
}
if (mcs_any) {
- if (!bts->cs_adj_enabled) {
+ if (!the_pcu->vty.cs_adj_enabled) {
if (bts->initial_mcs_dl) {
num = bts->initial_mcs_dl;
} else {
@@ -771,7 +771,7 @@ static enum CodingScheme max_coding_scheme_dl(struct gprs_rlcmac_bts *bts)
return mcs_get_egprs_by_num(num);
}
- if (!bts->cs_adj_enabled) {
+ if (!the_pcu->vty.cs_adj_enabled) {
if (bts->initial_cs_dl) {
num = bts->initial_cs_dl;
} else {
diff --git a/src/gprs_ms.c b/src/gprs_ms.c
index 6fbb06a8..cc64c86f 100644
--- a/src/gprs_ms.c
+++ b/src/gprs_ms.c
@@ -571,12 +571,9 @@ void ms_set_egprs_ms_class(struct GprsMs *ms, uint8_t ms_class_)
void ms_update_error_rate(struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, int error_rate)
{
- struct gprs_rlcmac_bts *bts_;
int64_t now;
enum CodingScheme max_cs_dl = ms_max_cs_dl(ms);
-
OSMO_ASSERT(max_cs_dl);
- bts_ = bts_data(ms->bts);
if (error_rate < 0)
return;
@@ -588,7 +585,7 @@ void ms_update_error_rate(struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, int er
ms->nack_rate_dl = error_rate;
- if (error_rate > bts_->cs_adj_upper_limit) {
+ if (error_rate > the_pcu->vty.cs_adj_upper_limit) {
if (mcs_chan_code(ms->current_cs_dl) > 0) {
mcs_dec_kind(&ms->current_cs_dl, ms_mode(ms));
LOGP(DRLCMACDL, LOGL_INFO,
@@ -597,7 +594,7 @@ void ms_update_error_rate(struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, int er
ms_imsi(ms), error_rate, mcs_name(ms->current_cs_dl));
ms->last_cs_not_low = now;
}
- } else if (error_rate < bts_->cs_adj_lower_limit) {
+ } else if (error_rate < the_pcu->vty.cs_adj_lower_limit) {
if (ms->current_cs_dl < max_cs_dl) {
if (now - ms->last_cs_not_low > 1000) {
mcs_inc_kind(&ms->current_cs_dl, ms_mode(ms));
@@ -801,7 +798,7 @@ enum CodingScheme ms_current_cs_dl(const struct GprsMs *ms)
return cs;
/* RF conditions are good, don't reduce */
- if (ms->nack_rate_dl < bts_data(ms->bts)->cs_adj_lower_limit)
+ if (ms->nack_rate_dl < the_pcu->vty.cs_adj_lower_limit)
return cs;
/* The throughput would probably be better if the CS level was reduced */
diff --git a/src/gprs_pcu.c b/src/gprs_pcu.c
index 2a84f7bc..d7a851b7 100644
--- a/src/gprs_pcu.c
+++ b/src/gprs_pcu.c
@@ -55,6 +55,9 @@ struct gprs_pcu *gprs_pcu_alloc(void *ctx)
/* By default resegmentation is supported in DL can also be configured
* through VTY */
pcu->vty.dl_arq_type = EGPRS_ARQ1;
+ pcu->vty.cs_adj_enabled = true;
+ pcu->vty.cs_adj_upper_limit = 33; /* Decrease CS if the error rate is above */
+ pcu->vty.cs_adj_lower_limit = 10; /* Increase CS if the error rate is below */
pcu->T_defs = T_defs_pcu;
osmo_tdefs_reset(pcu->T_defs);
diff --git a/src/gprs_pcu.h b/src/gprs_pcu.h
index f07510bf..6c9eae10 100644
--- a/src/gprs_pcu.h
+++ b/src/gprs_pcu.h
@@ -79,6 +79,9 @@ struct gprs_pcu {
uint8_t alpha, gamma;
bool dl_tbf_preemptive_retransmission;
enum egprs_arq_type dl_arq_type; /* EGPRS_ARQ1 to support resegmentation in DL, EGPRS_ARQ2 for no reseg */
+ bool cs_adj_enabled; /* whether cs_adj_{upper,lower}_limit are used to adjust DL CS */
+ uint8_t cs_adj_upper_limit; /* downgrade DL CS if error rate above its value */
+ uint8_t cs_adj_lower_limit; /* upgrade DL CS if error rate below its value */
} vty;
struct gsmtap_inst *gsmtap;
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index ef868795..c830400c 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -136,9 +136,9 @@ static int config_write_pcu(struct vty *vty)
vty_out(vty, " cs max %d %d%s", the_pcu->vty.max_cs_dl,
the_pcu->vty.max_cs_ul, VTY_NEWLINE);
}
- if (bts->cs_adj_enabled)
+ if (the_pcu->vty.cs_adj_enabled)
vty_out(vty, " cs threshold %d %d%s",
- bts->cs_adj_lower_limit, bts->cs_adj_upper_limit,
+ the_pcu->vty.cs_adj_lower_limit, the_pcu->vty.cs_adj_upper_limit,
VTY_NEWLINE);
else
vty_out(vty, " no cs threshold%s", VTY_NEWLINE);
@@ -910,8 +910,6 @@ DEFUN_ATTR(cfg_pcu_cs_err_limits,
CS_STR CS_ERR_LIMITS_STR "lower limit in %\n" "upper limit in %\n",
CMD_ATTR_IMMEDIATE)
{
- struct gprs_rlcmac_bts *bts = bts_main_data();
-
uint8_t lower_limit = atoi(argv[0]);
uint8_t upper_limit = atoi(argv[1]);
@@ -922,9 +920,9 @@ DEFUN_ATTR(cfg_pcu_cs_err_limits,
return CMD_WARNING;
}
- bts->cs_adj_enabled = 1;
- bts->cs_adj_upper_limit = upper_limit;
- bts->cs_adj_lower_limit = lower_limit;
+ the_pcu->vty.cs_adj_enabled = true;
+ the_pcu->vty.cs_adj_upper_limit = upper_limit;
+ the_pcu->vty.cs_adj_lower_limit = lower_limit;
return CMD_SUCCESS;
}
@@ -935,11 +933,9 @@ DEFUN_ATTR(cfg_pcu_no_cs_err_limits,
NO_STR CS_STR CS_ERR_LIMITS_STR,
CMD_ATTR_IMMEDIATE)
{
- struct gprs_rlcmac_bts *bts = bts_main_data();
-
- bts->cs_adj_enabled = 0;
- bts->cs_adj_upper_limit = 100;
- bts->cs_adj_lower_limit = 0;
+ the_pcu->vty.cs_adj_enabled = false;
+ the_pcu->vty.cs_adj_upper_limit = 100;
+ the_pcu->vty.cs_adj_lower_limit = 0;
return CMD_SUCCESS;
}
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index b6d3a9e5..024a5f3e 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -1132,7 +1132,7 @@ int gprs_rlcmac_dl_tbf::update_window(unsigned first_bsn,
error_rate = analyse_errors(show_rbb, behind_last_bsn, &ana_res);
- if (bts_data()->cs_adj_enabled && ms())
+ if (the_pcu->vty.cs_adj_enabled && ms())
ms_update_error_rate(ms(), this, error_rate);
m_window.update(bts, rbb, first_bsn, &lost, &received);
@@ -1187,7 +1187,7 @@ int gprs_rlcmac_dl_tbf::update_window(const uint8_t ssn, const uint8_t *rbb)
error_rate = analyse_errors(show_rbb, ssn, &ana_res);
- if (bts_data()->cs_adj_enabled && ms())
+ if (the_pcu->vty.cs_adj_enabled && ms())
ms_update_error_rate(ms(), this, error_rate);
m_window.update(bts, show_rbb, ssn,
diff --git a/tests/ms/MsTest.cpp b/tests/ms/MsTest.cpp
index 1e810f2b..b914f01b 100644
--- a/tests/ms/MsTest.cpp
+++ b/tests/ms/MsTest.cpp
@@ -511,7 +511,7 @@ static void test_ms_cs_selection()
bts->initial_cs_dl = 4;
bts->initial_cs_ul = 1;
bts->cs_downgrade_threshold = 0;
- bts->cs_adj_lower_limit = 0;
+ the_pcu->vty.cs_adj_lower_limit = 0;
ms = ms_alloc(&the_bts, tlli);