aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-07-21 18:29:46 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-07-21 19:22:36 +0200
commit6eed1911fd619fb594a9d1a7fc734c1f62ff2f08 (patch)
tree2e192a178a7045fe19cbe053bf4d06a81156a4b1
parentb31f5ef69963c4e8139515368a3bf867a5d76b00 (diff)
bssgp: Fix leak rate computation CS value
Currently the initial_cs_dl value is used to compute the maximum leak rate. This can be too low if adaptive CS selection is used. This commit changes gprs_bssgp_tx_fc_bvc to derive the max CS level from the configuration. Sponsored-by: On-Waves ehf
-rw-r--r--src/gprs_bssgp_pcu.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 02395a8..7601b21 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -595,6 +595,7 @@ int gprs_bssgp_tx_fc_bvc(void)
uint32_t ms_leak_rate; /* oct/s */
uint32_t avg_delay_ms;
int num_pdch = -1;
+ int max_cs_dl;
if (!the_pcu.bctx) {
LOGP(DBSSGP, LOGL_ERROR, "No bctx\n");
@@ -602,6 +603,22 @@ int gprs_bssgp_tx_fc_bvc(void)
}
bts = bts_main_data();
+ if (bts->cs_adj_enabled) {
+ max_cs_dl = bts->max_cs_dl;
+ if (!max_cs_dl) {
+ if (bts->cs4)
+ max_cs_dl = 4;
+ else if (bts->cs3)
+ max_cs_dl = 3;
+ else if (bts->cs2)
+ max_cs_dl = 2;
+ else
+ max_cs_dl = 1;
+ }
+ } else {
+ max_cs_dl = bts->initial_cs_dl;
+ }
+
bucket_size = bts->fc_bvc_bucket_size;
leak_rate = bts->fc_bvc_leak_rate;
ms_bucket_size = bts->fc_ms_bucket_size;
@@ -611,11 +628,11 @@ int gprs_bssgp_tx_fc_bvc(void)
if (num_pdch < 0)
num_pdch = count_pdch(bts);
- leak_rate = gprs_bssgp_max_leak_rate(bts->initial_cs_dl, num_pdch);
+ leak_rate = gprs_bssgp_max_leak_rate(max_cs_dl, num_pdch);
LOGP(DBSSGP, LOGL_DEBUG,
"Computed BVC leak rate = %d, num_pdch = %d, cs = %d\n",
- leak_rate, num_pdch, bts->initial_cs_dl);
+ leak_rate, num_pdch, max_cs_dl);
};
if (ms_leak_rate == 0) {
@@ -631,15 +648,14 @@ int gprs_bssgp_tx_fc_bvc(void)
if (ms_num_pdch > max_pdch)
ms_num_pdch = max_pdch;
- ms_leak_rate = gprs_bssgp_max_leak_rate(bts->initial_cs_dl,
- ms_num_pdch);
+ ms_leak_rate = gprs_bssgp_max_leak_rate(max_cs_dl, ms_num_pdch);
/* TODO: To properly support multiple TRX, the per MS leak rate
* should be derived from the max number of PDCH TS per TRX.
*/
LOGP(DBSSGP, LOGL_DEBUG,
"Computed MS default leak rate = %d, ms_num_pdch = %d, cs = %d\n",
- ms_leak_rate, ms_num_pdch, bts->initial_cs_dl);
+ ms_leak_rate, ms_num_pdch, max_cs_dl);
};
/* TODO: Force leak_rate to 0 on buffer bloat */