Move dl_arq_type field from BTS to PCU

Change-Id: I0b82ab59edd58d60e5581c707dc49f58de0ba203
This commit is contained in:
Pau Espin 2021-01-14 13:08:02 +01:00
parent 05f9f59a67
commit 97296b299c
8 changed files with 19 additions and 29 deletions

View File

@ -245,12 +245,6 @@ static void bts_init(struct gprs_rlcmac_bts *bts, BTS* bts_obj)
bts->llc_codel_interval_msec = LLC_CODEL_USE_DEFAULT;
bts->llc_idle_ack_csec = 10;
/*
* By default resegmentation is supported in DL
* can also be configured through VTY
*/
bts->dl_arq_type = EGPRS_ARQ1;
bts->app_info = NULL;
bts->bts = bts_obj;
bts->T_defs_bts = T_defs_bts;

View File

@ -108,8 +108,6 @@ struct gprs_rlcmac_bts {
uint8_t si13[GSM_MACBLOCK_LEN];
bool si13_is_set;
/* 0 to support resegmentation in DL, 1 for no reseg */
uint8_t dl_arq_type;
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 */

View File

@ -38,8 +38,10 @@ enum mcs_kind {
EGPRS,
};
#define EGPRS_ARQ1 0x0
#define EGPRS_ARQ2 0x1
enum egprs_arq_type {
EGPRS_ARQ1 = 0,
EGPRS_ARQ2 = 1
};
extern const struct value_string mcs_names[];
const char *mcs_name(enum CodingScheme val);

View File

@ -52,6 +52,9 @@ struct gprs_pcu *gprs_pcu_alloc(void *ctx)
pcu->vty.max_mcs_dl = MAX_EDGE_MCS;
pcu->vty.alpha = 0; /* a = 0.0 */
pcu->vty.dl_tbf_preemptive_retransmission = true;
/* By default resegmentation is supported in DL can also be configured
* through VTY */
pcu->vty.dl_arq_type = EGPRS_ARQ1;
pcu->T_defs = T_defs_pcu;
osmo_tdefs_reset(pcu->T_defs);

View File

@ -27,6 +27,7 @@
#include <osmocom/core/gsmtap_util.h>
#include "gprs_bssgp_pcu.h"
#include "coding_scheme.h"
#define LLC_CODEL_DISABLE 0
#define LLC_CODEL_USE_DEFAULT (-1)
@ -77,6 +78,7 @@ struct gprs_pcu {
uint8_t force_two_phase;
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 */
} vty;
struct gsmtap_inst *gsmtap;

View File

@ -198,9 +198,8 @@ static int config_write_pcu(struct vty *vty)
vty_out(vty, " window-size %d %d%s", bts->ws_base, bts->ws_pdch,
VTY_NEWLINE);
if (bts->dl_arq_type)
vty_out(vty, " egprs dl arq-type arq2%s",
VTY_NEWLINE);
if (the_pcu->vty.dl_arq_type == EGPRS_ARQ2)
vty_out(vty, " egprs dl arq-type arq2%s", VTY_NEWLINE);
if (bts->force_llc_lifetime == 0xffff)
vty_out(vty, " queue lifetime infinite%s", VTY_NEWLINE);
@ -574,12 +573,10 @@ DEFUN_ATTR(cfg_pcu_dl_arq_type,
"enable ARQ2 support",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
if (!strcmp(argv[0], "arq2"))
bts->dl_arq_type = 1;
the_pcu->vty.dl_arq_type = EGPRS_ARQ2;
else
bts->dl_arq_type = 0;
the_pcu->vty.dl_arq_type = EGPRS_ARQ1;
return CMD_SUCCESS;
}

View File

@ -486,7 +486,7 @@ int gprs_rlcmac_dl_tbf::take_next_bsn(uint32_t fn,
/* Table 8.1.1.2 and Table 8.1.1.1 of 44.060 */
m_rlc.block(bsn)->cs_current_trans = get_retx_mcs(m_rlc.block(bsn)->cs_init,
ms_current_cs_dl(ms()),
!bts->bts_data()->dl_arq_type);
bts->pcu->vty.dl_arq_type == EGPRS_ARQ1);
LOGPTBFDL(this, LOGL_DEBUG,
"initial_cs_dl(%s) last_mcs(%s) demanded_mcs(%s) cs_trans(%s) arq_type(%d) bsn(%d)\n",
@ -494,7 +494,7 @@ int gprs_rlcmac_dl_tbf::take_next_bsn(uint32_t fn,
mcs_name(m_rlc.block(bsn)->cs_last),
mcs_name(ms_current_cs_dl(ms())),
mcs_name(m_rlc.block(bsn)->cs_current_trans),
bts->bts_data()->dl_arq_type, bsn);
the_pcu->vty.dl_arq_type, bsn);
/* TODO: Need to remove this check when MCS-8 -> MCS-6
* transistion is handled.

View File

@ -2525,7 +2525,6 @@ static void test_tbf_epdan_out_of_rx_window(void)
{
the_pcu->bts = bts_alloc(the_pcu);
BTS *the_bts = the_pcu->bts;
gprs_rlcmac_bts *bts;
uint8_t ms_class = 11;
uint8_t egprs_ms_class = 11;
uint8_t trx_no;
@ -2546,12 +2545,10 @@ static void test_tbf_epdan_out_of_rx_window(void)
fprintf(stderr, "=== start %s ===\n", __func__);
bts = the_bts->bts_data();
setup_bts(the_bts, ts_no);
OSMO_ASSERT(osmo_tdef_set(the_pcu->T_defs, -2031, 200, OSMO_TDEF_MS) == 0);
/* ARQ II */
bts->dl_arq_type = EGPRS_ARQ2;
the_pcu->vty.dl_arq_type = EGPRS_ARQ2;
/*
* Simulate a message captured during over-the-air testing,
@ -3083,7 +3080,7 @@ static void test_tbf_egprs_retx_dl(void)
setup_bts(the_bts, ts_no);
OSMO_ASSERT(osmo_tdef_set(the_pcu->T_defs, -2031, 200, OSMO_TDEF_MS) == 0);
/* ARQ II */
bts->dl_arq_type = EGPRS_ARQ2;
the_pcu->vty.dl_arq_type = EGPRS_ARQ2;
/* First parameter is current MCS, second one is demanded_mcs */
@ -3114,7 +3111,7 @@ static void test_tbf_egprs_spb_dl(void)
OSMO_ASSERT(osmo_tdef_set(the_pcu->T_defs, -2031, 200, OSMO_TDEF_MS) == 0);
/* ARQ I resegmentation support */
bts->dl_arq_type = EGPRS_ARQ1;
the_pcu->vty.dl_arq_type = EGPRS_ARQ1;
/*
* First parameter is current MCS, second one is demanded_mcs
@ -3135,18 +3132,15 @@ static void test_tbf_egprs_dl()
{
the_pcu->bts = bts_alloc(the_pcu);
BTS *the_bts = the_pcu->bts;
gprs_rlcmac_bts *bts;
uint8_t ts_no = 4;
int i;
fprintf(stderr, "=== start %s ===\n", __func__);
bts = the_bts->bts_data();
setup_bts(the_bts, ts_no);
OSMO_ASSERT(osmo_tdef_set(the_pcu->T_defs, -2031, 200, OSMO_TDEF_MS) == 0);
/* ARQ II */
bts->dl_arq_type = EGPRS_ARQ2;
the_pcu->vty.dl_arq_type = EGPRS_ARQ2;
for (i = 1; i <= 9; i++)
establish_and_use_egprs_dl_tbf(the_bts, i);