Move cs_downgrade_threshold field from BTS to PCU

Change-Id: I3e1c65eb3cccff565d5d84588bdce93a47909a0f
This commit is contained in:
Pau Espin 2021-01-14 13:20:55 +01:00
parent e8dcf64881
commit ad79b857cd
8 changed files with 14 additions and 25 deletions

View File

@ -232,7 +232,6 @@ static void bts_init(struct gprs_rlcmac_bts *bts, BTS* bts_obj)
bts->mcs_lqual_ranges[7].high = 24;
bts->mcs_lqual_ranges[8].low = 23;
bts->mcs_lqual_ranges[8].high = 256;
bts->cs_downgrade_threshold = 200;
bts->ns_dialect = NS2_DIALECT_IPACCESS;
/* TODO: increase them when CRBB decoding is implemented */

View File

@ -108,10 +108,6 @@ struct gprs_rlcmac_bts {
uint8_t si13[GSM_MACBLOCK_LEN];
bool si13_is_set;
/* 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;
/* Link quality range for each UL (M)CS. Below or above, next/prev (M)CS is selected. */
struct {int16_t low; int16_t high; } cs_lqual_ranges[MAX_GPRS_CS];
struct {int16_t low; int16_t high; } mcs_lqual_ranges[MAX_EDGE_MCS];

View File

@ -794,7 +794,7 @@ enum CodingScheme ms_current_cs_dl(const struct GprsMs *ms)
unencoded_octets += llc_chunk_size(tbf_llc((struct gprs_rlcmac_tbf *)ms->dl_tbf));
/* There are many unencoded octets, don't reduce */
if (unencoded_octets >= bts_data(ms->bts)->cs_downgrade_threshold)
if (unencoded_octets >= the_pcu->vty.cs_downgrade_threshold)
return cs;
/* RF conditions are good, don't reduce */

View File

@ -58,6 +58,7 @@ struct gprs_pcu *gprs_pcu_alloc(void *ctx)
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->vty.cs_downgrade_threshold = 200;
pcu->T_defs = T_defs_pcu;
osmo_tdefs_reset(pcu->T_defs);

View File

@ -82,6 +82,9 @@ struct gprs_pcu {
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 */
/* 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;
} vty;
struct gsmtap_inst *gsmtap;

View File

@ -143,9 +143,9 @@ static int config_write_pcu(struct vty *vty)
else
vty_out(vty, " no cs threshold%s", VTY_NEWLINE);
if (bts->cs_downgrade_threshold)
if (the_pcu->vty.cs_downgrade_threshold)
vty_out(vty, " cs downgrade-threshold %d%s",
bts->cs_downgrade_threshold, VTY_NEWLINE);
the_pcu->vty.cs_downgrade_threshold, VTY_NEWLINE);
else
vty_out(vty, " no cs downgrade-threshold%s", VTY_NEWLINE);
@ -947,10 +947,7 @@ DEFUN_ATTR(cfg_pcu_cs_downgrade_thrsh,
CS_STR CS_DOWNGRADE_STR "downgrade if less octets left\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->cs_downgrade_threshold = atoi(argv[0]);
the_pcu->vty.cs_downgrade_threshold = atoi(argv[0]);
return CMD_SUCCESS;
}
@ -960,10 +957,7 @@ DEFUN_ATTR(cfg_pcu_no_cs_downgrade_thrsh,
NO_STR CS_STR CS_DOWNGRADE_STR,
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->cs_downgrade_threshold = 0;
the_pcu->vty.cs_downgrade_threshold = 0;
return CMD_SUCCESS;
}

View File

@ -510,7 +510,7 @@ static void test_ms_cs_selection()
bts->initial_cs_dl = 4;
bts->initial_cs_ul = 1;
bts->cs_downgrade_threshold = 0;
the_pcu->vty.cs_downgrade_threshold = 0;
the_pcu->vty.cs_adj_lower_limit = 0;
ms = ms_alloc(&the_bts, tlli);
@ -525,7 +525,7 @@ static void test_ms_cs_selection()
OSMO_ASSERT(mcs_chan_code(ms_current_cs_dl(ms)) == 3);
bts->cs_downgrade_threshold = 200;
the_pcu->vty.cs_downgrade_threshold = 200;
OSMO_ASSERT(mcs_chan_code(ms_current_cs_dl(ms)) == 2);
@ -559,7 +559,7 @@ static void test_ms_mcs_mode()
bts->initial_cs_dl = 4;
bts->initial_cs_ul = 1;
bts->cs_downgrade_threshold = 0;
the_pcu->vty.cs_downgrade_threshold = 0;
ms2 = ms_alloc(&the_bts, tlli + 1);
dump_ms(ms2, "2: with BTS defaults");

View File

@ -3070,13 +3070,11 @@ static void test_tbf_egprs_retx_dl(void)
{
the_pcu->bts = bts_alloc(the_pcu);
BTS *the_bts = the_pcu->bts;
gprs_rlcmac_bts *bts;
uint8_t ts_no = 4;
fprintf(stderr, "=== start %s ===\n", __func__);
bts = the_bts->bts_data();
bts->cs_downgrade_threshold = 0;
the_pcu->vty.cs_downgrade_threshold = 0;
setup_bts(the_bts, ts_no);
OSMO_ASSERT(osmo_tdef_set(the_pcu->T_defs, -2031, 200, OSMO_TDEF_MS) == 0);
/* ARQ II */
@ -3100,13 +3098,11 @@ static void test_tbf_egprs_spb_dl(void)
{
the_pcu->bts = bts_alloc(the_pcu);
BTS *the_bts = the_pcu->bts;
gprs_rlcmac_bts *bts;
uint8_t ts_no = 4;
fprintf(stderr, "=== start %s ===\n", __func__);
bts = the_bts->bts_data();
bts->cs_downgrade_threshold = 0;
the_pcu->vty.cs_downgrade_threshold = 0;
setup_bts(the_bts, ts_no);
OSMO_ASSERT(osmo_tdef_set(the_pcu->T_defs, -2031, 200, OSMO_TDEF_MS) == 0);