diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-05-06 14:24:36 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-05-06 15:22:57 +0200 |
commit | 6e4ccec6c4b69681e94e4d3b27ef022e4aab81a9 (patch) | |
tree | dbfbcea95d3551f141406ae576545a36aa7629d9 /src/tbf_dl.cpp | |
parent | 0288cdb0a8d4011905da55a5b74319e38e27e70d (diff) |
bssgp: Compute and transmit queue delay
The specification 28.018, allows to transmit the average LLC downlink
queueing delay in FLOW CONTROL BVC messages (BVC Measurement IE, see
GSM 28.018, 10.4.4 and 11.3.7).
This commit extends gprs_bssgp_pcu.cpp to compute the average delay
time between two subsequent FLOW CONTROL BVC messages. The average is
implemented as an arithmetic average without any weighting.
Ticket: OW#1432
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf_dl.cpp')
-rw-r--r-- | src/tbf_dl.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 45c463c7..0aa22f90 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -242,7 +242,8 @@ int gprs_rlcmac_dl_tbf::handle(struct gprs_rlcmac_bts *bts, struct msgb *gprs_rlcmac_dl_tbf::llc_dequeue(bssgp_bvc_ctx *bctx) { struct msgb *msg; - struct timeval *tv, tv_now, tv_now2; + struct timeval *tv_recv, *tv_disc; + struct timeval tv_now, tv_now2; uint32_t octets = 0, frames = 0; struct timeval hyst_delta = {0, 0}; const unsigned keep_small_thresh = 60; @@ -254,16 +255,19 @@ struct msgb *gprs_rlcmac_dl_tbf::llc_dequeue(bssgp_bvc_ctx *bctx) timeradd(&tv_now, &hyst_delta, &tv_now2); while ((msg = m_llc.dequeue())) { - tv = (struct timeval *)msg->data; - msgb_pull(msg, sizeof(*tv)); - msgb_pull(msg, sizeof(*tv)); + tv_disc = (struct timeval *)msg->data; + msgb_pull(msg, sizeof(*tv_disc)); + tv_recv = (struct timeval *)msg->data; + msgb_pull(msg, sizeof(*tv_recv)); + + gprs_bssgp_update_queue_delay(tv_recv, &tv_now); /* Is the age below the low water mark? */ - if (!gprs_llc::is_frame_expired(&tv_now2, tv)) + if (!gprs_llc::is_frame_expired(&tv_now2, tv_disc)) break; /* Is the age below the high water mark */ - if (!gprs_llc::is_frame_expired(&tv_now, tv)) { + if (!gprs_llc::is_frame_expired(&tv_now, tv_disc)) { /* Has the previous message not been dropped? */ if (frames == 0) break; |