Move fc_* fields from BTS to PCU

Change-Id: I816d49e732d0fc7a3c9aa1f0e9a83b83d25e6a32
changes/88/22188/4
Pau Espin 2 years ago
parent 113fb419ec
commit e891222920
  1. 1
      src/bts.cpp
  2. 6
      src/bts.h
  3. 12
      src/gprs_bssgp_pcu.cpp
  4. 1
      src/gprs_pcu.c
  5. 6
      src/gprs_pcu.h
  6. 72
      src/pcu_vty.c
  7. 2
      tests/emu/pcu_emu.cpp

@ -193,7 +193,6 @@ static const struct osmo_stat_item_group_desc bts_statg_desc = {
static void bts_init(struct gprs_rlcmac_bts *bts, BTS* bts_obj)
{
memset(bts, 0, sizeof(*bts));
bts->fc_interval = 1;
bts->initial_cs_dl = bts->initial_cs_ul = 1;
bts->initial_mcs_dl = bts->initial_mcs_ul = 1;
bts->cs_mask = 1 << 0; /* CS-1 always enabled by default */

@ -85,12 +85,6 @@ void bts_update_tbf_ta(const char *p, uint32_t fn, uint8_t trx_no, uint8_t ts, i
struct gprs_rlcmac_bts {
bool active;
uint8_t bsic;
uint8_t fc_interval;
uint16_t fc_bucket_time;
uint32_t fc_bvc_bucket_size;
uint32_t fc_bvc_leak_rate;
uint32_t fc_ms_bucket_size;
uint32_t fc_ms_leak_rate;
uint8_t cs_mask; /* Allowed CS mask from BTS */
uint16_t mcs_mask; /* Allowed MCS mask from BTS */
uint8_t initial_cs_dl, initial_cs_ul;

@ -673,7 +673,7 @@ static uint32_t compute_bucket_size(struct gprs_rlcmac_bts *bts,
uint32_t leak_rate, uint32_t fallback)
{
uint32_t bucket_size = 0;
uint16_t bucket_time = bts->fc_bucket_time;
uint16_t bucket_time = the_pcu->vty.fc_bucket_time;
if (bucket_time == 0)
bucket_time = bts->force_llc_lifetime;
@ -811,10 +811,10 @@ static int gprs_bssgp_tx_fc_bvc(void)
max_cs_dl = max_coding_scheme_dl(bts);
bucket_size = bts->fc_bvc_bucket_size;
leak_rate = bts->fc_bvc_leak_rate;
ms_bucket_size = bts->fc_ms_bucket_size;
ms_leak_rate = bts->fc_ms_leak_rate;
bucket_size = the_pcu->vty.fc_bvc_bucket_size;
leak_rate = the_pcu->vty.fc_bvc_leak_rate;
ms_bucket_size = the_pcu->vty.fc_ms_bucket_size;
ms_leak_rate = the_pcu->vty.fc_ms_leak_rate;
/* FIXME: This calculation is mostly wrong. It should be done based on
currently established TBF (and whether the related (egprs)_ms_class
@ -940,7 +940,7 @@ static void bvc_timeout(void *_priv)
LOGP(DBSSGP, LOGL_DEBUG, "Sending flow control info on BVCI %d\n",
the_pcu->bssgp.bctx->bvci);
gprs_bssgp_tx_fc_bvc();
osmo_timer_schedule(&the_pcu->bssgp.bvc_timer, the_pcu->bssgp.bts->fc_interval, 0);
osmo_timer_schedule(&the_pcu->bssgp.bvc_timer, the_pcu->vty.fc_interval, 0);
}
static int ns_create_nsvc(struct gprs_rlcmac_bts *bts,

@ -46,6 +46,7 @@ struct gprs_pcu *gprs_pcu_alloc(void *ctx)
pcu = (struct gprs_pcu *)talloc_zero(ctx, struct gprs_pcu);
OSMO_ASSERT(pcu);
pcu->vty.fc_interval = 1;
pcu->vty.max_cs_ul = MAX_GPRS_CS;
pcu->vty.max_cs_dl = MAX_GPRS_CS;
pcu->vty.max_mcs_ul = MAX_EDGE_MCS;

@ -71,6 +71,12 @@ struct gprs_pcu {
char *pcu_sock_path;
struct { /* Config Values set by VTY */
uint8_t fc_interval;
uint16_t fc_bucket_time;
uint32_t fc_bvc_bucket_size;
uint32_t fc_bvc_leak_rate;
uint32_t fc_ms_bucket_size;
uint32_t fc_ms_leak_rate;
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;

@ -106,20 +106,20 @@ static int config_write_pcu(struct vty *vty)
unsigned int i;
vty_out(vty, "pcu%s", VTY_NEWLINE);
vty_out(vty, " flow-control-interval %d%s", bts->fc_interval,
vty_out(vty, " flow-control-interval %d%s", the_pcu->vty.fc_interval,
VTY_NEWLINE);
if (bts->fc_bvc_bucket_size)
if (the_pcu->vty.fc_bvc_bucket_size)
vty_out(vty, " flow-control force-bvc-bucket-size %d%s",
bts->fc_bvc_bucket_size, VTY_NEWLINE);
if (bts->fc_bvc_leak_rate)
the_pcu->vty.fc_bvc_bucket_size, VTY_NEWLINE);
if (the_pcu->vty.fc_bvc_leak_rate)
vty_out(vty, " flow-control force-bvc-leak-rate %d%s",
bts->fc_bvc_leak_rate, VTY_NEWLINE);
if (bts->fc_ms_bucket_size)
the_pcu->vty.fc_bvc_leak_rate, VTY_NEWLINE);
if (the_pcu->vty.fc_ms_bucket_size)
vty_out(vty, " flow-control force-ms-bucket-size %d%s",
bts->fc_ms_bucket_size, VTY_NEWLINE);
if (bts->fc_ms_leak_rate)
the_pcu->vty.fc_ms_bucket_size, VTY_NEWLINE);
if (the_pcu->vty.fc_ms_leak_rate)
vty_out(vty, " flow-control force-ms-leak-rate %d%s",
bts->fc_ms_leak_rate, VTY_NEWLINE);
the_pcu->vty.fc_ms_leak_rate, VTY_NEWLINE);
if (the_pcu->vty.force_initial_cs) {
if (bts->initial_cs_ul == bts->initial_cs_dl)
vty_out(vty, " cs %d%s", bts->initial_cs_dl,
@ -292,10 +292,7 @@ DEFUN_ATTR(cfg_pcu_fc_interval,
"Interval time in seconds\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->fc_interval = atoi(argv[0]);
the_pcu->vty.fc_interval = atoi(argv[0]);
return CMD_SUCCESS;
}
#define FC_STR "BSSGP Flow Control configuration\n"
@ -308,10 +305,7 @@ DEFUN_ATTR(cfg_pcu_fc_bvc_bucket_size,
FC_STR FC_BMAX_STR("BVC") "Bucket size in octets\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->fc_bvc_bucket_size = atoi(argv[0]);
the_pcu->vty.fc_bvc_bucket_size = atoi(argv[0]);
return CMD_SUCCESS;
}
@ -321,10 +315,7 @@ DEFUN_ATTR(cfg_pcu_no_fc_bvc_bucket_size,
NO_STR FC_STR FC_BMAX_STR("BVC"),
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->fc_bvc_bucket_size = 0;
the_pcu->vty.fc_bvc_bucket_size = 0;
return CMD_SUCCESS;
}
@ -334,9 +325,7 @@ DEFUN_ATTR(cfg_pcu_fc_bvc_leak_rate,
FC_STR FC_LR_STR("BVC") "Leak rate in bit/s\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->fc_bvc_leak_rate = atoi(argv[0]);
the_pcu->vty.fc_bvc_leak_rate = atoi(argv[0]);
return CMD_SUCCESS;
}
@ -347,10 +336,7 @@ DEFUN_ATTR(cfg_pcu_no_fc_bvc_leak_rate,
NO_STR FC_STR FC_LR_STR("BVC"),
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->fc_bvc_leak_rate = 0;
the_pcu->vty.fc_bvc_leak_rate = 0;
return CMD_SUCCESS;
}
@ -360,10 +346,7 @@ DEFUN_ATTR(cfg_pcu_fc_ms_bucket_size,
FC_STR FC_BMAX_STR("default MS") "Bucket size in octets\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->fc_ms_bucket_size = atoi(argv[0]);
the_pcu->vty.fc_ms_bucket_size = atoi(argv[0]);
return CMD_SUCCESS;
}
@ -373,10 +356,7 @@ DEFUN_ATTR(cfg_pcu_no_fc_ms_bucket_size,
NO_STR FC_STR FC_BMAX_STR("default MS"),
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->fc_ms_bucket_size = 0;
the_pcu->vty.fc_ms_bucket_size = 0;
return CMD_SUCCESS;
}
@ -386,10 +366,7 @@ DEFUN_ATTR(cfg_pcu_fc_ms_leak_rate,
FC_STR FC_LR_STR("default MS") "Leak rate in bit/s\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->fc_ms_leak_rate = atoi(argv[0]);
the_pcu->vty.fc_ms_leak_rate = atoi(argv[0]);
return CMD_SUCCESS;
}
@ -399,10 +376,7 @@ DEFUN_ATTR(cfg_pcu_no_fc_ms_leak_rate,
NO_STR FC_STR FC_LR_STR("default MS"),
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->fc_ms_leak_rate = 0;
the_pcu->vty.fc_ms_leak_rate = 0;
return CMD_SUCCESS;
}
@ -413,10 +387,7 @@ DEFUN_ATTR(cfg_pcu_fc_bucket_time,
FC_STR FC_BTIME_STR "Time in centi-seconds\n",
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->fc_bucket_time = atoi(argv[0]);
the_pcu->vty.fc_bucket_time = atoi(argv[0]);
return CMD_SUCCESS;
}
@ -426,10 +397,7 @@ DEFUN_ATTR(cfg_pcu_no_fc_bucket_time,
NO_STR FC_STR FC_BTIME_STR,
CMD_ATTR_IMMEDIATE)
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->fc_bucket_time = 0;
the_pcu->vty.fc_bucket_time = 0;
return CMD_SUCCESS;
}

@ -66,7 +66,6 @@ struct gprs_test all_tests[] = {
static void init_main_bts()
{
struct gprs_rlcmac_bts *bts = bts_main_data();
bts->fc_interval = 100;
bts->initial_cs_dl = bts->initial_cs_ul = 1;
bts->cs_mask = 1 << 0; /* CS-1 always enabled by default */
bts->n3101 = 10;
@ -78,6 +77,7 @@ static void init_pcu(struct gprs_pcu *pcu)
{
if (!pcu->alloc_algorithm)
pcu->alloc_algorithm = alloc_algorithm_b;
pcu->vty.fc_interval = 100;
pcu->vty.alpha = 0; /* a = 0.0 */
}

Loading…
Cancel
Save