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
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 @@
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);
}