aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-04-21 12:56:48 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-05-06 15:20:35 +0200
commit87d7341fbe290582ac4a03f67349496e5306eb04 (patch)
tree453e943c92b5e0758481e856fe2da0b4d1d0357a
parent29d91e92715945f53aff4530602add765d63946e (diff)
bssgp: Make BVC bucket size / leak rate configurable
Currently the FLOW-CONTROL_BVC message contains fixed values: The tag is 1, the BVC bucket size is 6MB, the BVC bucket leak rate is 820kbit/s, the MS bucket size is 50kB, and the MS leak rate is 50kbit/s. This commit makes the BVC parameters configurable and adds the following VTY commands: - flow-control force-bvc-bucket-size <1-6553500> - no flow-control force-bvc-bucket-size - flow-control force-bvc-leak-rate <1-6553500> - no flow-control force-bvc-leak-rate - flow-control force-ms-bucket-size <1-6553500> - no flow-control force-ms-bucket-size - flow-control force-ms-leak-rate <1-6553500> - no flow-control force-ms-leak-rate The 'no' variants restore the default behaviour. Sponsored-by: On-Waves ehf
-rw-r--r--src/bts.h4
-rw-r--r--src/gprs_bssgp_pcu.cpp10
-rw-r--r--src/pcu_vty.c119
3 files changed, 132 insertions, 1 deletions
diff --git a/src/bts.h b/src/bts.h
index 4b7f7e8..ebb7cbf 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -111,6 +111,10 @@ struct gprs_rlcmac_trx {
struct gprs_rlcmac_bts {
uint8_t bsic;
uint8_t fc_interval;
+ 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 cs1;
uint8_t cs2;
uint8_t cs3;
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index 0904720..7c9bb75 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -484,12 +484,20 @@ static int nsvc_signal_cb(unsigned int subsys, unsigned int signal,
int gprs_bssgp_tx_fc_bvc(void)
{
+ struct gprs_rlcmac_bts *bts;
+
if (!the_pcu.bctx) {
LOGP(DBSSGP, LOGL_ERROR, "No bctx\n");
return -EIO;
}
+ bts = bts_main_data();
+
/* FIXME: use real values */
- return bssgp_tx_fc_bvc(the_pcu.bctx, 1, 6553500, 819100, 50000, 50000,
+ return bssgp_tx_fc_bvc(the_pcu.bctx, 1,
+ bts->fc_bvc_bucket_size ? bts->fc_bvc_bucket_size : 6553500,
+ bts->fc_bvc_leak_rate ? bts->fc_bvc_leak_rate : 819100,
+ bts->fc_ms_bucket_size ? bts->fc_ms_bucket_size : 50000,
+ bts->fc_ms_leak_rate ? bts->fc_ms_leak_rate : 50000,
NULL, NULL);
}
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index a8fdaa9..bddcacc 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -53,6 +53,18 @@ static int config_write_pcu(struct vty *vty)
vty_out(vty, "pcu%s", VTY_NEWLINE);
vty_out(vty, " flow-control-interval %d%s", bts->fc_interval,
VTY_NEWLINE);
+ if (bts->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)
+ vty_out(vty, " flow-control force-bvc-leak-rate %d%s",
+ bts->fc_bvc_leak_rate, VTY_NEWLINE);
+ if (bts->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)
+ vty_out(vty, " flow-control force-ms-leak-rate %d%s",
+ bts->fc_ms_leak_rate, VTY_NEWLINE);
if (bts->force_cs) {
if (bts->initial_cs_ul == bts->initial_cs_dl)
vty_out(vty, " cs %d%s", bts->initial_cs_dl,
@@ -110,6 +122,105 @@ DEFUN(cfg_pcu_fc_interval,
return CMD_SUCCESS;
}
+#define FC_STR "BSSGP Flow Control configuration\n"
+#define FC_BMAX_STR(who) "Force a fixed value for the " who " bucket size\n"
+#define FC_LR_STR(who) "Force a fixed value for the " who " leak rate\n"
+
+DEFUN(cfg_pcu_fc_bvc_bucket_size,
+ cfg_pcu_fc_bvc_bucket_size_cmd,
+ "flow-control force-bvc-bucket-size <1-6553500>",
+ FC_STR FC_BMAX_STR("BVC") "Bucket size in octets\n")
+{
+ struct gprs_rlcmac_bts *bts = bts_main_data();
+
+ bts->fc_bvc_bucket_size = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_pcu_no_fc_bvc_bucket_size,
+ cfg_pcu_no_fc_bvc_bucket_size_cmd,
+ "no flow-control force-bvc-bucket-size",
+ NO_STR FC_STR FC_BMAX_STR("BVC"))
+{
+ struct gprs_rlcmac_bts *bts = bts_main_data();
+
+ bts->fc_bvc_bucket_size = 0;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_pcu_fc_bvc_leak_rate,
+ cfg_pcu_fc_bvc_leak_rate_cmd,
+ "flow-control force-bvc-leak-rate <1-6553500>",
+ FC_STR FC_LR_STR("BVC") "Leak rate in bit/s\n")
+{
+ struct gprs_rlcmac_bts *bts = bts_main_data();
+
+ bts->fc_bvc_leak_rate = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_pcu_no_fc_bvc_leak_rate,
+ cfg_pcu_no_fc_bvc_leak_rate_cmd,
+ "no flow-control force-bvc-leak-rate",
+ NO_STR FC_STR FC_LR_STR("BVC"))
+{
+ struct gprs_rlcmac_bts *bts = bts_main_data();
+
+ bts->fc_bvc_leak_rate = 0;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_pcu_fc_ms_bucket_size,
+ cfg_pcu_fc_ms_bucket_size_cmd,
+ "flow-control force-ms-bucket-size <1-6553500>",
+ FC_STR FC_BMAX_STR("default MS") "Bucket size in octets\n")
+{
+ struct gprs_rlcmac_bts *bts = bts_main_data();
+
+ bts->fc_ms_bucket_size = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_pcu_no_fc_ms_bucket_size,
+ cfg_pcu_no_fc_ms_bucket_size_cmd,
+ "no flow-control force-ms-bucket-size",
+ NO_STR FC_STR FC_BMAX_STR("default MS"))
+{
+ struct gprs_rlcmac_bts *bts = bts_main_data();
+
+ bts->fc_ms_bucket_size = 0;
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_pcu_fc_ms_leak_rate,
+ cfg_pcu_fc_ms_leak_rate_cmd,
+ "flow-control force-ms-leak-rate <1-6553500>",
+ FC_STR FC_LR_STR("default MS") "Leak rate in bit/s\n")
+{
+ struct gprs_rlcmac_bts *bts = bts_main_data();
+
+ bts->fc_ms_leak_rate = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_pcu_no_fc_ms_leak_rate,
+ cfg_pcu_no_fc_ms_leak_rate_cmd,
+ "no flow-control force-ms-leak-rate",
+ NO_STR FC_STR FC_LR_STR("default MS"))
+{
+ struct gprs_rlcmac_bts *bts = bts_main_data();
+
+ bts->fc_ms_leak_rate = 0;
+
+ return CMD_SUCCESS;
+}
DEFUN(cfg_pcu_cs,
cfg_pcu_cs_cmd,
@@ -404,6 +515,14 @@ int pcu_vty_init(const struct log_info *cat)
install_element(PCU_NODE, &cfg_pcu_alloc_cmd);
install_element(PCU_NODE, &cfg_pcu_two_phase_cmd);
install_element(PCU_NODE, &cfg_pcu_fc_interval_cmd);
+ install_element(PCU_NODE, &cfg_pcu_fc_bvc_bucket_size_cmd);
+ install_element(PCU_NODE, &cfg_pcu_no_fc_bvc_bucket_size_cmd);
+ install_element(PCU_NODE, &cfg_pcu_fc_bvc_leak_rate_cmd);
+ install_element(PCU_NODE, &cfg_pcu_no_fc_bvc_leak_rate_cmd);
+ install_element(PCU_NODE, &cfg_pcu_fc_ms_bucket_size_cmd);
+ install_element(PCU_NODE, &cfg_pcu_no_fc_ms_bucket_size_cmd);
+ install_element(PCU_NODE, &cfg_pcu_fc_ms_leak_rate_cmd);
+ install_element(PCU_NODE, &cfg_pcu_no_fc_ms_leak_rate_cmd);
install_element(PCU_NODE, &cfg_pcu_alpha_cmd);
install_element(PCU_NODE, &cfg_pcu_gamma_cmd);
install_element(PCU_NODE, &cfg_pcu_dl_tbf_idle_time_cmd);